general cleanup for some warnings in the project and some developer annoyances.

Reviewed-on: https://git.ryujinx.app/projects/Ryubing/pulls/161
This commit is contained in:
LotP
2026-07-04 15:30:55 +00:00
committed by LotP
parent 97aed15d19
commit b236732713
20 changed files with 130 additions and 126 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
{
{
"Locales": [
{
"ID": "SettingsTabInputDirectMouseAccess",
+1 -1
View File
@@ -6,7 +6,7 @@ namespace ARMeilleure.Common
public readonly struct AddressTableLevel
{
/// <summary>
/// Gets the index of the <see cref="Level"/> in the guest address.
/// Gets the index of the <see cref="Index"/> in the guest address.
/// </summary>
public int Index { get; }
@@ -128,7 +128,7 @@ namespace Ryujinx.BuildValidationTasks
using (StreamWriter sw = new(path))
{
sw.Write(jsonString);
sw.Write($"{jsonString}\n");
}
}
@@ -11,7 +11,11 @@ namespace Ryujinx.HLE.HOS.Services.Notification
private readonly KEvent _getNotificationSendingNotifierEvent;
private int _getNotificationSendingNotifierEventHandle;
public INotificationSystemEventAccessor(ServiceCtx context) { }
public INotificationSystemEventAccessor(ServiceCtx context)
{
_getNotificationSendingNotifierEvent = new KEvent(context.Device.System.KernelContext);
}
[CommandCmif(0)] // 9.0.0+
// GetNotificationSendingNotifier() -> nn::notification::server::INotificationSystemEventAccessor
+1 -1
View File
@@ -41,7 +41,7 @@ namespace Ryujinx.Input.SDL3
}
int serialNumber = 0;
string? serial = SDL_GetGamepadSerial(gamepadHandle);
string serial = SDL_GetGamepadSerial(gamepadHandle);
if (serial is not null)
{
int.TryParse(serial, out serialNumber);
+6 -5
View File
@@ -767,8 +767,9 @@ namespace Ryujinx.Input.HLE
{
foreach (AssignedInputDevice assignedController in assignedControllers)
{
foreach (string gamepadId in gamepadDriver.GamepadsIds)
for (int index = 0; index < gamepadDriver.GamepadsIds.Length; index++)
{
string gamepadId = gamepadDriver.GamepadsIds[index];
if (string.Equals(gamepadId, assignedController.Id, StringComparison.Ordinal))
{
yield return assignedController;
@@ -782,14 +783,14 @@ namespace Ryujinx.Input.HLE
if (config is StandardControllerInputConfig)
{
foreach (string gamepadId in gamepadDriver.GamepadsIds)
for (int index = 0; index < gamepadDriver.GamepadsIds.Length; index++)
{
string gamepadId = gamepadDriver.GamepadsIds[index];
if (string.Equals(gamepadId, config.Id, StringComparison.Ordinal))
{
yield return new AssignedInputDevice
{
Type = AssignedInputDeviceType.Controller,
Id = gamepadId,
Type = AssignedInputDeviceType.Controller, Id = gamepadId,
};
yield break;
}
@@ -1092,7 +1093,7 @@ namespace Ryujinx.Input.HLE
: _assignedControllerConfigs.FirstOrDefault(),
_controllerDriver
),
_ => ((IGamepad?)null, (InputConfig?)null, (IGamepadDriver?)null)
_ => ((IGamepad)null, (InputConfig)null, (IGamepadDriver)null)
};
_controllerGamepad = _gamepad;
+2 -2
View File
@@ -26,9 +26,9 @@ namespace Ryujinx.Ava.Common
internal class TrimmerWindow : Ryujinx.Common.Logging.XCIFileTrimmerLog
{
private readonly XCITrimmerViewModel _viewModel;
private readonly XciTrimmerViewModel _viewModel;
public TrimmerWindow(XCITrimmerViewModel viewModel)
public TrimmerWindow(XciTrimmerViewModel viewModel)
{
_viewModel = viewModel;
}
@@ -1105,7 +1105,7 @@ namespace Ryujinx.Ava.Systems.PlayReport
return $"At the main menu";
static string LocFinal(string? location) => location switch
static string LocFinal(string location) => location switch
{
"0" => "Somewhere in Miitopia",
"1" => "Wandering around Greenhorne",
@@ -1152,7 +1152,9 @@ namespace Ryujinx.Ava.Systems.PlayReport
return "At the main menu";
}
static string MarioOrLuigiGamemode(string? gamemode) => gamemode switch
return "";
static string MarioOrLuigiGamemode(string gamemode) => gamemode switch
{
"0" => "mario",
"1" => "luigi",
@@ -1161,14 +1163,14 @@ namespace Ryujinx.Ava.Systems.PlayReport
_ => gamemode
};
static string OtherGameMode(string? gamemode) => gamemode switch
{
"2" => "Boost Rush",
"3" => "Challenges",
"4" => "Coin Battle",
"5" => "Coin Battle Editor",
_ => ""
};
// static string OtherGameMode(string gamemode) => gamemode switch
// {
// "2" => "Boost Rush",
// "3" => "Challenges",
// "4" => "Coin Battle",
// "5" => "Coin Battle Editor",
// _ => ""
// };
static string SpecialMapNames(int? course) => course switch
{
@@ -1196,9 +1198,6 @@ namespace Ryujinx.Ava.Systems.PlayReport
// Glacier seals = 16, water leaf = 15
// desert ice = 14, acorn squid = 13
// all other course numbers are to be considered a hazard
return "";
}
}
}
@@ -108,7 +108,7 @@ namespace Ryujinx.Ava.UI.Helpers
try
{
string labelsJson = File.ReadAllText(labelsPath);
Dictionary<string, string>? labels = JsonSerializer.Deserialize<Dictionary<string, string>>(labelsJson, _serializerOptions);
Dictionary<string, string> labels = JsonSerializer.Deserialize<Dictionary<string, string>>(labelsJson, _serializerOptions);
if (labels != null)
{
@@ -1767,7 +1767,7 @@ namespace Ryujinx.Ava.UI.ViewModels
}
}
private async Task<IReadOnlyList<string>?> PickFolders(LocaleKeys titleKey)
private async Task<IReadOnlyList<string>> PickFolders(LocaleKeys titleKey)
{
return (await StorageProvider.OpenMultiFolderPickerAsync(new FolderPickerOpenOptions
{
@@ -2161,7 +2161,7 @@ namespace Ryujinx.Ava.UI.ViewModels
Window.Position.X + (int)(Window.Bounds.Width / 2),
Window.Position.Y + (int)(Window.Bounds.Height / 2));
Avalonia.Platform.Screen? screen =
Avalonia.Platform.Screen screen =
Window.Screens.ScreenFromVisual(Window) ??
Window.Screens.ScreenFromPoint(windowCenter) ??
Window.Screens.Primary;
@@ -16,7 +16,7 @@ using static Ryujinx.Common.Utilities.XCIFileTrimmer;
namespace Ryujinx.Ava.UI.ViewModels
{
public class XCITrimmerViewModel : BaseModel
public class XciTrimmerViewModel : BaseModel
{
private const long BytesPerMb = 1024 * 1024;
@@ -49,7 +49,7 @@ namespace Ryujinx.Ava.UI.ViewModels
private int _processingTotal;
public XCITrimmerViewModel(MainWindowViewModel mainWindowViewModel)
public XciTrimmerViewModel(MainWindowViewModel mainWindowViewModel)
{
_logger = new XCITrimmerLog.TrimmerWindow(this);
_mainWindowViewModel = mainWindowViewModel;
@@ -299,9 +299,9 @@ namespace Ryujinx.Ava.UI.ViewModels
private class CompareXCITrimmerFiles : IComparer<XCITrimmerFileModel>
{
private readonly XCITrimmerViewModel _viewModel;
private readonly XciTrimmerViewModel _viewModel;
public CompareXCITrimmerFiles(XCITrimmerViewModel ViewModel)
public CompareXCITrimmerFiles(XciTrimmerViewModel ViewModel)
{
_viewModel = ViewModel;
}
@@ -1,5 +1,5 @@
<UserControl
x:Class="Ryujinx.Ava.UI.Views.Dialog.XCITrimmerView"
x:Class="Ryujinx.Ava.UI.Views.Dialog.XciTrimmerView"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
@@ -11,7 +11,7 @@
xmlns:models="clr-namespace:Ryujinx.Ava.Common.Models"
Width="700"
Height="600"
x:DataType="viewModels:XCITrimmerViewModel"
x:DataType="viewModels:XciTrimmerViewModel"
Focusable="True"
mc:Ignorable="d">
<Grid Margin="25,10,25,0" RowDefinitions="Auto,Auto,*,Auto,Auto">
@@ -121,7 +121,7 @@
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
CornerRadius="5"
IsVisible="{Binding $parent[UserControl].DataContext.Processing}"
IsVisible="{Binding !$parent[UserControl].((viewModels:XciTrimmerViewModel)DataContext).Processing}"
Maximum="100"
Minimum="0"
Value="{Binding PercentageProgress}" />
@@ -131,7 +131,7 @@
HorizontalAlignment="Right"
VerticalAlignment="Center"
MaxLines="1"
IsVisible="{Binding !$parent[UserControl].DataContext.Processing}"
IsVisible="{Binding !$parent[UserControl].((viewModels:XciTrimmerViewModel)DataContext).Processing}"
Text="{Binding ., Converter={x:Static helpers:XCITrimmerFileSpaceSavingsConverter.Instance}}" />
</Grid>
</Grid>
@@ -11,16 +11,16 @@ using System.Threading.Tasks;
namespace Ryujinx.Ava.UI.Views.Dialog
{
public partial class XCITrimmerView : RyujinxControl<XCITrimmerViewModel>
public partial class XciTrimmerView : RyujinxControl<XciTrimmerViewModel>
{
public XCITrimmerView()
public XciTrimmerView()
{
InitializeComponent();
}
private void ToggleSelect(object sender, RoutedEventArgs e)
{
if (DataContext is XCITrimmerViewModel vm)
if (DataContext is XciTrimmerViewModel vm)
vm.ToggleSelect();
}
@@ -31,9 +31,9 @@ namespace Ryujinx.Ava.UI.Views.Dialog
PrimaryButtonText = string.Empty,
SecondaryButtonText = string.Empty,
CloseButtonText = string.Empty,
Content = new XCITrimmerView
Content = new XciTrimmerView
{
ViewModel = new XCITrimmerViewModel(RyujinxApp.MainWindow.ViewModel)
ViewModel = new XciTrimmerViewModel(RyujinxApp.MainWindow.ViewModel)
},
Title = LocaleManager.Instance[LocaleKeys.MenuBar_Actions_XCITrimmerButton]
};
@@ -58,7 +58,7 @@ namespace Ryujinx.Ava.UI.Views.Dialog
private void Close(object sender, RoutedEventArgs e)
{
((ContentDialog)Parent).Hide();
((ContentDialog)Parent!).Hide();
}
private void Cancel(Object sender, RoutedEventArgs e)
@@ -69,7 +69,7 @@ namespace Ryujinx.Ava.UI.Views.Dialog
public void Sort_Checked(object sender, RoutedEventArgs args)
{
if (sender is RadioButton { Tag: string sortField })
ViewModel.SortingField = Enum.Parse<XCITrimmerViewModel.SortField>(sortField);
ViewModel.SortingField = Enum.Parse<XciTrimmerViewModel.SortField>(sortField);
}
public void Order_Checked(object sender, RoutedEventArgs args)
@@ -43,7 +43,7 @@ namespace Ryujinx.Ava.UI.Views.Main
ResumeEmulationMenuItem.Command = Commands.Create(() => ViewModel.AppHost?.Resume());
StopEmulationMenuItem.Command = Commands.Create(() => ViewModel.AppHost?.ShowExitPrompt().OrCompleted());
RestartEmulationMenuItem.Command = Commands.Create(() => ViewModel.RestartEmulation());
XCITrimmerMenuItem.Command = Commands.Create(XCITrimmerView.Show);
XCITrimmerMenuItem.Command = Commands.Create(XciTrimmerView.Show);
AboutWindowMenuItem.Command = Commands.Create(AboutView.Show);
CompatibilityListMenuItem.Command = Commands.Create(() => CompatibilityListWindow.Show());
LdnGameListMenuItem.Command = Commands.Create(() => LdnGamesListWindow.Show());
@@ -44,7 +44,7 @@ namespace Ryujinx.Ava.UI.Views.Settings
return;
}
MainWindow? mainWindow = RyujinxApp.MainWindow;
MainWindow mainWindow = RyujinxApp.MainWindow;
if (mainWindow?.ViewModel?.AppHost?.NpadManager is not { } npadManager)
{
return;