Fix whitespace formatting
This commit is contained in:
parent
7f302c6aa7
commit
a9f6e6f3b4
@ -492,7 +492,7 @@ namespace Ryujinx.Common.Collections
|
|||||||
Start = start;
|
Start = start;
|
||||||
End = end;
|
End = end;
|
||||||
Max = end;
|
Max = end;
|
||||||
Values = [ new RangeNode<TKey, TValue>(start, end, value) ];
|
Values = [new RangeNode<TKey, TValue>(start, end, value)];
|
||||||
Parent = parent;
|
Parent = parent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,8 +4,8 @@ using System.Diagnostics;
|
|||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Runtime.Intrinsics.X86;
|
|
||||||
using System.Runtime.Intrinsics;
|
using System.Runtime.Intrinsics;
|
||||||
|
using System.Runtime.Intrinsics.X86;
|
||||||
// ReSharper disable InconsistentNaming
|
// ReSharper disable InconsistentNaming
|
||||||
|
|
||||||
namespace Ryujinx.Common
|
namespace Ryujinx.Common
|
||||||
@ -67,18 +67,198 @@ namespace Ryujinx.Common
|
|||||||
|
|
||||||
private static ReadOnlySpan<byte> Xxh3KSecret =>
|
private static ReadOnlySpan<byte> Xxh3KSecret =>
|
||||||
[
|
[
|
||||||
0xb8, 0xfe, 0x6c, 0x39, 0x23, 0xa4, 0x4b, 0xbe, 0x7c, 0x01, 0x81, 0x2c, 0xf7, 0x21, 0xad, 0x1c,
|
0xb8,
|
||||||
0xde, 0xd4, 0x6d, 0xe9, 0x83, 0x90, 0x97, 0xdb, 0x72, 0x40, 0xa4, 0xa4, 0xb7, 0xb3, 0x67, 0x1f,
|
0xfe,
|
||||||
0xcb, 0x79, 0xe6, 0x4e, 0xcc, 0xc0, 0xe5, 0x78, 0x82, 0x5a, 0xd0, 0x7d, 0xcc, 0xff, 0x72, 0x21,
|
0x6c,
|
||||||
0xb8, 0x08, 0x46, 0x74, 0xf7, 0x43, 0x24, 0x8e, 0xe0, 0x35, 0x90, 0xe6, 0x81, 0x3a, 0x26, 0x4c,
|
0x39,
|
||||||
0x3c, 0x28, 0x52, 0xbb, 0x91, 0xc3, 0x00, 0xcb, 0x88, 0xd0, 0x65, 0x8b, 0x1b, 0x53, 0x2e, 0xa3,
|
0x23,
|
||||||
0x71, 0x64, 0x48, 0x97, 0xa2, 0x0d, 0xf9, 0x4e, 0x38, 0x19, 0xef, 0x46, 0xa9, 0xde, 0xac, 0xd8,
|
0xa4,
|
||||||
0xa8, 0xfa, 0x76, 0x3f, 0xe3, 0x9c, 0x34, 0x3f, 0xf9, 0xdc, 0xbb, 0xc7, 0xc7, 0x0b, 0x4f, 0x1d,
|
0x4b,
|
||||||
0x8a, 0x51, 0xe0, 0x4b, 0xcd, 0xb4, 0x59, 0x31, 0xc8, 0x9f, 0x7e, 0xc9, 0xd9, 0x78, 0x73, 0x64,
|
0xbe,
|
||||||
0xea, 0xc5, 0xac, 0x83, 0x34, 0xd3, 0xeb, 0xc3, 0xc5, 0x81, 0xa0, 0xff, 0xfa, 0x13, 0x63, 0xeb,
|
0x7c,
|
||||||
0x17, 0x0d, 0xdd, 0x51, 0xb7, 0xf0, 0xda, 0x49, 0xd3, 0x16, 0x55, 0x26, 0x29, 0xd4, 0x68, 0x9e,
|
0x01,
|
||||||
0x2b, 0x16, 0xbe, 0x58, 0x7d, 0x47, 0xa1, 0xfc, 0x8f, 0xf8, 0xb8, 0xd1, 0x7a, 0xd0, 0x31, 0xce,
|
0x81,
|
||||||
0x45, 0xcb, 0x3a, 0x8f, 0x95, 0x16, 0x04, 0x28, 0xaf, 0xd7, 0xfb, 0xca, 0xbb, 0x4b, 0x40, 0x7e
|
0x2c,
|
||||||
|
0xf7,
|
||||||
|
0x21,
|
||||||
|
0xad,
|
||||||
|
0x1c,
|
||||||
|
0xde,
|
||||||
|
0xd4,
|
||||||
|
0x6d,
|
||||||
|
0xe9,
|
||||||
|
0x83,
|
||||||
|
0x90,
|
||||||
|
0x97,
|
||||||
|
0xdb,
|
||||||
|
0x72,
|
||||||
|
0x40,
|
||||||
|
0xa4,
|
||||||
|
0xa4,
|
||||||
|
0xb7,
|
||||||
|
0xb3,
|
||||||
|
0x67,
|
||||||
|
0x1f,
|
||||||
|
0xcb,
|
||||||
|
0x79,
|
||||||
|
0xe6,
|
||||||
|
0x4e,
|
||||||
|
0xcc,
|
||||||
|
0xc0,
|
||||||
|
0xe5,
|
||||||
|
0x78,
|
||||||
|
0x82,
|
||||||
|
0x5a,
|
||||||
|
0xd0,
|
||||||
|
0x7d,
|
||||||
|
0xcc,
|
||||||
|
0xff,
|
||||||
|
0x72,
|
||||||
|
0x21,
|
||||||
|
0xb8,
|
||||||
|
0x08,
|
||||||
|
0x46,
|
||||||
|
0x74,
|
||||||
|
0xf7,
|
||||||
|
0x43,
|
||||||
|
0x24,
|
||||||
|
0x8e,
|
||||||
|
0xe0,
|
||||||
|
0x35,
|
||||||
|
0x90,
|
||||||
|
0xe6,
|
||||||
|
0x81,
|
||||||
|
0x3a,
|
||||||
|
0x26,
|
||||||
|
0x4c,
|
||||||
|
0x3c,
|
||||||
|
0x28,
|
||||||
|
0x52,
|
||||||
|
0xbb,
|
||||||
|
0x91,
|
||||||
|
0xc3,
|
||||||
|
0x00,
|
||||||
|
0xcb,
|
||||||
|
0x88,
|
||||||
|
0xd0,
|
||||||
|
0x65,
|
||||||
|
0x8b,
|
||||||
|
0x1b,
|
||||||
|
0x53,
|
||||||
|
0x2e,
|
||||||
|
0xa3,
|
||||||
|
0x71,
|
||||||
|
0x64,
|
||||||
|
0x48,
|
||||||
|
0x97,
|
||||||
|
0xa2,
|
||||||
|
0x0d,
|
||||||
|
0xf9,
|
||||||
|
0x4e,
|
||||||
|
0x38,
|
||||||
|
0x19,
|
||||||
|
0xef,
|
||||||
|
0x46,
|
||||||
|
0xa9,
|
||||||
|
0xde,
|
||||||
|
0xac,
|
||||||
|
0xd8,
|
||||||
|
0xa8,
|
||||||
|
0xfa,
|
||||||
|
0x76,
|
||||||
|
0x3f,
|
||||||
|
0xe3,
|
||||||
|
0x9c,
|
||||||
|
0x34,
|
||||||
|
0x3f,
|
||||||
|
0xf9,
|
||||||
|
0xdc,
|
||||||
|
0xbb,
|
||||||
|
0xc7,
|
||||||
|
0xc7,
|
||||||
|
0x0b,
|
||||||
|
0x4f,
|
||||||
|
0x1d,
|
||||||
|
0x8a,
|
||||||
|
0x51,
|
||||||
|
0xe0,
|
||||||
|
0x4b,
|
||||||
|
0xcd,
|
||||||
|
0xb4,
|
||||||
|
0x59,
|
||||||
|
0x31,
|
||||||
|
0xc8,
|
||||||
|
0x9f,
|
||||||
|
0x7e,
|
||||||
|
0xc9,
|
||||||
|
0xd9,
|
||||||
|
0x78,
|
||||||
|
0x73,
|
||||||
|
0x64,
|
||||||
|
0xea,
|
||||||
|
0xc5,
|
||||||
|
0xac,
|
||||||
|
0x83,
|
||||||
|
0x34,
|
||||||
|
0xd3,
|
||||||
|
0xeb,
|
||||||
|
0xc3,
|
||||||
|
0xc5,
|
||||||
|
0x81,
|
||||||
|
0xa0,
|
||||||
|
0xff,
|
||||||
|
0xfa,
|
||||||
|
0x13,
|
||||||
|
0x63,
|
||||||
|
0xeb,
|
||||||
|
0x17,
|
||||||
|
0x0d,
|
||||||
|
0xdd,
|
||||||
|
0x51,
|
||||||
|
0xb7,
|
||||||
|
0xf0,
|
||||||
|
0xda,
|
||||||
|
0x49,
|
||||||
|
0xd3,
|
||||||
|
0x16,
|
||||||
|
0x55,
|
||||||
|
0x26,
|
||||||
|
0x29,
|
||||||
|
0xd4,
|
||||||
|
0x68,
|
||||||
|
0x9e,
|
||||||
|
0x2b,
|
||||||
|
0x16,
|
||||||
|
0xbe,
|
||||||
|
0x58,
|
||||||
|
0x7d,
|
||||||
|
0x47,
|
||||||
|
0xa1,
|
||||||
|
0xfc,
|
||||||
|
0x8f,
|
||||||
|
0xf8,
|
||||||
|
0xb8,
|
||||||
|
0xd1,
|
||||||
|
0x7a,
|
||||||
|
0xd0,
|
||||||
|
0x31,
|
||||||
|
0xce,
|
||||||
|
0x45,
|
||||||
|
0xcb,
|
||||||
|
0x3a,
|
||||||
|
0x8f,
|
||||||
|
0x95,
|
||||||
|
0x16,
|
||||||
|
0x04,
|
||||||
|
0x28,
|
||||||
|
0xaf,
|
||||||
|
0xd7,
|
||||||
|
0xfb,
|
||||||
|
0xca,
|
||||||
|
0xbb,
|
||||||
|
0x4b,
|
||||||
|
0x40,
|
||||||
|
0x7e
|
||||||
];
|
];
|
||||||
|
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
@ -551,6 +731,6 @@ namespace Ryujinx.Common
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,10 +7,10 @@ namespace Ryujinx.Common
|
|||||||
public static T AlignUp<T>(T value, T size) where T : IBinaryInteger<T>
|
public static T AlignUp<T>(T value, T size) where T : IBinaryInteger<T>
|
||||||
=> (value + (size - T.One)) & -size;
|
=> (value + (size - T.One)) & -size;
|
||||||
|
|
||||||
public static T AlignDown<T>(T value, T size) where T : IBinaryInteger<T>
|
public static T AlignDown<T>(T value, T size) where T : IBinaryInteger<T>
|
||||||
=> value & -size;
|
=> value & -size;
|
||||||
|
|
||||||
public static T DivRoundUp<T>(T value, T dividend) where T : IBinaryInteger<T>
|
public static T DivRoundUp<T>(T value, T dividend) where T : IBinaryInteger<T>
|
||||||
=> (value + (dividend - T.One)) / dividend;
|
=> (value + (dividend - T.One)) / dividend;
|
||||||
|
|
||||||
public static int Pow2RoundDown(int value) => BitOperations.IsPow2(value) ? value : Pow2RoundUp(value) >> 1;
|
public static int Pow2RoundDown(int value) => BitOperations.IsPow2(value) ? value : Pow2RoundUp(value) >> 1;
|
||||||
|
@ -72,7 +72,7 @@ namespace Ryujinx.Graphics.Nvdec.FFmpeg.H264
|
|||||||
Flush();
|
Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
public readonly Span<byte> AsSpan()
|
public readonly Span<byte> AsSpan()
|
||||||
=> new Span<byte>(workBuffer)[.._offset];
|
=> new Span<byte>(workBuffer)[.._offset];
|
||||||
|
|
||||||
public void WriteU(uint value, int valueSize) => WriteBits((int)value, valueSize);
|
public void WriteU(uint value, int valueSize) => WriteBits((int)value, valueSize);
|
||||||
|
@ -114,7 +114,7 @@ namespace Ryujinx.Graphics.Texture
|
|||||||
_height == other._height &&
|
_height == other._height &&
|
||||||
_stride == other._stride &&
|
_stride == other._stride &&
|
||||||
_bytesPerPixel == other._bytesPerPixel;
|
_bytesPerPixel == other._bytesPerPixel;
|
||||||
|
|
||||||
|
|
||||||
return !other._isLinear && _layoutConverter.LayoutMatches(other._layoutConverter);
|
return !other._isLinear && _layoutConverter.LayoutMatches(other._layoutConverter);
|
||||||
}
|
}
|
||||||
|
@ -589,12 +589,12 @@ namespace Ryujinx.HLE.FileSystem
|
|||||||
// So, we check it early for a better user experience.
|
// So, we check it early for a better user experience.
|
||||||
if (_virtualFileSystem.KeySet.HeaderKey.IsZeros())
|
if (_virtualFileSystem.KeySet.HeaderKey.IsZeros())
|
||||||
throw new MissingKeyException("HeaderKey is empty. Cannot decrypt NCA headers.");
|
throw new MissingKeyException("HeaderKey is empty. Cannot decrypt NCA headers.");
|
||||||
|
|
||||||
Dictionary<ulong, List<(NcaContentType type, string path)>> updateNcas = new();
|
Dictionary<ulong, List<(NcaContentType type, string path)>> updateNcas = new();
|
||||||
|
|
||||||
if (Directory.Exists(firmwarePackage))
|
if (Directory.Exists(firmwarePackage))
|
||||||
return VerifyAndGetVersionDirectory(firmwarePackage);
|
return VerifyAndGetVersionDirectory(firmwarePackage);
|
||||||
|
|
||||||
if (!File.Exists(firmwarePackage))
|
if (!File.Exists(firmwarePackage))
|
||||||
throw new FileNotFoundException("Firmware file does not exist.");
|
throw new FileNotFoundException("Firmware file does not exist.");
|
||||||
|
|
||||||
@ -620,7 +620,7 @@ namespace Ryujinx.HLE.FileSystem
|
|||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
SystemVersion VerifyAndGetVersionDirectory(string firmwareDirectory)
|
SystemVersion VerifyAndGetVersionDirectory(string firmwareDirectory)
|
||||||
=> VerifyAndGetVersion(new LocalFileSystem(firmwareDirectory));
|
=> VerifyAndGetVersion(new LocalFileSystem(firmwareDirectory));
|
||||||
|
|
||||||
SystemVersion VerifyAndGetVersionZip(ZipArchive archive)
|
SystemVersion VerifyAndGetVersionZip(ZipArchive archive)
|
||||||
|
@ -18,7 +18,7 @@ namespace Ryujinx.Headless.SDL2
|
|||||||
public bool TextProcessingEnabled
|
public bool TextProcessingEnabled
|
||||||
{
|
{
|
||||||
get => Volatile.Read(ref _canProcessInput);
|
get => Volatile.Read(ref _canProcessInput);
|
||||||
|
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
Volatile.Write(ref _canProcessInput, value);
|
Volatile.Write(ref _canProcessInput, value);
|
||||||
|
@ -147,7 +147,8 @@ namespace Ryujinx.Input.SDL2
|
|||||||
|
|
||||||
public void Rumble(float lowFrequency, float highFrequency, uint durationMs)
|
public void Rumble(float lowFrequency, float highFrequency, uint durationMs)
|
||||||
{
|
{
|
||||||
if (!Features.HasFlag(GamepadFeaturesFlag.Rumble)) return;
|
if (!Features.HasFlag(GamepadFeaturesFlag.Rumble))
|
||||||
|
return;
|
||||||
|
|
||||||
ushort lowFrequencyRaw = (ushort)(lowFrequency * ushort.MaxValue);
|
ushort lowFrequencyRaw = (ushort)(lowFrequency * ushort.MaxValue);
|
||||||
ushort highFrequencyRaw = (ushort)(highFrequency * ushort.MaxValue);
|
ushort highFrequencyRaw = (ushort)(highFrequency * ushort.MaxValue);
|
||||||
@ -265,7 +266,8 @@ namespace Ryujinx.Input.SDL2
|
|||||||
// ReSharper disable once ForeachCanBePartlyConvertedToQueryUsingAnotherGetEnumerator
|
// ReSharper disable once ForeachCanBePartlyConvertedToQueryUsingAnotherGetEnumerator
|
||||||
foreach (ButtonMappingEntry entry in _buttonsUserMapping)
|
foreach (ButtonMappingEntry entry in _buttonsUserMapping)
|
||||||
{
|
{
|
||||||
if (!entry.IsValid) continue;
|
if (!entry.IsValid)
|
||||||
|
continue;
|
||||||
|
|
||||||
// Do not touch state of button already pressed
|
// Do not touch state of button already pressed
|
||||||
if (!result.IsPressed(entry.To))
|
if (!result.IsPressed(entry.To))
|
||||||
|
@ -14,8 +14,8 @@ namespace Ryujinx.UI.Common
|
|||||||
public static class DiscordIntegrationModule
|
public static class DiscordIntegrationModule
|
||||||
{
|
{
|
||||||
public static Timestamps StartedAt { get; set; }
|
public static Timestamps StartedAt { get; set; }
|
||||||
|
|
||||||
private static readonly string _description = ReleaseInformation.IsValid
|
private static readonly string _description = ReleaseInformation.IsValid
|
||||||
? $"v{ReleaseInformation.Version} {ReleaseInformation.ReleaseChannelOwner}/{ReleaseInformation.ReleaseChannelRepo}@{ReleaseInformation.BuildGitHash}"
|
? $"v{ReleaseInformation.Version} {ReleaseInformation.ReleaseChannelOwner}/{ReleaseInformation.ReleaseChannelRepo}@{ReleaseInformation.BuildGitHash}"
|
||||||
: "dev build";
|
: "dev build";
|
||||||
|
|
||||||
@ -80,7 +80,7 @@ namespace Ryujinx.UI.Common
|
|||||||
},
|
},
|
||||||
Details = TruncateToByteLength($"Playing {appMeta.Title}"),
|
Details = TruncateToByteLength($"Playing {appMeta.Title}"),
|
||||||
State = appMeta.LastPlayed.HasValue && appMeta.TimePlayed.TotalSeconds > 5
|
State = appMeta.LastPlayed.HasValue && appMeta.TimePlayed.TotalSeconds > 5
|
||||||
? $"Total play time: {appMeta.TimePlayed.Humanize(2, false)}"
|
? $"Total play time: {appMeta.TimePlayed.Humanize(2, false)}"
|
||||||
: "Never played",
|
: "Never played",
|
||||||
Timestamps = Timestamps.Now
|
Timestamps = Timestamps.Now
|
||||||
});
|
});
|
||||||
@ -120,7 +120,7 @@ namespace Ryujinx.UI.Common
|
|||||||
_discordClient?.Dispose();
|
_discordClient?.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static readonly string[] _discordGameAssetKeys =
|
private static readonly string[] _discordGameAssetKeys =
|
||||||
[
|
[
|
||||||
"01002da013484000", // The Legend of Zelda: Skyward Sword HD
|
"01002da013484000", // The Legend of Zelda: Skyward Sword HD
|
||||||
"01007ef00011e000", // The Legend of Zelda: Breath of the Wild
|
"01007ef00011e000", // The Legend of Zelda: Breath of the Wild
|
||||||
|
@ -98,7 +98,6 @@ namespace Ryujinx.UI.Common.Helper
|
|||||||
if (baseApplicationExtension is not (".nro" or ".nso"))
|
if (baseApplicationExtension is not (".nro" or ".nso"))
|
||||||
return IsFirmwareValid(contentManager, out error);
|
return IsFirmwareValid(contentManager, out error);
|
||||||
|
|
||||||
error = UserError.Success;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
error = UserError.ApplicationNotFound;
|
error = UserError.ApplicationNotFound;
|
||||||
|
@ -9,7 +9,7 @@ namespace Ryujinx.UI.Common.Helper
|
|||||||
{
|
{
|
||||||
if (activeProcess == null)
|
if (activeProcess == null)
|
||||||
return string.Empty;
|
return string.Empty;
|
||||||
|
|
||||||
string titleNameSection = string.IsNullOrWhiteSpace(activeProcess.Name) ? string.Empty : $" {activeProcess.Name}";
|
string titleNameSection = string.IsNullOrWhiteSpace(activeProcess.Name) ? string.Empty : $" {activeProcess.Name}";
|
||||||
string titleVersionSection = string.IsNullOrWhiteSpace(activeProcess.DisplayVersion) ? string.Empty : $" v{activeProcess.DisplayVersion}";
|
string titleVersionSection = string.IsNullOrWhiteSpace(activeProcess.DisplayVersion) ? string.Empty : $" v{activeProcess.DisplayVersion}";
|
||||||
string titleIdSection = $" ({activeProcess.ProgramIdText.ToUpper()})";
|
string titleIdSection = $" ({activeProcess.ProgramIdText.ToUpper()})";
|
||||||
|
@ -87,7 +87,8 @@ namespace Ryujinx.UI.Common.Helper
|
|||||||
|
|
||||||
foreach (string path in titleUpdateMetadata.Paths)
|
foreach (string path in titleUpdateMetadata.Paths)
|
||||||
{
|
{
|
||||||
if (!File.Exists(path)) continue;
|
if (!File.Exists(path))
|
||||||
|
continue;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -104,7 +105,7 @@ namespace Ryujinx.UI.Common.Helper
|
|||||||
|
|
||||||
if (controlNca is null || patchNca is null)
|
if (controlNca is null || patchNca is null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
ApplicationControlProperty controlData = new();
|
ApplicationControlProperty controlData = new();
|
||||||
|
|
||||||
using UniqueRef<IFile> nacpFile = new();
|
using UniqueRef<IFile> nacpFile = new();
|
||||||
@ -144,7 +145,7 @@ namespace Ryujinx.UI.Common.Helper
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string PathToGameUpdatesJson(ulong applicationIdBase)
|
private static string PathToGameUpdatesJson(ulong applicationIdBase)
|
||||||
=> Path.Combine(AppDataManager.GamesDirPath, applicationIdBase.ToString("x16"), "updates.json");
|
=> Path.Combine(AppDataManager.GamesDirPath, applicationIdBase.ToString("x16"), "updates.json");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,10 +34,10 @@ namespace Ryujinx.UI.Common.SystemInfo
|
|||||||
{
|
{
|
||||||
if (OperatingSystem.IsWindows())
|
if (OperatingSystem.IsWindows())
|
||||||
return new WindowsSystemInfo();
|
return new WindowsSystemInfo();
|
||||||
|
|
||||||
if (OperatingSystem.IsLinux())
|
if (OperatingSystem.IsLinux())
|
||||||
return new LinuxSystemInfo();
|
return new LinuxSystemInfo();
|
||||||
|
|
||||||
if (OperatingSystem.IsMacOS())
|
if (OperatingSystem.IsMacOS())
|
||||||
return new MacOSSystemInfo();
|
return new MacOSSystemInfo();
|
||||||
|
|
||||||
|
@ -22,8 +22,8 @@ namespace Ryujinx.Ava
|
|||||||
public class App : Application
|
public class App : Application
|
||||||
{
|
{
|
||||||
internal static string FormatTitle(LocaleKeys? windowTitleKey = null)
|
internal static string FormatTitle(LocaleKeys? windowTitleKey = null)
|
||||||
=> windowTitleKey is null
|
=> windowTitleKey is null
|
||||||
? $"Ryujinx {Program.Version}"
|
? $"Ryujinx {Program.Version}"
|
||||||
: $"Ryujinx {Program.Version} - {LocaleManager.Instance[windowTitleKey.Value]}";
|
: $"Ryujinx {Program.Version} - {LocaleManager.Instance[windowTitleKey.Value]}";
|
||||||
|
|
||||||
public static MainWindow MainWindow => Current!
|
public static MainWindow MainWindow => Current!
|
||||||
|
@ -21,7 +21,8 @@ namespace Ryujinx.Ava.Common.Locale
|
|||||||
new CompiledBindingPathBuilder()
|
new CompiledBindingPathBuilder()
|
||||||
.Property(PropertyInfo, PropertyInfoAccessorFactory.CreateInpcPropertyAccessor)
|
.Property(PropertyInfo, PropertyInfoAccessorFactory.CreateInpcPropertyAccessor)
|
||||||
.Build()
|
.Build()
|
||||||
) { Source = LocaleManager.Instance }
|
)
|
||||||
|
{ Source = LocaleManager.Instance }
|
||||||
.ProvideValue(serviceProvider);
|
.ProvideValue(serviceProvider);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -80,8 +80,8 @@ namespace Ryujinx.Ava.Common.Locale
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If the locale doesn't contain the key return the default one.
|
// If the locale doesn't contain the key return the default one.
|
||||||
return _localeDefaultStrings.TryGetValue(key, out string defaultValue)
|
return _localeDefaultStrings.TryGetValue(key, out string defaultValue)
|
||||||
? defaultValue
|
? defaultValue
|
||||||
: key.ToString(); // If the locale text doesn't exist return the key.
|
: key.ToString(); // If the locale text doesn't exist return the key.
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
|
@ -136,7 +136,7 @@ namespace Ryujinx.Ava.UI.Applet
|
|||||||
_hiddenTextBox.CaretIndex = cursorBegin;
|
_hiddenTextBox.CaretIndex = cursorBegin;
|
||||||
});
|
});
|
||||||
|
|
||||||
public void SetText(string text, int cursorBegin, int cursorEnd) =>
|
public void SetText(string text, int cursorBegin, int cursorEnd) =>
|
||||||
Dispatcher.UIThread.Post(() =>
|
Dispatcher.UIThread.Post(() =>
|
||||||
{
|
{
|
||||||
_hiddenTextBox.Text = text;
|
_hiddenTextBox.Text = text;
|
||||||
|
@ -224,7 +224,7 @@ namespace Ryujinx.Ava.UI.Controls
|
|||||||
{
|
{
|
||||||
if (sender is not MenuItem { DataContext: MainWindowViewModel { SelectedApplication: not null } viewModel })
|
if (sender is not MenuItem { DataContext: MainWindowViewModel { SelectedApplication: not null } viewModel })
|
||||||
return;
|
return;
|
||||||
|
|
||||||
string ptcDir = Path.Combine(AppDataManager.GamesDirPath, viewModel.SelectedApplication.IdString, "cache", "cpu");
|
string ptcDir = Path.Combine(AppDataManager.GamesDirPath, viewModel.SelectedApplication.IdString, "cache", "cpu");
|
||||||
string mainDir = Path.Combine(ptcDir, "0");
|
string mainDir = Path.Combine(ptcDir, "0");
|
||||||
string backupDir = Path.Combine(ptcDir, "1");
|
string backupDir = Path.Combine(ptcDir, "1");
|
||||||
|
@ -199,7 +199,7 @@ namespace Ryujinx.Ava.UI.Helpers
|
|||||||
string secondaryText,
|
string secondaryText,
|
||||||
string acceptButton,
|
string acceptButton,
|
||||||
string closeButton,
|
string closeButton,
|
||||||
string title)
|
string title)
|
||||||
=> ShowTextDialog(
|
=> ShowTextDialog(
|
||||||
title,
|
title,
|
||||||
primary,
|
primary,
|
||||||
@ -215,7 +215,7 @@ namespace Ryujinx.Ava.UI.Helpers
|
|||||||
string acceptButtonText,
|
string acceptButtonText,
|
||||||
string cancelButtonText,
|
string cancelButtonText,
|
||||||
string title,
|
string title,
|
||||||
UserResult primaryButtonResult = UserResult.Yes)
|
UserResult primaryButtonResult = UserResult.Yes)
|
||||||
=> await ShowTextDialog(
|
=> await ShowTextDialog(
|
||||||
string.IsNullOrWhiteSpace(title) ? LocaleManager.Instance[LocaleKeys.DialogConfirmationTitle] : title,
|
string.IsNullOrWhiteSpace(title) ? LocaleManager.Instance[LocaleKeys.DialogConfirmationTitle] : title,
|
||||||
primaryText,
|
primaryText,
|
||||||
@ -226,7 +226,7 @@ namespace Ryujinx.Ava.UI.Helpers
|
|||||||
(int)Symbol.Help,
|
(int)Symbol.Help,
|
||||||
primaryButtonResult);
|
primaryButtonResult);
|
||||||
|
|
||||||
internal static async Task<UserResult> CreateLocalizedConfirmationDialog(string primaryText, string secondaryText)
|
internal static async Task<UserResult> CreateLocalizedConfirmationDialog(string primaryText, string secondaryText)
|
||||||
=> await CreateConfirmationDialog(
|
=> await CreateConfirmationDialog(
|
||||||
primaryText,
|
primaryText,
|
||||||
secondaryText,
|
secondaryText,
|
||||||
@ -234,7 +234,7 @@ namespace Ryujinx.Ava.UI.Helpers
|
|||||||
LocaleManager.Instance[LocaleKeys.InputDialogNo],
|
LocaleManager.Instance[LocaleKeys.InputDialogNo],
|
||||||
LocaleManager.Instance[LocaleKeys.RyujinxConfirm]);
|
LocaleManager.Instance[LocaleKeys.RyujinxConfirm]);
|
||||||
|
|
||||||
internal static async Task CreateUpdaterInfoDialog(string primary, string secondaryText)
|
internal static async Task CreateUpdaterInfoDialog(string primary, string secondaryText)
|
||||||
=> await ShowTextDialog(
|
=> await ShowTextDialog(
|
||||||
LocaleManager.Instance[LocaleKeys.DialogUpdaterTitle],
|
LocaleManager.Instance[LocaleKeys.DialogUpdaterTitle],
|
||||||
primary,
|
primary,
|
||||||
@ -244,7 +244,7 @@ namespace Ryujinx.Ava.UI.Helpers
|
|||||||
LocaleManager.Instance[LocaleKeys.InputDialogOk],
|
LocaleManager.Instance[LocaleKeys.InputDialogOk],
|
||||||
(int)Symbol.Important);
|
(int)Symbol.Important);
|
||||||
|
|
||||||
internal static async Task CreateWarningDialog(string primary, string secondaryText)
|
internal static async Task CreateWarningDialog(string primary, string secondaryText)
|
||||||
=> await ShowTextDialog(
|
=> await ShowTextDialog(
|
||||||
LocaleManager.Instance[LocaleKeys.DialogWarningTitle],
|
LocaleManager.Instance[LocaleKeys.DialogWarningTitle],
|
||||||
primary,
|
primary,
|
||||||
|
@ -39,8 +39,8 @@ namespace Ryujinx.Ava.UI.Helpers
|
|||||||
|
|
||||||
await ContentDialogHelper.CreateInfoDialog(
|
await ContentDialogHelper.CreateInfoDialog(
|
||||||
LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.DialogUserErrorDialogMessage, errorCode, GetErrorTitle(error)),
|
LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.DialogUserErrorDialogMessage, errorCode, GetErrorTitle(error)),
|
||||||
GetErrorDescription(error),
|
GetErrorDescription(error),
|
||||||
"",
|
"",
|
||||||
LocaleManager.Instance[LocaleKeys.InputDialogOk],
|
LocaleManager.Instance[LocaleKeys.InputDialogOk],
|
||||||
LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.DialogUserErrorDialogTitle, errorCode));
|
LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.DialogUserErrorDialogTitle, errorCode));
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
|
|||||||
|
|
||||||
private PlayerIndex _playerId;
|
private PlayerIndex _playerId;
|
||||||
private int _controller;
|
private int _controller;
|
||||||
private int _controllerNumber;
|
private readonly int _controllerNumber;
|
||||||
private string _controllerImage;
|
private string _controllerImage;
|
||||||
private int _device;
|
private int _device;
|
||||||
private object _configViewModel;
|
private object _configViewModel;
|
||||||
|
@ -913,7 +913,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
|
|
||||||
public KeyGesture PauseKey
|
public KeyGesture PauseKey
|
||||||
{
|
{
|
||||||
get => KeyGesture.Parse(_pauseKey);
|
get => KeyGesture.Parse(_pauseKey);
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
_pauseKey = value.ToString();
|
_pauseKey = value.ToString();
|
||||||
|
@ -143,14 +143,14 @@ namespace Ryujinx.Ava.UI.Views.Main
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async void OpenAmiiboWindow(object sender, RoutedEventArgs e)
|
public async void OpenAmiiboWindow(object sender, RoutedEventArgs e)
|
||||||
=> await ViewModel.OpenAmiiboWindow();
|
=> await ViewModel.OpenAmiiboWindow();
|
||||||
|
|
||||||
public async void OpenCheatManagerForCurrentApp(object sender, RoutedEventArgs e)
|
public async void OpenCheatManagerForCurrentApp(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (!ViewModel.IsGameRunning)
|
if (!ViewModel.IsGameRunning)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
string name = ViewModel.AppHost.Device.Processes.ActiveApplication.ApplicationControlProperties.Title[(int)ViewModel.AppHost.Device.System.State.DesiredTitleLanguage].NameString.ToString();
|
string name = ViewModel.AppHost.Device.Processes.ActiveApplication.ApplicationControlProperties.Title[(int)ViewModel.AppHost.Device.System.State.DesiredTitleLanguage].NameString.ToString();
|
||||||
|
|
||||||
await new CheatWindow(
|
await new CheatWindow(
|
||||||
@ -186,7 +186,8 @@ namespace Ryujinx.Ava.UI.Views.Main
|
|||||||
|
|
||||||
private async void ChangeWindowSize_Click(object sender, RoutedEventArgs e)
|
private async void ChangeWindowSize_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (sender is not MenuItem { Tag: string resolution }) return;
|
if (sender is not MenuItem { Tag: string resolution })
|
||||||
|
return;
|
||||||
|
|
||||||
(int height, int width) = resolution.Split(' ')
|
(int height, int width) = resolution.Split(' ')
|
||||||
.Into(parts => (int.Parse(parts[0]), int.Parse(parts[1])));
|
.Into(parts => (int.Parse(parts[0]), int.Parse(parts[1])));
|
||||||
|
@ -83,7 +83,7 @@ namespace Ryujinx.Ava.UI.Windows
|
|||||||
|
|
||||||
TitleBar.ExtendsContentIntoTitleBar = true;
|
TitleBar.ExtendsContentIntoTitleBar = true;
|
||||||
TitleBar.TitleBarHitTestType = TitleBarHitTestType.Complex;
|
TitleBar.TitleBarHitTestType = TitleBarHitTestType.Complex;
|
||||||
|
|
||||||
|
|
||||||
// NOTE: Height of MenuBar and StatusBar is not usable here, since it would still be 0 at this point.
|
// NOTE: Height of MenuBar and StatusBar is not usable here, since it would still be 0 at this point.
|
||||||
StatusBarHeight = StatusBarView.StatusBar.MinHeight;
|
StatusBarHeight = StatusBarView.StatusBar.MinHeight;
|
||||||
@ -665,8 +665,9 @@ namespace Ryujinx.Ava.UI.Windows
|
|||||||
? string.Format(LocaleManager.Instance[LocaleKeys.AutoloadUpdateAddedMessage], numUpdatesAdded)
|
? string.Format(LocaleManager.Instance[LocaleKeys.AutoloadUpdateAddedMessage], numUpdatesAdded)
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
if (msg is null) return;
|
if (msg is null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
|
||||||
Dispatcher.UIThread.InvokeAsync(async () =>
|
Dispatcher.UIThread.InvokeAsync(async () =>
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user