From dda8b4b13083db6b0dea9ece8150bf5aff6f94f5 Mon Sep 17 00:00:00 2001 From: HJfod <60038575+HJfod@users.noreply.github.com> Date: Sat, 10 Feb 2024 18:07:35 +0200 Subject: [PATCH] type in z layer now works thanks to LevelEditorLayer bindings --- src/features/TypeInZLayer.cpp | 12 ++++++------ src/utils/EditableBMLabelProxy.cpp | 2 ++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/features/TypeInZLayer.cpp b/src/features/TypeInZLayer.cpp index 9beeba96..57cc9b47 100644 --- a/src/features/TypeInZLayer.cpp +++ b/src/features/TypeInZLayer.cpp @@ -12,12 +12,12 @@ class $modify(EditorUI) { m_currentLayerLabel = EditableBMLabelProxy::replace( m_currentLayerLabel, 40.f, "Z", [this](auto str) { - // try { - // m_editorLayer->m_currentLayer = std::stoi(str); - // } - // catch(...) { - // m_editorLayer->m_currentLayer = -1; - // } + try { + m_editorLayer->m_currentLayer = std::stoi(str); + } + catch(...) { + m_editorLayer->m_currentLayer = -1; + } } ); diff --git a/src/utils/EditableBMLabelProxy.cpp b/src/utils/EditableBMLabelProxy.cpp index ab667e24..83ce58c0 100644 --- a/src/utils/EditableBMLabelProxy.cpp +++ b/src/utils/EditableBMLabelProxy.cpp @@ -48,7 +48,9 @@ void EditableBMLabelProxy::setString(const char* str) { void EditableBMLabelProxy::setString(const char* str, bool needUpdateLabel) { CCLabelBMFont::setString(str, needUpdateLabel); if (m_input && !m_ignoreLabelUpdate) { + m_ignoreLabelUpdate = true; m_input->setString(str); + m_ignoreLabelUpdate = false; } }