Updated to use Glade
Also added scrollbar and default dark theme
This commit is contained in:
parent
f364337e58
commit
d50204c108
7 changed files with 5706 additions and 130 deletions
|
@ -23,13 +23,13 @@ namespace Ryujinx
|
|||
HBox ButtonBox = new HBox(true, 3);
|
||||
Alignment BoxAlign = new Alignment(1, 0, 0, 0);
|
||||
|
||||
Button ok = new Button("OK");
|
||||
ok.Pressed += (o, args) => OK_Pressed(o, args, CSWin);
|
||||
ButtonBox.Add(ok);
|
||||
Button Save = new Button("Save");
|
||||
Save.Pressed += (o, args) => Save_Pressed(o, args, CSWin);
|
||||
ButtonBox.Add(Save);
|
||||
|
||||
Button close = new Button("Close");
|
||||
close.Pressed += (o, args) => Close_Pressed(o, args, CSWin);
|
||||
ButtonBox.Add(close);
|
||||
Button Cancel = new Button("Cancel");
|
||||
Cancel.Pressed += (o, args) => Cancel_Pressed(o, args, CSWin);
|
||||
ButtonBox.Add(Cancel);
|
||||
|
||||
BoxAlign.SetPadding(0, 5, 0, 7);
|
||||
BoxAlign.Add(ButtonBox);
|
||||
|
@ -39,13 +39,13 @@ namespace Ryujinx
|
|||
CSWin.ShowAll();
|
||||
}
|
||||
|
||||
static void OK_Pressed(object o, EventArgs args, Window window)
|
||||
static void Save_Pressed(object o, EventArgs args, Window window)
|
||||
{
|
||||
//save settings stuff will go here
|
||||
window.Destroy();
|
||||
}
|
||||
|
||||
static void Close_Pressed(object o, EventArgs args, Window window)
|
||||
static void Cancel_Pressed(object o, EventArgs args, Window window)
|
||||
{
|
||||
window.Destroy();
|
||||
}
|
||||
|
|
|
@ -23,13 +23,13 @@ namespace Ryujinx
|
|||
HBox ButtonBox = new HBox(true, 3);
|
||||
Alignment BoxAlign = new Alignment(1, 0, 0, 0);
|
||||
|
||||
Button ok = new Button("OK");
|
||||
ok.Pressed += (o, args) => OK_Pressed(o, args, GSWin);
|
||||
ButtonBox.Add(ok);
|
||||
Button Save = new Button("Save");
|
||||
Save.Pressed += (o, args) => Save_Pressed(o, args, GSWin);
|
||||
ButtonBox.Add(Save);
|
||||
|
||||
Button close = new Button("Close");
|
||||
close.Pressed += (o, args) => Close_Pressed(o, args, GSWin);
|
||||
ButtonBox.Add(close);
|
||||
Button Cancel = new Button("Cancel");
|
||||
Cancel.Pressed += (o, args) => Cancel_Pressed(o, args, GSWin);
|
||||
ButtonBox.Add(Cancel);
|
||||
|
||||
BoxAlign.SetPadding(0, 5, 0, 7);
|
||||
BoxAlign.Add(ButtonBox);
|
||||
|
@ -39,13 +39,13 @@ namespace Ryujinx
|
|||
GSWin.ShowAll();
|
||||
}
|
||||
|
||||
static void OK_Pressed(object o, EventArgs args, Window window)
|
||||
static void Save_Pressed(object o, EventArgs args, Window window)
|
||||
{
|
||||
//save settings stuff will go here
|
||||
window.Destroy();
|
||||
}
|
||||
|
||||
static void Close_Pressed(object o, EventArgs args, Window window)
|
||||
static void Cancel_Pressed(object o, EventArgs args, Window window)
|
||||
{
|
||||
window.Destroy();
|
||||
}
|
||||
|
|
|
@ -1,21 +1,34 @@
|
|||
using Gtk;
|
||||
using GUI = Gtk.Builder.ObjectAttribute;
|
||||
using Ryujinx.Common.Logging;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace Ryujinx
|
||||
{
|
||||
public class MainMenU
|
||||
public class MainMenu : Window
|
||||
{
|
||||
public static void MainMenu(HLE.Switch device)
|
||||
{
|
||||
Application.Init();
|
||||
internal HLE.Switch device { get; private set; }
|
||||
|
||||
Window MainWin = new Window(WindowType.Toplevel);
|
||||
MainWin.Title = "Ryujinx";
|
||||
MainWin.Icon = new Gdk.Pixbuf("./ryujinx.png");
|
||||
MainWin.SetDefaultSize(1280, 745);
|
||||
MainWin.WindowPosition = WindowPosition.Center;
|
||||
internal ListStore TableStore { get; private set; }
|
||||
|
||||
//UI Controls
|
||||
[GUI] MenuBar MenuBar;
|
||||
[GUI] MenuItem LoadApplicationFile;
|
||||
[GUI] MenuItem LoadApplicationFolder;
|
||||
[GUI] MenuItem Exit;
|
||||
[GUI] MenuItem GeneralSettingsMenu;
|
||||
[GUI] MenuItem ControlSettingsMenu;
|
||||
[GUI] MenuItem NFC;
|
||||
[GUI] MenuItem Debugger;
|
||||
[GUI] MenuItem About;
|
||||
[GUI] TreeView GameTable;
|
||||
|
||||
public MainMenu(HLE.Switch _device) : this(new Builder("Ryujinx.MainMenu.glade"), _device) { }
|
||||
|
||||
private MainMenu(Builder builder, HLE.Switch _device) : base(builder.GetObject("MainWin").Handle)
|
||||
{
|
||||
device = _device;
|
||||
|
||||
if (device.System.State.DiscordIntergrationEnabled == true)
|
||||
{
|
||||
|
@ -26,78 +39,25 @@ namespace Ryujinx
|
|||
Program.DiscordClient.SetPresence(Program.DiscordPresence);
|
||||
}
|
||||
|
||||
VBox box = new VBox();
|
||||
MenuBar MenuBar = new MenuBar();
|
||||
TreeView GameTable = new TreeView();
|
||||
builder.Autoconnect(this);
|
||||
ApplyTheme();
|
||||
|
||||
//Menu Bar
|
||||
MenuItem FileMenu = new MenuItem("File");
|
||||
MenuBar.Append(FileMenu);
|
||||
Menu FileSubmenu = new Menu();
|
||||
FileMenu.Submenu = FileSubmenu;
|
||||
DeleteEvent += Window_Close;
|
||||
|
||||
MenuItem LoadApplicationFile = new MenuItem("Load Application from File");
|
||||
FileSubmenu.Append(LoadApplicationFile);
|
||||
LoadApplicationFile.Activated += (o, args) => Load_Application_File(o, args, MainWin, device);
|
||||
|
||||
MenuItem LoadApplicationFolder = new MenuItem("Load Application from Folder");
|
||||
FileSubmenu.Append(LoadApplicationFolder);
|
||||
LoadApplicationFolder.Activated += (o, args) => Load_Application_Folder(o, args, MainWin, device);
|
||||
|
||||
FileSubmenu.Append(new SeparatorMenuItem());
|
||||
|
||||
MenuItem Exit = new MenuItem("Exit");
|
||||
FileSubmenu.Append(Exit);
|
||||
Exit.Activated += (o, args) => Exit_Pressed(o, args, MainWin);
|
||||
|
||||
MenuItem OptionsMenu = new MenuItem("Options");
|
||||
MenuBar.Append(OptionsMenu);
|
||||
Menu OptionsSubmenu = new Menu();
|
||||
OptionsMenu.Submenu = OptionsSubmenu;
|
||||
|
||||
FileSubmenu.Append(new SeparatorMenuItem());
|
||||
|
||||
MenuItem GeneralSettingsMenu = new MenuItem("General Settings");
|
||||
OptionsSubmenu.Append(GeneralSettingsMenu);
|
||||
GeneralSettingsMenu.Activated += new EventHandler(General_Settings_Pressed);
|
||||
|
||||
MenuItem ControlSettingsMenu = new MenuItem("Control Settings");
|
||||
OptionsSubmenu.Append(ControlSettingsMenu);
|
||||
ControlSettingsMenu.Activated += new EventHandler(Control_Settings_Pressed);
|
||||
|
||||
MenuItem ToolsMenu = new MenuItem("Tools");
|
||||
MenuBar.Append(ToolsMenu);
|
||||
Menu ToolsSubmenu = new Menu();
|
||||
ToolsMenu.Submenu = ToolsSubmenu;
|
||||
|
||||
MenuItem NFC = new MenuItem("Scan NFC Tag from File");
|
||||
ToolsSubmenu.Append(NFC);
|
||||
NFC.Sensitive = false;
|
||||
NFC.Activated += (o, args) => NFC_Pressed(o, args, MainWin);
|
||||
|
||||
MenuItem HelpMenu = new MenuItem("Help");
|
||||
MenuBar.Append(HelpMenu);
|
||||
Menu HelpSubmenu = new Menu();
|
||||
HelpMenu.Submenu = HelpSubmenu;
|
||||
|
||||
MenuItem About = new MenuItem("About");
|
||||
HelpSubmenu.Append(About);
|
||||
About.Activated += new EventHandler(About_Pressed);
|
||||
|
||||
box.PackStart(MenuBar, false, false, 0);
|
||||
//disable some buttons
|
||||
NFC.Sensitive = false;
|
||||
Debugger.Sensitive = false;
|
||||
|
||||
//Games grid thing
|
||||
ListStore TableStore = new ListStore(typeof(Gdk.Pixbuf), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string));
|
||||
GameTable.RowActivated += (o, args) => Row_Activated(o, args, TableStore, MainWin, device);
|
||||
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("Icon", new CellRendererPixbuf(), "pixbuf", 0);
|
||||
GameTable.AppendColumn("Game", new CellRendererText(), "text", 1);
|
||||
GameTable.AppendColumn("Version", new CellRendererText(), "text", 2);
|
||||
GameTable.AppendColumn("Time Played", new CellRendererText(), "text", 3);
|
||||
GameTable.AppendColumn("Last Played", new CellRendererText(), "text", 4);
|
||||
GameTable.AppendColumn("Path", new CellRendererText(), "text", 5);
|
||||
|
||||
string dat = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "GameDirs.dat");
|
||||
string dat = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "GameDirs.dat");
|
||||
if (File.Exists(dat) == false) { File.Create(dat).Close(); }
|
||||
string[] GameDirs = File.ReadAllLines(dat);
|
||||
string[] Games = new string[] { };
|
||||
|
@ -108,34 +68,41 @@ namespace Ryujinx
|
|||
DirectoryInfo GameDirInfo = new DirectoryInfo(GameDir);
|
||||
foreach (var Game in GameDirInfo.GetFiles())
|
||||
{
|
||||
if ((Path.GetExtension(Game.ToString()) == ".xci") || (Path.GetExtension(Game.ToString()) == ".nca") || (Path.GetExtension(Game.ToString()) == ".nsp") || (Path.GetExtension(Game.ToString()) == ".pfs0") || (Path.GetExtension(Game.ToString()) == ".nro") || (Path.GetExtension(Game.ToString()) == ".nso"))
|
||||
if ((System.IO.Path.GetExtension(Game.ToString()) == ".xci") || (System.IO.Path.GetExtension(Game.ToString()) == ".nca") || (System.IO.Path.GetExtension(Game.ToString()) == ".nsp") || (System.IO.Path.GetExtension(Game.ToString()) == ".pfs0") || (System.IO.Path.GetExtension(Game.ToString()) == ".nro") || (System.IO.Path.GetExtension(Game.ToString()) == ".nso"))
|
||||
{
|
||||
Array.Resize(ref Games, Games.Length + 1);
|
||||
Games[Games.Length - 1] = Game.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TableStore = new ListStore(typeof(Gdk.Pixbuf), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string));
|
||||
foreach (string GamePath in Games)
|
||||
{
|
||||
TableStore.AppendValues(new Gdk.Pixbuf("./ryujinx.png", 50, 50), "", "", "", "", GamePath);
|
||||
TableStore.AppendValues(new Gdk.Pixbuf("./ryujinx.png", 50, 50), "", "", "", "", "", GamePath);
|
||||
}
|
||||
|
||||
GameTable.Model = TableStore;
|
||||
box.PackStart(GameTable, true, true, 0);
|
||||
|
||||
MainWin.DeleteEvent += (obj, args) => Window_Close(obj, args, MainWin);
|
||||
MainWin.Add(box);
|
||||
MainWin.ShowAll();
|
||||
|
||||
Application.Run();
|
||||
}
|
||||
|
||||
static void Row_Activated(object obj, RowActivatedArgs args, ListStore TableStore, Window window, HLE.Switch device)
|
||||
public static void ApplyTheme()
|
||||
{
|
||||
var settings = Settings.Default;
|
||||
settings.XftRgba = "rgb";
|
||||
settings.XftHinting = 1;
|
||||
settings.XftHintstyle = "hintfull";
|
||||
|
||||
CssProvider css_provider = new CssProvider();
|
||||
css_provider.LoadFromPath("Theme.css");
|
||||
StyleContext.AddProviderForScreen(Gdk.Screen.Default, css_provider, 800);
|
||||
}
|
||||
|
||||
private void Row_Activated(object obj, RowActivatedArgs args)
|
||||
{
|
||||
TableStore.GetIter(out TreeIter treeiter, new TreePath(args.Path.ToString()));
|
||||
string path = (string)TableStore.GetValue(treeiter, 5);
|
||||
|
||||
switch (Path.GetExtension(path).ToLowerInvariant())
|
||||
string path = (string)TableStore.GetValue(treeiter, 6);
|
||||
|
||||
switch (System.IO.Path.GetExtension(path).ToLowerInvariant())
|
||||
{
|
||||
case ".xci":
|
||||
Logger.PrintInfo(LogClass.Application, "Loading as XCI.");
|
||||
|
@ -155,13 +122,13 @@ namespace Ryujinx
|
|||
device.LoadProgram(path);
|
||||
break;
|
||||
}
|
||||
window.Destroy();
|
||||
Destroy();
|
||||
Application.Quit();
|
||||
}
|
||||
|
||||
static void Load_Application_File(object o, EventArgs args, Window window, HLE.Switch device)
|
||||
private void Load_Application_File(object o, EventArgs args)
|
||||
{
|
||||
FileChooserDialog fc = new FileChooserDialog("Choose the file to open", window, FileChooserAction.Open, "Cancel", ResponseType.Cancel, "Open", ResponseType.Accept);
|
||||
FileChooserDialog fc = new FileChooserDialog("Choose the file to open", this, FileChooserAction.Open, "Cancel", ResponseType.Cancel, "Open", ResponseType.Accept);
|
||||
fc.Filter = new FileFilter();
|
||||
fc.Filter.AddPattern("*.nsp");
|
||||
fc.Filter.AddPattern("*.xci");
|
||||
|
@ -171,7 +138,7 @@ namespace Ryujinx
|
|||
|
||||
if (fc.Run() == (int)ResponseType.Accept)
|
||||
{
|
||||
switch (Path.GetExtension(fc.Filename).ToLowerInvariant())
|
||||
switch (System.IO.Path.GetExtension(fc.Filename).ToLowerInvariant())
|
||||
{
|
||||
case ".xci":
|
||||
Logger.PrintInfo(LogClass.Application, "Loading as XCI.");
|
||||
|
@ -191,15 +158,15 @@ namespace Ryujinx
|
|||
device.LoadProgram(fc.Filename);
|
||||
break;
|
||||
}
|
||||
window.Destroy();
|
||||
Destroy();
|
||||
Application.Quit();
|
||||
}
|
||||
fc.Destroy();
|
||||
}
|
||||
|
||||
static void Load_Application_Folder(object o, EventArgs args, Window window, HLE.Switch device)
|
||||
private void Load_Application_Folder(object o, EventArgs args)
|
||||
{
|
||||
FileChooserDialog fc = new FileChooserDialog("Choose the folder to open", window, FileChooserAction.SelectFolder, "Cancel", ResponseType.Cancel, "Open", ResponseType.Accept);
|
||||
FileChooserDialog fc = new FileChooserDialog("Choose the folder to open", this, FileChooserAction.SelectFolder, "Cancel", ResponseType.Cancel, "Open", ResponseType.Accept);
|
||||
|
||||
if (fc.Run() == (int)ResponseType.Accept)
|
||||
{
|
||||
|
@ -220,38 +187,38 @@ namespace Ryujinx
|
|||
Logger.PrintInfo(LogClass.Application, "Loading as cart WITHOUT RomFS.");
|
||||
device.LoadCart(fc.Filename);
|
||||
}
|
||||
window.Destroy();
|
||||
Destroy();
|
||||
Application.Quit();
|
||||
}
|
||||
fc.Destroy();
|
||||
}
|
||||
|
||||
static void Exit_Pressed(object o, EventArgs args, Window window)
|
||||
private void Exit_Pressed(object o, EventArgs args)
|
||||
{
|
||||
window.Destroy();
|
||||
Destroy();
|
||||
Application.Quit();
|
||||
}
|
||||
|
||||
static void Window_Close(object obj, DeleteEventArgs args, Window window)
|
||||
private void Window_Close(object obj, DeleteEventArgs args)
|
||||
{
|
||||
window.Destroy();
|
||||
Destroy();
|
||||
Application.Quit();
|
||||
args.RetVal = true;
|
||||
}
|
||||
|
||||
static void General_Settings_Pressed(object o, EventArgs args)
|
||||
private void General_Settings_Pressed(object o, EventArgs args)
|
||||
{
|
||||
GeneralSettings.GeneralSettingsMenu();
|
||||
}
|
||||
|
||||
static void Control_Settings_Pressed(object o, EventArgs args)
|
||||
private void Control_Settings_Pressed(object o, EventArgs args)
|
||||
{
|
||||
ControlSettings.ControlSettingsMenu();
|
||||
}
|
||||
|
||||
static void NFC_Pressed(object o, EventArgs args, Window window)
|
||||
private void NFC_Pressed(object o, EventArgs args)
|
||||
{
|
||||
FileChooserDialog fc = new FileChooserDialog("Choose the file to open", window, FileChooserAction.Open, "Cancel", ResponseType.Cancel, "Open", ResponseType.Accept);
|
||||
FileChooserDialog fc = new FileChooserDialog("Choose the file to open", this, FileChooserAction.Open, "Cancel", ResponseType.Cancel, "Open", ResponseType.Accept);
|
||||
fc.Filter = new FileFilter();
|
||||
fc.Filter.AddPattern("*.bin");
|
||||
|
||||
|
@ -262,10 +229,16 @@ namespace Ryujinx
|
|||
fc.Destroy();
|
||||
}
|
||||
|
||||
static void About_Pressed(object o, EventArgs args)
|
||||
private void Debugger_Pressed(object o, EventArgs args)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
private void About_Pressed(object o, EventArgs args)
|
||||
{
|
||||
AboutDialog about = new AboutDialog();
|
||||
about.ProgramName = "Ryujinx";
|
||||
about.Icon = new Gdk.Pixbuf("ryujinx.png");
|
||||
about.Version = "Version x.x.x";
|
||||
about.Authors = new string[] { "gdkchan", "Ac_K", "LDj3SNuD", "emmauss", "MerryMage", "MS-DOS1999", "Thog", "jD", "BaronKiko", "Dr.Hacknik", "Lordmau5", "(and Xpl0itR did a bit of work too :D)" };
|
||||
about.Copyright = "Unlicense";
|
||||
|
|
191
Ryujinx/MainMenu.glade
Normal file
191
Ryujinx/MainMenu.glade
Normal file
|
@ -0,0 +1,191 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.22.1 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.20"/>
|
||||
<object class="GtkWindow" id="MainWin">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="title" translatable="yes">Ryujinx</property>
|
||||
<property name="window_position">center</property>
|
||||
<property name="default_width">1280</property>
|
||||
<property name="default_height">745</property>
|
||||
<property name="icon">ryujinx.png</property>
|
||||
<property name="gravity">center</property>
|
||||
<child type="titlebar">
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="box">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkMenuBar" id="MenuBar">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="FileMenu">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">File</property>
|
||||
<property name="use_underline">True</property>
|
||||
<child type="submenu">
|
||||
<object class="GtkMenu">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="LoadApplicationFile">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Load Application from File</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="activate" handler="Load_Application_File" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="LoadApplicationFolder">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Load Application from Folder</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="activate" handler="Load_Application_Folder" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparatorMenuItem" id="sep">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="Exit">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Exit</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="activate" handler="Exit_Pressed" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="OptionsMenu">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Options</property>
|
||||
<property name="use_underline">True</property>
|
||||
<child type="submenu">
|
||||
<object class="GtkMenu">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="GeneralSettingsMenu">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">General Settings</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="activate" handler="General_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>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="ToolsMenu">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Tools</property>
|
||||
<property name="use_underline">True</property>
|
||||
<child type="submenu">
|
||||
<object class="GtkMenu">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="NFC">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Scan NFC Tag from File</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="activate" handler="NFC_Pressed" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="Debugger">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Debugger</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="activate" handler="Debugger_Pressed" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="HelpMenu">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Help</property>
|
||||
<property name="use_underline">True</property>
|
||||
<child type="submenu">
|
||||
<object class="GtkMenu">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="About">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">About</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="activate" handler="About_Pressed" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</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="GtkTreeView" id="GameTable">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<signal name="row-activated" handler="Row_Activated" swapped="no"/>
|
||||
<child internal-child="selection">
|
||||
<object class="GtkTreeSelection"/>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
|
@ -8,6 +8,7 @@ using Ryujinx.Profiler;
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Ryujinx
|
||||
{
|
||||
|
@ -35,16 +36,16 @@ namespace Ryujinx
|
|||
Profile.Initialize();
|
||||
|
||||
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
|
||||
AppDomain.CurrentDomain.ProcessExit += CurrentDomain_ProcessExit;
|
||||
AppDomain.CurrentDomain.ProcessExit += CurrentDomain_ProcessExit;
|
||||
|
||||
if (device.System.State.DiscordIntegrationEnabled == true)
|
||||
{
|
||||
DiscordClient = new DiscordRpcClient("568815339807309834");
|
||||
DiscordClient = new DiscordRpcClient("568815339807309834");
|
||||
DiscordPresence = new RichPresence
|
||||
{
|
||||
Assets = new Assets
|
||||
{
|
||||
LargeImageKey = "ryujinx",
|
||||
LargeImageKey = "ryujinx",
|
||||
LargeImageText = "Ryujinx is an emulator for the Nintendo Switch"
|
||||
}
|
||||
};
|
||||
|
@ -55,7 +56,18 @@ namespace Ryujinx
|
|||
|
||||
if (args.Length == 0)
|
||||
{
|
||||
MainMenU.MainMenu(device);
|
||||
Gtk.Application.Init();
|
||||
|
||||
var resourceNames = Assembly.GetExecutingAssembly().GetManifestResourceNames();
|
||||
var app = new Gtk.Application("Ryujinx.Ryujinx", GLib.ApplicationFlags.None);
|
||||
app.Register(GLib.Cancellable.Current);
|
||||
|
||||
var win = new MainMenu(device);
|
||||
app.AddWindow(win);
|
||||
|
||||
win.Show();
|
||||
|
||||
Gtk.Application.Run();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -115,12 +127,12 @@ namespace Ryujinx
|
|||
DiscordPresence.Assets.LargeImageKey = device.System.TitleID;
|
||||
}
|
||||
|
||||
DiscordPresence.Details = $"Playing {device.System.TitleName}";
|
||||
DiscordPresence.State = string.IsNullOrWhiteSpace(device.System.TitleID) ? string.Empty : device.System.TitleID.ToUpper();
|
||||
DiscordPresence.Details = $"Playing {device.System.TitleName}";
|
||||
DiscordPresence.State = string.IsNullOrWhiteSpace(device.System.TitleID) ? string.Empty : device.System.TitleID.ToUpper();
|
||||
DiscordPresence.Assets.LargeImageText = device.System.TitleName;
|
||||
DiscordPresence.Assets.SmallImageKey = "ryujinx";
|
||||
DiscordPresence.Assets.SmallImageKey = "ryujinx";
|
||||
DiscordPresence.Assets.SmallImageText = "Ryujinx is an emulator for the Nintendo Switch";
|
||||
DiscordPresence.Timestamps = new Timestamps(DateTime.UtcNow);
|
||||
DiscordPresence.Timestamps = new Timestamps(DateTime.UtcNow);
|
||||
|
||||
DiscordClient.SetPresence(DiscordPresence);
|
||||
}
|
||||
|
|
|
@ -18,6 +18,10 @@
|
|||
<Optimize>false</Optimize>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="MainMenu.glade" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="DiscordRichPresence" Version="1.0.108" />
|
||||
<PackageReference Include="GtkSharp" Version="3.22.24.37" />
|
||||
|
@ -43,6 +47,9 @@
|
|||
<None Update="ryujinx.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Theme.css">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
5393
Ryujinx/Theme.css
Normal file
5393
Ryujinx/Theme.css
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue