minor bug fixes
This commit is contained in:
@@ -119,6 +119,7 @@ namespace anm2ed::imgui
|
||||
|
||||
closePopup.trigger();
|
||||
|
||||
bool isClosePopupOpenPrevious = closePopup.isOpen;
|
||||
if (ImGui::BeginPopupModal(closePopup.label(), &closePopup.isOpen, ImGuiWindowFlags_NoResize))
|
||||
{
|
||||
if (closeDocumentIndex >= 0 && closeDocumentIndex < (int)manager.documents.size())
|
||||
@@ -168,6 +169,8 @@ namespace anm2ed::imgui
|
||||
|
||||
ImGui::EndPopup();
|
||||
}
|
||||
|
||||
if ((isClosePopupOpenPrevious != closePopup.isOpen) && isQuitting) isQuitting = false;
|
||||
}
|
||||
|
||||
ImGui::End();
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
#include <imgui/imgui_internal.h>
|
||||
|
||||
#include <format>
|
||||
#include <cmath>
|
||||
#include <format>
|
||||
#include <sstream>
|
||||
#include <unordered_map>
|
||||
|
||||
@@ -116,10 +116,16 @@ namespace anm2ed::imgui
|
||||
return isActivated;
|
||||
}
|
||||
|
||||
std::string& selectable_input_text_id()
|
||||
{
|
||||
static std::string editID{};
|
||||
return editID;
|
||||
}
|
||||
|
||||
bool selectable_input_text(const std::string& label, const std::string& id, std::string& text, bool isSelected,
|
||||
ImGuiSelectableFlags flags, RenameState& state)
|
||||
{
|
||||
static std::string editID{};
|
||||
auto& editID = selectable_input_text_id();
|
||||
auto isRename = editID == id;
|
||||
bool isActivated{};
|
||||
|
||||
|
||||
@@ -180,6 +180,7 @@ namespace anm2ed::imgui
|
||||
bool input_float_range(const char*, float&, float, float, float = STEP, float = STEP_FAST, const char* = "%.3f",
|
||||
ImGuiInputTextFlags = 0);
|
||||
bool combo_negative_one_indexed(const std::string&, int*, std::vector<const char*>&);
|
||||
std::string& selectable_input_text_id();
|
||||
bool selectable_input_text(const std::string& label, const std::string& id, std::string& text, bool isSelected,
|
||||
ImGuiSelectableFlags flags, RenameState& state);
|
||||
void set_item_tooltip_shortcut(const char*, const std::string& = {});
|
||||
|
||||
@@ -220,6 +220,7 @@ namespace anm2ed::imgui
|
||||
auto add = [&]()
|
||||
{
|
||||
anm2::Animation animation;
|
||||
animation.name = localize.get(TEXT_NEW_ANIMATION);
|
||||
if (anm2::Animation* referenceAnimation = document.animation_get())
|
||||
{
|
||||
for (auto [id, layerAnimation] : referenceAnimation->layerAnimations)
|
||||
|
||||
@@ -127,7 +127,9 @@ namespace anm2ed::imgui
|
||||
auto add = [&]()
|
||||
{
|
||||
auto id = map::next_id_get(anm2.content.events);
|
||||
anm2.content.events[id] = anm2::Event();
|
||||
anm2::Event event{};
|
||||
event.name = localize.get(TEXT_NEW_EVENT);
|
||||
anm2.content.events[id] = event;
|
||||
selection = {id};
|
||||
reference = {id};
|
||||
newEventId = id;
|
||||
|
||||
@@ -31,9 +31,11 @@ namespace anm2ed::imgui
|
||||
|
||||
auto widgetSize = widget_size_with_row_get(2);
|
||||
|
||||
if (ImGui::Button(localize.get(BASIC_NEW), widgetSize)) dialog.file_save(dialog::ANM2_NEW); // handled in taskbar.cpp
|
||||
if (ImGui::Button(localize.get(BASIC_NEW), widgetSize))
|
||||
dialog.file_save(dialog::ANM2_NEW); // handled in taskbar.cpp
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button(localize.get(BASIC_OPEN), widgetSize)) dialog.file_open(dialog::ANM2_OPEN); // handled in taskbar.cpp
|
||||
if (ImGui::Button(localize.get(BASIC_OPEN), widgetSize))
|
||||
dialog.file_open(dialog::ANM2_OPEN); // handled in taskbar.cpp
|
||||
|
||||
if (ImGui::BeginChild("##Recent Files Child", {}, ImGuiChildFlags_Borders))
|
||||
{
|
||||
@@ -97,6 +99,8 @@ namespace anm2ed::imgui
|
||||
|
||||
ImGui::EndPopup();
|
||||
}
|
||||
|
||||
selectable_input_text_id() = {};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user