EditLevelLayer ids

This commit is contained in:
camila314 2022-12-14 11:54:32 -06:00
parent fe058a7c2a
commit b3c88d349e
4 changed files with 72 additions and 3 deletions

View file

@ -0,0 +1,69 @@
#include <Geode/modify/EditLevelLayer.hpp>
#include <Geode/Bindings.hpp>
#include <Geode/utils/cocos.hpp>
#include "AddIDs.hpp"
USE_GEODE_NAMESPACE();
$register_ids(EditLevelLayer) {
setIDs(this, 0,
"background",
"bottom-left-art",
"bottom-right-art",
"level-name-background",
"level-name-input",
"description-background",
"description-input",
"description-text-area",
"level-action-menu",
"level-length",
"level-song",
"level-verified",
"version-label",
"level-id-label",
"right-side-menu",
"back-button-menu",
"info-button-menu"
);
if (auto menu = this->getChildByID("level-action-menu")) {
setIDs(menu, 0,
"edit-button",
"play-button",
"share-button"
);
}
if (auto menu = this->getChildByID("right-side-menu")) {
setIDs(menu, 0,
"delete-button",
"help-button",
"duplicate-button",
"move-to-top-button",
"folder-button"
);
detachAndCreateMenu(menu,
"folder-menu",
ColumnLayout::create(),
menu->getChildByID("folder-button")
);
}
if (auto menu = this->getChildByID("back-button-menu"))
setIDSafe(menu, 0, "back-button");
if (auto menu = this->getChildByID("info-button-menu"))
setIDSafe(menu, 0, "info-button");
}
class $modify(EditLevelLayer) {
bool init(GJGameLevel* l) {
if (!EditLevelLayer::init(l))
return false;
NodeIDs::get()->provide(this);
return true;
}
};

View file

@ -1,4 +1,4 @@
#include <Geode/Modify.hpp>
#include <Geode/modify/EditorUI.hpp>
#include <Geode/Bindings.hpp>
#include <Geode/utils/cocos.hpp>
#include "AddIDs.hpp"

View file

@ -1,4 +1,4 @@
#include <Geode/Modify.hpp>
#include <Geode/modify/GJGarageLayer.hpp>
#include <Geode/Bindings.hpp>
#include <Geode/utils/cocos.hpp>
#include "AddIDs.hpp"

View file

@ -1,4 +1,4 @@
#include <Geode/Modify.hpp>
#include <Geode/modify/UILayer.hpp>
#include <Geode/Bindings.hpp>
#include <Geode/utils/cocos.hpp>
#include "AddIDs.hpp"