From c5a9ab8119e09e473f951237a3de38ddc78ca9a0 Mon Sep 17 00:00:00 2001 From: shweet Date: Thu, 9 Jul 2026 21:37:41 -0400 Subject: [PATCH] fix spritesheet overwrite warning --- src/util/imgui/popup.cpp | 13 ++++++++++++- src/util/imgui/popup.hpp | 7 ++++++- workshop/metadata.xml | 2 +- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/util/imgui/popup.cpp b/src/util/imgui/popup.cpp index b4398c0..1d14342 100644 --- a/src/util/imgui/popup.cpp +++ b/src/util/imgui/popup.cpp @@ -6,6 +6,8 @@ namespace anm2ed::imgui { + int PopupHelper::nextId = 1; + #define POPUP_LIST \ X(POPUP_SMALL, 0.25f, true) \ X(POPUP_NORMAL, 0.5f, true) \ @@ -32,6 +34,15 @@ namespace anm2ed::imgui this->labelId = labelId; this->type = type; this->position = position; + id = nextId++; + } + + const char* PopupHelper::label() const + { + labelText = localize.get(labelId); + labelText += "##Popup"; + labelText += std::to_string(id); + return labelText.c_str(); } void PopupHelper::open() @@ -45,7 +56,7 @@ namespace anm2ed::imgui void PopupHelper::trigger() { - if (isTriggered) ImGui::OpenPopup(localize.get(labelId)); + if (isTriggered) ImGui::OpenPopup(label()); isTriggered = false; auto viewport = ImGui::GetMainViewport(); diff --git a/src/util/imgui/popup.hpp b/src/util/imgui/popup.hpp index feac831..96cc8a0 100644 --- a/src/util/imgui/popup.hpp +++ b/src/util/imgui/popup.hpp @@ -1,5 +1,7 @@ #pragma once +#include + #include "strings.hpp" namespace anm2ed::imgui @@ -31,12 +33,15 @@ namespace anm2ed::imgui StringType labelId{}; PopupType type{}; PopupPosition position{}; + int id{}; bool isOpen{}; bool isTriggered{}; bool isJustOpened{}; + mutable std::string labelText{}; + static int nextId; PopupHelper(StringType, PopupType = POPUP_NORMAL, PopupPosition = POPUP_CENTER); - const char* label() const { return localize.get(labelId); } + const char* label() const; bool is_open(); void open(); void trigger(); diff --git a/workshop/metadata.xml b/workshop/metadata.xml index 8046fe2..8b5c3c9 100644 --- a/workshop/metadata.xml +++ b/workshop/metadata.xml @@ -51,6 +51,6 @@ Alternatively, if you have subscribed to the mod, you can find the latest releas [h3]Happy animating![/h3] [img]https://files.catbox.moe/4auc1c.gif[/img] - 2.25 + 2.26 Public