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