some shit

This commit is contained in:
Anna 2022-09-07 13:25:05 -04:00
parent aef3dd0778
commit 6ad9dd02d9
3 changed files with 21 additions and 13 deletions

View File

@ -13,6 +13,8 @@ public class Configuration : IPluginConfiguration {
public bool RemoveGlow = true;
public bool AutoViewer;
public bool AutoViewerClose = true;
public bool LockViewer;
public bool ClickThroughViewer;
public bool HideTitlebar;
public float ViewerOpacity = 100.0f;
public int DefaultGlyph = 3;

View File

@ -25,16 +25,6 @@ internal class Settings : ITab {
anyChanged |= vfx |= ImGui.Checkbox("Disable in trials", ref this.Plugin.Config.DisableTrials);
anyChanged |= vfx |= ImGui.Checkbox("Disable in Deep Dungeons", ref this.Plugin.Config.DisableDeepDungeon);
anyChanged |= vfx |= ImGui.Checkbox("Remove glow effect from signs", ref this.Plugin.Config.RemoveGlow);
anyChanged |= ImGui.Checkbox("Open the viewer automatically when near a sign", ref this.Plugin.Config.AutoViewer);
anyChanged |= ImGui.Checkbox("Close the viewer automatically when no signs are nearby", ref this.Plugin.Config.AutoViewerClose);
if (this.Plugin.Config.AutoViewerClose) {
ImGui.TreePush();
anyChanged |= ImGui.Checkbox("Hide viewer titlebar", ref this.Plugin.Config.HideTitlebar);
ImGui.TreePop();
}
anyChanged |= ImGui.SliderFloat("Viewer opacity", ref this.Plugin.Config.ViewerOpacity, 0f, 100.0f, $"{this.Plugin.Config.ViewerOpacity:N3}%%");
var glyph = this.Plugin.Config.DefaultGlyph + 1;
if (ImGui.InputInt("Default glyph", ref glyph)) {
@ -42,6 +32,21 @@ internal class Settings : ITab {
anyChanged = true;
}
if (ImGui.CollapsingHeader("Viewer settings")) {
anyChanged |= ImGui.SliderFloat("Viewer opacity", ref this.Plugin.Config.ViewerOpacity, 0f, 100.0f, $"{this.Plugin.Config.ViewerOpacity:N3}%%");
anyChanged |= ImGui.Checkbox("Open the viewer automatically when near a sign", ref this.Plugin.Config.AutoViewer);
anyChanged |= ImGui.Checkbox("Close the viewer automatically when no signs are nearby", ref this.Plugin.Config.AutoViewerClose);
if (this.Plugin.Config.AutoViewerClose) {
ImGui.TreePush();
anyChanged |= ImGui.Checkbox("Hide viewer titlebar", ref this.Plugin.Config.HideTitlebar);
ImGui.TreePop();
}
anyChanged |= ImGui.Checkbox("Lock viewer in place", ref this.Plugin.Config.LockViewer);
anyChanged |= ImGui.Checkbox("Click through viewer", ref this.Plugin.Config.ClickThroughViewer);
}
if (anyChanged) {
this.Plugin.SaveConfig();
}

View File

@ -21,9 +21,10 @@ internal class Viewer {
return;
}
var flags = this.Plugin.Config.HideTitlebar
? ImGuiWindowFlags.NoTitleBar
: ImGuiWindowFlags.None;
var flags = ImGuiWindowFlags.NoBringToFrontOnFocus;
flags |= this.Plugin.Config.HideTitlebar ? ImGuiWindowFlags.NoTitleBar : ImGuiWindowFlags.None;
flags |= this.Plugin.Config.LockViewer ? ImGuiWindowFlags.NoMove : ImGuiWindowFlags.None;
flags |= this.Plugin.Config.ClickThroughViewer ? ImGuiWindowFlags.NoInputs : ImGuiWindowFlags.None;
ImGui.SetNextWindowSize(new Vector2(350, 175), ImGuiCond.FirstUseEver);
ImGui.SetNextWindowBgAlpha(this.Plugin.Config.ViewerOpacity / 100.0f);
if (!ImGui.Begin("Messages", ref this.Visible, flags)) {