diff --git a/changelog.md b/changelog.md index 7d22b2c..fea7972 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,8 @@ # BetterEdit 6 +## v6.10.0-alpha.4 + * Fix Layer Lock Button sometimes being visible on All + ## v6.10.0-alpha.3 * Add Create Loop keybind * Fix Next Free not working for Editor Layers diff --git a/mod.json b/mod.json index 98141c8..b4e2dcf 100644 --- a/mod.json +++ b/mod.json @@ -1,6 +1,6 @@ { "geode": "4.1.0", - "version": "6.10.0-alpha.3", + "version": "6.10.0-alpha.4", "gd": { "win": "2.2074", "mac": "2.2074", diff --git a/src/features/TypeInZLayer.cpp b/src/features/TypeInZLayer.cpp index 6d46f88..adacc08 100644 --- a/src/features/TypeInZLayer.cpp +++ b/src/features/TypeInZLayer.cpp @@ -59,7 +59,7 @@ class $modify(TypeInUI, EditorUI) { m_editorLayer->m_currentLayer = numFromString(str).unwrapOr(-1); }, [this](auto) { - this->updateLockBtn(); + this->updateLockBtn(true); } ); m_currentLayerLabel = proxy; @@ -74,16 +74,16 @@ class $modify(TypeInUI, EditorUI) { static_cast(this->getChildByID("layer-locked-sprite"))->setOpacity(0); m_fields->onUIHide.setFilter(UIShowFilter(this)); - m_fields->onUIHide.bind([this, layerLockBtn, nextFreeBtn](auto* ev) { + m_fields->onUIHide.bind([this, nextFreeBtn](auto* ev) { m_currentLayerLabel->setVisible(ev->show); - layerLockBtn->setVisible(ev->show); nextFreeBtn->setVisible(ev->show); + this->updateLockBtn(ev->show); }); return true; } - void updateLockBtn() { + void updateLockBtn(bool show) { auto layerMenu = this->getChildByID("layer-menu"); if (!layerMenu) return; auto lockBtn = static_cast(layerMenu->getChildByID("lock-layer"_spr)); @@ -108,7 +108,7 @@ class $modify(TypeInUI, EditorUI) { lockBtn->setNormalImage(spr); spr->setAnchorPoint((layerLocked || onAll) ? ccp(.47f, .48f) : ccp(.5f, .2f)); - lockBtn->setVisible(m_editorLayer->m_layerLockingEnabled && !onAll); + lockBtn->setVisible(show && m_editorLayer->m_layerLockingEnabled && !onAll); m_currentLayerLabel->setColor(layerLocked ? ccc3(255, 150, 0) : ccc3(255, 255, 255)); } @@ -131,12 +131,12 @@ class $modify(TypeInUI, EditorUI) { if (auto btn = this->querySelector("all-layers-button")) { btn->setVisible(true); } - this->updateLockBtn(); + this->updateLockBtn(true); } $override void onLockLayer(CCObject* sender) { EditorUI::onLockLayer(sender); - this->updateLockBtn(); + this->updateLockBtn(true); } }; diff --git a/src/utils/Editor.cpp b/src/utils/Editor.cpp index ca1d77e..ffc6a5c 100644 --- a/src/utils/Editor.cpp +++ b/src/utils/Editor.cpp @@ -216,14 +216,6 @@ class $modify(HideUI, EditorUI) { EditorUI::showUI(show); UIShowEvent(this, show).post(); - m_currentLayerLabel->setVisible(show); - - auto lockBtn = static_cast( - this->querySelector("layer-menu hjfod.betteredit/lock-layer") - ); - if (lockBtn) { - lockBtn->setVisible(show); - } m_tabsMenu->setVisible(show && m_selectedMode == 2); } };