mirror of
https://git.ryujinx.app/projects/Kenji-NX.git
synced 2026-09-29 18:10:06 +02:00
Revert "misc: chore: Remove redundant code"
This reverts commit 05a88ccc94.
This commit is contained in:
@@ -795,10 +795,10 @@ namespace Ryujinx.UI.App.Common
|
||||
{
|
||||
ldnWebHost = DefaultLanPlayWebHost;
|
||||
}
|
||||
|
||||
IEnumerable<LdnGameData> ldnGameDataArray = Array.Empty<LdnGameData>();
|
||||
using HttpClient httpClient = new HttpClient();
|
||||
string ldnGameDataArrayString = await httpClient.GetStringAsync($"https://{ldnWebHost}/api/public_games");
|
||||
IEnumerable<LdnGameData> ldnGameDataArray = JsonHelper.Deserialize(ldnGameDataArrayString, _ldnDataSerializerContext.IEnumerableLdnGameData);
|
||||
ldnGameDataArray = JsonHelper.Deserialize(ldnGameDataArrayString, _ldnDataSerializerContext.IEnumerableLdnGameData);
|
||||
var evt = new LdnGameDataReceivedEventArgs
|
||||
{
|
||||
LdnData = ldnGameDataArray
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Ryujinx.UI.App.Common
|
||||
public TimeSpan TimePlayed { get; set; } = TimeSpan.Zero;
|
||||
|
||||
[JsonPropertyName("last_played_utc")]
|
||||
public DateTime? LastPlayed { get; set; }
|
||||
public DateTime? LastPlayed { get; set; } = null;
|
||||
|
||||
[JsonPropertyName("time_played")]
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||
|
||||
@@ -13,6 +13,7 @@ using Ryujinx.UI.Common.Helper;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Text.Json.Nodes;
|
||||
|
||||
namespace Ryujinx.UI.Common.Configuration
|
||||
{
|
||||
@@ -25,23 +26,44 @@ namespace Ryujinx.UI.Common.Configuration
|
||||
{
|
||||
public class Columns
|
||||
{
|
||||
public ReactiveObject<bool> FavColumn { get; private set; } = new();
|
||||
public ReactiveObject<bool> IconColumn { get; private set; } = new();
|
||||
public ReactiveObject<bool> AppColumn { get; private set; } = new();
|
||||
public ReactiveObject<bool> DevColumn { get; private set; } = new();
|
||||
public ReactiveObject<bool> VersionColumn { get; private set; } = new();
|
||||
public ReactiveObject<bool> LdnInfoColumn { get; private set; } = new();
|
||||
public ReactiveObject<bool> TimePlayedColumn { get; private set; } = new();
|
||||
public ReactiveObject<bool> LastPlayedColumn { get; private set; } = new();
|
||||
public ReactiveObject<bool> FileExtColumn { get; private set; } = new();
|
||||
public ReactiveObject<bool> FileSizeColumn { get; private set; } = new();
|
||||
public ReactiveObject<bool> PathColumn { get; private set; } = new();
|
||||
public ReactiveObject<bool> FavColumn { get; private set; }
|
||||
public ReactiveObject<bool> IconColumn { get; private set; }
|
||||
public ReactiveObject<bool> AppColumn { get; private set; }
|
||||
public ReactiveObject<bool> DevColumn { get; private set; }
|
||||
public ReactiveObject<bool> VersionColumn { get; private set; }
|
||||
public ReactiveObject<bool> LdnInfoColumn { get; private set; }
|
||||
public ReactiveObject<bool> TimePlayedColumn { get; private set; }
|
||||
public ReactiveObject<bool> LastPlayedColumn { get; private set; }
|
||||
public ReactiveObject<bool> FileExtColumn { get; private set; }
|
||||
public ReactiveObject<bool> FileSizeColumn { get; private set; }
|
||||
public ReactiveObject<bool> PathColumn { get; private set; }
|
||||
|
||||
public Columns()
|
||||
{
|
||||
FavColumn = new ReactiveObject<bool>();
|
||||
IconColumn = new ReactiveObject<bool>();
|
||||
AppColumn = new ReactiveObject<bool>();
|
||||
DevColumn = new ReactiveObject<bool>();
|
||||
VersionColumn = new ReactiveObject<bool>();
|
||||
LdnInfoColumn = new ReactiveObject<bool>();
|
||||
TimePlayedColumn = new ReactiveObject<bool>();
|
||||
LastPlayedColumn = new ReactiveObject<bool>();
|
||||
FileExtColumn = new ReactiveObject<bool>();
|
||||
FileSizeColumn = new ReactiveObject<bool>();
|
||||
PathColumn = new ReactiveObject<bool>();
|
||||
}
|
||||
}
|
||||
|
||||
public class ColumnSortSettings
|
||||
{
|
||||
public ReactiveObject<int> SortColumnId { get; private set; } = new();
|
||||
public ReactiveObject<bool> SortAscending { get; private set; } = new();
|
||||
public ReactiveObject<int> SortColumnId { get; private set; }
|
||||
public ReactiveObject<bool> SortAscending { get; private set; }
|
||||
|
||||
public ColumnSortSettings()
|
||||
{
|
||||
SortColumnId = new ReactiveObject<int>();
|
||||
SortAscending = new ReactiveObject<bool>();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -49,12 +71,22 @@ namespace Ryujinx.UI.Common.Configuration
|
||||
/// </summary>
|
||||
public class ShownFileTypeSettings
|
||||
{
|
||||
public ReactiveObject<bool> NSP { get; private set; } = new();
|
||||
public ReactiveObject<bool> PFS0 { get; private set; } = new();
|
||||
public ReactiveObject<bool> XCI { get; private set; } = new();
|
||||
public ReactiveObject<bool> NCA { get; private set; } = new();
|
||||
public ReactiveObject<bool> NRO { get; private set; } = new();
|
||||
public ReactiveObject<bool> NSO { get; private set; } = new();
|
||||
public ReactiveObject<bool> NSP { get; private set; }
|
||||
public ReactiveObject<bool> PFS0 { get; private set; }
|
||||
public ReactiveObject<bool> XCI { get; private set; }
|
||||
public ReactiveObject<bool> NCA { get; private set; }
|
||||
public ReactiveObject<bool> NRO { get; private set; }
|
||||
public ReactiveObject<bool> NSO { get; private set; }
|
||||
|
||||
public ShownFileTypeSettings()
|
||||
{
|
||||
NSP = new ReactiveObject<bool>();
|
||||
PFS0 = new ReactiveObject<bool>();
|
||||
XCI = new ReactiveObject<bool>();
|
||||
NCA = new ReactiveObject<bool>();
|
||||
NRO = new ReactiveObject<bool>();
|
||||
NSO = new ReactiveObject<bool>();
|
||||
}
|
||||
}
|
||||
|
||||
// <summary>
|
||||
@@ -62,11 +94,20 @@ namespace Ryujinx.UI.Common.Configuration
|
||||
///<summary>
|
||||
public class WindowStartupSettings
|
||||
{
|
||||
public ReactiveObject<int> WindowSizeWidth { get; private set; } = new();
|
||||
public ReactiveObject<int> WindowSizeHeight { get; private set; } = new();
|
||||
public ReactiveObject<int> WindowPositionX { get; private set; } = new();
|
||||
public ReactiveObject<int> WindowPositionY { get; private set; } = new();
|
||||
public ReactiveObject<bool> WindowMaximized { get; private set; } = new();
|
||||
public ReactiveObject<int> WindowSizeWidth { get; private set; }
|
||||
public ReactiveObject<int> WindowSizeHeight { get; private set; }
|
||||
public ReactiveObject<int> WindowPositionX { get; private set; }
|
||||
public ReactiveObject<int> WindowPositionY { get; private set; }
|
||||
public ReactiveObject<bool> WindowMaximized { get; private set; }
|
||||
|
||||
public WindowStartupSettings()
|
||||
{
|
||||
WindowSizeWidth = new ReactiveObject<int>();
|
||||
WindowSizeHeight = new ReactiveObject<int>();
|
||||
WindowPositionX = new ReactiveObject<int>();
|
||||
WindowPositionY = new ReactiveObject<int>();
|
||||
WindowMaximized = new ReactiveObject<bool>();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -380,24 +421,32 @@ namespace Ryujinx.UI.Common.Configuration
|
||||
/// <summary>
|
||||
/// Enable or disable keyboard support (Independent from controllers binding)
|
||||
/// </summary>
|
||||
public ReactiveObject<bool> EnableKeyboard { get; private set; } = new();
|
||||
public ReactiveObject<bool> EnableKeyboard { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Enable or disable mouse support (Independent from controllers binding)
|
||||
/// </summary>
|
||||
public ReactiveObject<bool> EnableMouse { get; private set; } = new();
|
||||
public ReactiveObject<bool> EnableMouse { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Hotkey Keyboard Bindings
|
||||
/// </summary>
|
||||
public ReactiveObject<KeyboardHotkeys> Hotkeys { get; private set; } = new();
|
||||
public ReactiveObject<KeyboardHotkeys> Hotkeys { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Input device configuration.
|
||||
/// NOTE: This ReactiveObject won't issue an event when the List has elements added or removed.
|
||||
/// TODO: Implement a ReactiveList class.
|
||||
/// </summary>
|
||||
public ReactiveObject<List<InputConfig>> InputConfig { get; private set; } = new();
|
||||
public ReactiveObject<List<InputConfig>> InputConfig { get; private set; }
|
||||
|
||||
public HidSection()
|
||||
{
|
||||
EnableKeyboard = new ReactiveObject<bool>();
|
||||
EnableMouse = new ReactiveObject<bool>();
|
||||
Hotkeys = new ReactiveObject<KeyboardHotkeys>();
|
||||
InputConfig = new ReactiveObject<List<InputConfig>>();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -99,13 +99,16 @@ namespace Ryujinx.UI.Common.Helper
|
||||
Dictionary<ulong, ContentMetaData> updates =
|
||||
pfs.GetContentData(ContentMetaType.Patch, vfs, checkLevel);
|
||||
|
||||
Nca patchNca = null;
|
||||
Nca controlNca = null;
|
||||
|
||||
if (!updates.TryGetValue(applicationIdBase, out ContentMetaData content))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Nca patchNca = content.GetNcaByType(vfs.KeySet, ContentType.Program);
|
||||
Nca controlNca = content.GetNcaByType(vfs.KeySet, ContentType.Control);
|
||||
patchNca = content.GetNcaByType(vfs.KeySet, ContentType.Program);
|
||||
controlNca = content.GetNcaByType(vfs.KeySet, ContentType.Control);
|
||||
|
||||
if (controlNca == null || patchNca == null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user