From bf650c8d4d7744fec194c4ebe3f71c7755c3aaac Mon Sep 17 00:00:00 2001 From: HJfod <60038575+HJfod@users.noreply.github.com> Date: Wed, 22 May 2024 17:30:27 +0300 Subject: [PATCH] EditButtonBar ids --- changelog.md | 3 +++ mod.json | 2 +- src/EditorUI.cpp | 66 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 70 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index cbc460b..b60fec8 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,8 @@ # Node IDs Changelog +## v1.11.0 + * Add IDs for all the EditButtonBars in EditorUI as well as for the edit buttons (move, rotate, etc.) + ## v1.10.1 * Temporarily remove LevelListLayer IDs as there were no layouts which will need to be added due to API breaks diff --git a/mod.json b/mod.json index 401b58e..bcc0efb 100644 --- a/mod.json +++ b/mod.json @@ -6,7 +6,7 @@ "mac": "2.200", "ios": "2.205" }, - "version": "v1.10.2", + "version": "v1.11.0", "id": "geode.node-ids", "name": "Node IDs", "developer": "Geode Team", diff --git a/src/EditorUI.cpp b/src/EditorUI.cpp index 81a95b8..ccbb048 100644 --- a/src/EditorUI.cpp +++ b/src/EditorUI.cpp @@ -217,9 +217,75 @@ using namespace geode::node_ids; deleteFilterMenu->updateLayout(); } + auto buttonBarIDs = { + "block-tab-bar", + "outline-tab-bar", + "slope-tab-bar", + "hazard-tab-bar", + "3d-tab-bar", + "portal-tab-bar", + "monster-tab-bar", + "pixel-tab-bar", + "collectible-tab-bar", + "icon-tab-bar", + "deco-tab-bar", + "sawblade-tab-bar", + "trigger-tab-bar", + "custom-tab-bar", + "edit-tab-bar", + }; + + size_t buttonBarIndex = 0; + for (auto id : buttonBarIDs) { + if (auto bar = getChildOfType(this, buttonBarIndex++)) { + bar->setID(id); + } + } + + if (auto editBar = static_cast(this->getChildByID("edit-tab-bar"))) { + auto editButtonIDs = { + "move-up-small-button", + "move-down-small-button", + "move-left-small-button", + "move-right-small-button", + "move-up-button", + "move-down-button", + "move-left-button", + "move-right-button", + "move-up-big-button", + "move-down-big-button", + "move-left-big-button", + "move-right-big-button", + "move-up-tiny-button", + "move-down-tiny-button", + "move-left-tiny-button", + "move-right-tiny-button", + "move-up-half-button", + "move-down-half-button", + "move-left-half-button", + "move-right-half-button", + "flip-x-button", + "flip-y-button", + "rotate-cw-button", + "rotate-ccw-button", + "rotate-cw-45-button", + "rotate-ccw-45-button", + "rotate-free-button", + "rotate-snap-button", + "scale-button", + "scale-xy-button", + "warp-button", + }; + size_t i = 0; + for (auto id : editButtonIDs) { + static_cast(editBar->m_buttonArray->objectAtIndex(i++))->setID(id); + } + } + if (auto menu = getChildOfType(this, 2)) { menu->setID("build-tabs-menu"); + // todo: maybe form these from buttonBarIDs to avoid duplication? setIDs( menu, 0,