feat: add option to disable movement
This commit is contained in:
parent
7607db473c
commit
e102ed0a15
|
@ -36,6 +36,7 @@ namespace PeepingTom {
|
||||||
public string SoundPath { get; set; } = null;
|
public string SoundPath { get; set; } = null;
|
||||||
public float SoundCooldown { get; set; } = 10f;
|
public float SoundCooldown { get; set; } = 10f;
|
||||||
|
|
||||||
|
public bool AllowMovement { get; set; } = true;
|
||||||
public bool ShowInCombat { get; set; } = false;
|
public bool ShowInCombat { get; set; } = false;
|
||||||
public bool ShowInInstance { get; set; } = false;
|
public bool ShowInInstance { get; set; } = false;
|
||||||
public bool ShowInCutscenes { get; set; } = false;
|
public bool ShowInCutscenes { get; set; } = false;
|
||||||
|
|
|
@ -153,8 +153,15 @@ namespace PeepingTom {
|
||||||
ImGui.EndTabItem();
|
ImGui.EndTabItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui.BeginTabItem("Visibility")) {
|
if (ImGui.BeginTabItem("Window")) {
|
||||||
// TODO: this needs somewhere better to live in the settings
|
bool allowMovement = this.config.AllowMovement;
|
||||||
|
if (ImGui.Checkbox("Allow moving the main window", ref allowMovement)) {
|
||||||
|
this.config.AllowMovement = allowMovement;
|
||||||
|
this.config.Save();
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui.Spacing();
|
||||||
|
|
||||||
bool showInCombat = this.config.ShowInCombat;
|
bool showInCombat = this.config.ShowInCombat;
|
||||||
if (ImGui.Checkbox("Show window while in combat", ref showInCombat)) {
|
if (ImGui.Checkbox("Show window while in combat", ref showInCombat)) {
|
||||||
this.config.ShowInCombat = showInCombat;
|
this.config.ShowInCombat = showInCombat;
|
||||||
|
@ -271,7 +278,11 @@ namespace PeepingTom {
|
||||||
this.PlaySound();
|
this.PlaySound();
|
||||||
}
|
}
|
||||||
this.lastTargetAmount = targeting.Length;
|
this.lastTargetAmount = targeting.Length;
|
||||||
if (ImGui.Begin(this.plugin.Name, ref this.visible, ImGuiWindowFlags.AlwaysAutoResize)) {
|
ImGuiWindowFlags flags = ImGuiWindowFlags.AlwaysAutoResize;
|
||||||
|
if (!this.config.AllowMovement) {
|
||||||
|
flags |= ImGuiWindowFlags.NoMove;
|
||||||
|
}
|
||||||
|
if (ImGui.Begin(this.plugin.Name, ref this.visible, flags)) {
|
||||||
ImGui.Text("Targeting you");
|
ImGui.Text("Targeting you");
|
||||||
bool anyHovered = false;
|
bool anyHovered = false;
|
||||||
if (ImGui.ListBoxHeader("##targeting", targeting.Length, 5)) {
|
if (ImGui.ListBoxHeader("##targeting", targeting.Length, 5)) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user