fix spritesheet overwrite warning
This commit is contained in:
1 parent
2b662d24d6
commit
c5a9ab8119
3 files changed
+19
-3
No files matched your search
@@ -6,6 +6,8 @@
|
|||||||
|
|
||||||
namespace anm2ed::imgui
|
namespace anm2ed::imgui
|
||||||
{
|
{
|
||||||
|
int PopupHelper::nextId = 1;
|
||||||
|
|
||||||
#define POPUP_LIST \
|
#define POPUP_LIST \
|
||||||
X(POPUP_SMALL, 0.25f, true) \
|
X(POPUP_SMALL, 0.25f, true) \
|
||||||
X(POPUP_NORMAL, 0.5f, true) \
|
X(POPUP_NORMAL, 0.5f, true) \
|
||||||
@@ -32,6 +34,15 @@ namespace anm2ed::imgui
|
|||||||
this->labelId = labelId;
|
this->labelId = labelId;
|
||||||
this->type = type;
|
this->type = type;
|
||||||
this->position = position;
|
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()
|
void PopupHelper::open()
|
||||||
@@ -45,7 +56,7 @@ namespace anm2ed::imgui
|
|||||||
|
|
||||||
void PopupHelper::trigger()
|
void PopupHelper::trigger()
|
||||||
{
|
{
|
||||||
if (isTriggered) ImGui::OpenPopup(localize.get(labelId));
|
if (isTriggered) ImGui::OpenPopup(label());
|
||||||
isTriggered = false;
|
isTriggered = false;
|
||||||
|
|
||||||
auto viewport = ImGui::GetMainViewport();
|
auto viewport = ImGui::GetMainViewport();
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include "strings.hpp"
|
#include "strings.hpp"
|
||||||
|
|
||||||
namespace anm2ed::imgui
|
namespace anm2ed::imgui
|
||||||
@@ -31,12 +33,15 @@ namespace anm2ed::imgui
|
|||||||
StringType labelId{};
|
StringType labelId{};
|
||||||
PopupType type{};
|
PopupType type{};
|
||||||
PopupPosition position{};
|
PopupPosition position{};
|
||||||
|
int id{};
|
||||||
bool isOpen{};
|
bool isOpen{};
|
||||||
bool isTriggered{};
|
bool isTriggered{};
|
||||||
bool isJustOpened{};
|
bool isJustOpened{};
|
||||||
|
mutable std::string labelText{};
|
||||||
|
static int nextId;
|
||||||
|
|
||||||
PopupHelper(StringType, PopupType = POPUP_NORMAL, PopupPosition = POPUP_CENTER);
|
PopupHelper(StringType, PopupType = POPUP_NORMAL, PopupPosition = POPUP_CENTER);
|
||||||
const char* label() const { return localize.get(labelId); }
|
const char* label() const;
|
||||||
bool is_open();
|
bool is_open();
|
||||||
void open();
|
void open();
|
||||||
void trigger();
|
void trigger();
|
||||||
|
|||||||
@@ -51,6 +51,6 @@ Alternatively, if you have subscribed to the mod, you can find the latest releas
|
|||||||
[h3]Happy animating![/h3]
|
[h3]Happy animating![/h3]
|
||||||
[img]https://files.catbox.moe/4auc1c.gif[/img]
|
[img]https://files.catbox.moe/4auc1c.gif[/img]
|
||||||
</description>
|
</description>
|
||||||
<version>2.25</version>
|
<version>2.26</version>
|
||||||
<visibility>Public</visibility>
|
<visibility>Public</visibility>
|
||||||
</metadata>
|
</metadata>
|
||||||
Reference in new issue
Block a user