diff --git a/Ryujinx/GUI/AboutWindow.cs b/Ryujinx/GUI/AboutWindow.cs new file mode 100644 index 0000000000..1a3712516c --- /dev/null +++ b/Ryujinx/GUI/AboutWindow.cs @@ -0,0 +1,84 @@ +using Gtk; +using GUI = Gtk.Builder.ObjectAttribute; +using System; +using System.Diagnostics; +using System.Reflection; +using System.Runtime.InteropServices; + +namespace Ryujinx +{ + public class AboutWindow : Window + { + [GUI] Window AboutWin; + [GUI] Image RyujinxLogo; + [GUI] Image PatreonLogo; + [GUI] Image GitHubLogo; + [GUI] Image DiscordLogo; + [GUI] Image TwitterLogo; + + public AboutWindow() : this(new Builder("Ryujinx.GUI.AboutWindow.glade")) { } + + private AboutWindow(Builder builder) : base(builder.GetObject("AboutWin").Handle) + { + builder.Autoconnect(this); + AboutWin.Icon = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.GUI.assets.ryujinxIcon.png"); + RyujinxLogo.Pixbuf = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.GUI.assets.ryujinxIcon.png", 220, 220); + PatreonLogo.Pixbuf = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.GUI.assets.PatreonLogo.png", 30 , 30 ); + GitHubLogo.Pixbuf = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.GUI.assets.GitHubLogo.png" , 30 , 30 ); + DiscordLogo.Pixbuf = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.GUI.assets.DiscordLogo.png", 30 , 30 ); + TwitterLogo.Pixbuf = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.GUI.assets.TwitterLogo.png", 30 , 30 ); + } + + public void OpenUrl(string url) + { + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + Process.Start(new ProcessStartInfo("cmd", $"/c start {url}")); + } + else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + { + Process.Start("xdg-open", url); + } + else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) + { + Process.Start("open", url); + } + } + + //Events + private void RyujinxButton_Pressed(object obj, ButtonPressEventArgs args) + { + OpenUrl("https://ryujinx.org"); + } + + private void PatreonButton_Pressed(object obj, ButtonPressEventArgs args) + { + OpenUrl("https://www.patreon.com/ryujinx"); + } + + private void GitHubButton_Pressed(object obj, ButtonPressEventArgs args) + { + OpenUrl("https://github.com/Ryujinx/Ryujinx"); + } + + private void DiscordButton_Pressed(object obj, ButtonPressEventArgs args) + { + OpenUrl("https://discordapp.com/invite/N2FmfVc"); + } + + private void TwitterButton_Pressed(object obj, ButtonPressEventArgs args) + { + OpenUrl("https://twitter.com/RyujinxEmu"); + } + + private void ContributersButton_Pressed(object obj, ButtonPressEventArgs args) + { + OpenUrl("https://github.com/Ryujinx/Ryujinx/graphs/contributors"); + } + + private void CloseToggle_Activated(object obj, EventArgs args) + { + Destroy(); + } + } +} diff --git a/Ryujinx/GUI/AboutWindow.glade b/Ryujinx/GUI/AboutWindow.glade new file mode 100644 index 0000000000..d732890fcd --- /dev/null +++ b/Ryujinx/GUI/AboutWindow.glade @@ -0,0 +1,461 @@ + + + + + + False + False + True + 800 + 400 + dialog + + + + + + False + vertical + 2 + + + False + end + + + True + False + + + + True + True + 0 + + + + + Close + True + True + True + + + + True + True + 5 + 1 + + + + + False + False + 0 + + + + + True + False + + + True + False + vertical + + + True + False + + + + True + True + 0 + + + + + True + False + vertical + + + True + False + Ryujinx + + + False + True + 5 + 0 + + + + + True + False + (REE-YOU-JI-NX) + + + False + True + 5 + 1 + + + + + True + False + Version x.x.x +Unlicenced + + + False + True + 5 + 2 + + + + + True + False + + + + True + False + https://ryujinx.org + + + + + False + True + 5 + 3 + + + + + True + True + 1 + + + + + False + True + 0 + + + + + True + False + + + True + False + + + + True + False + vertical + + + + True + True + 0 + + + + + True + False + Patreon + + + False + True + 1 + + + + + + + True + True + 0 + + + + + True + False + + + + True + False + vertical + + + + True + True + 0 + + + + + True + False + GitHub + + + False + True + 1 + + + + + + + True + True + 1 + + + + + True + False + + + + True + False + vertical + + + + True + True + 0 + + + + + True + False + Discord + + + False + True + 1 + + + + + + + True + True + 2 + + + + + True + False + + + + True + False + vertical + + + + True + True + 0 + + + + + True + False + Twitter + + + False + True + 1 + + + + + + + True + True + 3 + + + + + True + True + 1 + + + + + True + False + Ryujinx is not affiliated with Nintendo +or any of its partners in any way + + + False + True + 5 + 2 + + + + + True + True + 0 + + + + + True + False + vertical + + + True + False + start + Ryujinx is an emulator for the Nintendo Switch. +Please support us on Patreon. +Get all the latest news on Twitter. +Developers interested in contributing can find out more on our discord. + + + False + True + 5 + 0 + + + + + True + False + vertical + + + True + False + start + Created By: + + + False + True + 5 + 0 + + + + + True + False + [Devs go here] + + + False + True + 5 + 1 + + + + + False + True + 1 + + + + + True + False + + + + True + False + end + 5 + All Contributers + + + + + False + True + 2 + + + + + True + True + 1 + + + + + True + True + 10 + 1 + + + + + + diff --git a/Ryujinx/GUI/MainMenu.cs b/Ryujinx/GUI/MainMenu.cs index a3eb222e61..420a36397f 100644 --- a/Ryujinx/GUI/MainMenu.cs +++ b/Ryujinx/GUI/MainMenu.cs @@ -375,20 +375,10 @@ namespace Ryujinx private void About_Pressed(object o, EventArgs args) { - AboutDialog about = new AboutDialog - { - ProgramName = "Ryujinx", - Icon = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.GUI.assets.ryujinxIcon.png"), - Version = "Version x.x.x", - 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)" }, - Copyright = "Unlicense", - Comments = "Ryujinx is an emulator for the Nintendo Switch", - Website = "https://github.com/Ryujinx/Ryujinx", - WindowPosition = WindowPosition.Center, - }; - - about.Run(); - about.Destroy(); + var AboutWin = new AboutWindow(); + gtkapp.Register(GLib.Cancellable.Current); + gtkapp.AddWindow(AboutWin); + AboutWin.Show(); } /// diff --git a/Ryujinx/GUI/SwitchSettings.cs b/Ryujinx/GUI/SwitchSettings.cs index 2d0aa82482..d4007e0c65 100644 --- a/Ryujinx/GUI/SwitchSettings.cs +++ b/Ryujinx/GUI/SwitchSettings.cs @@ -39,10 +39,12 @@ namespace Ryujinx [GUI] ComboBoxText SystemLanguageSelect; [GUI] CheckButton CustThemeToggle; [GUI] Entry CustThemeDir; + [GUI] ToggleButton BrowseThemeDir; [GUI] Label CustThemeDirLabel; [GUI] TreeView GameDirsBox; [GUI] Entry AddGameDirBox; [GUI] ToggleButton AddDir; + [GUI] ToggleButton BrowseDir; [GUI] ToggleButton RemoveDir; [GUI] Entry LogPath; [GUI] Image ControllerImage; @@ -167,7 +169,7 @@ namespace Ryujinx GameDirsBoxStore.AppendValues(GameDir); } - if (CustThemeToggle.Active == false) { CustThemeDir.Sensitive = false; CustThemeDirLabel.Sensitive = false; } + if (CustThemeToggle.Active == false) { CustThemeDir.Sensitive = false; CustThemeDirLabel.Sensitive = false; BrowseThemeDir.Sensitive = false; } LogPath.Buffer.Text = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Ryujinx.log"); @@ -205,6 +207,20 @@ namespace Ryujinx AddDir.SetStateFlags(0, true); } + private void BrowseDir_Pressed(object obj, EventArgs args) + { + FileChooserDialog fc = new FileChooserDialog("Choose the game directory to add to the list", this, FileChooserAction.SelectFolder, "Cancel", ResponseType.Cancel, "Open", ResponseType.Accept); + + if (fc.Run() == (int)ResponseType.Accept) + { + GameDirsBoxStore.AppendValues(fc.Filename); + } + + fc.Destroy(); + + BrowseDir.SetStateFlags(0, true); + } + private void RemoveDir_Pressed(object obj, EventArgs args) { TreeSelection selection = GameDirsBox.Selection; @@ -217,7 +233,23 @@ namespace Ryujinx 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; } + if (CustThemeToggle.Active == false) { CustThemeDir.Sensitive = false; CustThemeDirLabel.Sensitive = false; BrowseThemeDir.Sensitive = false; } else { CustThemeDir.Sensitive = true; CustThemeDirLabel.Sensitive = true; BrowseThemeDir.Sensitive = true; } + } + + private void BrowseThemeDir_Pressed(object obj, EventArgs args) + { + FileChooserDialog fc = new FileChooserDialog("Choose the theme to load", this, FileChooserAction.Open, "Cancel", ResponseType.Cancel, "Open", ResponseType.Accept); + fc.Filter = new FileFilter(); + fc.Filter.AddPattern("*.css"); + + if (fc.Run() == (int)ResponseType.Accept) + { + CustThemeDir.Buffer.Text = fc.Filename; + } + + fc.Destroy(); + + BrowseThemeDir.SetStateFlags(0, true); } private void SaveToggle_Activated(object obj, EventArgs args) diff --git a/Ryujinx/GUI/SwitchSettings.glade b/Ryujinx/GUI/SwitchSettings.glade index 6a26805b9c..976f5fe09a 100644 --- a/Ryujinx/GUI/SwitchSettings.glade +++ b/Ryujinx/GUI/SwitchSettings.glade @@ -313,6 +313,7 @@ True True 5 + False @@ -457,6 +458,7 @@ True True 5 + False diff --git a/Ryujinx/GUI/assets/DiscordLogo.png b/Ryujinx/GUI/assets/DiscordLogo.png new file mode 100644 index 0000000000..85c46fd8d3 Binary files /dev/null and b/Ryujinx/GUI/assets/DiscordLogo.png differ diff --git a/Ryujinx/GUI/assets/GitHubLogo.png b/Ryujinx/GUI/assets/GitHubLogo.png new file mode 100644 index 0000000000..192846a120 Binary files /dev/null and b/Ryujinx/GUI/assets/GitHubLogo.png differ diff --git a/Ryujinx/GUI/assets/PatreonLogo.png b/Ryujinx/GUI/assets/PatreonLogo.png new file mode 100644 index 0000000000..5b35572af6 Binary files /dev/null and b/Ryujinx/GUI/assets/PatreonLogo.png differ diff --git a/Ryujinx/GUI/assets/TwitterLogo.png b/Ryujinx/GUI/assets/TwitterLogo.png new file mode 100644 index 0000000000..a2030bc6e5 Binary files /dev/null and b/Ryujinx/GUI/assets/TwitterLogo.png differ diff --git a/Ryujinx/Ryujinx.csproj b/Ryujinx/Ryujinx.csproj index 7f32601e20..eb76dcd586 100644 --- a/Ryujinx/Ryujinx.csproj +++ b/Ryujinx/Ryujinx.csproj @@ -19,7 +19,18 @@ + + + + + + + + + + + @@ -27,6 +38,7 @@ +