diff --git a/Glamaholic/Configuration.cs b/Glamaholic/Configuration.cs index 2430284..cda7bfd 100755 --- a/Glamaholic/Configuration.cs +++ b/Glamaholic/Configuration.cs @@ -11,6 +11,7 @@ namespace Glamaholic { public List Plates { get; init; } = new(); public bool ShowEditorMenu = true; public bool ShowExamineMenu = true; + public bool ShowKofiButton = true; internal void AddPlate(SavedPlate plate) { var valid = Enum.GetValues(); diff --git a/Glamaholic/Ui/MainInterface.cs b/Glamaholic/Ui/MainInterface.cs index 31d5cf1..95d502e 100755 --- a/Glamaholic/Ui/MainInterface.cs +++ b/Glamaholic/Ui/MainInterface.cs @@ -156,10 +156,31 @@ namespace Glamaholic.Ui { if (ImGui.BeginMenu("Settings")) { anyChanged |= ImGui.MenuItem("Show plate editor menu", null, ref this.Ui.Plugin.Config.ShowEditorMenu); anyChanged |= ImGui.MenuItem("Show examine window menu", null, ref this.Ui.Plugin.Config.ShowExamineMenu); + ImGui.Separator(); + anyChanged |= ImGui.MenuItem("Show Ko-fi button", null, ref this.Ui.Plugin.Config.ShowKofiButton); ImGui.EndMenu(); } + if (this.Ui.Plugin.Config.ShowKofiButton) { + const string kofiText = "Support on Ko-fi"; + var kofiTextSize = ImGui.CalcTextSize(kofiText); + ImGui.GetWindowDrawList().AddRectFilled( + ImGui.GetCursorScreenPos(), + ImGui.GetCursorScreenPos() + kofiTextSize + ImGui.GetStyle().ItemInnerSpacing * 2, + 0xFF5B5EFF + ); + ImGui.PushStyleColor(ImGuiCol.Text, 0xFFFFFFFF); + ImGui.PushStyleColor(ImGuiCol.HeaderHovered, 0x00000000); + if (ImGui.MenuItem(kofiText)) { + Process.Start(new ProcessStartInfo("https://ko-fi.com/ascclemens") { + UseShellExecute = true, + }); + } + + ImGui.PopStyleColor(2); + } + if (anyChanged) { this.Ui.Plugin.SaveConfig(); } @@ -445,7 +466,7 @@ namespace Glamaholic.Ui { drawCursor + new Vector2(paddingSize / 2f) + new Vector2(iconSize), ImGui.ColorConvertFloat4ToU32(ImGui.GetStyle().Colors[(int) ImGuiCol.Text]) ); - + ImGui.GetWindowDrawList().AddLine( drawCursor + new Vector2(paddingSize / 2f) + new Vector2(iconSize, 0), drawCursor + new Vector2(paddingSize / 2f) + new Vector2(0, iconSize),