use Fields for geode fields

This commit is contained in:
altalk23 2024-04-22 00:20:54 +03:00
parent 4505b0da69
commit 8db0e39651
2 changed files with 11 additions and 7 deletions

View file

@ -11,11 +11,13 @@
using namespace geode::prelude;
struct CustomLoadingLayer : Modify<CustomLoadingLayer, LoadingLayer> {
bool m_menuDisabled;
CCLabelBMFont* m_smallLabel = nullptr;
CCLabelBMFont* m_smallLabel2 = nullptr;
int m_geodeLoadStep = 0;
int m_totalMods = 0;
struct Fields {
bool m_menuDisabled = false;
CCLabelBMFont* m_smallLabel = nullptr;
CCLabelBMFont* m_smallLabel2 = nullptr;
int m_geodeLoadStep = 0;
int m_totalMods = 0;
};
static void onModify(auto& self) {
if (!self.setHookPriority("LoadingLayer::init", geode::node_ids::GEODE_ID_PRIORITY)) {

View file

@ -52,8 +52,10 @@ struct CustomMenuLayer : Modify<CustomMenuLayer, MenuLayer> {
GEODE_FORWARD_COMPAT_DISABLE_HOOKS_INNER("MenuLayer stuff disabled")
}
bool m_menuDisabled;
CCSprite* m_geodeButton;
struct Fields {
bool m_menuDisabled = false;
CCSprite* m_geodeButton = nullptr;
};
bool init() {
if (!MenuLayer::init()) return false;