misc: chore: Use collection expressions

This commit is contained in:
KeatonTheBot committed 2025-03-06 20:46:29 -06:00
1 parent 4d5757417e
commit e2973a875a
236 files changed
+9843 -7561

No files matched your search

+3 -3
View File
@@ -38,7 +38,7 @@ namespace Ryujinx.Ava.UI.Windows
MinWidth = 500;
MinHeight = 650;
LoadedCheats = new AvaloniaList<CheatNode>();
LoadedCheats = [];
IntegrityCheckLevel checkLevel = ConfigurationState.Instance.System.EnableFsIntegrityChecks
? IntegrityCheckLevel.ErrorOnInvalid
: IntegrityCheckLevel.None;
@@ -54,7 +54,7 @@ namespace Ryujinx.Ava.UI.Windows
_enabledCheatsPath = Path.Combine(titleModsPath, "cheats", "enabled.txt");
string[] enabled = Array.Empty<string>();
string[] enabled = [];
if (File.Exists(_enabledCheatsPath))
{
@@ -108,7 +108,7 @@ namespace Ryujinx.Ava.UI.Windows
return;
}
List<string> enabledCheats = new();
List<string> enabledCheats = [];
foreach (var cheats in LoadedCheats)
{
@@ -9,7 +9,7 @@ namespace Ryujinx.Ava.UI.Windows
{
InitializeComponent();
TransparencyLevelHint = new[] { WindowTransparencyLevel.Transparent };
TransparencyLevelHint = [WindowTransparencyLevel.Transparent];
WindowStartupLocation = WindowStartupLocation.Manual;
SystemDecorations = SystemDecorations.None;
ExtendClientAreaTitleBarHeightHint = 0;
+3 -2
View File
@@ -719,12 +719,13 @@ namespace Ryujinx.Ava.UI.Windows
private void ShowNewContentAddedDialog(int numDlcAdded, int numDlcRemoved, int numUpdatesAdded, int numUpdatesRemoved)
{
string[] messages = {
string[] messages =
[
numDlcRemoved > 0 ? string.Format(LocaleManager.Instance[LocaleKeys.AutoloadDlcRemovedMessage], numDlcRemoved): null,
numDlcAdded > 0 ? string.Format(LocaleManager.Instance[LocaleKeys.AutoloadDlcAddedMessage], numDlcAdded): null,
numUpdatesRemoved > 0 ? string.Format(LocaleManager.Instance[LocaleKeys.AutoloadUpdateRemovedMessage], numUpdatesRemoved): null,
numUpdatesAdded > 0 ? string.Format(LocaleManager.Instance[LocaleKeys.AutoloadUpdateAddedMessage], numUpdatesAdded) : null
};
];
string msg = String.Join("\r\n", messages);
+1 -1
View File
@@ -17,7 +17,7 @@ namespace Ryujinx.Ava.UI.Windows
public StyleableWindow()
{
WindowStartupLocation = WindowStartupLocation.CenterOwner;
TransparencyLevelHint = new[] { WindowTransparencyLevel.None };
TransparencyLevelHint = [WindowTransparencyLevel.None];
using Stream stream = Assembly.GetAssembly(typeof(ConfigurationState)).GetManifestResourceStream("Ryujinx.UI.Common.Resources.Logo_Ryujinx.png");