From 47a2287e837b5c646c73d32fb96a5f027a6e73fb Mon Sep 17 00:00:00 2001 From: goaaats <16760685+goaaats@users.noreply.github.com> Date: Sat, 4 Dec 2021 15:10:24 +0100 Subject: [PATCH] feat(console): require double click to kill game --- .../Internal/Windows/ConsoleWindow.cs | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/Dalamud/Interface/Internal/Windows/ConsoleWindow.cs b/Dalamud/Interface/Internal/Windows/ConsoleWindow.cs index a34d758f7..26e1d63ad 100644 --- a/Dalamud/Interface/Internal/Windows/ConsoleWindow.cs +++ b/Dalamud/Interface/Internal/Windows/ConsoleWindow.cs @@ -43,6 +43,8 @@ namespace Dalamud.Interface.Internal.Windows private int historyPos; private List history = new(); + private bool killGameArmed = false; + /// /// Initializes a new instance of the class. /// @@ -63,6 +65,13 @@ namespace Dalamud.Interface.Internal.Windows private List LogEntries => this.isFiltered ? this.filteredLogText : this.logText; + /// + public override void OnOpen() + { + this.killGameArmed = false; + base.OnOpen(); + } + /// /// Dispose of managed and unmanaged resources. /// @@ -190,8 +199,16 @@ namespace Dalamud.Interface.Internal.Windows ImGui.SetTooltip("Copy Log"); ImGui.SameLine(); - if (ImGuiComponents.IconButton(FontAwesomeIcon.Skull)) - Process.GetCurrentProcess().Kill(); + 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");