Skip to content

Commit

Permalink
improve build times
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSillyDoggo committed Dec 23, 2024
1 parent 29f6809 commit a7565e2
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 28 deletions.
29 changes: 29 additions & 0 deletions src/Client/Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -436,4 +436,33 @@ void Client::loadImGuiTheme(std::string theme)
THEME_COLOUR(NavWindowingHighlight);
THEME_COLOUR(NavWindowingDimBg);
THEME_COLOUR(ModalWindowDimBg);
}

bool Client::GetModuleEnabled(std::string id)
{
if (!mod)
mod = Mod::get();

return mod->getSavedValue<bool>(fmt::format("{}_enabled", id));
}

Module* Client::GetModule(std::string id)
{
if (!instance)
return nullptr;

for (size_t w = 0; w < instance->windows.size(); w++)
{
for (size_t m = 0; m < instance->windows[w]->modules.size(); m++)
{
if (!instance->windows[w]->modules[m]->id.compare(id))
{
return instance->windows[w]->modules[m];
}
}
}

//geode::prelude::log::info("missing module :( {}", id);

return nullptr;
}
31 changes: 3 additions & 28 deletions src/Client/Client.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,32 +70,7 @@ class Client
std::vector<std::filesystem::path> getLanguages();

//[[deprecated("GetModuleEnabled has been deprecated due to lag, please rember to cache the module :3")]]
static bool GetModuleEnabled(std::string id)
{
if (!mod)
mod = Mod::get();

return mod->getSavedValue<bool>(fmt::format("{}_enabled", id));
}

static Module* GetModule(std::string id)
{
if (!instance)
return nullptr;

for (size_t w = 0; w < instance->windows.size(); w++)
{
for (size_t m = 0; m < instance->windows[w]->modules.size(); m++)
{
if (!instance->windows[w]->modules[m]->id.compare(id))
{
return instance->windows[w]->modules[m];
}
}
}

//geode::prelude::log::info("missing module :( {}", id);

return nullptr;
}
static bool GetModuleEnabled(std::string id);

static Module* GetModule(std::string id);
};

0 comments on commit a7565e2

Please sign in to comment.