Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
266338a7c9 | ||
|
90156eea4c | ||
|
071c01c235 | ||
|
de06ffb0f7 |
@@ -1,45 +0,0 @@
|
|||||||
using Ryujinx.Ui.App.Common;
|
|
||||||
using System.Collections;
|
|
||||||
|
|
||||||
namespace Ryujinx.Ava.Ui.Models
|
|
||||||
{
|
|
||||||
internal class FileSizeSortComparer : IComparer
|
|
||||||
{
|
|
||||||
public int Compare(object x, object y)
|
|
||||||
{
|
|
||||||
string aValue = (x as ApplicationData).TimePlayed;
|
|
||||||
string bValue = (y as ApplicationData).TimePlayed;
|
|
||||||
|
|
||||||
if (aValue[^3..] == "GiB")
|
|
||||||
{
|
|
||||||
aValue = (float.Parse(aValue[0..^3]) * 1024).ToString();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
aValue = aValue[0..^3];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (bValue[^3..] == "GiB")
|
|
||||||
{
|
|
||||||
bValue = (float.Parse(bValue[0..^3]) * 1024).ToString();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
bValue = bValue[0..^3];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (float.Parse(aValue) > float.Parse(bValue))
|
|
||||||
{
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
else if (float.Parse(bValue) > float.Parse(aValue))
|
|
||||||
{
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,50 +0,0 @@
|
|||||||
using Ryujinx.Ui.App.Common;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace Ryujinx.Ava.Ui.Models.Generic
|
|
||||||
{
|
|
||||||
internal class FileSizeSortComparer : IComparer<ApplicationData>
|
|
||||||
{
|
|
||||||
public FileSizeSortComparer() { }
|
|
||||||
public FileSizeSortComparer(bool isAscending) { _order = isAscending ? 1 : -1; }
|
|
||||||
|
|
||||||
private int _order;
|
|
||||||
|
|
||||||
public int Compare(ApplicationData x, ApplicationData y)
|
|
||||||
{
|
|
||||||
string aValue = x.FileSize;
|
|
||||||
string bValue = y.FileSize;
|
|
||||||
|
|
||||||
if (aValue[^3..] == "GiB")
|
|
||||||
{
|
|
||||||
aValue = (float.Parse(aValue[0..^3]) * 1024).ToString();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
aValue = aValue[0..^3];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (bValue[^3..] == "GiB")
|
|
||||||
{
|
|
||||||
bValue = (float.Parse(bValue[0..^3]) * 1024).ToString();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
bValue = bValue[0..^3];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (float.Parse(aValue) > float.Parse(bValue))
|
|
||||||
{
|
|
||||||
return -1 * _order;
|
|
||||||
}
|
|
||||||
else if (float.Parse(bValue) > float.Parse(aValue))
|
|
||||||
{
|
|
||||||
return 1 * _order;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,66 +0,0 @@
|
|||||||
using Ryujinx.Ui.App.Common;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace Ryujinx.Ava.Ui.Models.Generic
|
|
||||||
{
|
|
||||||
internal class TimePlayedSortComparer : IComparer<ApplicationData>
|
|
||||||
{
|
|
||||||
public TimePlayedSortComparer() { }
|
|
||||||
public TimePlayedSortComparer(bool isAscending) { _order = isAscending ? 1 : -1; }
|
|
||||||
|
|
||||||
private int _order;
|
|
||||||
|
|
||||||
public int Compare(ApplicationData x, ApplicationData y)
|
|
||||||
{
|
|
||||||
string aValue = x.TimePlayed;
|
|
||||||
string bValue = y.TimePlayed;
|
|
||||||
|
|
||||||
if (aValue.Length > 4 && aValue[^4..] == "mins")
|
|
||||||
{
|
|
||||||
aValue = (float.Parse(aValue[0..^5]) * 60).ToString();
|
|
||||||
}
|
|
||||||
else if (aValue.Length > 3 && aValue[^3..] == "hrs")
|
|
||||||
{
|
|
||||||
aValue = (float.Parse(aValue[0..^4]) * 3600).ToString();
|
|
||||||
}
|
|
||||||
else if (aValue.Length > 4 && aValue[^4..] == "days")
|
|
||||||
{
|
|
||||||
aValue = (float.Parse(aValue[0..^5]) * 86400).ToString();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
aValue = aValue[0..^1];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (bValue.Length > 4 && bValue[^4..] == "mins")
|
|
||||||
{
|
|
||||||
bValue = (float.Parse(bValue[0..^5]) * 60).ToString();
|
|
||||||
}
|
|
||||||
else if (bValue.Length > 3 && bValue[^3..] == "hrs")
|
|
||||||
{
|
|
||||||
bValue = (float.Parse(bValue[0..^4]) * 3600).ToString();
|
|
||||||
}
|
|
||||||
else if (bValue.Length > 4 && bValue[^4..] == "days")
|
|
||||||
{
|
|
||||||
bValue = (float.Parse(bValue[0..^5]) * 86400).ToString();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
bValue = bValue[0..^1];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (float.Parse(aValue) > float.Parse(bValue))
|
|
||||||
{
|
|
||||||
return -1 * _order;
|
|
||||||
}
|
|
||||||
else if (float.Parse(bValue) > float.Parse(aValue))
|
|
||||||
{
|
|
||||||
return 1 * _order;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,27 +0,0 @@
|
|||||||
using Ryujinx.Ui.App.Common;
|
|
||||||
using System;
|
|
||||||
using System.Collections;
|
|
||||||
|
|
||||||
namespace Ryujinx.Ava.Ui.Models
|
|
||||||
{
|
|
||||||
internal class LastPlayedSortComparer : IComparer
|
|
||||||
{
|
|
||||||
public int Compare(object x, object y)
|
|
||||||
{
|
|
||||||
string aValue = (x as ApplicationData).LastPlayed;
|
|
||||||
string bValue = (y as ApplicationData).LastPlayed;
|
|
||||||
|
|
||||||
if (aValue == "Never")
|
|
||||||
{
|
|
||||||
aValue = DateTime.UnixEpoch.ToString();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (bValue == "Never")
|
|
||||||
{
|
|
||||||
bValue = DateTime.UnixEpoch.ToString();
|
|
||||||
}
|
|
||||||
|
|
||||||
return DateTime.Compare(DateTime.Parse(bValue), DateTime.Parse(aValue));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,61 +0,0 @@
|
|||||||
using Ryujinx.Ui.App.Common;
|
|
||||||
using System.Collections;
|
|
||||||
|
|
||||||
namespace Ryujinx.Ava.Ui.Models
|
|
||||||
{
|
|
||||||
internal class TimePlayedSortComparer : IComparer
|
|
||||||
{
|
|
||||||
public int Compare(object x, object y)
|
|
||||||
{
|
|
||||||
string aValue = (x as ApplicationData).TimePlayed;
|
|
||||||
string bValue = (y as ApplicationData).TimePlayed;
|
|
||||||
|
|
||||||
if (aValue.Length > 4 && aValue[^4..] == "mins")
|
|
||||||
{
|
|
||||||
aValue = (float.Parse(aValue[0..^5]) * 60).ToString();
|
|
||||||
}
|
|
||||||
else if (aValue.Length > 3 && aValue[^3..] == "hrs")
|
|
||||||
{
|
|
||||||
aValue = (float.Parse(aValue[0..^4]) * 3600).ToString();
|
|
||||||
}
|
|
||||||
else if (aValue.Length > 4 && aValue[^4..] == "days")
|
|
||||||
{
|
|
||||||
aValue = (float.Parse(aValue[0..^5]) * 86400).ToString();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
aValue = aValue[0..^1];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (bValue.Length > 4 && bValue[^4..] == "mins")
|
|
||||||
{
|
|
||||||
bValue = (float.Parse(bValue[0..^5]) * 60).ToString();
|
|
||||||
}
|
|
||||||
else if (bValue.Length > 3 && bValue[^3..] == "hrs")
|
|
||||||
{
|
|
||||||
bValue = (float.Parse(bValue[0..^4]) * 3600).ToString();
|
|
||||||
}
|
|
||||||
else if (bValue.Length > 4 && bValue[^4..] == "days")
|
|
||||||
{
|
|
||||||
bValue = (float.Parse(bValue[0..^5]) * 86400).ToString();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
bValue = bValue[0..^1];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (float.Parse(aValue) > float.Parse(bValue))
|
|
||||||
{
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
else if (float.Parse(bValue) > float.Parse(aValue))
|
|
||||||
{
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -502,8 +502,10 @@ namespace Ryujinx.Ava.Ui.ViewModels
|
|||||||
return SortMode switch
|
return SortMode switch
|
||||||
{
|
{
|
||||||
ApplicationSort.LastPlayed => new Models.Generic.LastPlayedSortComparer(IsAscending),
|
ApplicationSort.LastPlayed => new Models.Generic.LastPlayedSortComparer(IsAscending),
|
||||||
ApplicationSort.FileSize => new Models.Generic.FileSizeSortComparer(IsAscending),
|
ApplicationSort.FileSize => IsAscending ? SortExpressionComparer<ApplicationData>.Ascending(app => app.FileSizeBytes)
|
||||||
ApplicationSort.TotalTimePlayed => new Models.Generic.TimePlayedSortComparer(IsAscending),
|
: SortExpressionComparer<ApplicationData>.Descending(app => app.FileSizeBytes),
|
||||||
|
ApplicationSort.TotalTimePlayed => IsAscending ? SortExpressionComparer<ApplicationData>.Ascending(app => app.TimePlayedNum)
|
||||||
|
: SortExpressionComparer<ApplicationData>.Descending(app => app.TimePlayedNum),
|
||||||
ApplicationSort.Title => IsAscending ? SortExpressionComparer<ApplicationData>.Ascending(app => app.TitleName)
|
ApplicationSort.Title => IsAscending ? SortExpressionComparer<ApplicationData>.Ascending(app => app.TitleName)
|
||||||
: SortExpressionComparer<ApplicationData>.Descending(app => app.TitleName),
|
: SortExpressionComparer<ApplicationData>.Descending(app => app.TitleName),
|
||||||
ApplicationSort.Favorite => !IsAscending ? SortExpressionComparer<ApplicationData>.Ascending(app => app.Favorite)
|
ApplicationSort.Favorite => !IsAscending ? SortExpressionComparer<ApplicationData>.Ascending(app => app.Favorite)
|
||||||
|
@@ -22,7 +22,7 @@ namespace Ryujinx.Graphics.Gpu.Shader.DiskCache
|
|||||||
private const ushort FileFormatVersionMajor = 1;
|
private const ushort FileFormatVersionMajor = 1;
|
||||||
private const ushort FileFormatVersionMinor = 2;
|
private const ushort FileFormatVersionMinor = 2;
|
||||||
private const uint FileFormatVersionPacked = ((uint)FileFormatVersionMajor << 16) | FileFormatVersionMinor;
|
private const uint FileFormatVersionPacked = ((uint)FileFormatVersionMajor << 16) | FileFormatVersionMinor;
|
||||||
private const uint CodeGenVersion = 4011;
|
private const uint CodeGenVersion = 4029;
|
||||||
|
|
||||||
private const string SharedTocFileName = "shared.toc";
|
private const string SharedTocFileName = "shared.toc";
|
||||||
private const string SharedDataFileName = "shared.data";
|
private const string SharedDataFileName = "shared.data";
|
||||||
|
@@ -21,10 +21,11 @@ namespace Ryujinx.Graphics.Shader.Translation
|
|||||||
{
|
{
|
||||||
BasicBlock block = blocks[blkIndex];
|
BasicBlock block = blocks[blkIndex];
|
||||||
|
|
||||||
for (LinkedListNode<INode> node = block.Operations.First; node != null; node = node.Next)
|
for (LinkedListNode<INode> node = block.Operations.First; node != null;)
|
||||||
{
|
{
|
||||||
if (node.Value is not Operation operation)
|
if (node.Value is not Operation operation)
|
||||||
{
|
{
|
||||||
|
node = node.Next;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,10 +44,7 @@ namespace Ryujinx.Graphics.Shader.Translation
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (UsesGlobalMemory(operation.Inst))
|
LinkedListNode<INode> nextNode = node.Next;
|
||||||
{
|
|
||||||
node = RewriteGlobalAccess(node, config);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (operation is TextureOperation texOp)
|
if (operation is TextureOperation texOp)
|
||||||
{
|
{
|
||||||
@@ -59,7 +57,15 @@ namespace Ryujinx.Graphics.Shader.Translation
|
|||||||
node = InsertSnormNormalization(node, config);
|
node = InsertSnormNormalization(node, config);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nextNode = node.Next;
|
||||||
}
|
}
|
||||||
|
else if (UsesGlobalMemory(operation.Inst))
|
||||||
|
{
|
||||||
|
nextNode = RewriteGlobalAccess(node, config)?.Next ?? nextNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
node = nextNode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -72,7 +78,7 @@ namespace Ryujinx.Graphics.Shader.Translation
|
|||||||
bool isStg16Or8 = operation.Inst == Instruction.StoreGlobal16 || operation.Inst == Instruction.StoreGlobal8;
|
bool isStg16Or8 = operation.Inst == Instruction.StoreGlobal16 || operation.Inst == Instruction.StoreGlobal8;
|
||||||
bool isWrite = isAtomic || operation.Inst == Instruction.StoreGlobal || isStg16Or8;
|
bool isWrite = isAtomic || operation.Inst == Instruction.StoreGlobal || isStg16Or8;
|
||||||
|
|
||||||
Operation storageOp;
|
Operation storageOp = null;
|
||||||
|
|
||||||
Operand PrependOperation(Instruction inst, params Operand[] sources)
|
Operand PrependOperation(Instruction inst, params Operand[] sources)
|
||||||
{
|
{
|
||||||
@@ -120,6 +126,8 @@ namespace Ryujinx.Graphics.Shader.Translation
|
|||||||
sbSlot = PrependOperation(Instruction.ConditionalSelect, inRange, Const(slot), sbSlot);
|
sbSlot = PrependOperation(Instruction.ConditionalSelect, inRange, Const(slot), sbSlot);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (sbUseMask != 0)
|
||||||
|
{
|
||||||
Operand alignMask = Const(-config.GpuAccessor.QueryHostStorageBufferOffsetAlignment());
|
Operand alignMask = Const(-config.GpuAccessor.QueryHostStorageBufferOffsetAlignment());
|
||||||
|
|
||||||
Operand baseAddrTrunc = PrependOperation(Instruction.BitwiseAnd, sbBaseAddrLow, alignMask);
|
Operand baseAddrTrunc = PrependOperation(Instruction.BitwiseAnd, sbBaseAddrLow, alignMask);
|
||||||
@@ -164,6 +172,11 @@ namespace Ryujinx.Graphics.Shader.Translation
|
|||||||
|
|
||||||
storageOp = new Operation(storeInst, null, sources);
|
storageOp = new Operation(storeInst, null, sources);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else if (operation.Dest != null)
|
||||||
|
{
|
||||||
|
storageOp = new Operation(Instruction.Copy, operation.Dest, Const(0));
|
||||||
|
}
|
||||||
|
|
||||||
for (int index = 0; index < operation.SourcesCount; index++)
|
for (int index = 0; index < operation.SourcesCount; index++)
|
||||||
{
|
{
|
||||||
@@ -171,10 +184,18 @@ namespace Ryujinx.Graphics.Shader.Translation
|
|||||||
}
|
}
|
||||||
|
|
||||||
LinkedListNode<INode> oldNode = node;
|
LinkedListNode<INode> oldNode = node;
|
||||||
|
LinkedList<INode> oldNodeList = oldNode.List;
|
||||||
|
|
||||||
|
if (storageOp != null)
|
||||||
|
{
|
||||||
node = node.List.AddBefore(node, storageOp);
|
node = node.List.AddBefore(node, storageOp);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
node = null;
|
||||||
|
}
|
||||||
|
|
||||||
node.List.Remove(oldNode);
|
oldNodeList.Remove(oldNode);
|
||||||
|
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.2.0" />
|
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.4.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
@@ -12,9 +12,11 @@ namespace Ryujinx.Ui.App.Common
|
|||||||
public string Developer { get; set; }
|
public string Developer { get; set; }
|
||||||
public string Version { get; set; }
|
public string Version { get; set; }
|
||||||
public string TimePlayed { get; set; }
|
public string TimePlayed { get; set; }
|
||||||
|
public double TimePlayedNum { get; set; }
|
||||||
public string LastPlayed { get; set; }
|
public string LastPlayed { get; set; }
|
||||||
public string FileExtension { get; set; }
|
public string FileExtension { get; set; }
|
||||||
public string FileSize { get; set; }
|
public string FileSize { get; set; }
|
||||||
|
public double FileSizeBytes { get; set; }
|
||||||
public string Path { get; set; }
|
public string Path { get; set; }
|
||||||
public BlitStruct<ApplicationControlProperty> ControlHolder { get; set; }
|
public BlitStruct<ApplicationControlProperty> ControlHolder { get; set; }
|
||||||
}
|
}
|
||||||
|
@@ -465,9 +465,11 @@ namespace Ryujinx.Ui.App.Common
|
|||||||
Developer = developer,
|
Developer = developer,
|
||||||
Version = version,
|
Version = version,
|
||||||
TimePlayed = ConvertSecondsToReadableString(appMetadata.TimePlayed),
|
TimePlayed = ConvertSecondsToReadableString(appMetadata.TimePlayed),
|
||||||
|
TimePlayedNum = appMetadata.TimePlayed,
|
||||||
LastPlayed = appMetadata.LastPlayed,
|
LastPlayed = appMetadata.LastPlayed,
|
||||||
FileExtension = Path.GetExtension(applicationPath).ToUpper().Remove(0, 1),
|
FileExtension = Path.GetExtension(applicationPath).ToUpper().Remove(0, 1),
|
||||||
FileSize = (fileSize < 1) ? (fileSize * 1024).ToString("0.##") + " MiB" : fileSize.ToString("0.##") + " GiB",
|
FileSize = (fileSize < 1) ? (fileSize * 1024).ToString("0.##") + " MiB" : fileSize.ToString("0.##") + " GiB",
|
||||||
|
FileSizeBytes = fileSize,
|
||||||
Path = applicationPath,
|
Path = applicationPath,
|
||||||
ControlHolder = controlHolder
|
ControlHolder = controlHolder
|
||||||
};
|
};
|
||||||
|
@@ -680,7 +680,7 @@ namespace Ryujinx.Ui.Common.Configuration
|
|||||||
Hid.EnableMouse.Value = false;
|
Hid.EnableMouse.Value = false;
|
||||||
Hid.Hotkeys.Value = new KeyboardHotkeys
|
Hid.Hotkeys.Value = new KeyboardHotkeys
|
||||||
{
|
{
|
||||||
ToggleVsync = Key.Tab,
|
ToggleVsync = Key.F1,
|
||||||
ToggleMute = Key.F2,
|
ToggleMute = Key.F2,
|
||||||
Screenshot = Key.F8,
|
Screenshot = Key.F8,
|
||||||
ShowUi = Key.F4,
|
ShowUi = Key.F4,
|
||||||
@@ -818,7 +818,7 @@ namespace Ryujinx.Ui.Common.Configuration
|
|||||||
|
|
||||||
configurationFileFormat.Hotkeys = new KeyboardHotkeys
|
configurationFileFormat.Hotkeys = new KeyboardHotkeys
|
||||||
{
|
{
|
||||||
ToggleVsync = Key.Tab
|
ToggleVsync = Key.F1
|
||||||
};
|
};
|
||||||
|
|
||||||
configurationFileUpdated = true;
|
configurationFileUpdated = true;
|
||||||
@@ -999,7 +999,7 @@ namespace Ryujinx.Ui.Common.Configuration
|
|||||||
|
|
||||||
configurationFileFormat.Hotkeys = new KeyboardHotkeys
|
configurationFileFormat.Hotkeys = new KeyboardHotkeys
|
||||||
{
|
{
|
||||||
ToggleVsync = Key.Tab,
|
ToggleVsync = Key.F1,
|
||||||
Screenshot = Key.F8
|
Screenshot = Key.F8
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1012,7 +1012,7 @@ namespace Ryujinx.Ui.Common.Configuration
|
|||||||
|
|
||||||
configurationFileFormat.Hotkeys = new KeyboardHotkeys
|
configurationFileFormat.Hotkeys = new KeyboardHotkeys
|
||||||
{
|
{
|
||||||
ToggleVsync = Key.Tab,
|
ToggleVsync = Key.F1,
|
||||||
Screenshot = Key.F8,
|
Screenshot = Key.F8,
|
||||||
ShowUi = Key.F4
|
ShowUi = Key.F4
|
||||||
};
|
};
|
||||||
|
@@ -9,46 +9,56 @@ namespace Ryujinx.Ui.Helper
|
|||||||
{
|
{
|
||||||
string aValue = model.GetValue(a, 5).ToString();
|
string aValue = model.GetValue(a, 5).ToString();
|
||||||
string bValue = model.GetValue(b, 5).ToString();
|
string bValue = model.GetValue(b, 5).ToString();
|
||||||
|
float aFloat;
|
||||||
|
float bFloat;
|
||||||
|
|
||||||
if (aValue.Length > 4 && aValue[^4..] == "mins")
|
if (aValue.Length > 7 && aValue[^7..] == "minutes")
|
||||||
{
|
{
|
||||||
aValue = (float.Parse(aValue[0..^5]) * 60).ToString();
|
aValue = aValue.Replace("minutes", "");
|
||||||
|
aFloat = (float.Parse(aValue) * 60);
|
||||||
}
|
}
|
||||||
else if (aValue.Length > 3 && aValue[^3..] == "hrs")
|
else if (aValue.Length > 5 && aValue[^5..] == "hours")
|
||||||
{
|
{
|
||||||
aValue = (float.Parse(aValue[0..^4]) * 3600).ToString();
|
aValue = aValue.Replace("hours", "");
|
||||||
|
aFloat = (float.Parse(aValue) * 3600);
|
||||||
}
|
}
|
||||||
else if (aValue.Length > 4 && aValue[^4..] == "days")
|
else if (aValue.Length > 4 && aValue[^4..] == "days")
|
||||||
{
|
{
|
||||||
aValue = (float.Parse(aValue[0..^5]) * 86400).ToString();
|
aValue = aValue.Replace("days", "");
|
||||||
|
aFloat = (float.Parse(aValue) * 86400);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
aValue = aValue[0..^1];
|
aValue = aValue.Replace("seconds", "");
|
||||||
|
aFloat = float.Parse(aValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bValue.Length > 4 && bValue[^4..] == "mins")
|
if (bValue.Length > 7 && bValue[^7..] == "minutes")
|
||||||
{
|
{
|
||||||
bValue = (float.Parse(bValue[0..^5]) * 60).ToString();
|
bValue = bValue.Replace("minutes", "");
|
||||||
|
bFloat = (float.Parse(bValue) * 60);
|
||||||
}
|
}
|
||||||
else if (bValue.Length > 3 && bValue[^3..] == "hrs")
|
else if (bValue.Length > 5 && bValue[^5..] == "hours")
|
||||||
{
|
{
|
||||||
bValue = (float.Parse(bValue[0..^4]) * 3600).ToString();
|
bValue = bValue.Replace("hours", "");
|
||||||
|
bFloat = (float.Parse(bValue) * 3600);
|
||||||
}
|
}
|
||||||
else if (bValue.Length > 4 && bValue[^4..] == "days")
|
else if (bValue.Length > 4 && bValue[^4..] == "days")
|
||||||
{
|
{
|
||||||
bValue = (float.Parse(bValue[0..^5]) * 86400).ToString();
|
bValue = bValue.Replace("days", "");
|
||||||
|
bFloat = (float.Parse(bValue) * 86400);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
bValue = bValue[0..^1];
|
bValue = bValue[0..^8];
|
||||||
|
bFloat = float.Parse(bValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (float.Parse(aValue) > float.Parse(bValue))
|
if (aFloat > bFloat)
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
else if (float.Parse(bValue) > float.Parse(aValue))
|
else if (bFloat > aFloat)
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user