AboutWindow.cs
1 using Gtk; 2 using Ryujinx.Common.Utilities; 3 using Ryujinx.UI.Common.Helper; 4 using System.Net.Http; 5 using System.Net.NetworkInformation; 6 using System.Reflection; 7 using System.Threading.Tasks; 8 9 namespace Ryujinx.UI.Windows 10 { 11 public partial class AboutWindow : Window 12 { 13 public AboutWindow() : base($"Ryujinx {Program.Version} - About") 14 { 15 Icon = new Gdk.Pixbuf(Assembly.GetAssembly(typeof(OpenHelper)), "Ryujinx.UI.Common.Resources.Logo_Ryujinx.png"); 16 InitializeComponent(); 17 18 _ = DownloadPatronsJson(); 19 } 20 21 private async Task DownloadPatronsJson() 22 { 23 if (!NetworkInterface.GetIsNetworkAvailable()) 24 { 25 _patreonNamesText.Buffer.Text = "Connection Error."; 26 } 27 28 HttpClient httpClient = new(); 29 30 try 31 { 32 string patreonJsonString = await httpClient.GetStringAsync("https://patreon.ryujinx.org/"); 33 34 _patreonNamesText.Buffer.Text = string.Join(", ", JsonHelper.Deserialize(patreonJsonString, CommonJsonContext.Default.StringArray)); 35 } 36 catch 37 { 38 _patreonNamesText.Buffer.Text = "API Error."; 39 } 40 } 41 42 // 43 // Events 44 // 45 private void RyujinxButton_Pressed(object sender, ButtonPressEventArgs args) 46 { 47 OpenHelper.OpenUrl("https://ryujinx.org"); 48 } 49 50 private void AmiiboApiButton_Pressed(object sender, ButtonPressEventArgs args) 51 { 52 OpenHelper.OpenUrl("https://amiiboapi.com"); 53 } 54 55 private void PatreonButton_Pressed(object sender, ButtonPressEventArgs args) 56 { 57 OpenHelper.OpenUrl("https://www.patreon.com/ryujinx"); 58 } 59 60 private void GitHubButton_Pressed(object sender, ButtonPressEventArgs args) 61 { 62 OpenHelper.OpenUrl("https://github.com/Ryujinx/Ryujinx"); 63 } 64 65 private void DiscordButton_Pressed(object sender, ButtonPressEventArgs args) 66 { 67 OpenHelper.OpenUrl("https://discordapp.com/invite/N2FmfVc"); 68 } 69 70 private void TwitterButton_Pressed(object sender, ButtonPressEventArgs args) 71 { 72 OpenHelper.OpenUrl("https://twitter.com/RyujinxEmu"); 73 } 74 75 private void ContributorsButton_Pressed(object sender, ButtonPressEventArgs args) 76 { 77 OpenHelper.OpenUrl("https://github.com/Ryujinx/Ryujinx/graphs/contributors?type=a"); 78 } 79 80 private void ChangelogButton_Pressed(object sender, ButtonPressEventArgs args) 81 { 82 OpenHelper.OpenUrl("https://github.com/Ryujinx/Ryujinx/wiki/Changelog#ryujinx-changelog"); 83 } 84 } 85 }