fix spritesheet overwrite warning

This commit is contained in:
shweet committed 2026-07-09 21:37:41 -04:00
1 parent 2b662d24d6
commit c5a9ab8119
3 files changed
+19 -3

No files matched your search

+12 -1
View File
@@ -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();
+6 -1
View File
@@ -1,5 +1,7 @@
#pragma once
#include <string>
#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();
+1 -1
View File
@@ -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]
</description>
<version>2.25</version>
<version>2.26</version>
<visibility>Public</visibility>
</metadata>