Display title name instead of build ID in CheatWindow UI

Update the CheatWindow UI in Avalonia and Gtk3 to display the
title name instead of the build ID.

Fix #5903
This commit is contained in:
Israel Albino Galvan 2024-03-05 22:47:48 -03:00
commit 6642ceecb7
3 changed files with 4 additions and 4 deletions

View file

@ -86,7 +86,7 @@ namespace Ryujinx.UI.Windows
string parentPath = currentCheatFile.Replace(titleModsPath, ""); string parentPath = currentCheatFile.Replace(titleModsPath, "");
buildId = System.IO.Path.GetFileNameWithoutExtension(currentCheatFile).ToUpper(); buildId = System.IO.Path.GetFileNameWithoutExtension(currentCheatFile).ToUpper();
parentIter = ((TreeStore)_cheatTreeView.Model).AppendValues(false, buildId, parentPath, ""); parentIter = ((TreeStore)_cheatTreeView.Model).AppendValues(false, titleName, parentPath, "");
} }
string cleanName = cheat.Name[1..^7]; string cleanName = cheat.Name[1..^7];

View file

@ -1,4 +1,4 @@
<window:StyleableWindow <window:StyleableWindow
x:Class="Ryujinx.Ava.UI.Windows.CheatWindow" x:Class="Ryujinx.Ava.UI.Windows.CheatWindow"
xmlns="https://github.com/avaloniaui" xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
@ -91,7 +91,7 @@
<StackPanel HorizontalAlignment="Left" Orientation="Horizontal"> <StackPanel HorizontalAlignment="Left" Orientation="Horizontal">
<CheckBox MinWidth="20" IsChecked="{Binding IsEnabled}" /> <CheckBox MinWidth="20" IsChecked="{Binding IsEnabled}" />
<TextBlock Width="150" Text="{Binding CleanName}" IsVisible="{Binding !IsRootNode}" /> <TextBlock Width="150" Text="{Binding CleanName}" IsVisible="{Binding !IsRootNode}" />
<TextBlock Width="150" Text="{Binding BuildId}" IsVisible="{Binding IsRootNode}" /> <TextBlock Width="150" Text="{Binding Name}" IsVisible="{Binding IsRootNode}" />
<TextBlock Text="{Binding Path}" IsVisible="{Binding IsRootNode}" /> <TextBlock Text="{Binding Path}" IsVisible="{Binding IsRootNode}" />
</StackPanel> </StackPanel>
</TreeDataTemplate> </TreeDataTemplate>

View file

@ -72,7 +72,7 @@ namespace Ryujinx.Ava.UI.Windows
string parentPath = currentCheatFile.Replace(titleModsPath, ""); string parentPath = currentCheatFile.Replace(titleModsPath, "");
buildId = Path.GetFileNameWithoutExtension(currentCheatFile).ToUpper(); buildId = Path.GetFileNameWithoutExtension(currentCheatFile).ToUpper();
currentGroup = new CheatNode("", buildId, parentPath, true); currentGroup = new CheatNode(titleName, buildId, parentPath, true);
LoadedCheats.Add(currentGroup); LoadedCheats.Add(currentGroup);
} }