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; } }