Skip to content

Commit

Permalink
Add option to ignore the close hotkey
Browse files Browse the repository at this point in the history
Closes #51
  • Loading branch information
SheepGoMeh authored and PrincessRTFM committed Jul 29, 2024
1 parent c770aa3 commit 1488670
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions HuntBuddy/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public int Version {
public bool HideLocalHuntBackground;
public bool HideCompletedHunts;
public bool SuppressEliteMarkLocationWarning;
public bool IgnoreCloseHotkey;
public float IconScale = 1f;
public Vector4 IconBackgroundColour = new(0.76f, 0.75f, 0.76f, 0.8f);

Expand Down
2 changes: 1 addition & 1 deletion HuntBuddy/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ private WindowSystem WindowSystem {
get;
}

private MainWindow MainWindow {
internal MainWindow MainWindow {
get;
}

Expand Down
8 changes: 8 additions & 0 deletions HuntBuddy/Windows/ConfigurationWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public ConfigurationWindow() : base(
true) {
this.Size = Vector2.Zero;
this.SizeCondition = ImGuiCond.Always;
this.RespectCloseHotkey = !Plugin.Instance.Configuration.IgnoreCloseHotkey;
}

public override void PreOpenCheck() {
Expand Down Expand Up @@ -51,6 +52,13 @@ public override void Draw() {

ImGui.Spacing();

if (ImGui.Checkbox("Ignore close hotkey",
ref Plugin.Instance.Configuration.IgnoreCloseHotkey)) {
this.RespectCloseHotkey = !Plugin.Instance.Configuration.IgnoreCloseHotkey;
Plugin.Instance.MainWindow.RespectCloseHotkey = !Plugin.Instance.Configuration.IgnoreCloseHotkey;
save = true;
}

save |= ImGui.Checkbox("Lock plugin window positions and sizes",
ref Plugin.Instance.Configuration.LockWindowPositions);

Expand Down
1 change: 1 addition & 0 deletions HuntBuddy/Windows/MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public MainWindow() : base(
true) {
this.Size = new Vector2(400 * ImGui.GetIO().FontGlobalScale, 500);
this.SizeCondition = ImGuiCond.FirstUseEver;
this.RespectCloseHotkey = !Plugin.Instance.Configuration.IgnoreCloseHotkey;
}

public override void PreOpenCheck() {
Expand Down

0 comments on commit 1488670

Please sign in to comment.