Ac_k's requested changes

This commit is contained in:
Xpl0itR 2019-11-23 13:41:04 +00:00 committed by unknown
parent 763bc1a69e
commit 894ef30d78
No known key found for this signature in database
GPG key ID: 91798184109676AD
18 changed files with 219 additions and 158 deletions

View file

@ -89,7 +89,6 @@
},
"right_joycon": {
"stick": "Axis3",
"stick_y": "Button0",
"stick_button": "Button9",
"button_a": "Button1",
"button_b": "Button0",

View file

@ -23,12 +23,14 @@
01007a4008486000
01007ef00011e000
010080b00ad66000
01008db008c2c000
010094e00b52e000
01009aa000faa000
01009b90006dc000
01009cc00c97c000
0100a4200a284000
0100a5c00d162000
0100abf008968000
0100ae000aebc000
0100b3f000be2000
0100bc2004ff4000

View file

@ -32,16 +32,16 @@
<None Remove="Ui\assets\BlueCon.png" />
<None Remove="Ui\assets\ProCon.png" />
<None Remove="Ui\assets\RedCon.png" />
<None Remove="Ui\assets\ryujinxNCAIcon.png" />
<None Remove="Ui\assets\ryujinxNROIcon.png" />
<None Remove="Ui\assets\ryujinxNSOIcon.png" />
<None Remove="Ui\assets\ryujinxNSPIcon.png" />
<None Remove="Ui\assets\ryujinxXCIIcon.png" />
<None Remove="Ui\assets\NCAIcon.png" />
<None Remove="Ui\assets\NROIcon.png" />
<None Remove="Ui\assets\NSOIcon.png" />
<None Remove="Ui\assets\NSPIcon.png" />
<None Remove="Ui\assets\XCIIcon.png" />
<None Remove="Ui\assets\DiscordLogo.png" />
<None Remove="Ui\assets\GitHubLogo.png" />
<None Remove="Ui\assets\JoyCon.png" />
<None Remove="Ui\assets\PatreonLogo.png" />
<None Remove="Ui\assets\ryujinxIcon.png" />
<None Remove="Ui\assets\Icon.png" />
<None Remove="Ui\assets\TwitterLogo.png" />
<None Remove="Ui\MainWindow.glade" />
<None Remove="Ui\SwitchSettings.glade" />
@ -52,16 +52,16 @@
<EmbeddedResource Include="Ui\assets\BlueCon.png" />
<EmbeddedResource Include="Ui\assets\ProCon.png" />
<EmbeddedResource Include="Ui\assets\RedCon.png" />
<EmbeddedResource Include="Ui\assets\ryujinxNCAIcon.png" />
<EmbeddedResource Include="Ui\assets\ryujinxNROIcon.png" />
<EmbeddedResource Include="Ui\assets\ryujinxNSOIcon.png" />
<EmbeddedResource Include="Ui\assets\ryujinxNSPIcon.png" />
<EmbeddedResource Include="Ui\assets\ryujinxXCIIcon.png" />
<EmbeddedResource Include="Ui\assets\NCAIcon.png" />
<EmbeddedResource Include="Ui\assets\NROIcon.png" />
<EmbeddedResource Include="Ui\assets\NSOIcon.png" />
<EmbeddedResource Include="Ui\assets\NSPIcon.png" />
<EmbeddedResource Include="Ui\assets\XCIIcon.png" />
<EmbeddedResource Include="Ui\assets\DiscordLogo.png" />
<EmbeddedResource Include="Ui\assets\GitHubLogo.png" />
<EmbeddedResource Include="Ui\assets\JoyCon.png" />
<EmbeddedResource Include="Ui\assets\PatreonLogo.png" />
<EmbeddedResource Include="Ui\assets\ryujinxIcon.png" />
<EmbeddedResource Include="Ui\assets\Icon.png" />
<EmbeddedResource Include="Ui\assets\TwitterLogo.png" />
<EmbeddedResource Include="Ui\MainWindow.glade" />
<EmbeddedResource Include="Ui\SwitchSettings.glade" />

View file

@ -39,8 +39,8 @@ namespace Ryujinx.UI
{
builder.Autoconnect(this);
_aboutWin.Icon = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.Ui.assets.ryujinxIcon.png");
_ryujinxLogo.Pixbuf = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.Ui.assets.ryujinxIcon.png", 100, 100);
_aboutWin.Icon = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.Ui.assets.Icon.png");
_ryujinxLogo.Pixbuf = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.Ui.assets.Icon.png" , 100, 100);
_patreonLogo.Pixbuf = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.Ui.assets.PatreonLogo.png", 30 , 30 );
_gitHubLogo.Pixbuf = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.Ui.assets.GitHubLogo.png" , 30 , 30 );
_discordLogo.Pixbuf = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.Ui.assets.DiscordLogo.png", 30 , 30 );
@ -63,7 +63,7 @@ namespace Ryujinx.UI
}
}
private void OpenUrl(string url)
private static void OpenUrl(string url)
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{

View file

@ -0,0 +1,11 @@
using System;
namespace Ryujinx.UI
{
public class ApplicationAddedEventArgs : EventArgs
{
public ApplicationData AppData { get; set; }
public int NumAppsFound { get; set; }
public int NumAppsLoaded { get; set; }
}
}

View file

@ -0,0 +1,17 @@
namespace Ryujinx.UI
{
public struct ApplicationData
{
public bool Favorite { get; set; }
public byte[] Icon { get; set; }
public string TitleName { get; set; }
public string TitleId { get; set; }
public string Developer { get; set; }
public string Version { get; set; }
public string TimePlayed { get; set; }
public string LastPlayed { get; set; }
public string FileExtension { get; set; }
public string FileSize { get; set; }
public string Path { get; set; }
}
}

View file

@ -15,8 +15,8 @@ using System.Reflection;
using System.Text;
using Utf8Json;
using Utf8Json.Resolvers;
using ApplicationData = Ryujinx.UI.ApplicationLibrary.ApplicationData;
using SystemState = Ryujinx.HLE.HOS.SystemState;
using TitleLanguage = Ryujinx.HLE.HOS.SystemState.TitleLanguage;
namespace Ryujinx.UI
{
@ -24,45 +24,22 @@ namespace Ryujinx.UI
{
public static event EventHandler<ApplicationAddedEventArgs> ApplicationAdded;
public struct ApplicationData
{
public bool Favorite { get; set; }
public byte[] Icon { get; set; }
public string TitleName { get; set; }
public string TitleId { get; set; }
public string Developer { get; set; }
public string Version { get; set; }
public string TimePlayed { get; set; }
public string LastPlayed { get; set; }
public string FileExtension { get; set; }
public string FileSize { get; set; }
public string Path { get; set; }
}
private static readonly byte[] _ryujinxNspIcon = GetResourceBytes("Ryujinx.Ui.assets.ryujinxNSPIcon.png");
private static readonly byte[] _ryujinxXciIcon = GetResourceBytes("Ryujinx.Ui.assets.ryujinxXCIIcon.png");
private static readonly byte[] _ryujinxNcaIcon = GetResourceBytes("Ryujinx.Ui.assets.ryujinxNCAIcon.png");
private static readonly byte[] _ryujinxNroIcon = GetResourceBytes("Ryujinx.Ui.assets.ryujinxNROIcon.png");
private static readonly byte[] _ryujinxNsoIcon = GetResourceBytes("Ryujinx.Ui.assets.ryujinxNSOIcon.png");
private static Keyset _keySet;
private static SystemState.TitleLanguage _desiredTitleLanguage;
private struct ApplicationMetadata
{
public bool Favorite { get; set; }
public double TimePlayed { get; set; }
public string LastPlayed { get; set; }
}
private static readonly byte[] _nspIcon = GetResourceBytes("Ryujinx.Ui.assets.NSPIcon.png");
private static readonly byte[] _xciIcon = GetResourceBytes("Ryujinx.Ui.assets.XCIIcon.png");
private static readonly byte[] _ncaIcon = GetResourceBytes("Ryujinx.Ui.assets.NCAIcon.png");
private static readonly byte[] _nroIcon = GetResourceBytes("Ryujinx.Ui.assets.NROIcon.png");
private static readonly byte[] _nsoIcon = GetResourceBytes("Ryujinx.Ui.assets.NSOIcon.png");
private static Keyset _keySet;
private static TitleLanguage _desiredTitleLanguage;
private static ApplicationMetadata _appMetadata;
public static void LoadApplications(List<string> appDirs, Keyset keySet, SystemState.TitleLanguage desiredTitleLanguage)
public static void LoadApplications(List<string> appDirs, Keyset keySet, TitleLanguage desiredTitleLanguage)
{
int numApplicationsFound = 0;
int numApplicationsLoaded = 0;
_keySet = keySet;
_keySet = keySet;
_desiredTitleLanguage = desiredTitleLanguage;
// Builds the applications list with paths to found applications
@ -76,8 +53,7 @@ namespace Ryujinx.UI
continue;
}
string[] apps = Directory.GetFiles(appDir, "*.*", SearchOption.AllDirectories);
foreach (string app in apps)
foreach (string app in Directory.GetFiles(appDir, "*.*", SearchOption.AllDirectories))
{
if ((Path.GetExtension(app) == ".xci") ||
(Path.GetExtension(app) == ".nro") ||
@ -97,7 +73,8 @@ namespace Ryujinx.UI
foreach (DirectoryEntryEx fileEntry in nsp.EnumerateEntries("/", "*.nca"))
{
nsp.OpenFile(out IFile ncaFile, fileEntry.FullPath, OpenMode.Read).ThrowIfFailure();
Nca nca = new Nca(_keySet, ncaFile.AsStorage());
Nca nca = new Nca(_keySet, ncaFile.AsStorage());
int dataIndex = Nca.GetSectionIndexFromType(NcaSectionType.Data, NcaContentType.Program);
if (nca.Header.ContentType == NcaContentType.Program && !nca.Header.GetFsHeader(dataIndex).IsPatchSection())
@ -106,7 +83,10 @@ namespace Ryujinx.UI
}
}
if (!hasMainNca) continue;
if (!hasMainNca)
{
continue;
}
}
catch (InvalidDataException)
{
@ -120,7 +100,7 @@ namespace Ryujinx.UI
{
try
{
Nca nca = new Nca(_keySet, new FileStream(app, FileMode.Open, FileAccess.Read).AsStorage());
Nca nca = new Nca(_keySet, new FileStream(app, FileMode.Open, FileAccess.Read).AsStorage());
int dataIndex = Nca.GetSectionIndexFromType(NcaSectionType.Data, NcaContentType.Program);
if (nca.Header.ContentType != NcaContentType.Program || nca.Header.GetFsHeader(dataIndex).IsPatchSection())
@ -146,7 +126,7 @@ namespace Ryujinx.UI
string titleName = "Unknown";
string titleId = "0000000000000000";
string developer = "Unknown";
string version = "?";
string version = "0";
byte[] applicationIcon = null;
using (FileStream file = new FileStream(applicationPath, FileMode.Open, FileAccess.Read))
@ -176,7 +156,7 @@ namespace Ryujinx.UI
// If this is null then this is probably not a normal NSP, it's probably an ExeFS as an NSP
if (controlFs == null)
{
applicationIcon = _ryujinxNspIcon;
applicationIcon = _nspIcon;
Result result = pfs.OpenFile(out IFile npdmFile, "/main.npdm", OpenMode.Read);
@ -260,20 +240,20 @@ namespace Ryujinx.UI
if (applicationIcon == null)
{
applicationIcon = Path.GetExtension(applicationPath) == ".xci" ? _ryujinxXciIcon : _ryujinxNspIcon;
applicationIcon = Path.GetExtension(applicationPath) == ".xci" ? _xciIcon : _nspIcon;
}
}
}
}
catch (MissingKeyException exception)
{
applicationIcon = Path.GetExtension(applicationPath) == ".xci" ? _ryujinxXciIcon : _ryujinxNspIcon;
applicationIcon = Path.GetExtension(applicationPath) == ".xci" ? _xciIcon : _nspIcon;
Logger.PrintWarning(LogClass.Application, $"Your key set is missing a key with the name: {exception.Name}");
}
catch (InvalidDataException)
{
applicationIcon = Path.GetExtension(applicationPath) == ".xci" ? _ryujinxXciIcon : _ryujinxNspIcon;
applicationIcon = Path.GetExtension(applicationPath) == ".xci" ? _xciIcon : _nspIcon;
Logger.PrintWarning(LogClass.Application, $"The header key is incorrect or missing and therefore the NCA header content type check has failed. Errored File: {applicationPath}");
}
@ -306,57 +286,59 @@ namespace Ryujinx.UI
applicationIcon = Read(assetOffset + iconOffset, (int)iconSize);
// Creates memory stream out of byte array which is the NACP
using MemoryStream stream = new MemoryStream(Read(assetOffset + (int)nacpOffset, (int)nacpSize));
// Creates NACP class from the memory stream
Nacp controlData = new Nacp(stream);
// Get the title name, title ID, developer name and version number from the NACP
version = controlData.DisplayVersion;
titleName = controlData.Descriptions[(int)_desiredTitleLanguage].Title;
if (string.IsNullOrWhiteSpace(titleName))
using (MemoryStream stream = new MemoryStream(Read(assetOffset + (int) nacpOffset, (int) nacpSize)))
{
titleName = controlData.Descriptions.ToList().Find(x => !string.IsNullOrWhiteSpace(x.Title)).Title;
}
// Creates NACP class from the memory stream
Nacp controlData = new Nacp(stream);
titleId = controlData.PresenceGroupId.ToString("x16");
// Get the title name, title ID, developer name and version number from the NACP
version = controlData.DisplayVersion;
if (string.IsNullOrWhiteSpace(titleId))
{
titleId = controlData.SaveDataOwnerId.ToString("x16");
}
titleName = controlData.Descriptions[(int)_desiredTitleLanguage].Title;
if (string.IsNullOrWhiteSpace(titleId))
{
titleId = (controlData.AddOnContentBaseId - 0x1000).ToString("x16");
}
if (string.IsNullOrWhiteSpace(titleName))
{
titleName = controlData.Descriptions.ToList().Find(x => !string.IsNullOrWhiteSpace(x.Title)).Title;
}
developer = controlData.Descriptions[(int)_desiredTitleLanguage].Developer;
titleId = controlData.PresenceGroupId.ToString("x16");
if (string.IsNullOrWhiteSpace(developer))
{
developer = controlData.Descriptions.ToList().Find(x => !string.IsNullOrWhiteSpace(x.Developer)).Developer;
if (string.IsNullOrWhiteSpace(titleId))
{
titleId = controlData.SaveDataOwnerId.ToString("x16");
}
if (string.IsNullOrWhiteSpace(titleId))
{
titleId = (controlData.AddOnContentBaseId - 0x1000).ToString("x16");
}
developer = controlData.Descriptions[(int)_desiredTitleLanguage].Developer;
if (string.IsNullOrWhiteSpace(developer))
{
developer = controlData.Descriptions.ToList().Find(x => !string.IsNullOrWhiteSpace(x.Developer)).Developer;
}
}
}
else
{
applicationIcon = _ryujinxNroIcon;
applicationIcon = _nroIcon;
}
}
// If its an NCA or NSO we just set defaults
else if ((Path.GetExtension(applicationPath) == ".nca") || (Path.GetExtension(applicationPath) == ".nso"))
{
applicationIcon = Path.GetExtension(applicationPath) == ".nca" ? _ryujinxNcaIcon : _ryujinxNsoIcon;
applicationIcon = Path.GetExtension(applicationPath) == ".nca" ? _ncaIcon : _nsoIcon;
titleName = Path.GetFileNameWithoutExtension(applicationPath);
}
}
(bool fav, string timePlayed, string lastPlayed) = GetMetadata(titleId);
(bool favorite, string timePlayed, string lastPlayed) = GetMetadata(titleId);
ApplicationData data = new ApplicationData()
{
Favorite = fav,
Favorite = favorite,
Icon = applicationIcon,
TitleName = titleName,
TitleId = titleId,
@ -429,7 +411,7 @@ namespace Ryujinx.UI
return controlNca?.OpenFileSystem(NcaSectionType.Data, IntegrityCheckLevel.None);
}
private static (bool fav, string timePlayed, string lastPlayed) GetMetadata(string titleId)
private static (bool favorite, string timePlayed, string lastPlayed) GetMetadata(string titleId)
{
string metadataFolder = Path.Combine(new VirtualFileSystem().GetBasePath(), "games", titleId, "gui");
string metadataFile = Path.Combine(metadataFolder, "metadata.json");
@ -463,7 +445,8 @@ namespace Ryujinx.UI
{
const int secondsPerMinute = 60;
const int secondsPerHour = secondsPerMinute * 60;
const int secondsPerDay = secondsPerHour * 24;
const int secondsPerDay = secondsPerHour * 24;
string readableString;
if (seconds < secondsPerMinute)
@ -486,11 +469,4 @@ namespace Ryujinx.UI
return readableString;
}
}
public class ApplicationAddedEventArgs : EventArgs
{
public ApplicationData AppData { get; set; }
public int NumAppsFound { get; set; }
public int NumAppsLoaded { get; set; }
}
}

View file

@ -0,0 +1,9 @@
namespace Ryujinx.UI
{
public struct ApplicationMetadata
{
public bool Favorite { get; set; }
public double TimePlayed { get; set; }
public string LastPlayed { get; set; }
}
}

16
Ryujinx/Ui/GuiColumns.cs Normal file
View file

@ -0,0 +1,16 @@
namespace Ryujinx.UI
{
public struct GuiColumns
{
public bool FavColumn;
public bool IconColumn;
public bool AppColumn;
public bool DevColumn;
public bool VersionColumn;
public bool TimePlayedColumn;
public bool LastPlayedColumn;
public bool FileExtColumn;
public bool FileSizeColumn;
public bool PathColumn;
}
}

View file

@ -21,20 +21,6 @@ using System.Threading.Tasks;
namespace Ryujinx.UI
{
public struct GuiColumns
{
public bool FavColumn;
public bool IconColumn;
public bool AppColumn;
public bool DevColumn;
public bool VersionColumn;
public bool TimePlayedColumn;
public bool LastPlayedColumn;
public bool FileExtColumn;
public bool FileSizeColumn;
public bool PathColumn;
}
public class MainWindow : Window
{
private static HLE.Switch _device;
@ -63,13 +49,6 @@ namespace Ryujinx.UI
private static TreeView _treeView;
private struct ApplicationMetadata
{
public bool Favorite { get; set; }
public double TimePlayed { get; set; }
public string LastPlayed { get; set; }
}
public static bool DiscordIntegrationEnabled { get; set; }
public static DiscordRpcClient DiscordClient;
@ -139,7 +118,7 @@ namespace Ryujinx.UI
DiscordClient.SetPresence(DiscordPresence);
}
_mainWin.Icon = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.Ui.assets.ryujinxIcon.png");
_mainWin.Icon = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.Ui.assets.Icon.png");
_stopEmulation.Sensitive = false;
if (SwitchSettings.SwitchConfig.GuiColumns.FavColumn) { _favToggle.Active = true; }
@ -171,7 +150,7 @@ namespace Ryujinx.UI
MessageDialog errorDialog = new MessageDialog(null, DialogFlags.Modal, MessageType.Error, ButtonsType.Ok, null)
{
Title = "Ryujinx - Error",
Icon = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.Ui.assets.ryujinxIcon.png"),
Icon = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.Ui.assets.Icon.png"),
Text = "Ryujinx has encountered an Error",
SecondaryText = errorMessage,
WindowPosition = WindowPosition.Center
@ -183,7 +162,10 @@ namespace Ryujinx.UI
internal static void ApplyTheme()
{
if (!SwitchSettings.SwitchConfig.EnableCustomTheme) return;
if (!SwitchSettings.SwitchConfig.EnableCustomTheme)
{
return;
}
if (File.Exists(SwitchSettings.SwitchConfig.CustomThemePath) && (System.IO.Path.GetExtension(SwitchSettings.SwitchConfig.CustomThemePath) == ".css"))
{
@ -222,7 +204,7 @@ namespace Ryujinx.UI
foreach (TreeViewColumn column in _gameTable.Columns)
{
if (column.Title == "Fav") { _favColumn = column; }
if (column.Title == "Fav") { _favColumn = column; }
else if (column.Title == "Application") { _appColumn = column; }
else if (column.Title == "Developer") { _devColumn = column; }
else if (column.Title == "Version") { _versionColumn = column; }
@ -246,16 +228,18 @@ namespace Ryujinx.UI
internal static async Task UpdateGameTable()
{
if (_updatingGameTable) return;
if (_updatingGameTable)
{
return;
}
_updatingGameTable = true;
_updatingGameTable = true;
_treeView.HeadersClickable = false;
_tableStore.Clear();
await Task.Run(() => ApplicationLibrary.LoadApplications(SwitchSettings.SwitchConfig.GameDirs, _device.System.KeySet, _device.System.State.DesiredTitleLanguage));
_treeView.HeadersClickable = true;
_updatingGameTable = false;
_updatingGameTable = false;
}
internal void LoadApplication(string path)
@ -372,6 +356,7 @@ namespace Ryujinx.UI
string metadataFile = System.IO.Path.Combine(metadataFolder, "metadata.json");
IJsonFormatterResolver resolver = CompositeResolver.Create(new[] { StandardResolver.AllowPrivateSnakeCase });
ApplicationMetadata appMetadata;
if (!File.Exists(metadataFile))
@ -415,7 +400,10 @@ namespace Ryujinx.UI
private static void End()
{
if (_ending) return;
if (_ending)
{
return;
}
_ending = true;
@ -425,6 +413,7 @@ namespace Ryujinx.UI
string metadataFile = System.IO.Path.Combine(metadataFolder, "metadata.json");
IJsonFormatterResolver resolver = CompositeResolver.Create(new[] { StandardResolver.AllowPrivateSnakeCase });
ApplicationMetadata appMetadata;
if (!File.Exists(metadataFile))
@ -495,10 +484,12 @@ namespace Ryujinx.UI
private void FavToggle_Toggled(object sender, ToggledArgs args)
{
_tableStore.GetIter(out TreeIter treeIter, new TreePath(args.Path));
string titleid = _tableStore.GetValue(treeIter, 2).ToString().Split("\n")[1].ToLower();
string metadataPath = System.IO.Path.Combine(new VirtualFileSystem().GetBasePath(), "games", titleid, "gui", "metadata.json");
string titleId = _tableStore.GetValue(treeIter, 2).ToString().Split("\n")[1].ToLower();
string metadataPath = System.IO.Path.Combine(new VirtualFileSystem().GetBasePath(), "games", titleId, "gui", "metadata.json");
IJsonFormatterResolver resolver = CompositeResolver.Create(new[] { StandardResolver.AllowPrivateSnakeCase });
ApplicationMetadata appMetadata;
using (Stream stream = File.OpenRead(metadataPath))
@ -633,7 +624,8 @@ namespace Ryujinx.UI
private void Fav_Toggled(object sender, EventArgs args)
{
GuiColumns updatedColumns = SwitchSettings.SwitchConfig.GuiColumns;
updatedColumns.FavColumn = _favToggle.Active;
updatedColumns.FavColumn = _favToggle.Active;
SwitchSettings.SwitchConfig.GuiColumns = updatedColumns;
Configuration.SaveConfig(SwitchSettings.SwitchConfig, System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Config.json"));
@ -644,7 +636,8 @@ namespace Ryujinx.UI
private void Icon_Toggled(object sender, EventArgs args)
{
GuiColumns updatedColumns = SwitchSettings.SwitchConfig.GuiColumns;
updatedColumns.IconColumn = _iconToggle.Active;
updatedColumns.IconColumn = _iconToggle.Active;
SwitchSettings.SwitchConfig.GuiColumns = updatedColumns;
Configuration.SaveConfig(SwitchSettings.SwitchConfig, System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Config.json"));
@ -655,7 +648,8 @@ namespace Ryujinx.UI
private void Title_Toggled(object sender, EventArgs args)
{
GuiColumns updatedColumns = SwitchSettings.SwitchConfig.GuiColumns;
updatedColumns.AppColumn = _appToggle.Active;
updatedColumns.AppColumn = _appToggle.Active;
SwitchSettings.SwitchConfig.GuiColumns = updatedColumns;
Configuration.SaveConfig(SwitchSettings.SwitchConfig, System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Config.json"));
@ -666,7 +660,8 @@ namespace Ryujinx.UI
private void Developer_Toggled(object sender, EventArgs args)
{
GuiColumns updatedColumns = SwitchSettings.SwitchConfig.GuiColumns;
updatedColumns.DevColumn = _developerToggle.Active;
updatedColumns.DevColumn = _developerToggle.Active;
SwitchSettings.SwitchConfig.GuiColumns = updatedColumns;
Configuration.SaveConfig(SwitchSettings.SwitchConfig, System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Config.json"));
@ -676,8 +671,9 @@ namespace Ryujinx.UI
private void Version_Toggled(object sender, EventArgs args)
{
GuiColumns updatedColumns = SwitchSettings.SwitchConfig.GuiColumns;
updatedColumns.VersionColumn = _versionToggle.Active;
GuiColumns updatedColumns = SwitchSettings.SwitchConfig.GuiColumns;
updatedColumns.VersionColumn = _versionToggle.Active;
SwitchSettings.SwitchConfig.GuiColumns = updatedColumns;
Configuration.SaveConfig(SwitchSettings.SwitchConfig, System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Config.json"));
@ -687,8 +683,9 @@ namespace Ryujinx.UI
private void TimePlayed_Toggled(object sender, EventArgs args)
{
GuiColumns updatedColumns = SwitchSettings.SwitchConfig.GuiColumns;
updatedColumns.TimePlayedColumn = _timePlayedToggle.Active;
GuiColumns updatedColumns = SwitchSettings.SwitchConfig.GuiColumns;
updatedColumns.TimePlayedColumn = _timePlayedToggle.Active;
SwitchSettings.SwitchConfig.GuiColumns = updatedColumns;
Configuration.SaveConfig(SwitchSettings.SwitchConfig, System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Config.json"));
@ -698,8 +695,9 @@ namespace Ryujinx.UI
private void LastPlayed_Toggled(object sender, EventArgs args)
{
GuiColumns updatedColumns = SwitchSettings.SwitchConfig.GuiColumns;
updatedColumns.LastPlayedColumn = _lastPlayedToggle.Active;
GuiColumns updatedColumns = SwitchSettings.SwitchConfig.GuiColumns;
updatedColumns.LastPlayedColumn = _lastPlayedToggle.Active;
SwitchSettings.SwitchConfig.GuiColumns = updatedColumns;
Configuration.SaveConfig(SwitchSettings.SwitchConfig, System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Config.json"));
@ -709,8 +707,9 @@ namespace Ryujinx.UI
private void FileExt_Toggled(object sender, EventArgs args)
{
GuiColumns updatedColumns = SwitchSettings.SwitchConfig.GuiColumns;
updatedColumns.FileExtColumn = _fileExtToggle.Active;
GuiColumns updatedColumns = SwitchSettings.SwitchConfig.GuiColumns;
updatedColumns.FileExtColumn = _fileExtToggle.Active;
SwitchSettings.SwitchConfig.GuiColumns = updatedColumns;
Configuration.SaveConfig(SwitchSettings.SwitchConfig, System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Config.json"));
@ -720,8 +719,9 @@ namespace Ryujinx.UI
private void FileSize_Toggled(object sender, EventArgs args)
{
GuiColumns updatedColumns = SwitchSettings.SwitchConfig.GuiColumns;
updatedColumns.FileSizeColumn = _fileSizeToggle.Active;
GuiColumns updatedColumns = SwitchSettings.SwitchConfig.GuiColumns;
updatedColumns.FileSizeColumn = _fileSizeToggle.Active;
SwitchSettings.SwitchConfig.GuiColumns = updatedColumns;
Configuration.SaveConfig(SwitchSettings.SwitchConfig, System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Config.json"));
@ -732,7 +732,8 @@ namespace Ryujinx.UI
private void Path_Toggled(object sender, EventArgs args)
{
GuiColumns updatedColumns = SwitchSettings.SwitchConfig.GuiColumns;
updatedColumns.PathColumn = _pathToggle.Active;
updatedColumns.PathColumn = _pathToggle.Active;
SwitchSettings.SwitchConfig.GuiColumns = updatedColumns;
Configuration.SaveConfig(SwitchSettings.SwitchConfig, System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Config.json"));
@ -786,9 +787,18 @@ namespace Ryujinx.UI
bValue = bValue.Substring(0, bValue.Length - 1);
}
if (float.Parse(aValue) > float.Parse(bValue)) return -1;
else if (float.Parse(bValue) > float.Parse(aValue)) return 1;
else return 0;
if (float.Parse(aValue) > float.Parse(bValue))
{
return -1;
}
else if (float.Parse(bValue) > float.Parse(aValue))
{
return 1;
}
else
{
return 0;
}
}
private static int LastPlayedSort(ITreeModel model, TreeIter a, TreeIter b)
@ -796,8 +806,15 @@ namespace Ryujinx.UI
string aValue = model.GetValue(a, 6).ToString();
string bValue = model.GetValue(b, 6).ToString();
if (aValue == "Never") aValue = DateTime.UnixEpoch.ToString();
if (bValue == "Never") bValue = DateTime.UnixEpoch.ToString();
if (aValue == "Never")
{
aValue = DateTime.UnixEpoch.ToString();
}
if (bValue == "Never")
{
bValue = DateTime.UnixEpoch.ToString();
}
return DateTime.Compare(DateTime.Parse(bValue), DateTime.Parse(aValue));
}
@ -811,17 +828,32 @@ namespace Ryujinx.UI
{
aValue = (float.Parse(aValue[0..^2]) * 1024).ToString();
}
else aValue = aValue[0..^2];
else
{
aValue = aValue[0..^2];
}
if (bValue.Substring(bValue.Length - 2) == "GB")
{
bValue = (float.Parse(bValue[0..^2]) * 1024).ToString();
}
else bValue = bValue[0..^2];
else
{
bValue = bValue[0..^2];
}
if (float.Parse(aValue) > float.Parse(bValue)) return -1;
else if (float.Parse(bValue) > float.Parse(aValue)) return 1;
else return 0;
if (float.Parse(aValue) > float.Parse(bValue))
{
return -1;
}
else if (float.Parse(bValue) > float.Parse(aValue))
{
return 1;
}
else
{
return 0;
}
}
}
}

View file

@ -64,7 +64,6 @@ namespace Ryujinx.UI.Input
public struct NpadControllerRight
{
public ControllerInputId Stick;
public ControllerInputId StickY;
public ControllerInputId StickButton;
public ControllerInputId ButtonA;
public ControllerInputId ButtonB;

View file

@ -92,7 +92,7 @@ namespace Ryujinx.UI
_device = device;
_settingsWin.Icon = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.Ui.assets.ryujinxIcon.png");
_settingsWin.Icon = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.Ui.assets.Icon.png");
_controller1Image.Pixbuf = new Gdk.Pixbuf(Assembly.GetExecutingAssembly(), "Ryujinx.Ui.assets.JoyCon.png", 500, 500);
//Bind Events

View file

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

View file

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View file

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View file

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View file

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View file

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB