Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

Commit

Permalink
consolidate configuration files. this will break current configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
emmauss committed Apr 10, 2022
1 parent af9166e commit 2e209b7
Show file tree
Hide file tree
Showing 5 changed files with 144 additions and 33 deletions.
11 changes: 5 additions & 6 deletions Ryujinx.Ava/Configuration/ConfigurationFileFormat.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System.Collections.Generic;
using System.IO;
using Ryujinx.Ava.Common;
using Ryujinx.Ava.Ui.Controls;
using Ryujinx.Common.Configuration;
using Ryujinx.Common.Configuration.Hid;
using Ryujinx.Common.Logging;
Expand Down Expand Up @@ -245,9 +244,9 @@ public class ConfigurationFileFormat
public string BaseStyle { get; set; }

/// <summary>
/// Chooses the base style
/// Chooses the view mode of the game list
/// </summary>
public Glyph GameListViewMode { get; set; }
public int GameListViewMode { get; set; }

/// <summary>
/// Show application name in Grid Mode
Expand All @@ -256,14 +255,14 @@ public class ConfigurationFileFormat


/// <summary>
/// Sets App Icon Size in Grid Mode
/// Sets App Icon Size
/// </summary>
public int GridSize { get; set; }

/// <summary>
/// Sorts Apps in Grid Mode
/// Sorts Apps in the game list
/// </summary>
public ApplicationSort ApplicationSort { get; set; }
public int ApplicationSort { get; set; }

/// <summary>
/// Sets if Grid is ordered in Ascending Order
Expand Down
16 changes: 8 additions & 8 deletions Ryujinx.Ava/Configuration/ConfigurationState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public ColumnSortSettings()
/// <summary>
/// View Mode of the Game list
/// </summary>
public ReactiveObject<Glyph> GameListViewMode { get; private set; }
public ReactiveObject<int> GameListViewMode { get; private set; }

/// <summary>
/// Show application name in Grid Mode
Expand All @@ -123,7 +123,7 @@ public ColumnSortSettings()
/// <summary>
/// Sorts Apps in Grid Mode
/// </summary>
public ReactiveObject<ApplicationSort> ApplicationSort { get; private set; }
public ReactiveObject<int> ApplicationSort { get; private set; }

/// <summary>
/// Sets if Grid is ordered in Ascending Order
Expand All @@ -139,10 +139,10 @@ public UiSection()
CustomThemePath = new ReactiveObject<string>();
BaseStyle = new ReactiveObject<string>();
StartFullscreen = new ReactiveObject<bool>();
GameListViewMode = new ReactiveObject<Glyph>();
GameListViewMode = new ReactiveObject<int>();
ShowNames = new ReactiveObject<bool>();
GridSize = new ReactiveObject<int>();
ApplicationSort = new ReactiveObject<ApplicationSort>();
ApplicationSort = new ReactiveObject<int>();
IsAscendingOrder = new ReactiveObject<bool>();
LanguageCode = new ReactiveObject<string>();
ShowConsole = new ReactiveObject<bool>();
Expand Down Expand Up @@ -634,10 +634,10 @@ public void LoadDefault()
Ui.LanguageCode.Value = "en_US";
Ui.CustomThemePath.Value = "";
Ui.BaseStyle.Value = "Dark";
Ui.GameListViewMode.Value = Glyph.List;
Ui.GameListViewMode.Value = (int)Glyph.List;
Ui.ShowNames.Value = true;
Ui.GridSize.Value = 2;
Ui.ApplicationSort.Value = ApplicationSort.Favorite;
Ui.ApplicationSort.Value = (int)ApplicationSort.Favorite;
Ui.IsAscendingOrder.Value = true;
Ui.StartFullscreen.Value = false;
Ui.ShowConsole.Value = true;
Expand Down Expand Up @@ -1085,10 +1085,10 @@ public void Load(ConfigurationFileFormat configurationFileFormat, string configu

if (configurationFileFormat.Version < 38)
{
Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 37.");
Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 38.");

configurationFileFormat.BaseStyle = "Dark";
configurationFileFormat.GameListViewMode = Glyph.List;
configurationFileFormat.GameListViewMode = (int)Glyph.List;
configurationFileFormat.ShowNames = true;
configurationFileFormat.GridSize = 2;
configurationFileFormat.LanguageCode = "en_US";
Expand Down
8 changes: 4 additions & 4 deletions Ryujinx.Ava/Ui/ViewModels/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -546,10 +546,10 @@ public ObservableCollection<ApplicationData> Applications

public Glyph Glyph
{
get => ConfigurationState.Instance.Ui.GameListViewMode;
get =>(Glyph)ConfigurationState.Instance.Ui.GameListViewMode.Value;
set
{
ConfigurationState.Instance.Ui.GameListViewMode.Value = value;
ConfigurationState.Instance.Ui.GameListViewMode.Value = (int)value;

OnPropertyChanged();
OnPropertyChanged(nameof(IsGrid));
Expand All @@ -575,10 +575,10 @@ public bool ShowNames

public ApplicationSort SortMode
{
get => ConfigurationState.Instance.Ui.ApplicationSort;
get => (ApplicationSort)ConfigurationState.Instance.Ui.ApplicationSort.Value;
private set
{
ConfigurationState.Instance.Ui.ApplicationSort.Value = value;
ConfigurationState.Instance.Ui.ApplicationSort.Value = (int)value;

OnPropertyChanged();
OnPropertyChanged(nameof(SortName));
Expand Down
41 changes: 39 additions & 2 deletions Ryujinx/Configuration/ConfigurationFileFormat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class ConfigurationFileFormat
/// <summary>
/// The current version of the file format
/// </summary>
public const int CurrentVersion = 37;
public const int CurrentVersion = 38;

/// <summary>
/// Version of the configuration file format
Expand Down Expand Up @@ -80,7 +80,7 @@ public class ConfigurationFileFormat
/// Enables printing error log messages
/// </summary>
public bool LoggingEnableError { get; set; }

/// <summary>
/// Enables printing trace log messages
/// </summary>
Expand All @@ -106,6 +106,7 @@ public class ConfigurationFileFormat
/// </summary>
public GraphicsDebugLevel LoggingGraphicsDebugLevel { get; set; }


/// <summary>
/// Change System Language
/// </summary>
Expand Down Expand Up @@ -221,6 +222,11 @@ public class ConfigurationFileFormat
/// </summary>
public List<string> GameDirs { get; set; }

/// <summary>
/// Language Code for the UI
/// </summary>
public string LanguageCode { get; set; }

/// <summary>
/// Enable or disable custom themes in the GUI
/// </summary>
Expand All @@ -231,6 +237,37 @@ public class ConfigurationFileFormat
/// </summary>
public string CustomThemePath { get; set; }

/// <summary>
/// Chooses the base style // Not Used
/// </summary>
public string BaseStyle { get; set; }

/// <summary>
/// Chooses the view mode of the game list // Not Used
/// </summary>
public int GameListViewMode { get; set; }

/// <summary>
/// Show application name in Grid Mode // Not Used
/// </summary>
public bool ShowNames { get; set; }


/// <summary>
/// Sets App Icon Size // Not Used
/// </summary>
public int GridSize { get; set; }

/// <summary>
/// Sorts Apps in the game list // Not Used
/// </summary>
public int ApplicationSort { get; set; }

/// <summary>
/// Sets if Grid is ordered in Ascending Order // Not Used
/// </summary>
public bool IsAscendingOrder { get; set; }

/// <summary>
/// Start games in fullscreen mode
/// </summary>
Expand Down
Loading

0 comments on commit 2e209b7

Please sign in to comment.