Files
HellionChat/ChatTwo/Ui/CommandHelpWindow.cs
T
JonKazama-Hellion 7d5496e959 refactor(namespace): rename ChatTwo.* to HellionChat.* across all source files
81 namespace declarations and 100 using directives converted via sed,
plus two FQN-aliases (ChatTwoPartyFinderPayload in PayloadHandler.cs and
ModifierFlag in KeybindManager.cs) updated. Critical: Language.Designer.cs
and HellionStrings.Designer.cs ResourceManager string arguments updated
synchronously — these are runtime reflection lookups not caught by the
C# compiler.

Two intentional ChatTwo references remain: the legacy migration path
'ChatTwo.json' in Plugin.cs (still points to upstream Chat 2's config
file by design) and the InternalsVisibleTo declaration in
AssemblyInfo.cs (handled in the upcoming repo-folder rename task).

The local alias names 'ChatTwoPartyFinderPayload' and 'ChatTwoConflictDetector'
are preserved as local symbols; only their target namespaces and references
changed.
2026-05-03 21:23:28 +02:00

65 lines
1.9 KiB
C#

using System.Numerics;
using HellionChat.Util;
using Dalamud.Interface.Utility;
using Dalamud.Interface.Windowing;
using Dalamud.Utility;
using Dalamud.Bindings.ImGui;
using Lumina.Text.ReadOnly;
namespace HellionChat.Ui;
public class CommandHelpWindow : Window {
private ChatLogWindow LogWindow { get; }
private ReadOnlySeString? CommandDescription { get; set; }
internal CommandHelpWindow(ChatLogWindow logWindow) : base("command help##chat2-commandhelp")
{
LogWindow = logWindow;
Flags = ImGuiWindowFlags.NoSavedSettings | ImGuiWindowFlags.NoTitleBar | ImGuiWindowFlags.NoMove |
ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoFocusOnAppearing | ImGuiWindowFlags.AlwaysAutoResize;
RespectCloseHotkey = false;
DisableWindowSounds = true;
}
// Sets IsOpen to true if it should be drawn
public void UpdateContent(ReadOnlySeString commandDesc)
{
CommandDescription = commandDesc;
var width = 350;
var scaledWidth = width * ImGuiHelpers.GlobalScale;
var pos = LogWindow.LastWindowPos;
switch (Plugin.Config.CommandHelpSide) {
case CommandHelpSide.Right:
pos.X += LogWindow.LastWindowSize.X;
break;
case CommandHelpSide.Left:
pos.X -= scaledWidth;
break;
case CommandHelpSide.None:
default:
IsOpen = false;
return;
}
Position = pos;
SizeConstraints = new WindowSizeConstraints
{
MinimumSize = new Vector2(width, 0),
MaximumSize = LogWindow.LastWindowSize with { X = width }
};
IsOpen = true;
}
public override void Draw()
{
if (CommandDescription == null)
return;
LogWindow.DrawChunks(ChunkUtil.ToChunks(CommandDescription.Value.ToDalamudString(), ChunkSource.None, null).ToList());
}
}