misc: chore: Use explicit types & fix object creation

This commit is contained in:
KeatonTheBot
2026-05-30 16:26:50 -05:00
parent 9d3fecf334
commit 76a123b81d
454 changed files with 3042 additions and 2961 deletions
+1 -1
View File
@@ -28,7 +28,7 @@ namespace Ryujinx.Ava.UI.Models
}
set
{
foreach (var cheat in SubNodes)
foreach (CheatNode cheat in SubNodes)
{
cheat.IsEnabled = value;
cheat.OnPropertyChanged();
@@ -208,7 +208,7 @@ namespace Ryujinx.Ava.UI.Models.Input
public InputConfig GetConfig()
{
var config = new StandardControllerInputConfig
StandardControllerInputConfig config = new()
{
Id = Id,
Backend = InputBackendType.GamepadSDL3,
+1 -1
View File
@@ -66,7 +66,7 @@ namespace Ryujinx.Ava.UI.Models.Input
public KeyboardHotkeys GetConfig()
{
var config = new KeyboardHotkeys
KeyboardHotkeys config = new()
{
ToggleVSyncMode = ToggleVSyncMode,
Screenshot = Screenshot,
@@ -144,7 +144,7 @@ namespace Ryujinx.Ava.UI.Models.Input
public InputConfig GetConfig()
{
var config = new StandardKeyboardInputConfig
StandardKeyboardInputConfig config = new()
{
Id = Id,
Backend = InputBackendType.WindowKeyboard,
+6 -6
View File
@@ -46,7 +46,7 @@ namespace Ryujinx.Ava.UI.Models
TitleId = info.ProgramId;
UserId = info.UserId;
var appData = MainWindow.MainWindowViewModel.Applications.FirstOrDefault(x => x.IdString.ToUpper() == TitleIdString);
ApplicationData appData = MainWindow.MainWindowViewModel.Applications.FirstOrDefault(x => x.IdString.ToUpper() == TitleIdString);
InGameList = appData != null;
@@ -70,7 +70,7 @@ namespace Ryujinx.Ava.UI.Models
Task.Run(() =>
{
var saveRoot = Path.Combine(VirtualFileSystem.GetNandPath(), $"user/save/{info.SaveDataId:x16}");
string saveRoot = Path.Combine(VirtualFileSystem.GetNandPath(), $"user/save/{info.SaveDataId:x16}");
long totalSize = GetDirectorySize(saveRoot);
@@ -79,14 +79,14 @@ namespace Ryujinx.Ava.UI.Models
long size = 0;
if (Directory.Exists(path))
{
var directories = Directory.GetDirectories(path);
foreach (var directory in directories)
string[] directories = Directory.GetDirectories(path);
foreach (string directory in directories)
{
size += GetDirectorySize(directory);
}
var files = Directory.GetFiles(path);
foreach (var file in files)
string[] files = Directory.GetFiles(path);
foreach (string file in files)
{
size += new FileInfo(file).Length;
}
+2 -1
View File
@@ -1,3 +1,4 @@
using Avalonia;
using Avalonia.Media;
using CommunityToolkit.Mvvm.ComponentModel;
using Ryujinx.Ava.UI.Controls;
@@ -48,7 +49,7 @@ namespace Ryujinx.Ava.UI.Models
private void UpdateBackground()
{
var currentApplication = Avalonia.Application.Current;
Application currentApplication = Avalonia.Application.Current;
object color = null;
currentApplication?.Styles.TryGetResource("ControlFillColorSecondary", currentApplication.ActualThemeVariant, out color);