Skip to content

Commit

Permalink
pre-load singletons properly
Browse files Browse the repository at this point in the history
  • Loading branch information
Cvolton committed Dec 17, 2023
1 parent 9485e37 commit b668cab
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#include <Geode/Geode.hpp>
#include <Geode/modify/MenuLayer.hpp>

#include <thread>

//#include "managers/BetterInfoStatsV2.h"
#include "managers/BetterInfoStats.h"
#include "managers/BetterInfoCache.h"

using namespace geode::prelude;
Expand Down Expand Up @@ -52,6 +54,8 @@ void setupPageLimitBypass() {
}

void loadManagers() {
BetterInfoStats::sharedState();

std::thread([] {
//BetterInfoStatsV2::sharedState();
BetterInfoCache::sharedState();
Expand All @@ -62,6 +66,12 @@ void loadManagers() {
setupPageLimitBypass();
}

$on_mod(Loaded) {
loadManagers();
}
class $modify(MenuLayer) {
bool init() {
if(!MenuLayer::init()) return false;

loadManagers();

return true;
}
};

0 comments on commit b668cab

Please sign in to comment.