diff --git a/Ryujinx/ApplicationLibrary.cs b/Ryujinx/ApplicationLibrary.cs index d4f50c85de..7f5d066f35 100644 --- a/Ryujinx/ApplicationLibrary.cs +++ b/Ryujinx/ApplicationLibrary.cs @@ -9,6 +9,11 @@ namespace Ryujinx { public class ApplicationLibrary { + public static Gdk.Pixbuf RyujinxNSPIcon { get; private set; } + public static Gdk.Pixbuf RyujinxXCIIcon { get; private set; } + public static Gdk.Pixbuf RyujinxNCAIcon { get; private set; } + public static Gdk.Pixbuf RyujinxNROIcon { get; private set; } + public static Gdk.Pixbuf RyujinxNSOIcon { get; private set; } public static Gdk.Pixbuf RyujinxROMIcon { get; private set; } public static List ApplicationLibraryData { get; private set; } @@ -21,11 +26,17 @@ namespace Ryujinx public string DLC; public string TP; public string LP; + public string FileSize; public string Path; } public static void Init() { + RyujinxNSPIcon = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.GUI.assets.ryujinxNSPIcon.png", 75, 75); + RyujinxXCIIcon = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.GUI.assets.ryujinxXCIIcon.png", 75, 75); + RyujinxNCAIcon = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.GUI.assets.ryujinxNCAIcon.png", 75, 75); + RyujinxNROIcon = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.GUI.assets.ryujinxNROIcon.png", 75, 75); + RyujinxNSOIcon = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.GUI.assets.ryujinxNSOIcon.png", 75, 75); RyujinxROMIcon = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.GUI.assets.ryujinxROMIcon.png", 75, 75); string dat = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "GameDirs.dat"); @@ -50,15 +61,17 @@ namespace Ryujinx ApplicationLibraryData = new List(); foreach (string GamePath in Games) { + double filesize = new FileInfo(GamePath).Length * 0.000000000931; ApplicationData data = new ApplicationData() { - Icon = GetGameIcon(GamePath), - Game = (Path.GetExtension(GamePath) == ".nro") ? "Application" : "", - Version = "", - DLC = (Path.GetExtension(GamePath) == ".nro") ? "N/A" : "", - TP = "", - LP = "", - Path = GamePath + Icon = GetGameIcon(GamePath), + Game = (Path.GetExtension(GamePath) == ".nro") ? "Application" : "", + Version = "", + DLC = (Path.GetExtension(GamePath) == ".nro") ? "N/A" : "", + TP = "", + LP = "", + FileSize = (filesize < 1) ? (filesize * 1024).ToString("0.##") + "MB" : filesize.ToString("0.##") + "GB", + Path = GamePath, }; ApplicationLibraryData.Add(data); } @@ -70,11 +83,13 @@ namespace Ryujinx { BinaryReader Reader = new BinaryReader(Input); - if ((Path.GetExtension(filePath) == ".nsp") || (Path.GetExtension(filePath) == ".pfs0")) { return RyujinxROMIcon; } + if ((Path.GetExtension(filePath) == ".nsp") || (Path.GetExtension(filePath) == ".pfs0")) { return RyujinxNSPIcon; } - else if (Path.GetExtension(filePath) == ".xci") { return RyujinxROMIcon; } + else if (Path.GetExtension(filePath) == ".xci") { return RyujinxXCIIcon; } - else if (Path.GetExtension(filePath) == ".nca") { return RyujinxROMIcon; } + else if (Path.GetExtension(filePath) == ".nca") { return RyujinxNCAIcon; } + + else if (Path.GetExtension(filePath) == ".nso") { return RyujinxNSOIcon; } else if (Path.GetExtension(filePath) == ".nro") { @@ -98,7 +113,7 @@ namespace Ryujinx return new Gdk.Pixbuf(IconData, 75, 75); } - else { return RyujinxROMIcon; } + else { return RyujinxNROIcon; } } else { return RyujinxROMIcon; } diff --git a/Ryujinx/Configuration.cs b/Ryujinx/Configuration.cs index 444ac468bd..f186a34914 100644 --- a/Ryujinx/Configuration.cs +++ b/Ryujinx/Configuration.cs @@ -210,8 +210,7 @@ namespace Ryujinx throw new InvalidOperationException("Configuration has not been loaded yet."); } - GeneralSettings.ConfigureSettings(Instance); - ControlSettings.ConfigureControls(Instance); + SwitchSettings.ConfigureSettings(Instance); Logger.AddTarget(new AsyncLogTargetWrapper( new ConsoleLogTarget(), @@ -254,7 +253,7 @@ namespace Ryujinx } } - MainMenu.DiscordIntegrationEnabled = SwitchConfig.EnableDiscordIntergration; + MainMenu.DiscordIntegrationEnabled = SwitchConfig.EnableDiscordIntegration; device.EnableDeviceVsync = SwitchConfig.EnableVsync; diff --git a/Ryujinx/GUI/ControlSettings.glade b/Ryujinx/GUI/ControlSettings.glade deleted file mode 100644 index 5ff6424933..0000000000 --- a/Ryujinx/GUI/ControlSettings.glade +++ /dev/null @@ -1,852 +0,0 @@ - - - - - - False - Ryujinx - Control Settings - True - 800 - 550 - dialog - - - - - - False - vertical - 2 - - - False - end - - - Save - True - True - True - - - - False - True - 0 - - - - - Close - True - True - True - - - - False - True - 1 - - - - - False - False - 1 - - - - - True - True - - - True - False - vertical - - - Direct Keyboard Access - True - True - False - True - - - False - False - 10 - 0 - - - - - True - False - - - False - True - 1 - - - - - True - False - - - True - False - 2 - 5 - - - True - False - LStick Up - - - 0 - 0 - - - - - True - False - LStick Down - - - 0 - 1 - - - - - True - False - LStick Left - - - 0 - 2 - - - - - True - False - LStick Right - - - 0 - 3 - - - - - True - False - LStick Button - - - 0 - 4 - - - - - True - False - Dpad Up - - - 0 - 5 - - - - - True - False - Dpad Down - - - 0 - 6 - - - - - True - False - Dpad Left - - - 0 - 7 - - - - - True - False - Dpad Right - - - 0 - 8 - - - - - True - False - - - - - 0 - 9 - - - - - True - False - L - - - 0 - 10 - - - - - True - False - ZL - - - 0 - 11 - - - - - True - False - ZR - - - 2 - 11 - - - - - True - False - R - - - 2 - 10 - - - - - True - False - + - - - 2 - 9 - - - - - True - False - Y - - - 2 - 8 - - - - - True - False - X - - - 2 - 7 - - - - - True - False - B - - - 2 - 6 - - - - - True - False - A - - - 2 - 5 - - - - - True - False - RStick Button - - - 2 - 4 - - - - - True - False - RStick Right - - - 2 - 3 - - - - - True - False - RStick Left - - - 2 - 2 - - - - - True - False - RStick Down - - - 2 - 1 - - - - - True - False - RStick Up - - - 2 - 0 - - - - - - True - True - True - - - 1 - 0 - - - - - - True - True - True - - - 1 - 1 - - - - - - True - True - True - - - 1 - 2 - - - - - - True - True - True - - - 1 - 3 - - - - - - True - True - True - - - 1 - 4 - - - - - - True - True - True - - - 1 - 5 - - - - - - True - True - True - - - 1 - 6 - - - - - - True - True - True - - - 1 - 7 - - - - - - True - True - True - - - 1 - 8 - - - - - - True - True - True - - - 1 - 9 - - - - - - True - True - True - - - 1 - 10 - - - - - - True - True - True - - - 1 - 11 - - - - - - True - True - True - - - 3 - 0 - - - - - - True - True - True - - - 3 - 1 - - - - - - True - True - True - - - 3 - 2 - - - - - - True - True - True - - - 3 - 3 - - - - - - True - True - True - - - 3 - 4 - - - - - - True - True - True - - - 3 - 5 - - - - - - True - True - True - - - 3 - 6 - - - - - - True - True - True - - - 3 - 7 - - - - - - True - True - True - - - 3 - 8 - - - - - - True - True - True - - - 3 - 9 - - - - - - True - True - True - - - 3 - 10 - - - - - - True - True - True - - - 3 - 11 - - - - - False - True - 10 - 0 - - - - - True - False - - - True - True - 1 - - - - - False - True - 2 - - - - - - - True - False - Controller 1 - - - False - - - - - True - False - Multiple controllers are not yet supported - - - 1 - True - - - - - True - False - Controller 2 - - - 1 - False - - - - - True - False - Multiple controllers are not yet supported - - - 2 - - - - - True - False - Controller 3 - - - 2 - False - - - - - True - False - Multiple controllers are not yet supported - - - 3 - - - - - True - False - Controller 4 - - - 3 - False - - - - - True - False - Multiple controllers are not yet supported - - - 4 - - - - - True - False - Controller 5 - - - 4 - False - - - - - True - False - Multiple controllers are not yet supported - - - 5 - - - - - True - False - Controller 6 - - - 5 - False - - - - - True - False - Multiple controllers are not yet supported - - - 6 - - - - - True - False - Controller 7 - - - 6 - False - - - - - True - False - Multiple controllers are not yet supported - - - 7 - - - - - True - False - Controller 8 - - - 7 - False - - - - - True - True - 0 - - - - - - diff --git a/Ryujinx/GUI/GeneralSettings.cs b/Ryujinx/GUI/GeneralSettings.cs deleted file mode 100644 index 92cf24cf88..0000000000 --- a/Ryujinx/GUI/GeneralSettings.cs +++ /dev/null @@ -1,111 +0,0 @@ -using Gtk; -using GUI = Gtk.Builder.ObjectAttribute; -using Ryujinx.HLE.HOS.SystemState; -using System; -using System.IO; -using System.Reflection; - -namespace Ryujinx -{ - public class GeneralSettings : Window - { - private HLE.Switch device { get; set; } - - internal static Configuration SwitchConfig { get; private set; } - - [GUI] Window GSWin; - [GUI] CheckButton ErrorLogToggle; - [GUI] CheckButton WarningLogToggle; - [GUI] CheckButton InfoLogToggle; - [GUI] CheckButton StubLogToggle; - [GUI] CheckButton DebugLogToggle; - [GUI] CheckButton FileLogToggle; - [GUI] CheckButton DockedModeToggle; - [GUI] CheckButton DiscordToggle; - [GUI] CheckButton VSyncToggle; - [GUI] CheckButton MultiSchedToggle; - [GUI] CheckButton FSICToggle; - [GUI] CheckButton AggrToggle; - [GUI] CheckButton IgnoreToggle; - [GUI] CheckButton DirectKeyboardAccess; - [GUI] ComboBoxText SystemLanguageSelect; - [GUI] CheckButton CustThemeToggle; - [GUI] Entry CustThemeDir; - [GUI] TextView GameDirsBox; - - public static void ConfigureSettings(Configuration Instance) { SwitchConfig = Instance; } - - public GeneralSettings(HLE.Switch _device) : this(new Builder("Ryujinx.GUI.GeneralSettings.glade"), _device) { } - - private GeneralSettings(Builder builder, HLE.Switch _device) : base(builder.GetObject("GSWin").Handle) - { - device = _device; - - builder.Autoconnect(this); - - GSWin.Icon = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.GUI.assets.ryujinxIcon.png"); - - if (SwitchConfig.LoggingEnableError) { ErrorLogToggle.Click(); } - if (SwitchConfig.LoggingEnableWarn) { WarningLogToggle.Click(); } - if (SwitchConfig.LoggingEnableInfo) { InfoLogToggle.Click(); } - if (SwitchConfig.LoggingEnableStub) { StubLogToggle.Click(); } - if (SwitchConfig.LoggingEnableDebug) { DebugLogToggle.Click(); } - if (SwitchConfig.EnableFileLog) { FileLogToggle.Click(); } - if (SwitchConfig.DockedMode) { DockedModeToggle.Click(); } - if (SwitchConfig.EnableDiscordIntergration) { DiscordToggle.Click(); } - if (SwitchConfig.EnableVsync) { VSyncToggle.Click(); } - if (SwitchConfig.EnableMulticoreScheduling) { MultiSchedToggle.Click(); } - if (SwitchConfig.EnableFsIntegrityChecks) { FSICToggle.Click(); } - if (SwitchConfig.EnableAggressiveCpuOpts) { AggrToggle.Click(); } - if (SwitchConfig.IgnoreMissingServices) { IgnoreToggle.Click(); } - if (SwitchConfig.EnableKeyboard) { DirectKeyboardAccess.Click(); } - if (SwitchConfig.EnableCustomTheme) { CustThemeToggle.Click(); } - SystemLanguageSelect.SetActiveId(SwitchConfig.SystemLanguage.ToString()); - - CustThemeDir.Buffer.Text = SwitchConfig.CustomThemePath; - GameDirsBox.Buffer.Text = File.ReadAllText("./GameDirs.dat"); - - if (CustThemeToggle.Active == false) { CustThemeDir.Sensitive = false; } - } - - //Events - private void CustThemeToggle_Activated(object obj, EventArgs args) - { - if (CustThemeToggle.Active == false) { CustThemeDir.Sensitive = false; } else { CustThemeDir.Sensitive = true; } - } - - 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 (DirectKeyboardAccess.Active) { SwitchConfig.EnableKeyboard = true; } - if (CustThemeToggle.Active) { SwitchConfig.EnableCustomTheme = true; } - - SwitchConfig.SystemLanguage = (SystemLanguage)Enum.Parse(typeof(SystemLanguage), SystemLanguageSelect.ActiveId); - SwitchConfig.CustomThemePath = CustThemeDir.Buffer.Text; - - Configuration.SaveConfig(SwitchConfig, System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Config.json")); - File.WriteAllText("./GameDirs.dat", GameDirsBox.Buffer.Text); - - Configuration.Configure(device, SwitchConfig); - - Destroy(); - } - - private void CloseToggle_Activated(object obj, EventArgs args) - { - Destroy(); - } - } -} diff --git a/Ryujinx/GUI/GeneralSettings.glade b/Ryujinx/GUI/GeneralSettings.glade deleted file mode 100644 index 0453367d5f..0000000000 --- a/Ryujinx/GUI/GeneralSettings.glade +++ /dev/null @@ -1,402 +0,0 @@ - - - - - - False - Ryujinx - General Settings - True - 800 - 300 - dialog - - - - - - False - vertical - 2 - - - False - end - - - Save - True - True - True - - - - False - True - 0 - - - - - Close - True - True - True - - - - False - True - 1 - - - - - False - False - 0 - - - - - True - True - - - True - False - 15 - 15 - - - Enable Error Logs - True - True - False - True - - - 0 - 0 - - - - - Enable Warning Logs - True - True - False - True - - - 1 - 0 - - - - - Enable Info Logs - True - True - False - True - - - 2 - 0 - - - - - Enable Stub Logs - True - True - False - True - - - 3 - 0 - - - - - Enable Debug Logs - True - True - False - True - - - 0 - 1 - - - - - Enable File Log - True - True - False - True - - - 1 - 1 - - - - - Enable Discord Integration - True - True - False - True - - - 2 - 1 - - - - - Enable Docked Mode - True - True - False - True - - - 0 - 2 - - - - - Enable VSync - True - True - False - True - - - 3 - 1 - - - - - Enable Multicore Scheduling - True - True - False - True - - - 1 - 2 - - - - - Enable FS Integrity Checks - True - True - False - True - - - 2 - 2 - - - - - Enable Aggressive CPU Options - True - True - False - True - - - 3 - 2 - - - - - Ignore Missing Services - True - True - False - True - - - 0 - 3 - - - - - True - False - end - System Language: - - - 2 - 3 - - - - - True - False - - American English - British English - Canadian French - Chinese - Dutch - French - German - Italian - Japanese - Korean - Latin American Spanish - Portuguese - Russian - Simplified Chinese - Spanish - Taiwanese - Traditional Chinese - - - - 3 - 3 - - - - - Direct Keyboard Access - True - True - False - True - - - 1 - 3 - - - - - - - True - False - Emulation Settings - - - False - - - - - True - True - in - - - True - True - - - - - 1 - - - - - True - False - Game Directories - - - 1 - False - - - - - True - False - - - Use Custom Theme - True - True - False - True - - - - False - True - 10 - 0 - - - - - True - False - Custom Theme Dir: - - - False - True - 5 - 1 - - - - - True - True - center - - - True - True - 2 - - - - - 2 - - - - - True - False - GUI Settings - - - 2 - False - - - - - True - True - 1 - - - - - - diff --git a/Ryujinx/GUI/MainMenu.cs b/Ryujinx/GUI/MainMenu.cs index 1a6800f7e2..41e0423cc7 100644 --- a/Ryujinx/GUI/MainMenu.cs +++ b/Ryujinx/GUI/MainMenu.cs @@ -102,18 +102,19 @@ namespace Ryujinx NFC.Sensitive = false; GameTable.AppendColumn("Icon", new CellRendererPixbuf(), "pixbuf", 0); - GameTable.AppendColumn("Game", new CellRendererText(), "text", 1); - GameTable.AppendColumn("Version", new CellRendererText(), "text", 2); - GameTable.AppendColumn("DLC", new CellRendererText(), "text", 3); - GameTable.AppendColumn("Time Played", new CellRendererText(), "text", 4); - GameTable.AppendColumn("Last Played", new CellRendererText(), "text", 5); - GameTable.AppendColumn("Path", new CellRendererText(), "text", 6); + //GameTable.AppendColumn("Game", new CellRendererText(), "text", 1); + //GameTable.AppendColumn("Version", new CellRendererText(), "text", 2); + //GameTable.AppendColumn("DLC", new CellRendererText(), "text", 3); + //GameTable.AppendColumn("Time Played", new CellRendererText(), "text", 4); + //GameTable.AppendColumn("Last Played", new CellRendererText(), "text", 5); + GameTable.AppendColumn("File Size", new CellRendererText(), "text", 6); + GameTable.AppendColumn("Path", new CellRendererText(), "text", 7); - TableStore = new ListStore(typeof(Gdk.Pixbuf), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string)); + TableStore = new ListStore(typeof(Gdk.Pixbuf), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string)); foreach (ApplicationLibrary.ApplicationData AppData in ApplicationLibrary.ApplicationLibraryData) { - TableStore.AppendValues(AppData.Icon, AppData.Game, AppData.Version, AppData.DLC, AppData.TP, AppData.LP, AppData.Path); + TableStore.AppendValues(AppData.Icon, AppData.Game, AppData.Version, AppData.DLC, AppData.TP, AppData.LP, AppData.FileSize, AppData.Path); } GameTable.Model = TableStore; @@ -124,15 +125,15 @@ namespace Ryujinx { var settings = Settings.Default; settings.XftRgba = "rgb"; - settings.XftDpi = 96; + settings.XftDpi = 96; settings.XftHinting = 1; settings.XftHintstyle = "hintfull"; CssProvider css_provider = new CssProvider(); - if (GeneralSettings.SwitchConfig.EnableCustomTheme) + if (SwitchSettings.SwitchConfig.EnableCustomTheme) { - css_provider.LoadFromPath(GeneralSettings.SwitchConfig.CustomThemePath); + css_provider.LoadFromPath(SwitchSettings.SwitchConfig.CustomThemePath); } else { @@ -214,7 +215,7 @@ namespace Ryujinx private void Row_Activated(object obj, RowActivatedArgs args) { TableStore.GetIter(out TreeIter treeiter, new TreePath(args.Path.ToString())); - string path = (string)TableStore.GetValue(treeiter, 6); + string path = (string)TableStore.GetValue(treeiter, 7); LoadApplication(path); @@ -316,20 +317,12 @@ namespace Ryujinx Environment.Exit(0); } - private void General_Settings_Pressed(object o, EventArgs args) + private void Settings_Pressed(object o, EventArgs args) { - var GSWin = new GeneralSettings(device); + var SettingsWin = new SwitchSettings(device); gtkapp.Register(GLib.Cancellable.Current); - gtkapp.AddWindow(GSWin); - GSWin.Show(); - } - - private void Control_Settings_Pressed(object o, EventArgs args) - { - var CSWin = new ControlSettings(device); - gtkapp.Register(GLib.Cancellable.Current); - gtkapp.AddWindow(CSWin); - CSWin.Show(); + gtkapp.AddWindow(SettingsWin); + SettingsWin.Show(); } private void NFC_Pressed(object o, EventArgs args) diff --git a/Ryujinx/GUI/MainMenu.glade b/Ryujinx/GUI/MainMenu.glade index ddece64b5e..002320f35d 100644 --- a/Ryujinx/GUI/MainMenu.glade +++ b/Ryujinx/GUI/MainMenu.glade @@ -77,21 +77,12 @@ True False - + True False - General Settings + Settings True - - - - - - True - False - Control Settings - True - + diff --git a/Ryujinx/GUI/Settings.glade b/Ryujinx/GUI/Settings.glade new file mode 100644 index 0000000000..bd553c370e --- /dev/null +++ b/Ryujinx/GUI/Settings.glade @@ -0,0 +1,1501 @@ + + + + + + False + Ryujinx - Settings + False + True + 800 + 600 + dialog + + + + + + False + vertical + 2 + + + False + end + + + Save + True + True + True + + + + False + True + 0 + + + + + Close + True + True + True + + + + False + True + 1 + + + + + False + False + 0 + + + + + True + True + + + True + False + vertical + + + True + False + + + True + False + end + System Language: + + + False + True + 10 + 0 + + + + + True + False + + American English + British English + Canadian French + Chinese + Dutch + French + German + Italian + Japanese + Korean + Latin American Spanish + Portuguese + Russian + Simplified Chinese + Spanish + Taiwanese + Traditional Chinese + + + + True + True + 1 + + + + + False + True + 10 + 0 + + + + + Enable Discord Integration + True + True + False + 5 + True + + + False + True + 5 + 1 + + + + + True + False + + + False + True + 5 + 2 + + + + + True + False + start + 10 + Game Directories: + + + False + True + 3 + + + + + True + True + in + + + True + True + + + + + True + True + 5 + 4 + + + + + True + False + + + False + True + 5 + 5 + + + + + Use Custom Theme + True + True + False + start + 5 + True + + + + False + True + 5 + 6 + + + + + True + False + + + True + False + 5 + Custom Theme Dir: + + + False + True + 5 + 0 + + + + + True + True + center + + + True + True + 1 + + + + + False + True + 10 + 7 + + + + + + + True + False + General + + + False + + + + + True + False + vertical + + + True + False + vertical + + + True + False + start + 5 + 5 + Core + + + False + True + 0 + + + + + True + False + vertical + + + Enable VSync + True + True + False + start + 5 + 5 + True + + + False + True + 0 + + + + + Enable Multicore Scheduling + True + True + False + start + 5 + 5 + True + + + False + True + 1 + + + + + Enable Aggressive CPU Optimizations + True + True + False + start + 5 + 5 + True + + + False + True + 2 + + + + + Enable FS Integrity Checks + True + True + False + start + 5 + 5 + True + + + False + True + 3 + + + + + True + True + 1 + + + + + True + True + 5 + 0 + + + + + True + False + + + False + True + 1 + + + + + True + False + vertical + + + True + False + start + 5 + 5 + Logging + + + False + True + 0 + + + + + True + False + vertical + + + Enable Error Logs + True + True + False + start + 5 + 5 + True + + + False + True + 0 + + + + + Enable Warning Logs + True + True + False + start + 5 + 5 + True + + + False + True + 1 + + + + + Enable Info Logs + True + True + False + start + 5 + 5 + True + + + False + True + 2 + + + + + Enable Debug Logs + True + True + False + start + 5 + 5 + True + + + False + True + 3 + + + + + Enable Stub Logs + True + True + False + start + 5 + 5 + True + + + False + True + 4 + + + + + Enable Logging to File + True + True + False + start + 5 + 5 + True + + + False + True + 5 + + + + + True + True + 1 + + + + + True + True + 5 + 2 + + + + + True + False + + + False + True + 3 + + + + + True + False + vertical + + + True + False + start + 5 + 5 + Hacks - These may cause instability + + + False + True + 1 + + + + + True + False + vertical + + + Ignore Missing Services + True + True + False + start + 5 + 5 + True + + + False + True + 0 + + + + + True + True + 2 + + + + + True + True + 5 + 4 + + + + + 1 + + + + + True + False + System + + + 1 + False + + + + + True + False + vertical + + + True + False + + + Enable Docked Mode + True + True + False + True + + + False + True + 10 + 0 + + + + + Direct Keyboard Access + True + True + False + True + + + False + False + 10 + 1 + + + + + False + True + 5 + 0 + + + + + True + True + + + True + False + vertical + + + True + False + + + True + False + center + 10 + 10 + 5 + 5 + Controller Type: + + + False + True + 0 + + + + + True + False + 0 + + Handheld + Pro Controller + Paired Joycons + Left Joycon + Right Joycon + + + + True + True + 1 + + + + + True + True + 10 + 0 + + + + + True + False + + + True + False + 2 + 5 + + + True + False + LStick Up + + + 0 + 0 + + + + + True + False + LStick Down + + + 0 + 1 + + + + + True + False + LStick Left + + + 0 + 2 + + + + + True + False + LStick Right + + + 0 + 3 + + + + + True + False + LStick Button + + + 0 + 4 + + + + + True + False + Dpad Up + + + 0 + 5 + + + + + True + False + Dpad Down + + + 0 + 6 + + + + + True + False + Dpad Left + + + 0 + 7 + + + + + True + False + Dpad Right + + + 0 + 8 + + + + + True + False + - + + + 0 + 9 + + + + + True + False + L + + + 0 + 10 + + + + + True + False + ZL + + + 0 + 11 + + + + + True + False + ZR + + + 2 + 11 + + + + + True + False + R + + + 2 + 10 + + + + + True + False + + + + + 2 + 9 + + + + + True + False + Y + + + 2 + 8 + + + + + True + False + X + + + 2 + 7 + + + + + True + False + B + + + 2 + 6 + + + + + True + False + A + + + 2 + 5 + + + + + True + False + RStick Button + + + 2 + 4 + + + + + True + False + RStick Right + + + 2 + 3 + + + + + True + False + RStick Left + + + 2 + 2 + + + + + True + False + RStick Down + + + 2 + 1 + + + + + True + False + RStick Up + + + 2 + 0 + + + + + + True + True + True + + + 1 + 0 + + + + + + True + True + True + + + 1 + 1 + + + + + + True + True + True + + + 1 + 2 + + + + + + True + True + True + + + 1 + 3 + + + + + + True + True + True + + + 1 + 4 + + + + + + True + True + True + + + 1 + 5 + + + + + + True + True + True + + + 1 + 6 + + + + + + True + True + True + + + 1 + 7 + + + + + + True + True + True + + + 1 + 8 + + + + + + True + True + True + + + 1 + 9 + + + + + + True + True + True + + + 1 + 10 + + + + + + True + True + True + + + 1 + 11 + + + + + + True + True + True + + + 3 + 0 + + + + + + True + True + True + + + 3 + 1 + + + + + + True + True + True + + + 3 + 2 + + + + + + True + True + True + + + 3 + 3 + + + + + + True + True + True + + + 3 + 4 + + + + + + True + True + True + + + 3 + 5 + + + + + + True + True + True + + + 3 + 6 + + + + + + True + True + True + + + 3 + 7 + + + + + + True + True + True + + + 3 + 8 + + + + + + True + True + True + + + 3 + 9 + + + + + + True + True + True + + + 3 + 10 + + + + + + True + True + True + + + 3 + 11 + + + + + False + True + 10 + 0 + + + + + True + False + + + True + True + 1 + + + + + False + True + 1 + + + + + + + True + False + Controller 1 + + + False + + + + + True + False + Multiple controllers are not yet supported + + + 1 + True + + + + + True + False + Controller 2 + + + 1 + False + + + + + True + False + Multiple controllers are not yet supported + + + 2 + + + + + True + False + Controller 3 + + + 2 + False + + + + + True + False + Multiple controllers are not yet supported + + + 3 + + + + + True + False + Controller 4 + + + 3 + False + + + + + True + False + Multiple controllers are not yet supported + + + 4 + + + + + True + False + Controller 5 + + + 4 + False + + + + + True + False + Multiple controllers are not yet supported + + + 5 + + + + + True + False + Controller 6 + + + 5 + False + + + + + True + False + Multiple controllers are not yet supported + + + 6 + + + + + True + False + Controller 7 + + + 6 + False + + + + + True + False + Multiple controllers are not yet supported + + + 7 + + + + + True + False + Controller 8 + + + 7 + False + + + + + False + True + 2 + + + + + 2 + + + + + True + False + Controller + + + 2 + False + + + + + True + True + 1 + + + + + + diff --git a/Ryujinx/GUI/ControlSettings.cs b/Ryujinx/GUI/SwitchSettings.cs similarity index 54% rename from Ryujinx/GUI/ControlSettings.cs rename to Ryujinx/GUI/SwitchSettings.cs index 89b2bf6df5..f5e2b38ae7 100644 --- a/Ryujinx/GUI/ControlSettings.cs +++ b/Ryujinx/GUI/SwitchSettings.cs @@ -1,23 +1,46 @@ using Gtk; using GUI = Gtk.Builder.ObjectAttribute; +using Ryujinx.HLE.HOS.SystemState; +using Ryujinx.HLE.Input; using Ryujinx.UI.Input; using System; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Reflection; namespace Ryujinx { - public class ControlSettings : Window + public class SwitchSettings : Window { private HLE.Switch device { get; set; } internal static Configuration SwitchConfig { get; private set; } - [GUI] Window CSWin; + [GUI] Window SettingsWin; + [GUI] CheckButton ErrorLogToggle; + [GUI] CheckButton WarningLogToggle; + [GUI] CheckButton InfoLogToggle; + [GUI] CheckButton StubLogToggle; + [GUI] CheckButton DebugLogToggle; + [GUI] CheckButton FileLogToggle; + [GUI] CheckButton DockedModeToggle; + [GUI] CheckButton DiscordToggle; + [GUI] CheckButton VSyncToggle; + [GUI] CheckButton MultiSchedToggle; + [GUI] CheckButton FSICToggle; + [GUI] CheckButton AggrToggle; + [GUI] CheckButton IgnoreToggle; [GUI] CheckButton DirectKeyboardAccess; + [GUI] ComboBoxText SystemLanguageSelect; + [GUI] CheckButton CustThemeToggle; + [GUI] Entry CustThemeDir; + [GUI] Label CustThemeDirLabel; + [GUI] TextView GameDirsBox; [GUI] Image ControllerImage; + + [GUI] ComboBoxText Controller1Type; [GUI] ToggleButton LStickUp1; [GUI] ToggleButton LStickDown1; [GUI] ToggleButton LStickLeft1; @@ -43,19 +66,20 @@ namespace Ryujinx [GUI] ToggleButton R1; [GUI] ToggleButton ZR1; - public static void ConfigureControls(Configuration Instance) { SwitchConfig = Instance; } + public static void ConfigureSettings(Configuration Instance) { SwitchConfig = Instance; } - public ControlSettings(HLE.Switch _device) : this(new Builder("Ryujinx.GUI.ControlSettings.glade"), _device) { } + public SwitchSettings(HLE.Switch _device) : this(new Builder("Ryujinx.GUI.Settings.glade"), _device) { } - private ControlSettings(Builder builder, HLE.Switch _device) : base(builder.GetObject("CSWin").Handle) + private SwitchSettings(Builder builder, HLE.Switch _device) : base(builder.GetObject("SettingsWin").Handle) { device = _device; builder.Autoconnect(this); - CSWin.Icon = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.GUI.assets.ryujinxIcon.png"); - ControllerImage.Pixbuf = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.GUI.assets.JoyCon.png", 400, 400); + SettingsWin.Icon = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.GUI.assets.ryujinxIcon.png"); + ControllerImage.Pixbuf = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.GUI.assets.JoyCon.png", 500, 500); + //Bind Events LStickUp1.Toggled += (o, args) => Button_Pressed(o, args, LStickUp1); LStickDown1.Toggled += (o, args) => Button_Pressed(o, args, LStickDown1); LStickLeft1.Toggled += (o, args) => Button_Pressed(o, args, LStickLeft1); @@ -81,7 +105,26 @@ namespace Ryujinx R1.Toggled += (o, args) => Button_Pressed(o, args, R1); ZR1.Toggled += (o, args) => Button_Pressed(o, args, ZR1); - if (SwitchConfig.EnableKeyboard) { DirectKeyboardAccess.Click(); } + //Setup Currents + if (SwitchConfig.LoggingEnableError) { ErrorLogToggle.Click(); } + if (SwitchConfig.LoggingEnableWarn) { WarningLogToggle.Click(); } + if (SwitchConfig.LoggingEnableInfo) { InfoLogToggle.Click(); } + if (SwitchConfig.LoggingEnableStub) { StubLogToggle.Click(); } + if (SwitchConfig.LoggingEnableDebug) { DebugLogToggle.Click(); } + if (SwitchConfig.EnableFileLog) { FileLogToggle.Click(); } + if (SwitchConfig.DockedMode) { DockedModeToggle.Click(); } + if (SwitchConfig.EnableDiscordIntergration) { DiscordToggle.Click(); } + if (SwitchConfig.EnableVsync) { VSyncToggle.Click(); } + if (SwitchConfig.EnableMulticoreScheduling) { MultiSchedToggle.Click(); } + if (SwitchConfig.EnableFsIntegrityChecks) { FSICToggle.Click(); } + if (SwitchConfig.EnableAggressiveCpuOpts) { AggrToggle.Click(); } + if (SwitchConfig.IgnoreMissingServices) { IgnoreToggle.Click(); } + if (SwitchConfig.EnableKeyboard) { DirectKeyboardAccess.Click(); } + if (SwitchConfig.EnableCustomTheme) { CustThemeToggle.Click(); } + + SystemLanguageSelect.SetActiveId(SwitchConfig.SystemLanguage.ToString()); + Controller1Type .SetActiveId(SwitchConfig.ControllerType.ToString()); + LStickUp1.Label = SwitchConfig.KeyboardControls.LeftJoycon.StickUp.ToString(); LStickDown1.Label = SwitchConfig.KeyboardControls.LeftJoycon.StickDown.ToString(); LStickLeft1.Label = SwitchConfig.KeyboardControls.LeftJoycon.StickLeft.ToString(); @@ -106,6 +149,11 @@ namespace Ryujinx Plus1.Label = SwitchConfig.KeyboardControls.RightJoycon.ButtonPlus.ToString(); R1.Label = SwitchConfig.KeyboardControls.RightJoycon.ButtonR.ToString(); ZR1.Label = SwitchConfig.KeyboardControls.RightJoycon.ButtonZr.ToString(); + + CustThemeDir.Buffer.Text = SwitchConfig.CustomThemePath; + GameDirsBox.Buffer.Text = File.ReadAllText("./GameDirs.dat"); + + if (CustThemeToggle.Active == false) { CustThemeDir.Sensitive = false; CustThemeDirLabel.Sensitive = false; } } //Events @@ -113,56 +161,81 @@ namespace Ryujinx { KeyPressEvent += On_KeyPress; - void On_KeyPress(object obj , KeyPressEventArgs KeyPressed) + void On_KeyPress(object obj, KeyPressEventArgs KeyPressed) { string key = KeyPressed.Event.Key.ToString(); if (Enum.IsDefined(typeof(OpenTK.Input.Key), key.First().ToString().ToUpper() + key.Substring(1))) { Button.Label = key.First().ToString().ToUpper() + key.Substring(1); } - else if (GdkToTKInput.ContainsKey(key)) { Button.Label = GdkToTKInput[key]; } - else { Button.Label = "Space"; } + else if (GdkToTKInput.ContainsKey(key)) { Button.Label = GdkToTKInput[key]; } + else { Button.Label = "Space"; } Button.SetStateFlags(0, true); KeyPressEvent -= On_KeyPress; } } + private void CustThemeToggle_Activated(object obj, EventArgs args) + { + if (CustThemeToggle.Active == false) { CustThemeDir.Sensitive = false; CustThemeDirLabel.Sensitive = false; } else { CustThemeDir.Sensitive = true; CustThemeDirLabel.Sensitive = true; } + } + private void SaveToggle_Activated(object obj, EventArgs args) { - if (DirectKeyboardAccess.Active) { SwitchConfig.EnableKeyboard = true; } + 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 (DirectKeyboardAccess.Active) { SwitchConfig.EnableKeyboard = true; } + if (CustThemeToggle.Active) { SwitchConfig.EnableCustomTheme = true; } SwitchConfig.KeyboardControls.LeftJoycon = new NpadKeyboardLeft() { - StickUp = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), LStickUp1.Label), - StickDown = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), LStickDown1.Label), - StickLeft = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), LStickLeft1.Label), - StickRight = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), LStickRight1.Label), + StickUp = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), LStickUp1.Label), + StickDown = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), LStickDown1.Label), + StickLeft = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), LStickLeft1.Label), + StickRight = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), LStickRight1.Label), StickButton = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), LStickButton1.Label), - DPadUp = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), DpadUp1.Label), - DPadDown = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), DpadDown1.Label), - DPadLeft = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), DpadLeft1.Label), - DPadRight = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), DpadRight1.Label), + DPadUp = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), DpadUp1.Label), + DPadDown = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), DpadDown1.Label), + DPadLeft = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), DpadLeft1.Label), + DPadRight = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), DpadRight1.Label), ButtonMinus = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), Minus1.Label), - ButtonL = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), L1.Label), - ButtonZl = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), ZL1.Label), + ButtonL = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), L1.Label), + ButtonZl = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), ZL1.Label), }; SwitchConfig.KeyboardControls.RightJoycon = new NpadKeyboardRight() { - StickUp = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), RStickUp1.Label), - StickDown = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), RStickDown1.Label), - StickLeft = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), RStickLeft1.Label), - StickRight = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), RStickRight1.Label), + StickUp = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), RStickUp1.Label), + StickDown = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), RStickDown1.Label), + StickLeft = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), RStickLeft1.Label), + StickRight = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), RStickRight1.Label), StickButton = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), RStickButton1.Label), - ButtonA = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), A1.Label), - ButtonB = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), B1.Label), - ButtonX = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), X1.Label), - ButtonY = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), Y1.Label), - ButtonPlus = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), Plus1.Label), - ButtonR = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), R1.Label), - ButtonZr = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), ZR1.Label), + ButtonA = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), A1.Label), + ButtonB = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), B1.Label), + ButtonX = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), X1.Label), + ButtonY = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), Y1.Label), + ButtonPlus = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), Plus1.Label), + ButtonR = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), R1.Label), + ButtonZr = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), ZR1.Label), }; + SwitchConfig.SystemLanguage = (SystemLanguage)Enum.Parse(typeof(SystemLanguage), SystemLanguageSelect.ActiveId); + SwitchConfig.ControllerType = (HidControllerType)Enum.Parse(typeof(HidControllerType), Controller1Type.ActiveId); + SwitchConfig.CustomThemePath = CustThemeDir.Buffer.Text; + Configuration.SaveConfig(SwitchConfig, System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Config.json")); + File.WriteAllText("./GameDirs.dat", GameDirsBox.Buffer.Text); + Configuration.Configure(device, SwitchConfig); Destroy(); diff --git a/Ryujinx/GUI/assets/JoyCon.png b/Ryujinx/GUI/assets/JoyCon.png index b8bf163109..ec8a8f993c 100644 Binary files a/Ryujinx/GUI/assets/JoyCon.png and b/Ryujinx/GUI/assets/JoyCon.png differ diff --git a/Ryujinx/GUI/assets/ryujinxNCAIcon.png b/Ryujinx/GUI/assets/ryujinxNCAIcon.png new file mode 100644 index 0000000000..6d73c8c70c Binary files /dev/null and b/Ryujinx/GUI/assets/ryujinxNCAIcon.png differ diff --git a/Ryujinx/GUI/assets/ryujinxNROIcon.png b/Ryujinx/GUI/assets/ryujinxNROIcon.png new file mode 100644 index 0000000000..bc6b65bf4f Binary files /dev/null and b/Ryujinx/GUI/assets/ryujinxNROIcon.png differ diff --git a/Ryujinx/GUI/assets/ryujinxNSOIcon.png b/Ryujinx/GUI/assets/ryujinxNSOIcon.png new file mode 100644 index 0000000000..8782b3ea69 Binary files /dev/null and b/Ryujinx/GUI/assets/ryujinxNSOIcon.png differ diff --git a/Ryujinx/GUI/assets/ryujinxNSPIcon.png b/Ryujinx/GUI/assets/ryujinxNSPIcon.png new file mode 100644 index 0000000000..d01dc48229 Binary files /dev/null and b/Ryujinx/GUI/assets/ryujinxNSPIcon.png differ diff --git a/Ryujinx/GUI/assets/ryujinxXCIIcon.png b/Ryujinx/GUI/assets/ryujinxXCIIcon.png new file mode 100644 index 0000000000..08f783a80d Binary files /dev/null and b/Ryujinx/GUI/assets/ryujinxXCIIcon.png differ diff --git a/Ryujinx/Ryujinx.csproj b/Ryujinx/Ryujinx.csproj index 2d55b86f61..2cf868d8b0 100644 --- a/Ryujinx/Ryujinx.csproj +++ b/Ryujinx/Ryujinx.csproj @@ -21,10 +21,14 @@ + + + + - - + +