Skip to content

Commit

Permalink
type in z layer now works thanks to LevelEditorLayer bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
HJfod committed Feb 10, 2024
1 parent 4756145 commit dda8b4b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/features/TypeInZLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
);

Expand Down
2 changes: 2 additions & 0 deletions src/utils/EditableBMLabelProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down

0 comments on commit dda8b4b

Please sign in to comment.