hardest node ids ever

This commit is contained in:
altalk23 2024-02-03 19:39:39 +03:00
parent e2ff9c8719
commit e155c336c8
2 changed files with 30 additions and 0 deletions

View file

@ -16,6 +16,13 @@ struct CustomLoadingLayer : Modify<CustomLoadingLayer, LoadingLayer> {
int m_geodeLoadStep = 0;
int m_totalMods = 0;
static void onModify(auto& self) {
if (!self.setHookPriority("LoadingLayer::init", geode::node_ids::GEODE_ID_PRIORITY)) {
log::warn("Failed to set LoadingLayer::init hook priority, node IDs may not work properly");
}
GEODE_FORWARD_COMPAT_DISABLE_HOOKS_INNER("LoadingLayer stuff disabled")
}
GEODE_FORWARD_COMPAT_DISABLE_HOOKS("Switching to fallback custom loading layer")
void updateLoadedModsLabel() {
@ -48,6 +55,8 @@ struct CustomLoadingLayer : Modify<CustomLoadingLayer, LoadingLayer> {
if (!LoadingLayer::init(fromReload)) return false;
NodeIDs::provideFor(this);
m_fields->m_totalMods = Loader::get()->getAllMods().size();
m_fields->m_menuDisabled = Loader::get()->getLaunchFlag("disable-custom-menu");
if (m_fields->m_menuDisabled) {

View file

@ -0,0 +1,21 @@
#include <Geode/modify/IDManager.hpp>
#include <Geode/utils/cocos.hpp>
#include <Geode/utils/NodeIDs.hpp>
#include <Geode/ui/BasedButtonSprite.hpp>
using namespace geode::prelude;
using namespace geode::node_ids;
$register_ids(LoadingLayer) {
setIDs(
0, this,
"bg-texture",
"gd-logo",
"robtop-logo",
"cocos2d-logo",
"fmod-logo",
"loading-text",
"text-area",
"progress-slider"
);
}