feat(window): restore hide-chat-window + Enter-to-restore (1.5.6)

The eye/hide button now hides the HellionChat window (runtime-only, via a new
DrawConditions gate) instead of toggling native-chat suppression, matching 1.5.6.
The chat-activation keybind (Enter / "/"), whose dispatch was a dead stub in the
KeybindManager since the v1.6.0 rewrite, is re-wired to MainWindow.ActivateChat:
it un-hides, opens if closed, brings the window to front and focuses the input --
so the chat reacts to Enter again from any state. /hellion is a reliable one-press
recovery (Toggle now clears the hide), and the window always shows on login
(start state no longer read from the persisted flag). Adds HideRestoreSelfTestStep.
This commit is contained in:
2026-06-15 20:49:14 +02:00
parent b397591ba4
commit a73f4d0d0c
7 changed files with 124 additions and 19 deletions
+12 -10
View File
@@ -45,6 +45,9 @@ internal sealed class InputBar
// pop-out would be confusing). The main window's InputBar gets the instance.
private readonly ThemeQuickPicker? _themeQuickPicker;
// Null in pop-outs (those have their own close button). Hides the main window.
private readonly Action? _onHideWindow;
private string _pendingMessage = string.Empty;
private bool _isFocused;
private bool _wasInputTextHovered;
@@ -81,7 +84,8 @@ internal sealed class InputBar
ILogger<InputBar> logger,
Action onOpenSettings,
CommandHelpWindow commandHelpWindow,
ThemeQuickPicker? themeQuickPicker = null
ThemeQuickPicker? themeQuickPicker = null,
Action? onHideWindow = null
)
{
_symbolPicker = symbolPicker;
@@ -92,6 +96,7 @@ internal sealed class InputBar
_onOpenSettings = onOpenSettings;
_commandHelpWindow = commandHelpWindow;
_themeQuickPicker = themeQuickPicker;
_onHideWindow = onHideWindow;
}
public string PendingMessage => _pendingMessage;
@@ -540,20 +545,17 @@ internal sealed class InputBar
ImGui.SetTooltip("Settings");
}
// Hide button gated on ShowHideButton (1.5.6 parity). It is the last
// button in the row, so skipping it (with its leading SameLine) leaves
// no dangling SameLine. Shared by main + pop-out InputBars.
if (Plugin.Config.ShowHideButton)
// Hides the window (1.5.6 UserHide). One-way — Enter brings it back.
// Main window only (pop-outs have their own close); last in the row.
if (Plugin.Config.ShowHideButton && _onHideWindow is not null)
{
ImGui.SameLine();
var hidden = Plugin.Config.HideChat;
var visIcon = hidden ? FontAwesomeIcon.EyeSlash : FontAwesomeIcon.Eye;
if (ImGui.Button(visIcon.ToIconString()))
Plugin.Config.HideChat = !hidden;
if (ImGui.Button(FontAwesomeIcon.EyeSlash.ToIconString()))
_onHideWindow();
if (ImGui.IsItemHovered())
{
using (ImRaii.DefaultFont())
ImGui.SetTooltip(hidden ? "Unhide chat" : "Hide chat");
ImGui.SetTooltip("Hide chat (Enter to bring back)");
}
}
}