fix: close gamepad overlay when setting is disabled

This commit is contained in:
goaaats 2022-06-24 14:11:55 +02:00
parent bf72ad589d
commit b7cbaacac6
No known key found for this signature in database
GPG key ID: 49E2AA8C6A76498B
5 changed files with 16 additions and 8 deletions

View file

@ -128,9 +128,9 @@ namespace Dalamud.Game.Gui.Internal
private void ToggleWindow(bool visible)
{
if (visible)
Service<DalamudInterface>.Get().OpenIMEWindow();
Service<DalamudInterface>.Get().OpenImeWindow();
else
Service<DalamudInterface>.Get().CloseIMEWindow();
Service<DalamudInterface>.Get().CloseImeWindow();
}
private long WndProcDetour(IntPtr hWnd, uint msg, ulong wParam, long lParam)

View file

@ -289,7 +289,7 @@ namespace Dalamud.Interface.Internal
private void OnDebugDrawIMEPanel(string command, string arguments)
{
Service<DalamudInterface>.Get().OpenIMEWindow();
Service<DalamudInterface>.Get().OpenImeWindow();
}
private void OnOpenLog(string command, string arguments)

View file

@ -232,7 +232,7 @@ namespace Dalamud.Interface.Internal
/// <summary>
/// Opens the <see cref="IMEWindow"/>.
/// </summary>
public void OpenIMEWindow() => this.imeWindow.IsOpen = true;
public void OpenImeWindow() => this.imeWindow.IsOpen = true;
/// <summary>
/// Opens the <see cref="ConsoleWindow"/>.
@ -263,7 +263,7 @@ namespace Dalamud.Interface.Internal
/// Opens the <see cref="StyleEditorWindow"/>.
/// </summary>
public void OpenStyleEditor() => this.styleEditorWindow.IsOpen = true;
/// <summary>
/// Opens the <see cref="ProfilerWindow"/>.
/// </summary>
@ -276,7 +276,12 @@ namespace Dalamud.Interface.Internal
/// <summary>
/// Closes the <see cref="IMEWindow"/>.
/// </summary>
public void CloseIMEWindow() => this.imeWindow.IsOpen = false;
public void CloseImeWindow() => this.imeWindow.IsOpen = false;
/// <summary>
/// Closes the <see cref="GamepadModeNotifierWindow"/>.
/// </summary>
public void CloseGamepadModeNotifierWindow() => this.gamepadModeNotifierWindow.IsOpen = false;
#endregion

View file

@ -29,7 +29,7 @@ namespace Dalamud.Interface.Internal.Windows
/// <inheritdoc/>
public override void Draw()
{
if (this.IsOpen && Service<KeyState>.Get()[VirtualKey.SHIFT]) Service<DalamudInterface>.Get().CloseIMEWindow();
if (this.IsOpen && Service<KeyState>.Get()[VirtualKey.SHIFT]) Service<DalamudInterface>.Get().CloseImeWindow();
var ime = Service<DalamudIME>.GetNullable();
if (ime == null || !ime.IsEnabled)
@ -42,7 +42,7 @@ namespace Dalamud.Interface.Internal.Windows
/// <inheritdoc/>
public override void PostDraw()
{
if (this.IsOpen && Service<KeyState>.Get()[VirtualKey.SHIFT]) Service<DalamudInterface>.Get().CloseIMEWindow();
if (this.IsOpen && Service<KeyState>.Get()[VirtualKey.SHIFT]) Service<DalamudInterface>.Get().CloseImeWindow();
var ime = Service<DalamudIME>.GetNullable();
if (ime == null || !ime.IsEnabled)

View file

@ -952,6 +952,9 @@ namespace Dalamud.Interface.Internal.Windows
{
ImGui.GetIO().BackendFlags &= ~ImGuiBackendFlags.HasGamepad;
ImGui.GetIO().ConfigFlags &= ~ImGuiConfigFlags.NavEnableSetMousePos;
var di = Service<DalamudInterface>.Get();
di.CloseGamepadModeNotifierWindow();
}
else
{