1st wave of changes

This commit is contained in:
Xpl0itR 2019-06-12 00:44:31 +01:00
commit 8b2781c578
No known key found for this signature in database
GPG key ID: 91798184109676AD
16 changed files with 1661 additions and 1450 deletions

View file

@ -9,6 +9,11 @@ namespace Ryujinx
{ {
public class ApplicationLibrary 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 Gdk.Pixbuf RyujinxROMIcon { get; private set; }
public static List<ApplicationData> ApplicationLibraryData { get; private set; } public static List<ApplicationData> ApplicationLibraryData { get; private set; }
@ -21,11 +26,17 @@ namespace Ryujinx
public string DLC; public string DLC;
public string TP; public string TP;
public string LP; public string LP;
public string FileSize;
public string Path; public string Path;
} }
public static void Init() 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); RyujinxROMIcon = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.GUI.assets.ryujinxROMIcon.png", 75, 75);
string dat = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "GameDirs.dat"); string dat = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "GameDirs.dat");
@ -50,15 +61,17 @@ namespace Ryujinx
ApplicationLibraryData = new List<ApplicationData>(); ApplicationLibraryData = new List<ApplicationData>();
foreach (string GamePath in Games) foreach (string GamePath in Games)
{ {
double filesize = new FileInfo(GamePath).Length * 0.000000000931;
ApplicationData data = new ApplicationData() ApplicationData data = new ApplicationData()
{ {
Icon = GetGameIcon(GamePath), Icon = GetGameIcon(GamePath),
Game = (Path.GetExtension(GamePath) == ".nro") ? "Application" : "", Game = (Path.GetExtension(GamePath) == ".nro") ? "Application" : "",
Version = "", Version = "",
DLC = (Path.GetExtension(GamePath) == ".nro") ? "N/A" : "", DLC = (Path.GetExtension(GamePath) == ".nro") ? "N/A" : "",
TP = "", TP = "",
LP = "", LP = "",
Path = GamePath FileSize = (filesize < 1) ? (filesize * 1024).ToString("0.##") + "MB" : filesize.ToString("0.##") + "GB",
Path = GamePath,
}; };
ApplicationLibraryData.Add(data); ApplicationLibraryData.Add(data);
} }
@ -70,11 +83,13 @@ namespace Ryujinx
{ {
BinaryReader Reader = new BinaryReader(Input); 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") else if (Path.GetExtension(filePath) == ".nro")
{ {
@ -98,7 +113,7 @@ namespace Ryujinx
return new Gdk.Pixbuf(IconData, 75, 75); return new Gdk.Pixbuf(IconData, 75, 75);
} }
else { return RyujinxROMIcon; } else { return RyujinxNROIcon; }
} }
else { return RyujinxROMIcon; } else { return RyujinxROMIcon; }

View file

@ -210,8 +210,7 @@ namespace Ryujinx
throw new InvalidOperationException("Configuration has not been loaded yet."); throw new InvalidOperationException("Configuration has not been loaded yet.");
} }
GeneralSettings.ConfigureSettings(Instance); SwitchSettings.ConfigureSettings(Instance);
ControlSettings.ConfigureControls(Instance);
Logger.AddTarget(new AsyncLogTargetWrapper( Logger.AddTarget(new AsyncLogTargetWrapper(
new ConsoleLogTarget(), new ConsoleLogTarget(),
@ -254,7 +253,7 @@ namespace Ryujinx
} }
} }
MainMenu.DiscordIntegrationEnabled = SwitchConfig.EnableDiscordIntergration; MainMenu.DiscordIntegrationEnabled = SwitchConfig.EnableDiscordIntegration;
device.EnableDeviceVsync = SwitchConfig.EnableVsync; device.EnableDeviceVsync = SwitchConfig.EnableVsync;

View file

@ -1,852 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.1 -->
<interface>
<requires lib="gtk+" version="3.20"/>
<object class="GtkDialog" id="CSWin">
<property name="can_focus">False</property>
<property name="title" translatable="yes">Ryujinx - Control Settings</property>
<property name="modal">True</property>
<property name="default_width">800</property>
<property name="default_height">550</property>
<property name="type_hint">dialog</property>
<child>
<placeholder/>
</child>
<child internal-child="vbox">
<object class="GtkBox">
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
<child internal-child="action_area">
<object class="GtkButtonBox">
<property name="can_focus">False</property>
<property name="layout_style">end</property>
<child>
<object class="GtkToggleButton" id="SaveToggle">
<property name="label" translatable="yes">Save</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<signal name="toggled" handler="SaveToggle_Activated" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="CloseToggle">
<property name="label" translatable="yes">Close</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<signal name="toggled" handler="CloseToggle_Activated" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkNotebook">
<property name="visible">True</property>
<property name="can_focus">True</property>
<child>
<object class="GtkBox" id="ControllerBox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkCheckButton" id="DirectKeyboardAccess">
<property name="label" translatable="yes">Direct Keyboard Access</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="padding">10</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkSeparator">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkGrid">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="row_spacing">2</property>
<property name="column_spacing">5</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">LStick Up</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">LStick Down</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">LStick Left</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">LStick Right</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">LStick Button</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Dpad Up</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Dpad Down</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">6</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Dpad Left</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">7</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Dpad Right</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">8</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">-</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">9</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">L</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">10</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">ZL</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">11</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">ZR</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">11</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">R</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">10</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">+</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">9</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Y</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">8</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">X</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">7</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">B</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">6</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">A</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">5</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">RStick Button</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">RStick Right</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">RStick Left</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">RStick Down</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">RStick Up</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="LStickUp1">
<property name="label" translatable="yes"> </property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="LStickDown1">
<property name="label" translatable="yes"> </property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="LStickLeft1">
<property name="label" translatable="yes"> </property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="LStickRight1">
<property name="label" translatable="yes"> </property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">3</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="LStickButton1">
<property name="label" translatable="yes"> </property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">4</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="DpadUp1">
<property name="label" translatable="yes"> </property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">5</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="DpadDown1">
<property name="label" translatable="yes"> </property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">6</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="DpadLeft1">
<property name="label" translatable="yes"> </property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">7</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="DpadRight1">
<property name="label" translatable="yes"> </property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">8</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="Minus1">
<property name="label" translatable="yes"> </property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">9</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="L1">
<property name="label" translatable="yes"> </property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">10</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="ZL1">
<property name="label" translatable="yes"> </property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">11</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="RStickUp1">
<property name="label" translatable="yes"> </property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="left_attach">3</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="RStickDown1">
<property name="label" translatable="yes"> </property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="left_attach">3</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="RStickLeft1">
<property name="label" translatable="yes"> </property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="left_attach">3</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="RStickRight1">
<property name="label" translatable="yes"> </property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="left_attach">3</property>
<property name="top_attach">3</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="RStickButton1">
<property name="label" translatable="yes"> </property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="left_attach">3</property>
<property name="top_attach">4</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="A1">
<property name="label" translatable="yes"> </property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="left_attach">3</property>
<property name="top_attach">5</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="B1">
<property name="label" translatable="yes"> </property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="left_attach">3</property>
<property name="top_attach">6</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="X1">
<property name="label" translatable="yes"> </property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="left_attach">3</property>
<property name="top_attach">7</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="Y1">
<property name="label" translatable="yes"> </property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="left_attach">3</property>
<property name="top_attach">8</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="Plus1">
<property name="label" translatable="yes"> </property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="left_attach">3</property>
<property name="top_attach">9</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="R1">
<property name="label" translatable="yes"> </property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="left_attach">3</property>
<property name="top_attach">10</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="ZR1">
<property name="label" translatable="yes"> </property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="left_attach">3</property>
<property name="top_attach">11</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="padding">10</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkImage" id="ControllerImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
</child>
<child type="tab">
<object class="GtkLabel" id="Controller1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Controller 1</property>
</object>
<packing>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Multiple controllers are not yet supported</property>
</object>
<packing>
<property name="position">1</property>
<property name="tab_expand">True</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel" id="Controller2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Controller 2</property>
</object>
<packing>
<property name="position">1</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Multiple controllers are not yet supported</property>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel" id="Controller3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Controller 3</property>
</object>
<packing>
<property name="position">2</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Multiple controllers are not yet supported</property>
</object>
<packing>
<property name="position">3</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel" id="Controller4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Controller 4</property>
</object>
<packing>
<property name="position">3</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Multiple controllers are not yet supported</property>
</object>
<packing>
<property name="position">4</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel" id="Controller5">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Controller 5</property>
</object>
<packing>
<property name="position">4</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Multiple controllers are not yet supported</property>
</object>
<packing>
<property name="position">5</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel" id="Controller6">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Controller 6</property>
</object>
<packing>
<property name="position">5</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Multiple controllers are not yet supported</property>
</object>
<packing>
<property name="position">6</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel" id="Controller7">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Controller 7</property>
</object>
<packing>
<property name="position">6</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Multiple controllers are not yet supported</property>
</object>
<packing>
<property name="position">7</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel" id="Controller8">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Controller 8</property>
</object>
<packing>
<property name="position">7</property>
<property name="tab_fill">False</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
</object>
</child>
</object>
</interface>

View file

@ -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();
}
}
}

View file

@ -1,402 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.1 -->
<interface>
<requires lib="gtk+" version="3.20"/>
<object class="GtkDialog" id="GSWin">
<property name="can_focus">False</property>
<property name="title" translatable="yes">Ryujinx - General Settings</property>
<property name="modal">True</property>
<property name="default_width">800</property>
<property name="default_height">300</property>
<property name="type_hint">dialog</property>
<child>
<placeholder/>
</child>
<child internal-child="vbox">
<object class="GtkBox">
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
<child internal-child="action_area">
<object class="GtkButtonBox">
<property name="can_focus">False</property>
<property name="layout_style">end</property>
<child>
<object class="GtkToggleButton" id="SaveToggle">
<property name="label" translatable="yes">Save</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<signal name="toggled" handler="SaveToggle_Activated" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkToggleButton" id="CloseToggle">
<property name="label" translatable="yes">Close</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<signal name="toggled" handler="CloseToggle_Activated" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkNotebook">
<property name="visible">True</property>
<property name="can_focus">True</property>
<child>
<object class="GtkGrid">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="row_spacing">15</property>
<property name="column_spacing">15</property>
<child>
<object class="GtkCheckButton" id="ErrorLogToggle">
<property name="label" translatable="yes">Enable Error Logs</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="WarningLogToggle">
<property name="label" translatable="yes">Enable Warning Logs</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="InfoLogToggle">
<property name="label" translatable="yes">Enable Info Logs</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="StubLogToggle">
<property name="label" translatable="yes">Enable Stub Logs</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">3</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="DebugLogToggle">
<property name="label" translatable="yes">Enable Debug Logs</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="FileLogToggle">
<property name="label" translatable="yes">Enable File Log</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="DiscordToggle">
<property name="label" translatable="yes">Enable Discord Integration</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="DockedModeToggle">
<property name="label" translatable="yes">Enable Docked Mode</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="VSyncToggle">
<property name="label" translatable="yes">Enable VSync</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">3</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="MultiSchedToggle">
<property name="label" translatable="yes">Enable Multicore Scheduling</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="FSICToggle">
<property name="label" translatable="yes">Enable FS Integrity Checks</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="AggrToggle">
<property name="label" translatable="yes">Enable Aggressive CPU Options</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">3</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="IgnoreToggle">
<property name="label" translatable="yes">Ignore Missing Services</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
<property name="label" translatable="yes">System Language:</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">3</property>
</packing>
</child>
<child>
<object class="GtkComboBoxText" id="SystemLanguageSelect">
<property name="visible">True</property>
<property name="can_focus">False</property>
<items>
<item id="AmericanEnglish" translatable="yes">American English</item>
<item id="BritishEnglish" translatable="yes">British English</item>
<item id="CanadianFrench" translatable="yes">Canadian French</item>
<item id="Chinese" translatable="yes">Chinese</item>
<item id="Dutch" translatable="yes">Dutch</item>
<item id="French" translatable="yes">French</item>
<item id="German" translatable="yes">German</item>
<item id="Italian" translatable="yes">Italian</item>
<item id="Japanese" translatable="yes">Japanese</item>
<item id="Korean" translatable="yes">Korean</item>
<item id="LatinAmericanSpanish" translatable="yes">Latin American Spanish</item>
<item id="Portuguese" translatable="yes">Portuguese</item>
<item id="Russian" translatable="yes">Russian</item>
<item id="SimplifiedChinese" translatable="yes">Simplified Chinese</item>
<item id="Spanish" translatable="yes">Spanish</item>
<item id="Taiwanese" translatable="yes">Taiwanese</item>
<item id="TraditionalChinese" translatable="yes">Traditional Chinese</item>
</items>
</object>
<packing>
<property name="left_attach">3</property>
<property name="top_attach">3</property>
</packing>
</child>
<child>
<object class="GtkCheckButton" id="DirectKeyboardAccess">
<property name="label" translatable="yes">Direct Keyboard Access</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">3</property>
</packing>
</child>
</object>
</child>
<child type="tab">
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Emulation Settings</property>
</object>
<packing>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="shadow_type">in</property>
<child>
<object class="GtkTextView" id="GameDirsBox">
<property name="visible">True</property>
<property name="can_focus">True</property>
</object>
</child>
</object>
<packing>
<property name="position">1</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Game Directories</property>
</object>
<packing>
<property name="position">1</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkCheckButton" id="CustThemeToggle">
<property name="label" translatable="yes">Use Custom Theme</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="CustThemeToggle_Activated" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="padding">10</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Custom Theme Dir:</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="padding">5</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="CustThemeDir">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="valign">center</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="position">2</property>
</packing>
</child>
<child type="tab">
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">GUI Settings</property>
</object>
<packing>
<property name="position">2</property>
<property name="tab_fill">False</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
</interface>

View file

@ -102,18 +102,19 @@ namespace Ryujinx
NFC.Sensitive = false; NFC.Sensitive = false;
GameTable.AppendColumn("Icon", new CellRendererPixbuf(), "pixbuf", 0); GameTable.AppendColumn("Icon", new CellRendererPixbuf(), "pixbuf", 0);
GameTable.AppendColumn("Game", new CellRendererText(), "text", 1); //GameTable.AppendColumn("Game", new CellRendererText(), "text", 1);
GameTable.AppendColumn("Version", new CellRendererText(), "text", 2); //GameTable.AppendColumn("Version", new CellRendererText(), "text", 2);
GameTable.AppendColumn("DLC", new CellRendererText(), "text", 3); //GameTable.AppendColumn("DLC", new CellRendererText(), "text", 3);
GameTable.AppendColumn("Time Played", new CellRendererText(), "text", 4); //GameTable.AppendColumn("Time Played", new CellRendererText(), "text", 4);
GameTable.AppendColumn("Last Played", new CellRendererText(), "text", 5); //GameTable.AppendColumn("Last Played", new CellRendererText(), "text", 5);
GameTable.AppendColumn("Path", new CellRendererText(), "text", 6); 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) 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; GameTable.Model = TableStore;
@ -124,15 +125,15 @@ namespace Ryujinx
{ {
var settings = Settings.Default; var settings = Settings.Default;
settings.XftRgba = "rgb"; settings.XftRgba = "rgb";
settings.XftDpi = 96; settings.XftDpi = 96;
settings.XftHinting = 1; settings.XftHinting = 1;
settings.XftHintstyle = "hintfull"; settings.XftHintstyle = "hintfull";
CssProvider css_provider = new CssProvider(); 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 else
{ {
@ -214,7 +215,7 @@ namespace Ryujinx
private void Row_Activated(object obj, RowActivatedArgs args) private void Row_Activated(object obj, RowActivatedArgs args)
{ {
TableStore.GetIter(out TreeIter treeiter, new TreePath(args.Path.ToString())); 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); LoadApplication(path);
@ -316,20 +317,12 @@ namespace Ryujinx
Environment.Exit(0); 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.Register(GLib.Cancellable.Current);
gtkapp.AddWindow(GSWin); gtkapp.AddWindow(SettingsWin);
GSWin.Show(); SettingsWin.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();
} }
private void NFC_Pressed(object o, EventArgs args) private void NFC_Pressed(object o, EventArgs args)

View file

@ -77,21 +77,12 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<child> <child>
<object class="GtkMenuItem" id="GeneralSettingsMenu"> <object class="GtkMenuItem" id="SettingsMenu">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="label" translatable="yes">General Settings</property> <property name="label" translatable="yes">Settings</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<signal name="activate" handler="General_Settings_Pressed" swapped="no"/> <signal name="activate" handler="Settings_Pressed" swapped="no"/>
</object>
</child>
<child>
<object class="GtkMenuItem" id="ControlSettingsMenu">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Control Settings</property>
<property name="use_underline">True</property>
<signal name="activate" handler="Control_Settings_Pressed" swapped="no"/>
</object> </object>
</child> </child>
</object> </object>

1501
Ryujinx/GUI/Settings.glade Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,23 +1,46 @@
using Gtk; using Gtk;
using GUI = Gtk.Builder.ObjectAttribute; using GUI = Gtk.Builder.ObjectAttribute;
using Ryujinx.HLE.HOS.SystemState;
using Ryujinx.HLE.Input;
using Ryujinx.UI.Input; using Ryujinx.UI.Input;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO;
using System.Linq; using System.Linq;
using System.Reflection; using System.Reflection;
namespace Ryujinx namespace Ryujinx
{ {
public class ControlSettings : Window public class SwitchSettings : Window
{ {
private HLE.Switch device { get; set; } private HLE.Switch device { get; set; }
internal static Configuration SwitchConfig { get; private 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] CheckButton DirectKeyboardAccess;
[GUI] ComboBoxText SystemLanguageSelect;
[GUI] CheckButton CustThemeToggle;
[GUI] Entry CustThemeDir;
[GUI] Label CustThemeDirLabel;
[GUI] TextView GameDirsBox;
[GUI] Image ControllerImage; [GUI] Image ControllerImage;
[GUI] ComboBoxText Controller1Type;
[GUI] ToggleButton LStickUp1; [GUI] ToggleButton LStickUp1;
[GUI] ToggleButton LStickDown1; [GUI] ToggleButton LStickDown1;
[GUI] ToggleButton LStickLeft1; [GUI] ToggleButton LStickLeft1;
@ -43,19 +66,20 @@ namespace Ryujinx
[GUI] ToggleButton R1; [GUI] ToggleButton R1;
[GUI] ToggleButton ZR1; [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; device = _device;
builder.Autoconnect(this); builder.Autoconnect(this);
CSWin.Icon = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.GUI.assets.ryujinxIcon.png"); SettingsWin.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); 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); LStickUp1.Toggled += (o, args) => Button_Pressed(o, args, LStickUp1);
LStickDown1.Toggled += (o, args) => Button_Pressed(o, args, LStickDown1); LStickDown1.Toggled += (o, args) => Button_Pressed(o, args, LStickDown1);
LStickLeft1.Toggled += (o, args) => Button_Pressed(o, args, LStickLeft1); LStickLeft1.Toggled += (o, args) => Button_Pressed(o, args, LStickLeft1);
@ -81,7 +105,26 @@ namespace Ryujinx
R1.Toggled += (o, args) => Button_Pressed(o, args, R1); R1.Toggled += (o, args) => Button_Pressed(o, args, R1);
ZR1.Toggled += (o, args) => Button_Pressed(o, args, ZR1); 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(); LStickUp1.Label = SwitchConfig.KeyboardControls.LeftJoycon.StickUp.ToString();
LStickDown1.Label = SwitchConfig.KeyboardControls.LeftJoycon.StickDown.ToString(); LStickDown1.Label = SwitchConfig.KeyboardControls.LeftJoycon.StickDown.ToString();
LStickLeft1.Label = SwitchConfig.KeyboardControls.LeftJoycon.StickLeft.ToString(); LStickLeft1.Label = SwitchConfig.KeyboardControls.LeftJoycon.StickLeft.ToString();
@ -106,6 +149,11 @@ namespace Ryujinx
Plus1.Label = SwitchConfig.KeyboardControls.RightJoycon.ButtonPlus.ToString(); Plus1.Label = SwitchConfig.KeyboardControls.RightJoycon.ButtonPlus.ToString();
R1.Label = SwitchConfig.KeyboardControls.RightJoycon.ButtonR.ToString(); R1.Label = SwitchConfig.KeyboardControls.RightJoycon.ButtonR.ToString();
ZR1.Label = SwitchConfig.KeyboardControls.RightJoycon.ButtonZr.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 //Events
@ -113,56 +161,81 @@ namespace Ryujinx
{ {
KeyPressEvent += On_KeyPress; KeyPressEvent += On_KeyPress;
void On_KeyPress(object obj , KeyPressEventArgs KeyPressed) void On_KeyPress(object obj, KeyPressEventArgs KeyPressed)
{ {
string key = KeyPressed.Event.Key.ToString(); 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); } 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 if (GdkToTKInput.ContainsKey(key)) { Button.Label = GdkToTKInput[key]; }
else { Button.Label = "Space"; } else { Button.Label = "Space"; }
Button.SetStateFlags(0, true); Button.SetStateFlags(0, true);
KeyPressEvent -= On_KeyPress; 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) 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() SwitchConfig.KeyboardControls.LeftJoycon = new NpadKeyboardLeft()
{ {
StickUp = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), LStickUp1.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), StickDown = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), LStickDown1.Label),
StickLeft = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), LStickLeft1.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), StickRight = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), LStickRight1.Label),
StickButton = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), LStickButton1.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), DPadUp = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), DpadUp1.Label),
DPadDown = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), DpadDown1.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), DPadLeft = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), DpadLeft1.Label),
DPadRight = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), DpadRight1.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), ButtonMinus = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), Minus1.Label),
ButtonL = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), L1.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), ButtonZl = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), ZL1.Label),
}; };
SwitchConfig.KeyboardControls.RightJoycon = new NpadKeyboardRight() SwitchConfig.KeyboardControls.RightJoycon = new NpadKeyboardRight()
{ {
StickUp = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), RStickUp1.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), StickDown = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), RStickDown1.Label),
StickLeft = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), RStickLeft1.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), StickRight = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), RStickRight1.Label),
StickButton = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), RStickButton1.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), ButtonA = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), A1.Label),
ButtonB = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), B1.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), ButtonX = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), X1.Label),
ButtonY = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), Y1.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), ButtonPlus = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), Plus1.Label),
ButtonR = (OpenTK.Input.Key)Enum.Parse(typeof(OpenTK.Input.Key), R1.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), 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")); Configuration.SaveConfig(SwitchConfig, System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Config.json"));
File.WriteAllText("./GameDirs.dat", GameDirsBox.Buffer.Text);
Configuration.Configure(device, SwitchConfig); Configuration.Configure(device, SwitchConfig);
Destroy(); Destroy();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

After

Width:  |  Height:  |  Size: 282 KiB

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View file

@ -21,10 +21,14 @@
<ItemGroup> <ItemGroup>
<EmbeddedResource Include="GUI\assets\JoyCon.png" /> <EmbeddedResource Include="GUI\assets\JoyCon.png" />
<EmbeddedResource Include="GUI\assets\ryujinxIcon.png" /> <EmbeddedResource Include="GUI\assets\ryujinxIcon.png" />
<EmbeddedResource Include="GUI\assets\ryujinxNCAIcon.png" />
<EmbeddedResource Include="GUI\assets\ryujinxNROIcon.png" />
<EmbeddedResource Include="GUI\assets\ryujinxNSOIcon.png" />
<EmbeddedResource Include="GUI\assets\ryujinxNSPIcon.png" />
<EmbeddedResource Include="GUI\assets\ryujinxROMIcon.png" /> <EmbeddedResource Include="GUI\assets\ryujinxROMIcon.png" />
<EmbeddedResource Include="GUI\ControlSettings.glade" /> <EmbeddedResource Include="GUI\assets\ryujinxXCIIcon.png" />
<EmbeddedResource Include="GUI\GeneralSettings.glade" />
<EmbeddedResource Include="GUI\MainMenu.glade" /> <EmbeddedResource Include="GUI\MainMenu.glade" />
<EmbeddedResource Include="GUI\Settings.glade" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>