Skip to content

Commit

Permalink
Config update - focus target support, cleaner UI
Browse files Browse the repository at this point in the history
  • Loading branch information
oorzkws committed Apr 6, 2023
1 parent 08d198a commit 6a6f4e0
Showing 1 changed file with 29 additions and 10 deletions.
39 changes: 29 additions & 10 deletions BigPlayerDebuffsConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
using Dalamud.Plugin;
using ImGuiNET;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Numerics;
using Dalamud.Game.Text;

namespace BigPlayerDebuffs
{
Expand All @@ -27,8 +24,11 @@ public class BigPlayerDebuffsConfig : IPluginConfiguration {

public int Version { get; set; }

// What does the 'b' mean?
public float bScale = 1.4f;

public float fScale = 1.25f;
public bool includeMainTarget = true;
public bool includeFocusTarget = true;

public void Init(BigPlayerDebuffs plugin, DalamudPluginInterface pluginInterface) {
this.plugin = plugin;
Expand All @@ -47,17 +47,36 @@ public bool DrawConfigUI() {

var modified = false;

ImGui.SetNextWindowSize(new Vector2(500 * scale, 350), ImGuiCond.FirstUseEver);
ImGui.SetNextWindowSizeConstraints(new Vector2(500 * scale, 350), new Vector2(560 * scale, 650));
ImGui.Begin($"{plugin.Name} Config", ref drawConfig, ImGuiWindowFlags.NoCollapse);

modified |= ImGui.SliderFloat("Own Buff/Debuff Scale", ref bScale, 1.0F, 2.0F);

ImGui.SetNextWindowSize(new Vector2(550, 120) * scale, ImGuiCond.FirstUseEver);
ImGui.SetNextWindowSizeConstraints(new Vector2(550, 110), new Vector2(1100, 650) * scale);
ImGui.Begin($"{plugin.Name} Configuration", ref drawConfig, ImGuiWindowFlags.NoCollapse);
// Target UI
ImGui.BeginGroup();
modified |= ImGui.Checkbox("##Enable scaling in Target UI",ref includeMainTarget);
if(ImGui.IsItemHovered())
ImGui.SetTooltip("Enable scaling in target UI");
ImGui.SameLine();
ImGui.BeginDisabled(!includeMainTarget);
modified |= ImGui.SliderFloat("Scale in Target UI", ref bScale, 1.0F, 2.0F, "%.2f");
ImGui.EndDisabled();
ImGui.EndGroup();
// Focus target
ImGui.BeginGroup();
modified |= ImGui.Checkbox("##Enable scaling in Focus Target UI",ref includeFocusTarget);
if(ImGui.IsItemHovered())
ImGui.SetTooltip("Enable scaling in focus target UI");
ImGui.SameLine();
ImGui.BeginDisabled(!includeFocusTarget);
modified |= ImGui.SliderFloat("Scale in Focus Target UI", ref fScale, 1.0F, 2.0F, "%.2f");
ImGui.EndDisabled();
ImGui.EndGroup();
ImGui.Text("Hint: Ctrl+Click a slider to input a number directly");
ImGui.End();


if (modified)
{
plugin.ResetTargetStatus();
Save();
}

Expand Down

0 comments on commit 6a6f4e0

Please sign in to comment.