Skip to content

Commit 4e5ab12

Browse files
authored
replace raw gamevar strings with vars (#1295)
1 parent eb47ebb commit 4e5ab12

24 files changed

+107
-107
lines changed

bindings/2.113/GeometryDash.bro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1289,8 +1289,8 @@ class EditButtonBar : cocos2d::CCNode {
12891289
void reloadItemsInNormalSize() {
12901290
// TODO: fix this
12911291
// this->reloadItems(
1292-
// GameManager::sharedState()->getIntGameVariable("0049"),
1293-
// GameManager::sharedState()->getIntGameVariable("0050")
1292+
// GameManager::sharedState()->getIntGameVariable(GameVar::EditorButtonsPerRow),
1293+
// GameManager::sharedState()->getIntGameVariable(GameVar::EditorButtonRows)
12941294
// );
12951295
}
12961296
void addButton(CCMenuItemSpriteExtra* btn, bool reload) {

bindings/2.200/GeometryDash.bro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7054,8 +7054,8 @@ class PlayerObject : GameObject, AnimatedSpriteDelegate {
70547054
float m_unk688;
70557055
float m_unk68c;
70567056
PAD = win 0x12, mac 0x12;
7057-
bool m_unk6a2; // = GameManager::getGameVariable("0096")
7058-
bool m_unk6a3; // = GameManager::getGameVariable("0100")
7057+
bool m_unk6a2; // = GameManager::getGameVariable(GameVar::SwitchWaveTrailCol)
7058+
bool m_unk6a3; // = GameManager::getGameVariable(GameVar::EnableDeathEffect)
70597059
PAD = win 0x8, mac 0x10;
70607060
float m_unk6ac;
70617061
PAD = win 0xc, mac 0xc;

bindings/2.204/GeometryDash.bro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11670,8 +11670,8 @@ class PlayerObject : GameObject, AnimatedSpriteDelegate {
1167011670
float m_unk688;
1167111671
float m_unk68c;
1167211672
PAD = win 0x12, android32 0x12;
11673-
bool m_unk6a2; // = GameManager::getGameVariable("0096")
11674-
bool m_unk6a3; // = GameManager::getGameVariable("0100")
11673+
bool m_unk6a2; // = GameManager::getGameVariable(GameVar::SwitchWaveTrailCol)
11674+
bool m_unk6a3; // = GameManager::getGameVariable(GameVar::EnableDeathEffect)
1167511675
PAD = win 0x18, android32 0x18;
1167611676
int m_unk6c0;
1167711677
GameObject* m_objectSnappedTo;

bindings/2.205/GeometryDash.bro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11365,8 +11365,8 @@ class PlayerObject : GameObject, AnimatedSpriteDelegate {
1136511365
float m_unk688;
1136611366
float m_unk68c;
1136711367
PAD = win 0x12, android32 0x12, android64 0x12;
11368-
bool m_unk6a2; // = GameManager::getGameVariable("0096")
11369-
bool m_unk6a3; // = GameManager::getGameVariable("0100")
11368+
bool m_unk6a2; // = GameManager::getGameVariable(GameVar::SwitchWaveTrailCol)
11369+
bool m_unk6a3; // = GameManager::getGameVariable(GameVar::EnableDeathEffect)
1137011370
PAD = win 0x18, android32 0x18, android64 0x18;
1137111371
gd::unordered_set<int> m_unk6a4;
1137211372
GameObject* m_objectSnappedTo;

bindings/2.206/GeometryDash.bro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4117,8 +4117,8 @@ class EditorUI : cocos2d::CCLayer, FLAlertLayerProtocol, ColorSelectDelegate, GJ
41174117
void redoLastAction(cocos2d::CCObject*) = win 0x10dd30;
41184118
void reloadCustomItems() = win 0xe1190, ios 0x3f13c8, mac inline {
41194119
GameManager* gm = GameManager::sharedState();
4120-
int buttonsPerRow = gm->getIntGameVariable("0049");
4121-
int buttonRows = gm->getIntGameVariable("0050");
4120+
int buttonsPerRow = gm->getIntGameVariable(GameVar::EditorButtonsPerRow);
4121+
int buttonRows = gm->getIntGameVariable(GameVar::EditorButtonRows);
41224122
cocos2d::CCArray* customItems = createCustomItems();
41234123
m_buttonBar->loadFromItems(customItems,buttonsPerRow,buttonRows,true);
41244124
}

bindings/2.207/GeometryDash.bro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4116,8 +4116,8 @@ class EditorUI : cocos2d::CCLayer, FLAlertLayerProtocol, ColorSelectDelegate, GJ
41164116
void redoLastAction(cocos2d::CCObject*) = win 0x110170;
41174117
void reloadCustomItems() {
41184118
GameManager* gm = GameManager::sharedState();
4119-
int buttonsPerRow = gm->getIntGameVariable("0049");
4120-
int buttonRows = gm->getIntGameVariable("0050");
4119+
int buttonsPerRow = gm->getIntGameVariable(GameVar::EditorButtonsPerRow);
4120+
int buttonRows = gm->getIntGameVariable(GameVar::EditorButtonRows);
41214121
cocos2d::CCArray* customItems = createCustomItems();
41224122
m_buttonBar->loadFromItems(customItems,buttonsPerRow,buttonRows,true);
41234123
}

bindings/2.2072/GeometryDash.bro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4116,8 +4116,8 @@ class EditorUI : cocos2d::CCLayer, FLAlertLayerProtocol, ColorSelectDelegate, GJ
41164116
void redoLastAction(cocos2d::CCObject*) = win 0x110170;
41174117
void reloadCustomItems() {
41184118
GameManager* gm = GameManager::sharedState();
4119-
int buttonsPerRow = gm->getIntGameVariable("0049");
4120-
int buttonRows = gm->getIntGameVariable("0050");
4119+
int buttonsPerRow = gm->getIntGameVariable(GameVar::EditorButtonsPerRow);
4120+
int buttonRows = gm->getIntGameVariable(GameVar::EditorButtonRows);
41214121
cocos2d::CCArray* customItems = createCustomItems();
41224122
m_buttonBar->loadFromItems(customItems,buttonsPerRow,buttonRows,true);
41234123
}

bindings/2.2073/GeometryDash.bro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4117,8 +4117,8 @@ class EditorUI : cocos2d::CCLayer, FLAlertLayerProtocol, ColorSelectDelegate, GJ
41174117
void redoLastAction(cocos2d::CCObject*) = win 0x110170;
41184118
void reloadCustomItems() {
41194119
GameManager* gm = GameManager::sharedState();
4120-
int buttonsPerRow = gm->getIntGameVariable("0049");
4121-
int buttonRows = gm->getIntGameVariable("0050");
4120+
int buttonsPerRow = gm->getIntGameVariable(GameVar::EditorButtonsPerRow);
4121+
int buttonRows = gm->getIntGameVariable(GameVar::EditorButtonRows);
41224122
cocos2d::CCArray* customItems = createCustomItems();
41234123
m_buttonBar->loadFromItems(customItems,buttonsPerRow,buttonRows,true);
41244124
}

bindings/2.2074/GeometryDash.bro

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6405,36 +6405,36 @@ class EditorPauseLayer : CCBlockLayer, FLAlertLayerProtocol {
64056405
void toggleDebugDraw(cocos2d::CCObject* sender) = win 0xdbdd0, m1 0x22bc20, imac 0x2822f0, ios 0x39707c;
64066406
void toggleEditorBackground(cocos2d::CCObject* sender) = win inline, m1 0x22c19c, imac 0x282890, ios inline {
64076407
auto gameManager = GameManager::sharedState();
6408-
gameManager->toggleGameVariable("0078");
6409-
m_editorLayer->toggleBackground(!gameManager->getGameVariable("0078"));
6408+
gameManager->toggleGameVariable(GameVar::HideBackground);
6409+
m_editorLayer->toggleBackground(!gameManager->getGameVariable(GameVar::HideBackground));
64106410
}
64116411
void toggleEditorColorMode(cocos2d::CCObject* sender) = win 0xdbab0, m1 0x22bbd4, imac 0x2822a0, ios 0x397030;
64126412
void toggleEditorGrid(cocos2d::CCObject* sender) = win 0xdbee0, m1 0x22bac0, imac 0x282170, ios 0x396f1c;
64136413
void toggleEditorGround(cocos2d::CCObject* sender) = win 0xdbe20, m1 0x22bb10, imac 0x2821d0, ios 0x396f6c;
64146414
void toggleEffectDuration(cocos2d::CCObject* sender) = win inline, m1 0x22c164, imac 0x282850, ios inline {
6415-
GameManager::sharedState()->toggleGameVariable("0058");
6415+
GameManager::sharedState()->toggleGameVariable(GameVar::DurationLines);
64166416
}
64176417
void toggleEffectLines(cocos2d::CCObject* sender) = win inline, m1 0x22c180, imac 0x282870, ios inline {
6418-
GameManager::sharedState()->toggleGameVariable("0043");
6418+
GameManager::sharedState()->toggleGameVariable(GameVar::EffectLines);
64196419
}
64206420
void toggleFollowPlayer(cocos2d::CCObject* sender) = win inline, m1 0x22c12c, imac 0x282810, ios inline {
6421-
GameManager::sharedState()->toggleGameVariable("0001");
6421+
GameManager::sharedState()->toggleGameVariable(GameVar::FollowPlayer);
64226422
}
64236423
void toggleGridOnTop(cocos2d::CCObject* sender) = win inline, m1 0x22c1e4, imac 0x2828e0, ios inline {
64246424
auto gameManager = GameManager::sharedState();
6425-
gameManager->toggleGameVariable("0039");
6426-
m_editorLayer->m_drawGridLayer->getParent()->reorderChild(m_editorLayer->m_drawGridLayer, gameManager->getGameVariable("0039") ? 1399 : -1599);
6425+
gameManager->toggleGameVariable(GameVar::GridOnTop);
6426+
m_editorLayer->m_drawGridLayer->getParent()->reorderChild(m_editorLayer->m_drawGridLayer, gameManager->getGameVariable(GameVar::GridOnTop) ? 1399 : -1599);
64276427
}
64286428
void toggleHideInvisible(cocos2d::CCObject* sender) = win 0xdbb10, m1 0x22bc04, imac 0x2822d0, ios 0x397060;
64296429
void toggleIgnoreDamage(cocos2d::CCObject* sender) = win 0xdba60, m1 0x22ba88, imac 0x282130, ios 0x396ee4;
64306430
void togglePlaytestMusic(cocos2d::CCObject* sender) = win inline, m1 0x22c148, imac 0x282830, ios inline {
6431-
GameManager::sharedState()->toggleGameVariable("0002");
6431+
GameManager::sharedState()->toggleGameVariable(GameVar::PlaytestMusic);
64326432
}
64336433
void togglePreviewAnim(cocos2d::CCObject* sender) = ios 0x397000, win 0xdbc10, m1 0x22bba4, imac 0x282270;
64346434
void togglePreviewParticles(cocos2d::CCObject* sender) = win 0xdbb60, m1 0x22bb74, imac 0x282240, ios 0x396fd0;
64356435
void togglePreviewShaders(cocos2d::CCObject* sender) = win 0xdbbc0, m1 0x22bb58, imac 0x282220, ios 0x396fb4;
64366436
void toggleRecordOrder(cocos2d::CCObject* sender) = win inline, m1 0x22c258, imac 0x282960, ios inline {
6437-
GameManager::sharedState()->toggleGameVariable("0104");
6437+
GameManager::sharedState()->toggleGameVariable(GameVar::RecordOrder);
64386438
}
64396439
void toggleSelectFilter(cocos2d::CCObject* sender) = win 0xdbf90, m1 0x22baa4, imac 0x282150, ios 0x396f00;
64406440
void toggleShowObjectInfo(cocos2d::CCObject* sender) = win 0xdbf30, m1 0x22badc, imac 0x282190, ios 0x396f38;
@@ -7065,7 +7065,7 @@ class EditorUI : cocos2d::CCLayer, FLAlertLayerProtocol, ColorSelectDelegate, GJ
70657065
}
70667066
}
70677067
}
7068-
else if (GameManager::sharedState()->getGameVariable("0011")) {
7068+
else if (GameManager::sharedState()->getGameVariable(GameVar::AlwaysLimitControls)) {
70697069
if (m_playerTouchID2 == -1) {
70707070
m_playerTouchID2 = touch->getID();
70717071
m_editorLayer->queueButton(1, true, true);
@@ -7102,8 +7102,8 @@ class EditorUI : cocos2d::CCLayer, FLAlertLayerProtocol, ColorSelectDelegate, GJ
71027102
void recreateButtonTabs() = win inline, m1 0x317f8, imac 0x32160, ios 0x3e135c {
71037103
m_reloadItems = false;
71047104
auto gameManager = GameManager::sharedState();
7105-
auto buttonsPerRow = gameManager->getIntGameVariable("0049");
7106-
auto buttonRows = gameManager->getIntGameVariable("0050");
7105+
auto buttonsPerRow = gameManager->getIntGameVariable(GameVar::EditorButtonsPerRow);
7106+
auto buttonRows = gameManager->getIntGameVariable(GameVar::EditorButtonRows);
71077107
for (int i = 0; i < m_createButtonBars->count(); i++) {
71087108
static_cast<EditButtonBar*>(m_createButtonBars->objectAtIndex(i))->reloadItems(buttonsPerRow, buttonRows);
71097109
}
@@ -10538,7 +10538,7 @@ class GameManager : GManager {
1053810538
if (this->m_unkBool8) {
1053910539
this->m_unkBool8 = false;
1054010540
if (cocos2d::CCDirector::sharedDirector()->getSmoothFixCounter() >= 10) {
10541-
this->setGameVariable("0023", false);
10541+
this->setGameVariable(GameVar::SmoothFix, false);
1054210542
}
1054310543
}
1054410544
}
@@ -10894,9 +10894,9 @@ class GameManager : GManager {
1089410894
}
1089510895
void loadVideoSettings() = win inline, m1 0x306228, imac 0x375a90, ios 0x31b65c {
1089610896
auto application = cocos2d::CCApplication::sharedApplication();
10897-
application->toggleVerticalSync(this->getGameVariable("0030"));
10898-
application->setForceTimer(this->getGameVariable("0032"));
10899-
application->setSmoothFix(this->getGameVariable("0023"));
10897+
application->toggleVerticalSync(this->getGameVariable(GameVar::VerticalSync));
10898+
application->setForceTimer(this->getGameVariable(GameVar::ForceTimer));
10899+
application->setSmoothFix(this->getGameVariable(GameVar::SmoothFix));
1090010900
}
1090110901
void lockColor(int id, UnlockType type) = win inline, m1 0x2f7a20, imac 0x365080, ios 0x3130f4 {
1090210902
m_valueKeeper->removeObjectForKey(this->colorKey(id, type));
@@ -21161,19 +21161,19 @@ class GraphicsReloadLayer : cocos2d::CCLayer {
2116121161
director->updateContentScale(m_quality);
2116221162
auto newQuality = director->getLoadedTextureQuality();
2116321163
auto gameManager = GameManager::sharedState();
21164-
if (gameManager->getGameVariable("0025") == m_fullscreen) {
21165-
gameManager->setGameVariable("0025", !m_fullscreen);
21166-
gameManager->setGameVariable("0170", m_borderless);
21167-
gameManager->setGameVariable("0175", m_fix);
21164+
if (gameManager->getGameVariable(GameVar::WindowedMode) == m_fullscreen) {
21165+
gameManager->setGameVariable(GameVar::WindowedMode, !m_fullscreen);
21166+
gameManager->setGameVariable(GameVar::BorderlessFullscreen, m_borderless);
21167+
gameManager->setGameVariable(GameVar::BorderlessFix, m_fix);
2116821168
gameManager->switchScreenMode(m_fullscreen, m_borderless, m_fix, true);
2116921169
}
21170-
else if (!m_fullscreen || m_borderless == gameManager->getGameVariable("0170") || m_fix == gameManager->getGameVariable("0175")) {
21171-
gameManager->setGameVariable("0170", m_borderless);
21172-
gameManager->setGameVariable("0175", m_fix);
21170+
else if (!m_fullscreen || m_borderless == gameManager->getGameVariable(GameVar::BorderlessFullscreen) || m_fix == gameManager->getGameVariable(GameVar::BorderlessFix)) {
21171+
gameManager->setGameVariable(GameVar::BorderlessFullscreen, m_borderless);
21172+
gameManager->setGameVariable(GameVar::BorderlessFix, m_fix);
2117321173
if (oldQuality == newQuality) gameManager->queueReloadMenu();
2117421174
else gameManager->reloadAll(false, false, false, false, true);
2117521175
}
21176-
if (gameManager->getGameVariable("0115")) director->toggleShowFPS(1, "chatFont.fnt", { 0.f, 0.f });
21176+
if (gameManager->getGameVariable(GameVar::ShowFPS)) director->toggleShowFPS(1, "chatFont.fnt", { 0.f, 0.f });
2117721177
}
2117821178

2117921179
cocos2d::TextureQuality m_quality;
@@ -23012,7 +23012,7 @@ class LevelEditorLayer : GJBaseGameLayer, LevelSettingsDelegate {
2301223012
}
2301323013
else this->applyAttributeState(object, m_copyStateObject);
2301423014

23015-
if (!GameManager::sharedState()->getGameVariable("0156")) this->pasteGroupState(object, objects);
23015+
if (!GameManager::sharedState()->getGameVariable(GameVar::DisablePasteStateGroups)) this->pasteGroupState(object, objects);
2301623016
}
2301723017
void pasteColorState(GameObject* object, cocos2d::CCArray* objects) = win inline, m1 0xd7500, imac 0xf28a0, ios 0x36363c {
2301823018
if (!m_copyStateObject) return;
@@ -23264,7 +23264,7 @@ class LevelEditorLayer : GJBaseGameLayer, LevelSettingsDelegate {
2326423264
void updateObjectColors(cocos2d::CCArray* gameObjects) = ios 0x35ea84, win 0x2d1790, imac 0xeb700, m1 0xd102c;
2326523265
void updateOptions() = ios 0x357150, win 0x2ca8f0, m1 0xc4394, imac 0xdc880;
2326623266
void updatePreviewAnim() = win inline, m1 0xd7b80, imac 0xf2f90, ios 0x363b10 {
23267-
auto previewAnimations = GameManager::sharedState()->getGameVariable("0118");
23267+
auto previewAnimations = GameManager::sharedState()->getGameVariable(GameVar::PreviewAnimations);
2326823268
if (m_previewAnimations == previewAnimations) return;
2326923269
m_previewAnimations = previewAnimations;
2327023270
for (int i = 0; i < m_objects->count(); i++) {
@@ -24922,7 +24922,7 @@ class MenuLayer : cocos2d::CCLayer, FLAlertLayerProtocol, GooglePlayDelegate {
2492224922
void onFullVersion(cocos2d::CCObject* sender) = m1 0x30f424, imac 0x37ed30;
2492324923
void onGameCenter(cocos2d::CCObject* sender) = win inline, m1 0x30f0fc, imac 0x37e9a0, ios 0x266ee0 {
2492424924
auto gameManager = GameManager::sharedState();
24925-
if (gameManager->getGameVariable("0034")) {
24925+
if (gameManager->getGameVariable(GameVar::EnableGameCenter)) {
2492624926
gameManager->syncPlatformAchievements();
2492724927
PlatformToolbox::showAchievements();
2492824928
}
@@ -32668,8 +32668,8 @@ class SetupSmartBlockLayer : FLAlertLayer, TextInputDelegate, SelectArtDelegate
3266832668
m_ignoreCorners = smartTemplate->m_ignoreCorners;
3266932669
}
3267032670
auto gameManager = GameManager::sharedState();
32671-
m_useNearby = gameManager->getGameVariable("0131");
32672-
m_dontDelete = gameManager->getGameVariable("0132");
32671+
m_useNearby = gameManager->getGameVariable(GameVar::UseNearbyAsReference);
32672+
m_dontDelete = gameManager->getGameVariable(GameVar::DontDelete);
3267332673
if (m_gameObject) {
3267432674
m_referenceOnly = m_gameObject->m_referenceOnly;
3267532675
}
@@ -36597,7 +36597,7 @@ class UILayer : cocos2d::CCLayerColor {
3659736597
void toggleCheckpointsMenu(bool visible) = win 0x4b5340, m1 0x41d454, imac 0x4b52a0, ios 0x4d21c;
3659836598
void toggleMenuVisibility(bool visible) = win inline, ios 0x4dc58, m1 0x41e384, imac 0x4b64e0 {
3659936599
this->resetUINodeState();
36600-
if (GameManager::sharedState()->getGameVariable("0024")) {
36600+
if (GameManager::sharedState()->getGameVariable(GameVar::ShowCursor)) {
3660136601
static_cast<cocos2d::CCNodeRGBA*>(m_pauseBtn->getNormalImage())->setOpacity(visible ? 75 : 0);
3660236602
this->updateUINodeVisibility(visible && m_inPlatformer);
3660336603
}

bindings/2.208/inline/EditorPauseLayer.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,34 +25,34 @@ void EditorPauseLayer::onCreateTemplate(cocos2d::CCObject* sender) {
2525

2626
void EditorPauseLayer::toggleEditorBackground(cocos2d::CCObject* sender) {
2727
auto gameManager = GameManager::sharedState();
28-
gameManager->toggleGameVariable("0078");
29-
m_editorLayer->toggleBackground(!gameManager->getGameVariable("0078"));
28+
gameManager->toggleGameVariable(GameVar::HideBackground);
29+
m_editorLayer->toggleBackground(!gameManager->getGameVariable(GameVar::HideBackground));
3030
}
3131

3232
void EditorPauseLayer::toggleEffectDuration(cocos2d::CCObject* sender) {
33-
GameManager::sharedState()->toggleGameVariable("0058");
33+
GameManager::sharedState()->toggleGameVariable(GameVar::DurationLines);
3434
}
3535

3636
void EditorPauseLayer::toggleEffectLines(cocos2d::CCObject* sender) {
37-
GameManager::sharedState()->toggleGameVariable("0043");
37+
GameManager::sharedState()->toggleGameVariable(GameVar::EffectLines);
3838
}
3939

4040
void EditorPauseLayer::toggleFollowPlayer(cocos2d::CCObject* sender) {
41-
GameManager::sharedState()->toggleGameVariable("0001");
41+
GameManager::sharedState()->toggleGameVariable(GameVar::FollowPlayer);
4242
}
4343

4444
void EditorPauseLayer::toggleGridOnTop(cocos2d::CCObject* sender) {
4545
auto gameManager = GameManager::sharedState();
46-
gameManager->toggleGameVariable("0039");
47-
m_editorLayer->m_drawGridLayer->getParent()->reorderChild(m_editorLayer->m_drawGridLayer, gameManager->getGameVariable("0039") ? 1399 : -1599);
46+
gameManager->toggleGameVariable(GameVar::GridOnTop);
47+
m_editorLayer->m_drawGridLayer->getParent()->reorderChild(m_editorLayer->m_drawGridLayer, gameManager->getGameVariable(GameVar::GridOnTop) ? 1399 : -1599);
4848
}
4949

5050
void EditorPauseLayer::togglePlaytestMusic(cocos2d::CCObject* sender) {
51-
GameManager::sharedState()->toggleGameVariable("0002");
51+
GameManager::sharedState()->toggleGameVariable(GameVar::PlaytestMusic);
5252
}
5353

5454
void EditorPauseLayer::toggleRecordOrder(cocos2d::CCObject* sender) {
55-
GameManager::sharedState()->toggleGameVariable("0104");
55+
GameManager::sharedState()->toggleGameVariable(GameVar::RecordOrder);
5656
}
5757
#endif
5858

0 commit comments

Comments
 (0)