mirror of
https://github.com/GreemDev/Ryujinx
synced 2024-11-24 10:46:54 +01:00
misc: Replace "" with string.Empty.
This commit is contained in:
parent
9305d171e7
commit
139c195eb7
52 changed files with 1649 additions and 1636 deletions
|
@ -41,7 +41,7 @@ namespace Ryujinx.Audio.Backends.OpenAL
|
|||
|
||||
public OpenALHardwareDeviceDriver()
|
||||
{
|
||||
_device = ALC.OpenDevice("");
|
||||
_device = ALC.OpenDevice(string.Empty);
|
||||
_context = ALC.CreateContext(_device, new ALContextAttributes());
|
||||
_updateRequiredEvent = new ManualResetEvent(false);
|
||||
_pauseEvent = new ManualResetEvent(true);
|
||||
|
|
|
@ -119,7 +119,7 @@ namespace Ryujinx.Common.Configuration
|
|||
|
||||
private static string SetUpLogsDir()
|
||||
{
|
||||
string logDir = "";
|
||||
string logDir = string.Empty;
|
||||
|
||||
if (Mode == LaunchMode.Portable)
|
||||
{
|
||||
|
@ -148,7 +148,7 @@ namespace Ryujinx.Common.Configuration
|
|||
catch
|
||||
{
|
||||
Logger.Warning?.Print(LogClass.Application, $"Logging directory could not be created '{logDir}'");
|
||||
logDir = "";
|
||||
logDir = string.Empty;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(logDir))
|
||||
|
@ -179,7 +179,7 @@ namespace Ryujinx.Common.Configuration
|
|||
catch
|
||||
{
|
||||
Logger.Warning?.Print(LogClass.Application, $"Logging directory could not be created '{logDir}'");
|
||||
logDir = "";
|
||||
logDir = string.Empty;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(logDir))
|
||||
|
|
|
@ -121,8 +121,8 @@ namespace Ryujinx.Common.GraphicsDriver
|
|||
};
|
||||
application.AppName.Set("Ryujinx.exe");
|
||||
application.UserFriendlyName.Set("Ryujinx");
|
||||
application.Launcher.Set("");
|
||||
application.FileInFolder.Set("");
|
||||
application.Launcher.Set(string.Empty);
|
||||
application.FileInFolder.Set(string.Empty);
|
||||
|
||||
Check(NvAPI_DRS_CreateApplication(handle, profileHandle, ref application));
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ namespace Ryujinx.Common.Logging
|
|||
{
|
||||
if (_enabledClasses[(int)logClass])
|
||||
{
|
||||
Updated?.Invoke(null, new LogEventArgs(Level, _time.Elapsed, Thread.CurrentThread.Name, FormatMessage(logClass, "", message)));
|
||||
Updated?.Invoke(null, new LogEventArgs(Level, _time.Elapsed, Thread.CurrentThread.Name, FormatMessage(logClass, string.Empty, message)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -432,7 +432,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl.Instructions
|
|||
|
||||
bool colorIsVector = isGather || !isShadow;
|
||||
|
||||
texCall += ")" + (colorIsVector ? GetMaskMultiDest(texOp.Index) : "");
|
||||
texCall += ")" + (colorIsVector ? GetMaskMultiDest(texOp.Index) : string.Empty);
|
||||
|
||||
return texCall;
|
||||
}
|
||||
|
|
|
@ -830,12 +830,12 @@ namespace Ryujinx.Graphics.Shader.Translation
|
|||
|
||||
if (use.Node != null)
|
||||
{
|
||||
Console.Write($"{indentation} {separator}- ({(use.Inverted ? "INV " : "")}{use.Index})");
|
||||
Console.Write($"{indentation} {separator}- ({(use.Inverted ? "INV " : string.Empty)}{use.Index})");
|
||||
PrintTreeNode(use.Node, indentation + (last ? " " : " | "));
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine($"{indentation} {separator}- ({(use.Inverted ? "INV " : "")}{use.Index}) NULL");
|
||||
Console.WriteLine($"{indentation} {separator}- ({(use.Inverted ? "INV " : string.Empty)}{use.Index}) NULL");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -852,12 +852,12 @@ namespace Ryujinx.Graphics.Shader.Translation
|
|||
|
||||
if (use.Node != null)
|
||||
{
|
||||
Console.Write($"{indentation} {separator}- ({(use.Inverted ? "INV " : "")}{use.Index})");
|
||||
Console.Write($"{indentation} {separator}- ({(use.Inverted ? "INV " : string.Empty)}{use.Index})");
|
||||
PrintTreeNode(use.Node, indentation + (last ? " " : " | "));
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine($"{indentation} {separator}- ({(use.Inverted ? "INV " : "")}{use.Index}) NULL");
|
||||
Console.WriteLine($"{indentation} {separator}- ({(use.Inverted ? "INV " : string.Empty)}{use.Index}) NULL");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace Ryujinx.HLE.Generators
|
|||
{
|
||||
if (className.Modifiers.Any(SyntaxKind.AbstractKeyword) || className.Modifiers.Any(SyntaxKind.PrivateKeyword) || !className.AttributeLists.Any(x => x.Attributes.Any(y => y.ToString().StartsWith("Service"))))
|
||||
continue;
|
||||
var name = GetFullName(className, context).Replace("global::", "");
|
||||
var name = GetFullName(className, context).Replace("global::", string.Empty);
|
||||
if (!name.StartsWith("Ryujinx.HLE.HOS.Services"))
|
||||
continue;
|
||||
var constructors = className.ChildNodes().Where(x => x.IsKind(SyntaxKind.ConstructorDeclaration)).Select(y => y as ConstructorDeclarationSyntax).ToArray();
|
||||
|
|
|
@ -523,7 +523,7 @@ namespace Ryujinx.HLE.FileSystem
|
|||
{
|
||||
// Clean up the name and get the NcaId
|
||||
|
||||
string[] pathComponents = entry.FullName.Replace(".cnmt", "").Split('/');
|
||||
string[] pathComponents = entry.FullName.Replace(".cnmt", string.Empty).Split('/');
|
||||
|
||||
string ncaId = pathComponents[^1];
|
||||
|
||||
|
|
|
@ -132,7 +132,7 @@ namespace Ryujinx.HLE.FileSystem
|
|||
|
||||
if (systemPath.StartsWith(baseSystemPath))
|
||||
{
|
||||
string rawPath = systemPath.Replace(baseSystemPath, "");
|
||||
string rawPath = systemPath.Replace(baseSystemPath, string.Empty);
|
||||
int firstSeparatorOffset = rawPath.IndexOf(Path.DirectorySeparatorChar);
|
||||
|
||||
if (firstSeparatorOffset == -1)
|
||||
|
|
|
@ -107,7 +107,7 @@ namespace Ryujinx.HLE.HOS.Applets.Error
|
|||
|
||||
private static string CleanText(string value)
|
||||
{
|
||||
return CleanTextRegex().Replace(value, "").Replace("\0", "");
|
||||
return CleanTextRegex().Replace(value, string.Empty).Replace("\0", string.Empty);
|
||||
}
|
||||
|
||||
private string GetMessageText(uint module, uint description, string key)
|
||||
|
@ -129,17 +129,15 @@ namespace Ryujinx.HLE.HOS.Applets.Error
|
|||
|
||||
return CleanText(reader.ReadToEnd());
|
||||
}
|
||||
else
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
private string[] GetButtonsText(uint module, uint description, string key)
|
||||
{
|
||||
string buttonsText = GetMessageText(module, description, key);
|
||||
|
||||
return (buttonsText == "") ? null : buttonsText.Split(new[] { "\r\n", "\r", "\n" }, StringSplitOptions.None);
|
||||
return (buttonsText == string.Empty) ? null : buttonsText.Split(["\r\n", "\r", "\n"], StringSplitOptions.None);
|
||||
}
|
||||
|
||||
private void ParseErrorCommonArg()
|
||||
|
@ -156,7 +154,7 @@ namespace Ryujinx.HLE.HOS.Applets.Error
|
|||
|
||||
string message = GetMessageText(module, description, "DlgMsg");
|
||||
|
||||
if (message == "")
|
||||
if (message == string.Empty)
|
||||
{
|
||||
message = "An error has occured.\n\nPlease try again later.";
|
||||
}
|
||||
|
@ -190,7 +188,7 @@ namespace Ryujinx.HLE.HOS.Applets.Error
|
|||
|
||||
// TODO: Handle the LanguageCode to return the translated "OK" and "Details".
|
||||
|
||||
if (detailsText.Trim() != "")
|
||||
if (detailsText.Trim() != string.Empty)
|
||||
{
|
||||
buttons.Add("Details");
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ namespace Ryujinx.HLE.HOS.Applets
|
|||
|
||||
private byte[] _transferMemory;
|
||||
|
||||
private string _textValue = "";
|
||||
private string _textValue = string.Empty;
|
||||
private int _cursorBegin = 0;
|
||||
private Encoding _encoding = Encoding.Unicode;
|
||||
private KeyboardResult _lastResult = KeyboardResult.NotSet;
|
||||
|
|
|
@ -305,7 +305,7 @@ namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard
|
|||
{
|
||||
SKRect bounds = SKRect.Empty;
|
||||
|
||||
if (text == "")
|
||||
if (text == string.Empty)
|
||||
{
|
||||
paint.MeasureText(" ", ref bounds);
|
||||
}
|
||||
|
@ -321,7 +321,7 @@ namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard
|
|||
{
|
||||
SKRect bounds = SKRect.Empty;
|
||||
|
||||
if (text == "")
|
||||
if (text == string.Empty)
|
||||
{
|
||||
paint.MeasureText(" ", ref bounds);
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard
|
|||
/// </summary>
|
||||
internal class SoftwareKeyboardUIState
|
||||
{
|
||||
public string InputText = "";
|
||||
public string InputText = string.Empty;
|
||||
public int CursorBegin = 0;
|
||||
public int CursorEnd = 0;
|
||||
public bool AcceptPressed = false;
|
||||
|
|
|
@ -238,7 +238,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
|
|||
}
|
||||
else
|
||||
{
|
||||
info.SubName = "";
|
||||
info.SubName = string.Empty;
|
||||
}
|
||||
|
||||
info.ImageName = GetGuessedNsoNameFromIndex(imageIndex);
|
||||
|
|
|
@ -64,7 +64,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
|
|||
{
|
||||
if (userId.IsNull)
|
||||
{
|
||||
userId = new UserId(Guid.NewGuid().ToString().Replace("-", ""));
|
||||
userId = new UserId(Guid.NewGuid().ToString().Replace("-", string.Empty));
|
||||
}
|
||||
|
||||
UserProfile profile = new(userId, name, image);
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
using Gommon;
|
||||
using Ryujinx.Common.Logging;
|
||||
using Ryujinx.Common.Memory;
|
||||
using Ryujinx.Common.Utilities;
|
||||
|
@ -143,7 +144,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnMitm
|
|||
if (decompressedLdnData.Length != header.DecompressLength)
|
||||
{
|
||||
Logger.Error?.PrintMsg(LogClass.ServiceLdn, $"Decompress error: length does not match. ({decompressedLdnData.Length} != {header.DecompressLength})");
|
||||
Logger.Error?.PrintMsg(LogClass.ServiceLdn, $"Decompress error data: '{string.Join("", decompressedLdnData.Select(x => (int)x).ToArray())}'");
|
||||
Logger.Error?.PrintMsg(LogClass.ServiceLdn, $"Decompress error data: '{decompressedLdnData.Select(x => (int)x).JoinToString(string.Empty)}'");
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace Ryujinx.HLE.HOS.Services.Ngct
|
|||
ulong bufferSize = context.Request.PtrBuff[0].Size;
|
||||
|
||||
bool isMatch = false;
|
||||
string text = "";
|
||||
string text = string.Empty;
|
||||
|
||||
if (bufferSize != 0)
|
||||
{
|
||||
|
@ -57,8 +57,8 @@ namespace Ryujinx.HLE.HOS.Services.Ngct
|
|||
|
||||
ulong bufferFilteredPosition = context.Request.RecvListBuff[0].Position;
|
||||
|
||||
string text = "";
|
||||
string textFiltered = "";
|
||||
string text = string.Empty;
|
||||
string textFiltered = string.Empty;
|
||||
|
||||
if (bufferSize != 0)
|
||||
{
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -36,7 +36,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Nsd.Manager
|
|||
// TODO: Load Environment from the savedata.
|
||||
address = address.Replace("%", IManager.NsdSettings.Environment);
|
||||
|
||||
resolvedAddress = "";
|
||||
resolvedAddress = string.Empty;
|
||||
|
||||
if (IManager.NsdSettings == null)
|
||||
{
|
||||
|
|
|
@ -63,7 +63,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger
|
|||
|
||||
if (size < 0)
|
||||
{
|
||||
return "";
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
ReadOnlySpan<byte> data = ReadInPlace((size + 1) * 2);
|
||||
|
|
|
@ -166,7 +166,7 @@ namespace Ryujinx.HLE.HOS.Services.Vi.RootService
|
|||
|
||||
private ResultCode OpenDisplayImpl(ServiceCtx context, string name)
|
||||
{
|
||||
if (name == "")
|
||||
if (name == string.Empty)
|
||||
{
|
||||
return ResultCode.InvalidValue;
|
||||
}
|
||||
|
|
|
@ -102,7 +102,7 @@ namespace Ryujinx.HLE.Loaders.Executables
|
|||
Match fsSdkMatch = FsSdkRegex().Match(rawTextBuffer);
|
||||
if (fsSdkMatch.Success)
|
||||
{
|
||||
stringBuilder.AppendLine($" FS SDK Version: {fsSdkMatch.Value.Replace("sdk_version: ", "")}");
|
||||
stringBuilder.AppendLine($" FS SDK Version: {fsSdkMatch.Value.Replace("sdk_version: ", string.Empty)}");
|
||||
}
|
||||
|
||||
MatchCollection sdkMwMatches = SdkMwRegex().Matches(rawTextBuffer);
|
||||
|
|
|
@ -89,7 +89,7 @@ namespace Ryujinx.HLE.Loaders.Processes.Extensions
|
|||
Logger.Warning?.Print(LogClass.Ptc, "Detected unsupported ExeFs modifications. PTC disabled.");
|
||||
}
|
||||
|
||||
string programName = "";
|
||||
string programName = string.Empty;
|
||||
|
||||
if (!isHomebrew && programId > 0x010000000000FFFF)
|
||||
{
|
||||
|
|
|
@ -145,7 +145,7 @@ namespace Ryujinx.HLE.Loaders.Processes
|
|||
IFileSystem dummyExeFs = null;
|
||||
Stream romfsStream = null;
|
||||
|
||||
string programName = "";
|
||||
string programName = string.Empty;
|
||||
ulong programId = 0000000000000000;
|
||||
|
||||
// Load executable.
|
||||
|
|
|
@ -255,7 +255,7 @@ namespace Ryujinx.HLE.Loaders.Processes
|
|||
{
|
||||
NsoExecutable nso => Convert.ToHexString(nso.BuildId.ItemsRo.ToArray()),
|
||||
NroExecutable nro => Convert.ToHexString(nro.Header.BuildId),
|
||||
_ => "",
|
||||
_ => string.Empty
|
||||
}).ToUpper());
|
||||
|
||||
ulong[] nsoBase = new ulong[executables.Length];
|
||||
|
|
|
@ -1235,14 +1235,14 @@ namespace Ryujinx.Horizon.Common
|
|||
{ 0x412, "NotFound" },
|
||||
{ 0x612, "NotEnoughBuffer" },
|
||||
{ 0xCA12, "Cancelled" },
|
||||
{ 0x7FE12, "" },
|
||||
{ 0xFA212, "" },
|
||||
{ 0x7FE12, string.Empty },
|
||||
{ 0xFA212, string.Empty },
|
||||
{ 0xFA612, "InvalidTaskId" },
|
||||
{ 0xFB612, "InvalidSize" },
|
||||
{ 0xFCA12, "TaskCancelled" },
|
||||
{ 0xFCC12, "TaskNotCompleted" },
|
||||
{ 0xFCE12, "TaskQueueNotAvailable" },
|
||||
{ 0x106A12, "" },
|
||||
{ 0x106A12, string.Empty },
|
||||
{ 0x106C12, "OutOfRpcTask" },
|
||||
{ 0x109612, "InvalidCategory" },
|
||||
{ 0x214, "OutOfKeyResource" },
|
||||
|
|
|
@ -221,7 +221,7 @@ namespace Ryujinx.Horizon.Sdk.Ngc.Detail
|
|||
if (includeMultiWord)
|
||||
{
|
||||
int lastMultiWordIndex = 0;
|
||||
string multiWord = "";
|
||||
string multiWord = string.Empty;
|
||||
|
||||
while (_multiWordMap.Has(nodePlainIndex))
|
||||
{
|
||||
|
|
|
@ -162,7 +162,7 @@ namespace Ryujinx.UI.App.Common
|
|||
NsoReader reader = new();
|
||||
reader.Initialize(nsoFile.Release().AsStorage().AsFile(OpenMode.Read)).ThrowIfFailure();
|
||||
|
||||
return BitConverter.ToString(reader.Header.ModuleId.ItemsRo.ToArray()).Replace("-", "").ToUpper()[..16];
|
||||
return BitConverter.ToString(reader.Header.ModuleId.ItemsRo.ToArray()).Replace("-", string.Empty).ToUpper()[..16];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace Ryujinx.UI.Common.Helper
|
|||
if ((uninstall && AreMimeTypesRegisteredLinux()) || (!uninstall && !AreMimeTypesRegisteredLinux()))
|
||||
{
|
||||
string mimeTypesFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "mime", "Ryujinx.xml");
|
||||
string additionalArgs = !uninstall ? "--novendor" : "";
|
||||
string additionalArgs = !uninstall ? "--novendor" : string.Empty;
|
||||
|
||||
using Process mimeProcess = new();
|
||||
|
||||
|
@ -83,7 +83,7 @@ namespace Ryujinx.UI.Common.Helper
|
|||
|
||||
var openCmd = key.OpenSubKey(@"shell\open\command");
|
||||
|
||||
string keyValue = (string)openCmd.GetValue("");
|
||||
string keyValue = (string)openCmd.GetValue(string.Empty);
|
||||
|
||||
return keyValue is not null && (keyValue.Contains("Ryujinx") || keyValue.Contains(AppDomain.CurrentDomain.FriendlyName));
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ namespace Ryujinx.UI.Common.Helper
|
|||
{
|
||||
var titleUpdateWindowData = new TitleUpdateMetadata
|
||||
{
|
||||
Selected = "",
|
||||
Selected = string.Empty,
|
||||
Paths = [],
|
||||
};
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace Ryujinx.UI.LocaleGenerator
|
|||
|
||||
context.RegisterSourceOutput(contents, (spc, content) =>
|
||||
{
|
||||
var lines = content.Split('\n').Where(x => x.Trim().StartsWith("\"")).Select(x => x.Split(':')[0].Trim().Replace("\"", ""));
|
||||
var lines = content.Split('\n').Where(x => x.Trim().StartsWith("\"")).Select(x => x.Split(':')[0].Trim().Replace("\"", string.Empty));
|
||||
StringBuilder enumSourceBuilder = new();
|
||||
enumSourceBuilder.AppendLine("namespace Ryujinx.Ava.Common.Locale;");
|
||||
enumSourceBuilder.AppendLine("internal enum LocaleKeys");
|
||||
|
|
|
@ -115,7 +115,7 @@ namespace Ryujinx.Modules
|
|||
{
|
||||
await ContentDialogHelper.CreateUpdaterInfoDialog(
|
||||
LocaleManager.Instance[LocaleKeys.DialogUpdaterAlreadyOnLatestVersionMessage],
|
||||
"");
|
||||
string.Empty);
|
||||
}
|
||||
|
||||
_running = false;
|
||||
|
@ -134,7 +134,7 @@ namespace Ryujinx.Modules
|
|||
{
|
||||
await ContentDialogHelper.CreateUpdaterInfoDialog(
|
||||
LocaleManager.Instance[LocaleKeys.DialogUpdaterAlreadyOnLatestVersionMessage],
|
||||
"");
|
||||
string.Empty);
|
||||
}
|
||||
|
||||
_running = false;
|
||||
|
@ -177,7 +177,7 @@ namespace Ryujinx.Modules
|
|||
{
|
||||
await ContentDialogHelper.CreateUpdaterInfoDialog(
|
||||
LocaleManager.Instance[LocaleKeys.DialogUpdaterAlreadyOnLatestVersionMessage],
|
||||
"");
|
||||
string.Empty);
|
||||
}
|
||||
|
||||
_running = false;
|
||||
|
@ -301,13 +301,6 @@ namespace Ryujinx.Modules
|
|||
// Find the process name.
|
||||
string ryuName = Path.GetFileName(Environment.ProcessPath) ?? string.Empty;
|
||||
|
||||
// Migration: Start the updated binary.
|
||||
// TODO: Remove this in a future update.
|
||||
if (ryuName.StartsWith("Ryujinx.Ava"))
|
||||
{
|
||||
ryuName = ryuName.Replace(".Ava", "");
|
||||
}
|
||||
|
||||
// Some operating systems can see the renamed executable, so strip off the .ryuold if found.
|
||||
if (ryuName.EndsWith(".ryuold"))
|
||||
{
|
||||
|
|
|
@ -120,7 +120,7 @@ namespace Ryujinx.Ava.UI.Applet
|
|||
|
||||
bool okPressed = false;
|
||||
bool error = false;
|
||||
string inputText = args.InitialText ?? "";
|
||||
string inputText = args.InitialText ?? string.Empty;
|
||||
|
||||
Dispatcher.UIThread.InvokeAsync(async () =>
|
||||
{
|
||||
|
|
|
@ -26,7 +26,7 @@ namespace Ryujinx.Ava.UI.Applet
|
|||
public static SvgImage JoyconLeftImage => GetResource(JoyConLeftResource);
|
||||
public static SvgImage JoyconRightImage => GetResource(JoyConRightResource);
|
||||
|
||||
public string PlayerCount { get; set; } = "";
|
||||
public string PlayerCount { get; set; } = string.Empty;
|
||||
public bool SupportsProController { get; set; }
|
||||
public bool SupportsLeftJoycon { get; set; }
|
||||
public bool SupportsRightJoycon { get; set; }
|
||||
|
|
|
@ -27,7 +27,7 @@ namespace Ryujinx.Ava.UI.Controls
|
|||
{
|
||||
MainText = mainText;
|
||||
SecondaryText = secondaryText;
|
||||
Message = message ?? "";
|
||||
Message = message ?? string.Empty;
|
||||
DataContext = this;
|
||||
_placeholder = placeholder;
|
||||
InitializeComponent();
|
||||
|
@ -55,9 +55,9 @@ namespace Ryujinx.Ava.UI.Controls
|
|||
Input.Focus();
|
||||
}
|
||||
|
||||
public string Message { get; set; } = "";
|
||||
public string MainText { get; set; } = "";
|
||||
public string SecondaryText { get; set; } = "";
|
||||
public string Message { get; set; } = string.Empty;
|
||||
public string MainText { get; set; } = string.Empty;
|
||||
public string SecondaryText { get; set; } = string.Empty;
|
||||
|
||||
public static async Task<(UserResult Result, string Input)> ShowInputDialog(string title, SoftwareKeyboardUIArgs args)
|
||||
{
|
||||
|
@ -76,7 +76,7 @@ namespace Ryujinx.Ava.UI.Controls
|
|||
contentDialog.Title = title;
|
||||
contentDialog.PrimaryButtonText = args.SubmitText;
|
||||
contentDialog.IsPrimaryButtonEnabled = content._checkLength(content.Message.Length);
|
||||
contentDialog.SecondaryButtonText = "";
|
||||
contentDialog.SecondaryButtonText = string.Empty;
|
||||
contentDialog.CloseButtonText = LocaleManager.Instance[LocaleKeys.InputDialogCancel];
|
||||
contentDialog.Content = content;
|
||||
|
||||
|
@ -110,13 +110,13 @@ namespace Ryujinx.Ava.UI.Controls
|
|||
Error.IsVisible = false;
|
||||
Error.FontStyle = FontStyle.Italic;
|
||||
|
||||
string validationInfoText = "";
|
||||
string validationInfoText = string.Empty;
|
||||
|
||||
if (_inputMin <= 0 && _inputMax == int.MaxValue) // Disable.
|
||||
{
|
||||
Error.IsVisible = false;
|
||||
|
||||
_checkLength = length => true;
|
||||
_checkLength = _ => true;
|
||||
}
|
||||
else if (_inputMin > 0 && _inputMax == int.MaxValue)
|
||||
{
|
||||
|
|
|
@ -138,7 +138,7 @@ namespace Ryujinx.Ava.UI.Controls
|
|||
|
||||
foreach (var account in lostAccounts)
|
||||
{
|
||||
ViewModel.LostProfiles.Add(new UserProfile(new HLE.HOS.Services.Account.Acc.UserProfile(account, "", null), this));
|
||||
ViewModel.LostProfiles.Add(new UserProfile(new HLE.HOS.Services.Account.Acc.UserProfile(account, string.Empty, null), this));
|
||||
}
|
||||
|
||||
ViewModel.Profiles.Add(new BaseModel());
|
||||
|
@ -155,14 +155,11 @@ namespace Ryujinx.Ava.UI.Controls
|
|||
|
||||
if (profile == null)
|
||||
{
|
||||
Dispatcher.UIThread.Post(Action);
|
||||
_ = Dispatcher.UIThread.InvokeAsync(async ()
|
||||
=> await ContentDialogHelper.CreateErrorDialog(
|
||||
LocaleManager.Instance[LocaleKeys.DialogUserProfileDeletionWarningMessage]));
|
||||
|
||||
return;
|
||||
|
||||
static async void Action()
|
||||
{
|
||||
await ContentDialogHelper.CreateErrorDialog(LocaleManager.Instance[LocaleKeys.DialogUserProfileDeletionWarningMessage]);
|
||||
}
|
||||
}
|
||||
|
||||
AccountManager.OpenUser(profile.UserId);
|
||||
|
@ -170,10 +167,10 @@ namespace Ryujinx.Ava.UI.Controls
|
|||
|
||||
var result = await ContentDialogHelper.CreateConfirmationDialog(
|
||||
LocaleManager.Instance[LocaleKeys.DialogUserProfileDeletionConfirmMessage],
|
||||
"",
|
||||
string.Empty,
|
||||
LocaleManager.Instance[LocaleKeys.InputDialogYes],
|
||||
LocaleManager.Instance[LocaleKeys.InputDialogNo],
|
||||
"");
|
||||
string.Empty);
|
||||
|
||||
if (result == UserResult.Yes)
|
||||
{
|
||||
|
|
|
@ -205,7 +205,7 @@ namespace Ryujinx.Ava.UI.Helpers
|
|||
primary,
|
||||
secondaryText,
|
||||
acceptButton,
|
||||
"",
|
||||
string.Empty,
|
||||
closeButton,
|
||||
(int)Symbol.Important);
|
||||
|
||||
|
@ -221,7 +221,7 @@ namespace Ryujinx.Ava.UI.Helpers
|
|||
primaryText,
|
||||
secondaryText,
|
||||
acceptButtonText,
|
||||
"",
|
||||
string.Empty,
|
||||
cancelButtonText,
|
||||
(int)Symbol.Help,
|
||||
primaryButtonResult);
|
||||
|
@ -239,8 +239,8 @@ namespace Ryujinx.Ava.UI.Helpers
|
|||
LocaleManager.Instance[LocaleKeys.DialogUpdaterTitle],
|
||||
primary,
|
||||
secondaryText,
|
||||
"",
|
||||
"",
|
||||
string.Empty,
|
||||
string.Empty,
|
||||
LocaleManager.Instance[LocaleKeys.InputDialogOk],
|
||||
(int)Symbol.Important);
|
||||
|
||||
|
@ -249,8 +249,8 @@ namespace Ryujinx.Ava.UI.Helpers
|
|||
LocaleManager.Instance[LocaleKeys.DialogWarningTitle],
|
||||
primary,
|
||||
secondaryText,
|
||||
"",
|
||||
"",
|
||||
string.Empty,
|
||||
string.Empty,
|
||||
LocaleManager.Instance[LocaleKeys.InputDialogOk],
|
||||
(int)Symbol.Important);
|
||||
|
||||
|
@ -263,7 +263,7 @@ namespace Ryujinx.Ava.UI.Helpers
|
|||
LocaleManager.Instance[LocaleKeys.DialogErrorMessage],
|
||||
errorMessage,
|
||||
secondaryErrorMessage,
|
||||
"",
|
||||
string.Empty,
|
||||
LocaleManager.Instance[LocaleKeys.InputDialogOk],
|
||||
(int)Symbol.Dismiss);
|
||||
}
|
||||
|
@ -282,7 +282,7 @@ namespace Ryujinx.Ava.UI.Helpers
|
|||
primary,
|
||||
secondaryText,
|
||||
LocaleManager.Instance[LocaleKeys.InputDialogYes],
|
||||
"",
|
||||
string.Empty,
|
||||
LocaleManager.Instance[LocaleKeys.InputDialogNo],
|
||||
(int)Symbol.Help,
|
||||
UserResult.Yes);
|
||||
|
|
|
@ -122,7 +122,7 @@ namespace Ryujinx.Ava.UI.Helpers
|
|||
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
string keyString = "";
|
||||
string keyString = string.Empty;
|
||||
LocaleKeys localeKey;
|
||||
|
||||
switch (value)
|
||||
|
|
|
@ -40,7 +40,7 @@ namespace Ryujinx.Ava.UI.Helpers
|
|||
await ContentDialogHelper.CreateInfoDialog(
|
||||
LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.DialogUserErrorDialogMessage, errorCode, GetErrorTitle(error)),
|
||||
GetErrorDescription(error),
|
||||
"",
|
||||
string.Empty,
|
||||
LocaleManager.Instance[LocaleKeys.InputDialogOk],
|
||||
LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.DialogUserErrorDialogTitle, errorCode));
|
||||
}
|
||||
|
|
|
@ -320,7 +320,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||
}
|
||||
}
|
||||
|
||||
if (LastScannedAmiiboId != "")
|
||||
if (LastScannedAmiiboId != string.Empty)
|
||||
{
|
||||
SelectLastScannedAmiibo();
|
||||
}
|
||||
|
@ -421,7 +421,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||
usageStringBuilder.Append($"{LocaleManager.Instance[LocaleKeys.Unknown]}.");
|
||||
}
|
||||
|
||||
Usage = $"{LocaleManager.Instance[LocaleKeys.Usage]} {(writable ? $" ({LocaleManager.Instance[LocaleKeys.Writable]})" : "")} : {usageStringBuilder}";
|
||||
Usage = $"{LocaleManager.Instance[LocaleKeys.Usage]} {(writable ? $" ({LocaleManager.Instance[LocaleKeys.Writable]})" : string.Empty)} : {usageStringBuilder}";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -480,7 +480,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||
await ContentDialogHelper.CreateInfoDialog(LocaleManager.Instance[LocaleKeys.DialogAmiiboApiTitle],
|
||||
LocaleManager.Instance[LocaleKeys.DialogAmiiboApiFailFetchMessage],
|
||||
LocaleManager.Instance[LocaleKeys.InputDialogOk],
|
||||
"",
|
||||
string.Empty,
|
||||
LocaleManager.Instance[LocaleKeys.RyujinxInfo]);
|
||||
|
||||
return null;
|
||||
|
@ -530,7 +530,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||
await ContentDialogHelper.CreateInfoDialog(LocaleManager.Instance[LocaleKeys.DialogAmiiboApiTitle],
|
||||
LocaleManager.Instance[LocaleKeys.DialogAmiiboApiConnectErrorMessage],
|
||||
LocaleManager.Instance[LocaleKeys.InputDialogOk],
|
||||
"",
|
||||
string.Empty,
|
||||
LocaleManager.Instance[LocaleKeys.RyujinxInfo]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -287,7 +287,14 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||
var msg = string.Format(LocaleManager.Instance[LocaleKeys.DlcWindowDlcAddedMessage], numAdded);
|
||||
return Dispatcher.UIThread.InvokeAsync(async () =>
|
||||
{
|
||||
await ContentDialogHelper.ShowTextDialog(LocaleManager.Instance[LocaleKeys.DialogConfirmationTitle], msg, "", "", "", LocaleManager.Instance[LocaleKeys.InputDialogOk], (int)Symbol.Checkmark);
|
||||
await ContentDialogHelper.ShowTextDialog(
|
||||
LocaleManager.Instance[LocaleKeys.DialogConfirmationTitle],
|
||||
msg,
|
||||
string.Empty,
|
||||
string.Empty,
|
||||
string.Empty,
|
||||
LocaleManager.Instance[LocaleKeys.InputDialogOk],
|
||||
(int)Symbol.Checkmark);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1092,7 +1092,12 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||
|
||||
string message = LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.DialogFirmwareInstallerFirmwareInstallSuccessMessage, firmwareVersion.VersionString);
|
||||
|
||||
await ContentDialogHelper.CreateInfoDialog(dialogTitle, message, LocaleManager.Instance[LocaleKeys.InputDialogOk], "", LocaleManager.Instance[LocaleKeys.RyujinxInfo]);
|
||||
await ContentDialogHelper.CreateInfoDialog(
|
||||
dialogTitle,
|
||||
message,
|
||||
LocaleManager.Instance[LocaleKeys.InputDialogOk],
|
||||
string.Empty,
|
||||
LocaleManager.Instance[LocaleKeys.RyujinxInfo]);
|
||||
|
||||
Logger.Info?.Print(LogClass.Application, message);
|
||||
|
||||
|
@ -1163,7 +1168,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||
case LoadState.Loaded:
|
||||
LoadHeading = LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.LoadingHeading, _currentApplicationData.Name);
|
||||
IsLoadingIndeterminate = true;
|
||||
CacheLoadStatus = "";
|
||||
CacheLoadStatus = string.Empty;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
@ -1183,7 +1188,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||
case ShaderCacheLoadingState.Loaded:
|
||||
LoadHeading = LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.LoadingHeading, _currentApplicationData.Name);
|
||||
IsLoadingIndeterminate = true;
|
||||
CacheLoadStatus = "";
|
||||
CacheLoadStatus = string.Empty;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
@ -1303,7 +1308,12 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||
{
|
||||
await ContentDialogHelper.ShowTextDialog(
|
||||
LocaleManager.Instance[numAdded > 0 || numRemoved > 0 ? LocaleKeys.RyujinxConfirm : LocaleKeys.RyujinxInfo],
|
||||
msg, "", "", "", LocaleManager.Instance[LocaleKeys.InputDialogOk], (int)Symbol.Checkmark);
|
||||
msg,
|
||||
string.Empty,
|
||||
string.Empty,
|
||||
string.Empty,
|
||||
LocaleManager.Instance[LocaleKeys.InputDialogOk],
|
||||
(int)Symbol.Checkmark);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -1600,7 +1610,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||
LocaleManager.Instance[LocaleKeys.DialogLoadAppGameAlreadyLoadedMessage],
|
||||
LocaleManager.Instance[LocaleKeys.DialogLoadAppGameAlreadyLoadedSubMessage],
|
||||
LocaleManager.Instance[LocaleKeys.InputDialogOk],
|
||||
"",
|
||||
string.Empty,
|
||||
LocaleManager.Instance[LocaleKeys.RyujinxInfo]);
|
||||
|
||||
return;
|
||||
|
@ -1817,7 +1827,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||
|
||||
if (result == UserResult.Yes)
|
||||
{
|
||||
ConfigurationState.Instance.Graphics.ShadersDumpPath.Value = "";
|
||||
ConfigurationState.Instance.Graphics.ShadersDumpPath.Value = string.Empty;
|
||||
|
||||
SaveConfig();
|
||||
}
|
||||
|
|
|
@ -80,8 +80,8 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||
{
|
||||
Dispatcher.UIThread.InvokeAsync(() =>
|
||||
ContentDialogHelper.CreateInfoDialog(LocaleManager.Instance[LocaleKeys.DialogSettingsBackendThreadingWarningMessage],
|
||||
"",
|
||||
"",
|
||||
string.Empty,
|
||||
string.Empty,
|
||||
LocaleManager.Instance[LocaleKeys.InputDialogOk],
|
||||
LocaleManager.Instance[LocaleKeys.DialogSettingsBackendThreadingWarningTitle])
|
||||
);
|
||||
|
@ -338,7 +338,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||
{
|
||||
_gpuIds.Add(device.Id);
|
||||
|
||||
AvailableGpus.Add(new ComboBoxItem { Content = $"{device.Name} {(device.IsDiscrete ? "(dGPU)" : "")}" });
|
||||
AvailableGpus.Add(new ComboBoxItem { Content = $"{device.Name} {(device.IsDiscrete ? "(dGPU)" : string.Empty)}" });
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -227,10 +227,16 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||
private Task ShowNewUpdatesAddedDialog(int numAdded)
|
||||
{
|
||||
var msg = string.Format(LocaleManager.Instance[LocaleKeys.UpdateWindowUpdateAddedMessage], numAdded);
|
||||
return Dispatcher.UIThread.InvokeAsync(async () =>
|
||||
{
|
||||
await ContentDialogHelper.ShowTextDialog(LocaleManager.Instance[LocaleKeys.DialogConfirmationTitle], msg, "", "", "", LocaleManager.Instance[LocaleKeys.InputDialogOk], (int)Symbol.Checkmark);
|
||||
});
|
||||
return Dispatcher.UIThread.InvokeAsync(async () =>
|
||||
await ContentDialogHelper.ShowTextDialog(
|
||||
LocaleManager.Instance[LocaleKeys.DialogConfirmationTitle],
|
||||
msg,
|
||||
string.Empty,
|
||||
string.Empty,
|
||||
string.Empty,
|
||||
LocaleManager.Instance[LocaleKeys.InputDialogOk],
|
||||
(int)Symbol.Checkmark
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ namespace Ryujinx.Ava.UI.Views.Input
|
|||
{
|
||||
Title = LocaleManager.Instance[LocaleKeys.ControllerMotionTitle],
|
||||
PrimaryButtonText = LocaleManager.Instance[LocaleKeys.ControllerSettingsSave],
|
||||
SecondaryButtonText = "",
|
||||
SecondaryButtonText = string.Empty,
|
||||
CloseButtonText = LocaleManager.Instance[LocaleKeys.ControllerSettingsClose],
|
||||
Content = content,
|
||||
};
|
||||
|
|
|
@ -38,7 +38,7 @@ namespace Ryujinx.Ava.UI.Views.Input
|
|||
{
|
||||
Title = LocaleManager.Instance[LocaleKeys.ControllerRumbleTitle],
|
||||
PrimaryButtonText = LocaleManager.Instance[LocaleKeys.ControllerSettingsSave],
|
||||
SecondaryButtonText = "",
|
||||
SecondaryButtonText = string.Empty,
|
||||
CloseButtonText = LocaleManager.Instance[LocaleKeys.ControllerSettingsClose],
|
||||
Content = content,
|
||||
};
|
||||
|
|
|
@ -133,7 +133,8 @@ namespace Ryujinx.Ava.UI.Views.User
|
|||
var result = await ContentDialogHelper.CreateConfirmationDialog(LocaleManager.Instance[LocaleKeys.DeleteUserSave],
|
||||
LocaleManager.Instance[LocaleKeys.IrreversibleActionNote],
|
||||
LocaleManager.Instance[LocaleKeys.InputDialogYes],
|
||||
LocaleManager.Instance[LocaleKeys.InputDialogNo], "");
|
||||
LocaleManager.Instance[LocaleKeys.InputDialogNo],
|
||||
string.Empty);
|
||||
|
||||
if (result == UserResult.Yes)
|
||||
{
|
||||
|
|
|
@ -30,8 +30,8 @@ namespace Ryujinx.Ava.UI.Windows
|
|||
{
|
||||
ContentDialog contentDialog = new()
|
||||
{
|
||||
PrimaryButtonText = "",
|
||||
SecondaryButtonText = "",
|
||||
PrimaryButtonText = string.Empty,
|
||||
SecondaryButtonText = string.Empty,
|
||||
CloseButtonText = LocaleManager.Instance[LocaleKeys.UserProfilesClose],
|
||||
Content = new AboutWindow(),
|
||||
};
|
||||
|
|
|
@ -72,7 +72,7 @@ namespace Ryujinx.Ava.UI.Windows
|
|||
if (cheat.Path.FullName != currentCheatFile)
|
||||
{
|
||||
currentCheatFile = cheat.Path.FullName;
|
||||
string parentPath = currentCheatFile.Replace(titleModsPath, "");
|
||||
string parentPath = currentCheatFile.Replace(titleModsPath, string.Empty);
|
||||
|
||||
buildId = Path.GetFileNameWithoutExtension(currentCheatFile).ToUpper();
|
||||
currentGroup = new CheatNode("", buildId, parentPath, true);
|
||||
|
@ -80,7 +80,7 @@ namespace Ryujinx.Ava.UI.Windows
|
|||
LoadedCheats.Add(currentGroup);
|
||||
}
|
||||
|
||||
var model = new CheatNode(cheat.Name, buildId, "", false, enabled.Contains($"{buildId}-{cheat.Name}"));
|
||||
var model = new CheatNode(cheat.Name, buildId, string.Empty, false, enabled.Contains($"{buildId}-{cheat.Name}"));
|
||||
currentGroup?.SubNodes.Add(model);
|
||||
|
||||
cheatAdded++;
|
||||
|
|
|
@ -33,9 +33,9 @@ namespace Ryujinx.Ava.UI.Windows
|
|||
{
|
||||
ContentDialog contentDialog = new()
|
||||
{
|
||||
PrimaryButtonText = "",
|
||||
SecondaryButtonText = "",
|
||||
CloseButtonText = "",
|
||||
PrimaryButtonText = string.Empty,
|
||||
SecondaryButtonText = string.Empty,
|
||||
CloseButtonText = string.Empty,
|
||||
Content = new DownloadableContentManagerWindow(applicationLibrary, applicationData),
|
||||
Title = string.Format(LocaleManager.Instance[LocaleKeys.DlcWindowTitle], applicationData.Name, applicationData.IdBaseString),
|
||||
};
|
||||
|
|
|
@ -34,9 +34,9 @@ namespace Ryujinx.Ava.UI.Windows
|
|||
{
|
||||
ContentDialog contentDialog = new()
|
||||
{
|
||||
PrimaryButtonText = "",
|
||||
SecondaryButtonText = "",
|
||||
CloseButtonText = "",
|
||||
PrimaryButtonText = string.Empty,
|
||||
SecondaryButtonText = string.Empty,
|
||||
CloseButtonText = string.Empty,
|
||||
Content = new ModManagerWindow(titleId),
|
||||
Title = string.Format(LocaleManager.Instance[LocaleKeys.ModWindowTitle], titleName, titleId.ToString("X16")),
|
||||
};
|
||||
|
|
|
@ -33,9 +33,9 @@ namespace Ryujinx.Ava.UI.Windows
|
|||
{
|
||||
ContentDialog contentDialog = new()
|
||||
{
|
||||
PrimaryButtonText = "",
|
||||
SecondaryButtonText = "",
|
||||
CloseButtonText = "",
|
||||
PrimaryButtonText = string.Empty,
|
||||
SecondaryButtonText = string.Empty,
|
||||
CloseButtonText = string.Empty,
|
||||
Content = new TitleUpdateWindow(applicationLibrary, applicationData),
|
||||
Title = LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.GameUpdateWindowHeading, applicationData.Name, applicationData.IdBaseString),
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue