some more edits and a bug fix

This commit is contained in:
Xpl0itR 2019-06-08 15:22:50 +01:00
commit 6672b6c1de
No known key found for this signature in database
GPG key ID: 91798184109676AD
9 changed files with 133 additions and 79 deletions

View file

@ -40,8 +40,6 @@ namespace Ryujinx.HLE.HOS.SystemState
internal string ActiveAudioOutput { get; private set; } internal string ActiveAudioOutput { get; private set; }
public bool DiscordIntegrationEnabled { get; set; }
public bool DockedMode { get; set; } public bool DockedMode { get; set; }
public ColorSet ThemeColor { get; set; } public ColorSet ThemeColor { get; set; }

View file

@ -27,9 +27,8 @@ namespace Ryujinx
public static void Init() public static void Init()
{ {
using (Stream iconstream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Ryujinx.ryujinxROMIcon.png")) using (Stream iconstream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Ryujinx.ryujinxROMIcon.png"))
using (StreamReader reader = new StreamReader(iconstream))
{ {
RyujinxROMIcon = new Gdk.Pixbuf(iconstream); RyujinxROMIcon = new Gdk.Pixbuf(iconstream, 75, 75);
} }
string dat = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "GameDirs.dat"); string dat = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "GameDirs.dat");
@ -59,7 +58,7 @@ namespace Ryujinx
Icon = GetGameIcon(GamePath), Icon = GetGameIcon(GamePath),
Game = (Path.GetExtension(GamePath) == ".nro") ? "Application" : "", Game = (Path.GetExtension(GamePath) == ".nro") ? "Application" : "",
Version = "", Version = "",
DLC = "", DLC = (Path.GetExtension(GamePath) == ".nro") ? "N/A" : "",
TP = "", TP = "",
LP = "", LP = "",
Path = GamePath Path = GamePath

View file

@ -31,27 +31,27 @@ namespace Ryujinx
/// <summary> /// <summary>
/// Enables printing debug log messages /// Enables printing debug log messages
/// </summary> /// </summary>
public bool LoggingEnableDebug { get; private set; } public bool LoggingEnableDebug { get; set; }
/// <summary> /// <summary>
/// Enables printing stub log messages /// Enables printing stub log messages
/// </summary> /// </summary>
public bool LoggingEnableStub { get; private set; } public bool LoggingEnableStub { get; set; }
/// <summary> /// <summary>
/// Enables printing info log messages /// Enables printing info log messages
/// </summary> /// </summary>
public bool LoggingEnableInfo { get; private set; } public bool LoggingEnableInfo { get; set; }
/// <summary> /// <summary>
/// Enables printing warning log messages /// Enables printing warning log messages
/// </summary> /// </summary>
public bool LoggingEnableWarn { get; private set; } public bool LoggingEnableWarn { get; set; }
/// <summary> /// <summary>
/// Enables printing error log messages /// Enables printing error log messages
/// </summary> /// </summary>
public bool LoggingEnableError { get; private set; } public bool LoggingEnableError { get; set; }
/// <summary> /// <summary>
/// Enables printing guest log messages /// Enables printing guest log messages
@ -66,42 +66,42 @@ namespace Ryujinx
/// <summary> /// <summary>
/// Controls which log messages are written to the log targets /// Controls which log messages are written to the log targets
/// </summary> /// </summary>
public LogClass[] LoggingFilteredClasses { get; private set; } public LogClass[] LoggingFilteredClasses { get; set; }
/// <summary> /// <summary>
/// Enables or disables logging to a file on disk /// Enables or disables logging to a file on disk
/// </summary> /// </summary>
public bool EnableFileLog { get; private set; } public bool EnableFileLog { get; set; }
/// <summary> /// <summary>
/// Change System Language /// Change System Language
/// </summary> /// </summary>
public SystemLanguage SystemLanguage { get; private set; } public SystemLanguage SystemLanguage { get; set; }
/// <summary> /// <summary>
/// Enables or disables Docked Mode /// Enables or disables Docked Mode
/// </summary> /// </summary>
public bool DockedMode { get; private set; } public bool DockedMode { get; set; }
/// <summary> /// <summary>
/// Enables or disables Discord Rich Presence /// Enables or disables Discord Rich Presence
/// </summary> /// </summary>
public bool EnableDiscordIntegration { get; private set; } public bool EnableDiscordIntegration { get; set; }
/// <summary> /// <summary>
/// Enables or disables Vertical Sync /// Enables or disables Vertical Sync
/// </summary> /// </summary>
public bool EnableVsync { get; private set; } public bool EnableVsync { get; set; }
/// <summary> /// <summary>
/// Enables or disables multi-core scheduling of threads /// Enables or disables multi-core scheduling of threads
/// </summary> /// </summary>
public bool EnableMulticoreScheduling { get; private set; } public bool EnableMulticoreScheduling { get; set; }
/// <summary> /// <summary>
/// Enables integrity checks on Game content files /// Enables integrity checks on Game content files
/// </summary> /// </summary>
public bool EnableFsIntegrityChecks { get; private set; } public bool EnableFsIntegrityChecks { get; set; }
/// <summary> /// <summary>
/// Enables FS access log output to the console. Possible modes are 0-3 /// Enables FS access log output to the console. Possible modes are 0-3
@ -111,12 +111,12 @@ namespace Ryujinx
/// <summary> /// <summary>
/// Use old ChocolArm64 ARM emulator /// Use old ChocolArm64 ARM emulator
/// </summary> /// </summary>
public bool EnableLegacyJit { get; private set; } public bool EnableLegacyJit { get; set; }
/// <summary> /// <summary>
/// Enable or disable ignoring missing services /// Enable or disable ignoring missing services
/// </summary> /// </summary>
public bool IgnoreMissingServices { get; private set; } public bool IgnoreMissingServices { get; set; }
/// <summary> /// <summary>
/// The primary controller's type /// The primary controller's type
@ -126,12 +126,12 @@ namespace Ryujinx
/// <summary> /// <summary>
/// Enable or disable custom themes in the GUI /// Enable or disable custom themes in the GUI
/// </summary> /// </summary>
public bool EnableCustomTheme { get; private set; } public bool EnableCustomTheme { get; set; }
/// <summary> /// <summary>
/// Path to custom GUI theme /// Path to custom GUI theme
/// </summary> /// </summary>
public string CustomThemePath { get; private set; } public string CustomThemePath { get; set; }
/// <summary> /// <summary>
/// Enable or disable keyboard support (Independent from controllers binding) /// Enable or disable keyboard support (Independent from controllers binding)
@ -186,7 +186,7 @@ namespace Ryujinx
/// Configures a <see cref="Switch"/> instance /// Configures a <see cref="Switch"/> instance
/// </summary> /// </summary>
/// <param name="device">The instance to configure</param> /// <param name="device">The instance to configure</param>
public static void Configure(Switch device) public static void InitialConfigure(Switch device)
{ {
if (Instance == null) if (Instance == null)
{ {
@ -195,8 +195,6 @@ namespace Ryujinx
GeneralSettings.ConfigureSettings(Instance); GeneralSettings.ConfigureSettings(Instance);
GraphicsConfig.ShadersDumpPath = Instance.GraphicsShadersDumpPath;
Logger.AddTarget(new AsyncLogTargetWrapper( Logger.AddTarget(new AsyncLogTargetWrapper(
new ConsoleLogTarget(), new ConsoleLogTarget(),
1000, 1000,
@ -212,59 +210,63 @@ namespace Ryujinx
)); ));
} }
Logger.SetEnable(LogLevel.Debug, Instance.LoggingEnableDebug); Configure(device, Instance);
Logger.SetEnable(LogLevel.Stub, Instance.LoggingEnableStub); }
Logger.SetEnable(LogLevel.Info, Instance.LoggingEnableInfo);
Logger.SetEnable(LogLevel.Warning, Instance.LoggingEnableWarn);
Logger.SetEnable(LogLevel.Error, Instance.LoggingEnableError);
Logger.SetEnable(LogLevel.Guest, Instance.LoggingEnableGuest);
Logger.SetEnable(LogLevel.AccessLog, Instance.LoggingEnableFsAccessLog);
if (Instance.LoggingFilteredClasses.Length > 0) public static void Configure(Switch device, Configuration SwitchConfig)
{
GraphicsConfig.ShadersDumpPath = SwitchConfig.GraphicsShadersDumpPath;
Logger.SetEnable(LogLevel.Debug , SwitchConfig.LoggingEnableDebug);
Logger.SetEnable(LogLevel.Stub , SwitchConfig.LoggingEnableStub );
Logger.SetEnable(LogLevel.Info , SwitchConfig.LoggingEnableInfo );
Logger.SetEnable(LogLevel.Warning, SwitchConfig.LoggingEnableWarn );
Logger.SetEnable(LogLevel.Error , SwitchConfig.LoggingEnableError);
if (SwitchConfig.LoggingFilteredClasses.Length > 0)
{ {
foreach (var logClass in EnumExtensions.GetValues<LogClass>()) foreach (var logClass in EnumExtensions.GetValues<LogClass>())
{ {
Logger.SetEnable(logClass, false); Logger.SetEnable(logClass, false);
} }
foreach (var logClass in Instance.LoggingFilteredClasses) foreach (var logClass in SwitchConfig.LoggingFilteredClasses)
{ {
Logger.SetEnable(logClass, true); Logger.SetEnable(logClass, true);
} }
} }
device.System.State.DiscordIntegrationEnabled = Instance.EnableDiscordIntegration; Program.DiscordIntegrationEnabled = SwitchConfig.EnableDiscordIntegration;
device.EnableDeviceVsync = Instance.EnableVsync; device.EnableDeviceVsync = SwitchConfig.EnableVsync;
device.System.State.DockedMode = Instance.DockedMode; device.System.State.DockedMode = SwitchConfig.DockedMode;
device.System.State.SetLanguage(Instance.SystemLanguage); device.System.State.SetLanguage(SwitchConfig.SystemLanguage);
if (Instance.EnableMulticoreScheduling) if (SwitchConfig.EnableMulticoreScheduling)
{ {
device.System.EnableMultiCoreScheduling(); device.System.EnableMultiCoreScheduling();
} }
device.System.FsIntegrityCheckLevel = Instance.EnableFsIntegrityChecks device.System.FsIntegrityCheckLevel = SwitchConfig.EnableFsIntegrityChecks
? IntegrityCheckLevel.ErrorOnInvalid ? IntegrityCheckLevel.ErrorOnInvalid
: IntegrityCheckLevel.None; : IntegrityCheckLevel.None;
device.System.GlobalAccessLogMode = Instance.FsGlobalAccessLogMode; device.System.GlobalAccessLogMode = SwitchConfig.FsGlobalAccessLogMode;
device.System.UseLegacyJit = Instance.EnableLegacyJit; device.System.UseLegacyJit = SwitchConfig.EnableLegacyJit;
ServiceConfiguration.IgnoreMissingServices = Instance.IgnoreMissingServices; ServiceConfiguration.IgnoreMissingServices = SwitchConfig.IgnoreMissingServices;
if (Instance.JoystickControls.Enabled) if (SwitchConfig.JoystickControls.Enabled)
{ {
if (!Joystick.GetState(Instance.JoystickControls.Index).IsConnected) if (!Joystick.GetState(SwitchConfig.JoystickControls.Index).IsConnected)
{ {
Instance.JoystickControls.SetEnabled(false); SwitchConfig.JoystickControls.SetEnabled(false);
} }
} }
device.Hid.InitializePrimaryController(SwitchConfig.ControllerType);
device.Hid.InitializePrimaryController(Instance.ControllerType);
device.Hid.InitializeKeyboard(); device.Hid.InitializeKeyboard();
} }

View file

@ -1,7 +1,10 @@
using Gtk; using Gtk;
using GUI = Gtk.Builder.ObjectAttribute; using GUI = Gtk.Builder.ObjectAttribute;
using Ryujinx.HLE.HOS.SystemState;
using System; using System;
using System.IO; using System.IO;
using Utf8Json;
using Utf8Json.Resolvers;
namespace Ryujinx namespace Ryujinx
{ {
@ -62,8 +65,8 @@ namespace Ryujinx
if (SwitchConfig.EnableCustomTheme) { CustThemeToggle.Click(); } if (SwitchConfig.EnableCustomTheme) { CustThemeToggle.Click(); }
SystemLanguageSelect.SetActiveId(SwitchConfig.SystemLanguage.ToString()); SystemLanguageSelect.SetActiveId(SwitchConfig.SystemLanguage.ToString());
GameDirsBox.Buffer.Text = File.ReadAllText("./GameDirs.dat");
CustThemeDir.Buffer.Text = SwitchConfig.CustomThemePath; CustThemeDir.Buffer.Text = SwitchConfig.CustomThemePath;
GameDirsBox.Buffer.Text = File.ReadAllText("./GameDirs.dat");
if (CustThemeToggle.Active == false) { CustThemeDir.Sensitive = false; } if (CustThemeToggle.Active == false) { CustThemeDir.Sensitive = false; }
} }
@ -81,7 +84,29 @@ namespace Ryujinx
private void SaveToggle_Activated(object obj, EventArgs args) private void SaveToggle_Activated(object obj, EventArgs args)
{ {
if (ErrorLogToggle.Active) { SwitchConfig.LoggingEnableError = true; }
if (WarningLogToggle.Active) { SwitchConfig.LoggingEnableWarn = true; }
if (InfoLogToggle.Active) { SwitchConfig.LoggingEnableInfo = true; }
if (StubLogToggle.Active) { SwitchConfig.LoggingEnableStub = true; }
if (DebugLogToggle.Active) { SwitchConfig.LoggingEnableDebug = true; }
if (FileLogToggle.Active) { SwitchConfig.EnableFileLog = true; }
if (DockedModeToggle.Active) { SwitchConfig.DockedMode = true; }
if (DiscordToggle.Active) { SwitchConfig.EnableDiscordIntergration = true; }
if (VSyncToggle.Active) { SwitchConfig.EnableVsync = true; }
if (MultiSchedToggle.Active) { SwitchConfig.EnableMulticoreScheduling = true; }
if (FSICToggle.Active) { SwitchConfig.EnableFsIntegrityChecks = true; }
if (AggrToggle.Active) { SwitchConfig.EnableAggressiveCpuOpts = true; }
if (IgnoreToggle.Active) { SwitchConfig.IgnoreMissingServices = true; }
if (CustThemeToggle.Active) { SwitchConfig.EnableCustomTheme = true; }
SwitchConfig.SystemLanguage = (SystemLanguage)Enum.Parse(typeof(SystemLanguage), SystemLanguageSelect.ActiveId);
SwitchConfig.CustomThemePath = CustThemeDir.Buffer.Text;
File.WriteAllText("./GameDirs.dat", GameDirsBox.Buffer.Text); File.WriteAllText("./GameDirs.dat", GameDirsBox.Buffer.Text);
Configuration.Configure(device, SwitchConfig);
Destroy();
} }
} }
} }

View file

@ -405,7 +405,7 @@
</child> </child>
<child> <child>
<object class="GtkToggleButton" id="SaveToggle"> <object class="GtkToggleButton" id="SaveToggle">
<property name="label" translatable="yes">Toggle to Save</property> <property name="label" translatable="yes">Save</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">True</property> <property name="receives_default">True</property>
@ -418,7 +418,7 @@
</child> </child>
<child> <child>
<object class="GtkToggleButton" id="CloseToggle"> <object class="GtkToggleButton" id="CloseToggle">
<property name="label" translatable="yes">Toggle to Close</property> <property name="label" translatable="yes">Close</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">True</property> <property name="receives_default">True</property>

View file

@ -18,6 +18,8 @@ namespace Ryujinx
[GUI] MenuItem NFC; [GUI] MenuItem NFC;
[GUI] MenuItem ControlSettingsMenu; [GUI] MenuItem ControlSettingsMenu;
[GUI] TreeView GameTable; [GUI] TreeView GameTable;
[GUI] ScrolledWindow GameTableWindow;
[GUI] GLArea GLScreen;
public MainMenu(HLE.Switch _device, Application _gtkapp) : this(new Builder("Ryujinx.MainMenu.glade"), _device, _gtkapp) { } public MainMenu(HLE.Switch _device, Application _gtkapp) : this(new Builder("Ryujinx.MainMenu.glade"), _device, _gtkapp) { }
@ -26,7 +28,7 @@ namespace Ryujinx
device = _device; device = _device;
gtkapp = _gtkapp; gtkapp = _gtkapp;
if (device.System.State.DiscordIntergrationEnabled == true) if (Program.DiscordIntergrationEnabled)
{ {
Program.DiscordPresence.Details = "Main Menu"; Program.DiscordPresence.Details = "Main Menu";
Program.DiscordPresence.State = "Idling"; Program.DiscordPresence.State = "Idling";
@ -36,6 +38,9 @@ namespace Ryujinx
} }
builder.Autoconnect(this); builder.Autoconnect(this);
GameTableWindow.Show();
GLScreen.Hide();
ApplyTheme(); ApplyTheme();
DeleteEvent += Window_Close; DeleteEvent += Window_Close;
@ -112,6 +117,9 @@ namespace Ryujinx
break; break;
} }
GameTableWindow.Hide();
GLScreen.Show();
Destroy(); Destroy();
Application.Quit(); Application.Quit();
} }
@ -149,6 +157,9 @@ namespace Ryujinx
break; break;
} }
GameTableWindow.Hide();
GLScreen.Show();
Destroy(); Destroy();
Application.Quit(); Application.Quit();
} }
@ -180,6 +191,9 @@ namespace Ryujinx
device.LoadCart(fc.Filename); device.LoadCart(fc.Filename);
} }
GameTableWindow.Hide();
GLScreen.Show();
Destroy(); Destroy();
Application.Quit(); Application.Quit();
} }

View file

@ -154,7 +154,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkScrolledWindow"> <object class="GtkScrolledWindow" id="GameTableWindow">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="shadow_type">in</property> <property name="shadow_type">in</property>
@ -170,6 +170,18 @@
</object> </object>
</child> </child>
</object> </object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkGLArea" id="GLScreen">
<property name="visible">True</property>
<property name="app_paintable">True</property>
<property name="can_focus">False</property>
</object>
<packing> <packing>
<property name="expand">True</property> <property name="expand">True</property>
<property name="fill">True</property> <property name="fill">True</property>

View file

@ -17,13 +17,17 @@ namespace Ryujinx
public static RichPresence DiscordPresence; public static RichPresence DiscordPresence;
public static bool DiscordIntegrationEnabled { get; set; }
public static string ApplicationDirectory => AppDomain.CurrentDomain.BaseDirectory; public static string ApplicationDirectory => AppDomain.CurrentDomain.BaseDirectory;
static void Main(string[] args) static void Main(string[] args)
{ {
Console.Title = "Ryujinx Console"; Console.Title = "Ryujinx Console";
Environment.SetEnvironmentVariable("Path", $"{new DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory).Parent}\\bin;{Environment.GetEnvironmentVariable("Path", EnvironmentVariableTarget.Machine)}"); string parentDir = new DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory).Parent.ToString();
string systemPATH = Environment.GetEnvironmentVariable("Path", EnvironmentVariableTarget.Machine);
Environment.SetEnvironmentVariable("Path", $"{Path.Combine(parentDir, "bin")};{systemPATH}");
IGalRenderer renderer = new OglRenderer(); IGalRenderer renderer = new OglRenderer();
@ -32,7 +36,7 @@ namespace Ryujinx
Switch device = new Switch(renderer, audioOut); Switch device = new Switch(renderer, audioOut);
Configuration.Load(Path.Combine(ApplicationDirectory, "Config.jsonc")); Configuration.Load(Path.Combine(ApplicationDirectory, "Config.jsonc"));
Configuration.Configure(device); Configuration.InitialConfigure(device);
Profile.Initialize(); Profile.Initialize();
@ -41,7 +45,7 @@ namespace Ryujinx
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
AppDomain.CurrentDomain.ProcessExit += CurrentDomain_ProcessExit; AppDomain.CurrentDomain.ProcessExit += CurrentDomain_ProcessExit;
if (device.System.State.DiscordIntegrationEnabled == true) if (DiscordIntegrationEnabled)
{ {
DiscordClient = new DiscordRpcClient("568815339807309834"); DiscordClient = new DiscordRpcClient("568815339807309834");
DiscordPresence = new RichPresence DiscordPresence = new RichPresence
@ -122,7 +126,7 @@ namespace Ryujinx
} }
} }
if (device.System.State.DiscordIntegrationEnabled == true) if (DiscordIntegrationEnabled)
{ {
if (File.ReadAllLines(Path.Combine(ApplicationDirectory, "RPsupported.dat")).Contains(device.System.TitleID)) if (File.ReadAllLines(Path.Combine(ApplicationDirectory, "RPsupported.dat")).Contains(device.System.TitleID))
{ {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Before After
Before After