Skip to content

Commit

Permalink
redo integrity check when reloading resources
Browse files Browse the repository at this point in the history
  • Loading branch information
dankmeme01 committed Jan 13, 2025
1 parent b1a3b78 commit 11495a4
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/globed/integrity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ bool globed::useFallbackMenuButton() {
return g_fallbackMenuButton;
}

void globed::resetIntegrityCheck() {
g_checked = false;
g_disable = false;
g_fallbackMenuButton = false;
}

void globed::checkResources() {
g_checked = true;

Expand Down
1 change: 1 addition & 0 deletions src/globed/integrity.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace globed {
bool softDisabled();
bool useFallbackMenuButton();
void resetIntegrityCheck();

void checkResources();

Expand Down
2 changes: 2 additions & 0 deletions src/hooks/loading_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ using namespace asp::time;

static void loadingFinishedReimpl(bool fromRefresh) {
// reimplementation of the function

// push menulayer scene
auto* scene = MenuLayer::scene(fromRefresh);
auto* dir = CCDirector::get();
dir->replaceScene(scene);
Expand Down
3 changes: 3 additions & 0 deletions src/hooks/menu_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ using namespace geode::prelude;
bool HookedMenuLayer::init() {
if (!MenuLayer::init()) return false;

// reset integrity check state here
globed::resetIntegrityCheck();

if (!globed::softDisabled()) {
// auto connect
util::misc::callOnce("menu-layer-init-autoconnect", []{
Expand Down
2 changes: 1 addition & 1 deletion src/ui/game/chat/chatlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,4 @@ GlobedChatListPopup* GlobedChatListPopup::create() {

delete ret;
return nullptr;
}
}

0 comments on commit 11495a4

Please sign in to comment.