feat(console): require double click to kill game

This commit is contained in:
goaaats 2021-12-04 15:10:24 +01:00
parent 08f9485719
commit 47a2287e83
No known key found for this signature in database
GPG key ID: F18F057873895461

View file

@ -43,6 +43,8 @@ namespace Dalamud.Interface.Internal.Windows
private int historyPos;
private List<string> history = new();
private bool killGameArmed = false;
/// <summary>
/// Initializes a new instance of the <see cref="ConsoleWindow"/> class.
/// </summary>
@ -63,6 +65,13 @@ namespace Dalamud.Interface.Internal.Windows
private List<LogEntry> LogEntries => this.isFiltered ? this.filteredLogText : this.logText;
/// <inheritdoc/>
public override void OnOpen()
{
this.killGameArmed = false;
base.OnOpen();
}
/// <summary>
/// Dispose of managed and unmanaged resources.
/// </summary>
@ -190,8 +199,16 @@ namespace Dalamud.Interface.Internal.Windows
ImGui.SetTooltip("Copy Log");
ImGui.SameLine();
if (ImGuiComponents.IconButton(FontAwesomeIcon.Skull))
if (this.killGameArmed)
{
if (ImGuiComponents.IconButton(FontAwesomeIcon.Flushed))
Process.GetCurrentProcess().Kill();
}
else
{
if (ImGuiComponents.IconButton(FontAwesomeIcon.Skull))
this.killGameArmed = true;
}
if (ImGui.IsItemHovered())
ImGui.SetTooltip("Kill game");