Hide UI rework/arrow key fix (#2504)
* Unbreak arrow keys * Use bitshift for Flags instead of literal
This commit is contained in:
parent
5ceaf344ce
commit
46ffc81d90
@ -4,5 +4,6 @@
|
|||||||
{
|
{
|
||||||
public Key ToggleVsync { get; set; }
|
public Key ToggleVsync { get; set; }
|
||||||
public Key Screenshot { get; set; }
|
public Key Screenshot { get; set; }
|
||||||
|
public Key ShowUi { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"version": 28,
|
"version": 29,
|
||||||
"enable_file_log": true,
|
"enable_file_log": true,
|
||||||
"res_scale": 1,
|
"res_scale": 1,
|
||||||
"res_scale_custom": 1,
|
"res_scale_custom": 1,
|
||||||
@ -58,7 +58,8 @@
|
|||||||
"enable_mouse": false,
|
"enable_mouse": false,
|
||||||
"hotkeys": {
|
"hotkeys": {
|
||||||
"toggle_vsync": "Tab",
|
"toggle_vsync": "Tab",
|
||||||
"screenshot": "F8"
|
"screenshot": "F8",
|
||||||
|
"show_ui": "F4"
|
||||||
},
|
},
|
||||||
"keyboard_config": [],
|
"keyboard_config": [],
|
||||||
"controller_config": [],
|
"controller_config": [],
|
||||||
|
@ -14,7 +14,7 @@ namespace Ryujinx.Configuration
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The current version of the file format
|
/// The current version of the file format
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const int CurrentVersion = 28;
|
public const int CurrentVersion = 29;
|
||||||
|
|
||||||
public int Version { get; set; }
|
public int Version { get; set; }
|
||||||
|
|
||||||
|
@ -543,7 +543,8 @@ namespace Ryujinx.Configuration
|
|||||||
Hid.Hotkeys.Value = new KeyboardHotkeys
|
Hid.Hotkeys.Value = new KeyboardHotkeys
|
||||||
{
|
{
|
||||||
ToggleVsync = Key.Tab,
|
ToggleVsync = Key.Tab,
|
||||||
Screenshot = Key.F8
|
Screenshot = Key.F8,
|
||||||
|
ShowUi = Key.F4
|
||||||
};
|
};
|
||||||
Hid.InputConfig.Value = new List<InputConfig>
|
Hid.InputConfig.Value = new List<InputConfig>
|
||||||
{
|
{
|
||||||
@ -859,6 +860,20 @@ namespace Ryujinx.Configuration
|
|||||||
configurationFileUpdated = true;
|
configurationFileUpdated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (configurationFileFormat.Version < 29)
|
||||||
|
{
|
||||||
|
Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 29.");
|
||||||
|
|
||||||
|
configurationFileFormat.Hotkeys = new KeyboardHotkeys
|
||||||
|
{
|
||||||
|
ToggleVsync = Key.Tab,
|
||||||
|
Screenshot = Key.F8,
|
||||||
|
ShowUi = Key.F4
|
||||||
|
};
|
||||||
|
|
||||||
|
configurationFileUpdated = true;
|
||||||
|
}
|
||||||
|
|
||||||
Logger.EnableFileLog.Value = configurationFileFormat.EnableFileLog;
|
Logger.EnableFileLog.Value = configurationFileFormat.EnableFileLog;
|
||||||
Graphics.ResScale.Value = configurationFileFormat.ResScale;
|
Graphics.ResScale.Value = configurationFileFormat.ResScale;
|
||||||
Graphics.ResScaleCustom.Value = configurationFileFormat.ResScaleCustom;
|
Graphics.ResScaleCustom.Value = configurationFileFormat.ResScaleCustom;
|
||||||
|
@ -101,6 +101,7 @@ namespace Ryujinx.Ui
|
|||||||
[GUI] MenuItem _simulateWakeUpMessage;
|
[GUI] MenuItem _simulateWakeUpMessage;
|
||||||
[GUI] MenuItem _scanAmiibo;
|
[GUI] MenuItem _scanAmiibo;
|
||||||
[GUI] MenuItem _takeScreenshot;
|
[GUI] MenuItem _takeScreenshot;
|
||||||
|
[GUI] MenuItem _hideUi;
|
||||||
[GUI] MenuItem _fullScreen;
|
[GUI] MenuItem _fullScreen;
|
||||||
[GUI] CheckMenuItem _startFullScreen;
|
[GUI] CheckMenuItem _startFullScreen;
|
||||||
[GUI] CheckMenuItem _favToggle;
|
[GUI] CheckMenuItem _favToggle;
|
||||||
@ -243,6 +244,8 @@ namespace Ryujinx.Ui
|
|||||||
_gameTable.SearchColumn = 2;
|
_gameTable.SearchColumn = 2;
|
||||||
_gameTable.SearchEqualFunc = (model, col, key, iter) => !((string)model.GetValue(iter, col)).Contains(key, StringComparison.InvariantCultureIgnoreCase);
|
_gameTable.SearchEqualFunc = (model, col, key, iter) => !((string)model.GetValue(iter, col)).Contains(key, StringComparison.InvariantCultureIgnoreCase);
|
||||||
|
|
||||||
|
_hideUi.Label = _hideUi.Label.Replace("SHOWUIKEY", ConfigurationState.Instance.Hid.Hotkeys.Value.ShowUi.ToString());
|
||||||
|
|
||||||
UpdateColumns();
|
UpdateColumns();
|
||||||
UpdateGameTable();
|
UpdateGameTable();
|
||||||
|
|
||||||
@ -1072,15 +1075,6 @@ namespace Ryujinx.Ui
|
|||||||
ConfigurationState.Instance.Graphics.AspectRatio.Value = ((int)aspectRatio + 1) > Enum.GetNames(typeof(AspectRatio)).Length - 1 ? AspectRatio.Fixed4x3 : aspectRatio + 1;
|
ConfigurationState.Instance.Graphics.AspectRatio.Value = ((int)aspectRatio + 1) > Enum.GetNames(typeof(AspectRatio)).Length - 1 ? AspectRatio.Fixed4x3 : aspectRatio + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Focus_Menu_Bar(object sender, KeyReleaseEventArgs args)
|
|
||||||
{
|
|
||||||
if (args.Event.Key == Gdk.Key.Alt_L)
|
|
||||||
{
|
|
||||||
ToggleExtraWidgets(true);
|
|
||||||
_menuBar.GrabFocus();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Row_Clicked(object sender, ButtonReleaseEventArgs args)
|
private void Row_Clicked(object sender, ButtonReleaseEventArgs args)
|
||||||
{
|
{
|
||||||
if (args.Event.Button != 3 /* Right Click */)
|
if (args.Event.Button != 3 /* Right Click */)
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="title" translatable="yes">Ryujinx</property>
|
<property name="title" translatable="yes">Ryujinx</property>
|
||||||
<property name="window_position">center</property>
|
<property name="window_position">center</property>
|
||||||
<signal name="key-release-event" handler="Focus_Menu_Bar" swapped="no" />
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkBox" id="_box">
|
<object class="GtkBox" id="_box">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
@ -15,7 +14,7 @@
|
|||||||
<child>
|
<child>
|
||||||
<object class="GtkMenuBar" id="_menuBar">
|
<object class="GtkMenuBar" id="_menuBar">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">False</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkMenuItem" id="_fileMenu">
|
<object class="GtkMenuItem" id="_fileMenu">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
@ -343,7 +342,7 @@
|
|||||||
<object class="GtkMenuItem" id="_hideUi">
|
<object class="GtkMenuItem" id="_hideUi">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="label" translatable="yes">Hide UI (Alt to show)</property>
|
<property name="label" translatable="yes">Hide UI (SHOWUIKEY to show)</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="use_underline">True</property>
|
||||||
<signal name="activate" handler="HideUi_Pressed" swapped="no" />
|
<signal name="activate" handler="HideUi_Pressed" swapped="no" />
|
||||||
</object>
|
</object>
|
||||||
|
@ -568,6 +568,12 @@ namespace Ryujinx.Ui
|
|||||||
Renderer.Screenshot();
|
Renderer.Screenshot();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (currentHotkeyState.HasFlag(KeyboardHotkeyState.ShowUi) &&
|
||||||
|
!_prevHotkeyState.HasFlag(KeyboardHotkeyState.ShowUi))
|
||||||
|
{
|
||||||
|
(Toplevel as MainWindow).ToggleExtraWidgets(true);
|
||||||
|
}
|
||||||
|
|
||||||
_prevHotkeyState = currentHotkeyState;
|
_prevHotkeyState = currentHotkeyState;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -593,9 +599,10 @@ namespace Ryujinx.Ui
|
|||||||
[Flags]
|
[Flags]
|
||||||
private enum KeyboardHotkeyState
|
private enum KeyboardHotkeyState
|
||||||
{
|
{
|
||||||
None,
|
None = 0,
|
||||||
ToggleVSync,
|
ToggleVSync = 1 << 0,
|
||||||
Screenshot
|
Screenshot = 1 << 1,
|
||||||
|
ShowUi = 1 << 2
|
||||||
}
|
}
|
||||||
|
|
||||||
private KeyboardHotkeyState GetHotkeyState()
|
private KeyboardHotkeyState GetHotkeyState()
|
||||||
@ -612,6 +619,11 @@ namespace Ryujinx.Ui
|
|||||||
state |= KeyboardHotkeyState.Screenshot;
|
state |= KeyboardHotkeyState.Screenshot;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_keyboardInterface.IsPressed((Key)ConfigurationState.Instance.Hid.Hotkeys.Value.ShowUi))
|
||||||
|
{
|
||||||
|
state |= KeyboardHotkeyState.ShowUi;
|
||||||
|
}
|
||||||
|
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user