Make Device Location Name configuration (custom TZ) (#1031)
This permit to use arbitrary timezone (instead of UTC). Useful for games like ACNH.
This commit is contained in:
@@ -935,7 +935,7 @@ namespace Ryujinx.Ui
|
||||
|
||||
private void Settings_Pressed(object sender, EventArgs args)
|
||||
{
|
||||
SwitchSettings settingsWin = new SwitchSettings();
|
||||
SwitchSettings settingsWin = new SwitchSettings(_virtualFileSystem, _contentManager);
|
||||
settingsWin.Show();
|
||||
}
|
||||
|
||||
|
@@ -2,6 +2,7 @@
|
||||
using Ryujinx.Configuration;
|
||||
using Ryujinx.Configuration.Hid;
|
||||
using Ryujinx.Configuration.System;
|
||||
using Ryujinx.HLE.HOS.Services.Time.TimeZone;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
@@ -40,6 +41,7 @@ namespace Ryujinx.Ui
|
||||
[GUI] CheckButton _directKeyboardAccess;
|
||||
[GUI] ComboBoxText _systemLanguageSelect;
|
||||
[GUI] ComboBoxText _systemRegionSelect;
|
||||
[GUI] ComboBoxText _systemTimeZoneSelect;
|
||||
[GUI] CheckButton _custThemeToggle;
|
||||
[GUI] Entry _custThemePath;
|
||||
[GUI] ToggleButton _browseThemePath;
|
||||
@@ -80,9 +82,9 @@ namespace Ryujinx.Ui
|
||||
#pragma warning restore CS0649
|
||||
#pragma warning restore IDE0044
|
||||
|
||||
public SwitchSettings() : this(new Builder("Ryujinx.Ui.SwitchSettings.glade")) { }
|
||||
public SwitchSettings(HLE.FileSystem.VirtualFileSystem virtualFileSystem, HLE.FileSystem.Content.ContentManager contentManager) : this(new Builder("Ryujinx.Ui.SwitchSettings.glade"), virtualFileSystem, contentManager) { }
|
||||
|
||||
private SwitchSettings(Builder builder) : base(builder.GetObject("_settingsWin").Handle)
|
||||
private SwitchSettings(Builder builder, HLE.FileSystem.VirtualFileSystem virtualFileSystem, HLE.FileSystem.Content.ContentManager contentManager) : base(builder.GetObject("_settingsWin").Handle)
|
||||
{
|
||||
builder.Autoconnect(this);
|
||||
|
||||
@@ -197,8 +199,22 @@ namespace Ryujinx.Ui
|
||||
_custThemeToggle.Click();
|
||||
}
|
||||
|
||||
TimeZoneContentManager timeZoneContentManager = new TimeZoneContentManager();
|
||||
|
||||
timeZoneContentManager.InitializeInstance(virtualFileSystem, contentManager, LibHac.FsSystem.IntegrityCheckLevel.None);
|
||||
|
||||
List<string> locationNames = timeZoneContentManager.LocationNameCache.ToList();
|
||||
|
||||
locationNames.Sort();
|
||||
|
||||
foreach (string locationName in locationNames)
|
||||
{
|
||||
_systemTimeZoneSelect.Append(locationName, locationName);
|
||||
}
|
||||
|
||||
_systemLanguageSelect.SetActiveId(ConfigurationState.Instance.System.Language.Value.ToString());
|
||||
_systemRegionSelect .SetActiveId(ConfigurationState.Instance.System.Region.Value.ToString());
|
||||
_systemTimeZoneSelect.SetActiveId(timeZoneContentManager.SanityCheckDeviceLocationName());
|
||||
_controller1Type .SetActiveId(ConfigurationState.Instance.Hid.ControllerType.Value.ToString());
|
||||
Controller_Changed(null, null, _controller1Type.ActiveId, _controller1Image);
|
||||
|
||||
@@ -448,6 +464,8 @@ namespace Ryujinx.Ui
|
||||
ConfigurationState.Instance.Ui.GameDirs.Value = gameDirs;
|
||||
ConfigurationState.Instance.System.FsGlobalAccessLogMode.Value = (int)_fsLogSpinAdjustment.Value;
|
||||
|
||||
ConfigurationState.Instance.System.TimeZone.Value = _systemTimeZoneSelect.ActiveId;
|
||||
|
||||
MainWindow.SaveConfig();
|
||||
MainWindow.ApplyTheme();
|
||||
MainWindow.UpdateGameTable();
|
||||
|
@@ -210,6 +210,51 @@
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="box2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="tooltip_text" translatable="yes">Change System TimeZone</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">System TimeZone:</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBoxText" id="_systemTimeZoneSelect">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="tooltip_text" translatable="yes">Change System TimeZone</property>
|
||||
<property name="margin_left">5</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="_discordToggle">
|
||||
<property name="label" translatable="yes">Enable Discord Rich Presence</property>
|
||||
@@ -224,7 +269,7 @@
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="padding">5</property>
|
||||
<property name="position">1</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
|
Reference in New Issue
Block a user