UI: Link to the Discord in the About window, more Discord RPC games.

This commit is contained in:
Evan Husted 2024-10-12 21:44:13 -05:00
parent df9450d2ad
commit 456f1ec739
7 changed files with 25 additions and 29 deletions

View file

@ -118,7 +118,7 @@
HorizontalAlignment="Center"
Orientation="Horizontal"
Spacing="10">
<Button
<Button Name="GitHubRepoButton"
MinWidth="30"
MinHeight="30"
MaxWidth="30"
@ -127,7 +127,6 @@
Background="Transparent"
Click="Button_OnClick"
CornerRadius="15"
Tag="https://github.com/GreemDev/Ryujinx"
ToolTip.Tip="{locale:Locale AboutGithubUrlTooltipMessage}">
<Image Source="{Binding GithubLogo}" />
</Button>
@ -140,7 +139,7 @@
Background="Transparent"
Click="Button_OnClick"
CornerRadius="15"
Tag="https://discordapp.com/invite/N2FmfVc"
Tag="https://discord.gg/dHPrkBkkyA"
ToolTip.Tip="{locale:Locale AboutDiscordUrlTooltipMessage}">
<Image Source="{Binding DiscordLogo}" />
</Button>

View file

@ -7,6 +7,7 @@ using FluentAvalonia.UI.Controls;
using Ryujinx.Ava.Common.Locale;
using Ryujinx.Ava.UI.Helpers;
using Ryujinx.Ava.UI.ViewModels;
using Ryujinx.Common;
using Ryujinx.UI.Common.Helper;
using System.Threading.Tasks;
using Button = Avalonia.Controls.Button;
@ -20,6 +21,9 @@ namespace Ryujinx.Ava.UI.Windows
DataContext = new AboutWindowViewModel();
InitializeComponent();
GitHubRepoButton.Tag =
$"https://github.com/{ReleaseInformation.ReleaseChannelOwner}/{ReleaseInformation.ReleaseChannelRepo}";
}
public static async Task Show()
@ -46,9 +50,9 @@ namespace Ryujinx.Ava.UI.Windows
private void Button_OnClick(object sender, RoutedEventArgs e)
{
if (sender is Button button)
if (sender is Button { Tag: { } url })
{
OpenHelper.OpenUrl(button.Tag.ToString());
OpenHelper.OpenUrl(url.ToString());
}
}

View file

@ -43,8 +43,7 @@ namespace Ryujinx.Ava.UI.Windows
{
if (ViewModel.AmiiboSelectedIndex > -1)
{
AmiiboApi amiibo = ViewModel.AmiiboList[ViewModel.AmiiboSelectedIndex];
ScannedAmiibo = amiibo;
ScannedAmiibo = ViewModel.AmiiboList[ViewModel.AmiiboSelectedIndex];
IsScanned = true;
Close();
}

View file

@ -51,7 +51,7 @@ namespace Ryujinx.Ava.UI.Windows
_enabledCheatsPath = Path.Combine(titleModsPath, "cheats", "enabled.txt");
string[] enabled = Array.Empty<string>();
string[] enabled = [];
if (File.Exists(_enabledCheatsPath))
{
@ -101,24 +101,13 @@ namespace Ryujinx.Ava.UI.Windows
public void Save()
{
if (NoCheatsFound)
{
return;
}
List<string> enabledCheats = new();
var enabledCheats = LoadedCheats.SelectMany(it => it.SubNodes)
.Where(it => it.IsEnabled)
.Select(it => it.BuildIdKey);
foreach (var cheats in LoadedCheats)
{
foreach (var cheat in cheats.SubNodes)
{
if (cheat.IsEnabled)
{
enabledCheats.Add(cheat.BuildIdKey);
}
}
}
Directory.CreateDirectory(Path.GetDirectoryName(_enabledCheatsPath));
Directory.CreateDirectory(Path.GetDirectoryName(_enabledCheatsPath)!);
File.WriteAllLines(_enabledCheatsPath, enabledCheats);