Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

Commit

Permalink
rebased.
Browse files Browse the repository at this point in the history
  • Loading branch information
emmauss committed Mar 8, 2022
1 parent c6b9156 commit bf52e9d
Show file tree
Hide file tree
Showing 9 changed files with 66 additions and 6 deletions.
6 changes: 5 additions & 1 deletion Ryujinx.Ava/Assets/Locales/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -506,5 +506,9 @@
"SettingsTabGraphicsFrameRate" : "Host Refresh Rate:",
"SettingsTabGraphicsFrameRateTooltip" : "Sets host refresh rate. Set to 0 to remove limit.",
"SettingsTabCpuCache" : "CPU Cache",
"SettingsTabCpuMemory" : "CPU Memory"
"SettingsTabCpuMemory" : "CPU Memory",
"DialogUpdaterFlatpakNotSupportedMessage" : "Please update Ryujinx via FlatHub.",
"UpdaterDisabledWarningTitle" : "Updater Disabled!",
"GameListContextMenuOpenSdModsDirectory": "Open Atmosphere Mods Directory",
"GameListContextMenuOpenSdModsDirectoryToolTip": "Opens the alternative SD card atmosphere directory which contains Application's Mods"
}
2 changes: 1 addition & 1 deletion Ryujinx.Ava/Configuration/LoggerModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ private static void ReloadFileLogger(object sender, ReactiveEventArgs<bool> e)
if (e.NewValue)
{
Logger.AddTarget(new AsyncLogTargetWrapper(
new FileLogTarget(AppDomain.CurrentDomain.BaseDirectory, "file"),
new FileLogTarget(ReleaseInformations.GetBaseApplicationDirectory(), "file"),
1000,
AsyncLogTargetOverflowAction.Block
));
Expand Down
24 changes: 22 additions & 2 deletions Ryujinx.Ava/Modules/Updater/Updater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ private static void DoUpdateWithMultipleThreads(UpdaterWindow updateDialog, stri
catch (Exception e)
{
Logger.Warning?.Print(LogClass.Application, e.Message);
Logger.Warning?.Print(LogClass.Application, $"Multi-Threaded update failed, falling back to single-threaded updater.");
Logger.Warning?.Print(LogClass.Application, "Multi-Threaded update failed, falling back to single-threaded updater.");
DoUpdateWithSingleThread(updateDialog, downloadUrl, updateFile);
Expand All @@ -320,7 +320,7 @@ private static void DoUpdateWithMultipleThreads(UpdaterWindow updateDialog, stri
catch (WebException ex)
{
Logger.Warning?.Print(LogClass.Application, ex.Message);
Logger.Warning?.Print(LogClass.Application, $"Multi-Threaded update failed, falling back to single-threaded updater.");
Logger.Warning?.Print(LogClass.Application, "Multi-Threaded update failed, falling back to single-threaded updater.");

for (int j = 0; j < webClients.Count; j++)
{
Expand Down Expand Up @@ -523,6 +523,7 @@ await Task.Run(() =>

public static bool CanUpdate(bool showWarnings, StyleableWindow parent)
{
#if !DISABLE_UPDATER
if (RuntimeInformation.OSArchitecture != Architecture.X64)
{
if (showWarnings)
Expand Down Expand Up @@ -557,6 +558,25 @@ public static bool CanUpdate(bool showWarnings, StyleableWindow parent)
}

return true;
#else
if (showWarnings)
{
if (ReleaseInformations.IsFlatHubBuild())
{
ContentDialogHelper.CreateWarningDialog(parent,
LocaleManager.Instance["UpdaterDisabledWarningTitle"],
LocaleManager.Instance["DialogUpdaterFlatpakNotSupportedMessage"]);
}
else
{
ContentDialogHelper.CreateWarningDialog(parent,
LocaleManager.Instance["UpdaterDisabledWarningTitle"],
LocaleManager.Instance["DialogUpdaterDirtyBuildSubMessage"]);
}
}
#endif

return false;
}

// NOTE: This method should always reflect the latest build layout.s
Expand Down
13 changes: 13 additions & 0 deletions Ryujinx.Ava/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ internal class Program
public static double WindowScaleFactor { get; set; }
public static string Version { get; private set; }
public static string ConfigurationPath { get; private set; }

public static string CommandLineProfile { get; set; }
public static bool PreviewerDetached { get; private set; }
public static AdjustableRenderTimer RenderTimer { get; private set; }

Expand Down Expand Up @@ -106,6 +108,17 @@ private static void Initialize(string[] args)

baseDirPathArg = args[++i];
}
else if (arg == "-p" || arg == "--profile")
{
if (i + 1 >= args.Length)
{
Logger.Error?.Print(LogClass.Application, $"Invalid option '{arg}'");

continue;
}

CommandLineProfile = args[++i];
}
else if (arg == "-f" || arg == "--fullscreen")
{
startFullscreenArg = true;
Expand Down
4 changes: 4 additions & 0 deletions Ryujinx.Ava/Ui/Controls/GameGridView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
Command="{Binding OpenModsDirectory}"
Header="{locale:Locale GameListContextMenuOpenModsDirectory}"
ToolTip.Tip="{locale:Locale GameListContextMenuOpenModsDirectoryToolTip}" />
<MenuItem
Command="{Binding OpenSdModsDirectory}"
Header="{locale:Locale GameListContextMenuOpenSdModsDirectory}"
ToolTip.Tip="{locale:Locale GameListContextMenuOpenSdModsDirectoryToolTip}" />
<Separator />
<MenuItem Header="{locale:Locale GameListContextMenuCacheManagement}">
<MenuItem
Expand Down
16 changes: 15 additions & 1 deletion Ryujinx.Ava/Ui/ViewModels/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
using Ryujinx.Ava.Ui.Controls;
using Ryujinx.Ava.Ui.Models;
using Ryujinx.Ava.Ui.Windows;
using Ryujinx.Common;
using Ryujinx.Common.Configuration;
using Ryujinx.Common.Logging;
using Ryujinx.Configuration;
Expand Down Expand Up @@ -1052,7 +1053,7 @@ public void OpenRyujinxFolder()

public void OpenLogsFolder()
{
string logPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Logs");
string logPath = Path.Combine(ReleaseInformations.GetBaseApplicationDirectory(), "Logs");

new DirectoryInfo(logPath).Create();

Expand Down Expand Up @@ -1235,6 +1236,19 @@ public void OpenModsDirectory()
}
}

public void OpenSdModsDirectory()
{
var selection = SelectedApplication;

if (selection != null)
{
string sdModsBasePath = _owner.VirtualFileSystem.ModLoader.GetSdModsBasePath();
string titleModsPath = _owner.VirtualFileSystem.ModLoader.GetTitleDir(sdModsBasePath, selection.TitleId);

OpenHelper.OpenFolder(titleModsPath);
}
}

public void OpenPtcDirectory()
{
var selection = SelectedApplication;
Expand Down
4 changes: 4 additions & 0 deletions Ryujinx.Ava/Ui/Windows/MainWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,10 @@
Command="{ReflectionBinding OpenModsDirectory}"
Header="{locale:Locale GameListContextMenuOpenModsDirectory}"
ToolTip.Tip="{locale:Locale GameListContextMenuOpenModsDirectoryToolTip}" />
<MenuItem
Command="{ReflectionBinding OpenSdModsDirectory}"
Header="{locale:Locale GameListContextMenuOpenSdModsDirectory}"
ToolTip.Tip="{locale:Locale GameListContextMenuOpenSdModsDirectoryToolTip}" />
<Separator />
<MenuItem Header="{locale:Locale GameListContextMenuCacheManagement}">
<MenuItem
Expand Down
2 changes: 1 addition & 1 deletion Ryujinx.Ava/Ui/Windows/MainWindow.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ private void Initialize()
// Consider removing this at some point in the future when we don't need to worry about old saves.
VirtualFileSystem.FixExtraData(LibHacHorizonManager.RyujinxClient);

AccountManager = new AccountManager(LibHacHorizonManager.RyujinxClient);
AccountManager = new AccountManager(LibHacHorizonManager.RyujinxClient, Program.CommandLineProfile);

VirtualFileSystem.ReloadKeySet();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using LibHac.Ns;
using Ryujinx.Common.Logging;
using Ryujinx.HLE.HOS.Services.Arp;
using System;
Expand Down

0 comments on commit bf52e9d

Please sign in to comment.