From b668cab437ede3db3f015128ba150d556d93a17a Mon Sep 17 00:00:00 2001 From: Cvolton Date: Sun, 17 Dec 2023 17:54:55 +0100 Subject: [PATCH] pre-load singletons properly --- src/main.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index dc8735a..d915f6d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,8 +1,10 @@ #include +#include #include //#include "managers/BetterInfoStatsV2.h" +#include "managers/BetterInfoStats.h" #include "managers/BetterInfoCache.h" using namespace geode::prelude; @@ -52,6 +54,8 @@ void setupPageLimitBypass() { } void loadManagers() { + BetterInfoStats::sharedState(); + std::thread([] { //BetterInfoStatsV2::sharedState(); BetterInfoCache::sharedState(); @@ -62,6 +66,12 @@ void loadManagers() { setupPageLimitBypass(); } -$on_mod(Loaded) { - loadManagers(); -} \ No newline at end of file +class $modify(MenuLayer) { + bool init() { + if(!MenuLayer::init()) return false; + + loadManagers(); + + return true; + } +}; \ No newline at end of file