Skip to content

Commit

Permalink
DTR tab -> Settings tab (#112)
Browse files Browse the repository at this point in the history
* Modified DTR setting tab to be a general settings tab

* minor description change
  • Loading branch information
Jaksuhn authored Nov 8, 2023
1 parent f98136d commit 63ce61e
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions YesAlready/UI/MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public override void Draw()
DisplayListOptions();
DisplayTalkOptions();
DisplayBotherOptions();
DisplayDTROptions();
DisplayMiscOptions();

//if (ImGui.BeginTabItem("About"))
//{
Expand All @@ -102,6 +102,16 @@ public override void Draw()
}
}

private static void IndentedTextColored(Vector4 color, string text)
{
var indent = 27f * ImGuiHelpers.GlobalScale;
ImGui.Indent(indent);
ImGui.PushStyleColor(ImGuiCol.Text, color);
ImGui.TextWrapped(text);
ImGui.PopStyleColor();
ImGui.Unindent(indent);
}

#region Testing

private void UiBuilder_TestButton()
Expand Down Expand Up @@ -135,9 +145,9 @@ private void UiBuilder_TestButton()

// ====================================================================================================

private void DisplayDTROptions()
private void DisplayMiscOptions()
{
if (!ImGui.BeginTabItem("Server info bar"))
if (!ImGui.BeginTabItem("Settings"))
return;

ImGui.PushID("Server info bar");
Expand All @@ -147,7 +157,7 @@ private void DisplayDTROptions()
var config = DalamudReflector.GetService("Dalamud.Configuration.Internal.DalamudConfiguration");
var dtrList = config.GetFoP<List<string>>("DtrIgnore");
var enabled = !dtrList.Contains(Svc.PluginInterface.InternalName);
if(ImGui.Checkbox("Enable", ref enabled))
if(ImGui.Checkbox("DTR", ref enabled))
{
if(enabled)
{
Expand All @@ -159,6 +169,7 @@ private void DisplayDTROptions()
}
config.Call("QueueSave");
}
IndentedTextColored(shadedColor, $"Display the status of the {Name} in the Server Info Bar (DTR Bar). Clicking toggles the plugin.");
}
catch(Exception e)
{
Expand Down Expand Up @@ -235,16 +246,6 @@ private void DisplayBotherOptions()
if (!ImGui.BeginTabItem("Bothers"))
return;

static void IndentedTextColored(Vector4 color, string text)
{
var indent = 27f * ImGuiHelpers.GlobalScale;
ImGui.Indent(indent);
ImGui.PushStyleColor(ImGuiCol.Text, color);
ImGui.TextWrapped(text);
ImGui.PopStyleColor();
ImGui.Unindent(indent);
}

ImGui.PushID("BotherOptions");

#region Disable hotkey
Expand Down Expand Up @@ -688,7 +689,7 @@ private static void DisplayOkButtons()
sb.AppendLine("Ctrl-Shift right click a line to delete it and any children.");
sb.AppendLine();
sb.AppendLine("\"Add last seen as new entry\" button modifiers:");
sb.AppendLine(" Shift-Click to add to a new or first existing folder with the current zone name, restricted to that zone.");
sb.AppendLine(" Shift-Click to add to a new or first existing folder.");
sb.AppendLine();
sb.AppendLine("Currently supported text addons:");
sb.AppendLine(" - SelectOk");
Expand Down

0 comments on commit 63ce61e

Please sign in to comment.