feat: add ko-fi button
This commit is contained in:
parent
0c4e67e21f
commit
79ecf99df8
|
@ -11,6 +11,7 @@ namespace Glamaholic {
|
||||||
public List<SavedPlate> Plates { get; init; } = new();
|
public List<SavedPlate> Plates { get; init; } = new();
|
||||||
public bool ShowEditorMenu = true;
|
public bool ShowEditorMenu = true;
|
||||||
public bool ShowExamineMenu = true;
|
public bool ShowExamineMenu = true;
|
||||||
|
public bool ShowKofiButton = true;
|
||||||
|
|
||||||
internal void AddPlate(SavedPlate plate) {
|
internal void AddPlate(SavedPlate plate) {
|
||||||
var valid = Enum.GetValues<PlateSlot>();
|
var valid = Enum.GetValues<PlateSlot>();
|
||||||
|
|
|
@ -156,10 +156,31 @@ namespace Glamaholic.Ui {
|
||||||
if (ImGui.BeginMenu("Settings")) {
|
if (ImGui.BeginMenu("Settings")) {
|
||||||
anyChanged |= ImGui.MenuItem("Show plate editor menu", null, ref this.Ui.Plugin.Config.ShowEditorMenu);
|
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);
|
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();
|
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) {
|
if (anyChanged) {
|
||||||
this.Ui.Plugin.SaveConfig();
|
this.Ui.Plugin.SaveConfig();
|
||||||
}
|
}
|
||||||
|
@ -445,7 +466,7 @@ namespace Glamaholic.Ui {
|
||||||
drawCursor + new Vector2(paddingSize / 2f) + new Vector2(iconSize),
|
drawCursor + new Vector2(paddingSize / 2f) + new Vector2(iconSize),
|
||||||
ImGui.ColorConvertFloat4ToU32(ImGui.GetStyle().Colors[(int) ImGuiCol.Text])
|
ImGui.ColorConvertFloat4ToU32(ImGui.GetStyle().Colors[(int) ImGuiCol.Text])
|
||||||
);
|
);
|
||||||
|
|
||||||
ImGui.GetWindowDrawList().AddLine(
|
ImGui.GetWindowDrawList().AddLine(
|
||||||
drawCursor + new Vector2(paddingSize / 2f) + new Vector2(iconSize, 0),
|
drawCursor + new Vector2(paddingSize / 2f) + new Vector2(iconSize, 0),
|
||||||
drawCursor + new Vector2(paddingSize / 2f) + new Vector2(0, iconSize),
|
drawCursor + new Vector2(paddingSize / 2f) + new Vector2(0, iconSize),
|
||||||
|
|
Loading…
Reference in New Issue