Skip to content

Commit 345bbb2

Browse files
committed
removed "this->" and still gotta fix ios stuff
1 parent 5613346 commit 345bbb2

15 files changed

+81
-85
lines changed

include/Surge/modify/LevelSelectLayer.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,5 @@ class $modify(MyLevelSelectLayer, LevelSelectLayer) {
1010
bool init(int pageID);
1111

1212
$override
13-
#ifndef GEODE_IS_IOS
1413
ccColor3B colorForPage(int pageID);
15-
#endif
1614
};

src/layers/BasementLayer.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ bool BasementLayer::init() {
1414

1515
auto background = createLayerBG();
1616
background->setColor({ 60, 0, 60 });
17-
this->addChild(background, -1);
17+
addChild(background, -1);
1818

1919
auto misc = CCMenu::create();
20-
this->addChild(misc);
20+
addChild(misc);
2121

2222
m_pButtonMenu = CCMenu::create();
23-
this->addChild(m_pButtonMenu);
23+
addChild(m_pButtonMenu);
2424

2525
m_obNext = ccp(0.0f, 75.0f);
2626

@@ -35,17 +35,17 @@ bool BasementLayer::init() {
3535
auto title = CCLabelBMFont::create("The Basement", "goldFont.fnt");
3636
title->setPosition(winSize.width / 2, winSize.height / 2 + 130.0f);
3737
title->setScale(1.2f);
38-
this->addChild(title);
38+
addChild(title);
3939

40-
this->addButton("GDS_playBtn_001.png"_spr, "Secret Level", menu_selector(BasementLayer::onSecretLevel));
41-
this->addButton("GDS_homeBtn_001.png"_spr, "Home..?", menu_selector(BasementLayer::onScratchDialog));
42-
this->addButton("GDS_questBtn_001.png"_spr, "Credits", menu_selector(BasementLayer::onCredits));
40+
addButton("GDS_playBtn_001.png"_spr, "Secret Level", menu_selector(BasementLayer::onSecretLevel));
41+
addButton("GDS_homeBtn_001.png"_spr, "Home..?", menu_selector(BasementLayer::onScratchDialog));
42+
addButton("GDS_questBtn_001.png"_spr, "Credits", menu_selector(BasementLayer::onCredits));
4343

4444
m_bButtonsEntered = false;
4545

46-
this->setKeypadEnabled(true);
46+
setKeypadEnabled(true);
4747

48-
this->runSequentialFadeIn();
48+
runSequentialFadeIn();
4949

5050
return true;
5151
}

src/layers/CreditsLayer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ bool CreditsLayer::init() {
1818
auto menu = CCMenu::create();
1919
menu->setPosition({ 0.f, 0.f });
2020
menu->setAnchorPoint({ 0.f, 0.f });
21-
this->addChild(menu);
21+
addChild(menu);
2222

2323
auto background = createLayerBG();
2424
background->setPosition({ -5.f, -5.f });
25-
this->addChild(background, -1);
25+
addChild(background, -1);
2626
addSideArt(this, SideArt::Bottom, SideArtStyle::Layer, false);
2727

2828
auto backButton = CCMenuItemSpriteExtra::create(
@@ -35,7 +35,7 @@ bool CreditsLayer::init() {
3535

3636
auto containerNode = CCNode::create();
3737
containerNode->setPosition({ 0.f, 0.f - winSize.height });
38-
this->addChild(containerNode);
38+
addChild(containerNode);
3939

4040
auto gdLogo = CCSprite::createWithSpriteFrameName("GJ_logo_001.png");
4141
gdLogo->setPosition({ winSize.width / 2, winSize.height * 0.8f });

src/layers/IslandLevel.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
using namespace geode::prelude;
66

77
bool IslandLevel::setup(GJGameLevel* level, CCMenuItemSpriteExtra* button) {
8-
this->m_level = level;
9-
this->setID("IslandLevel"_spr);
8+
m_level = level;
9+
setID("IslandLevel"_spr);
1010

1111
auto GLM = GameLevelManager::sharedState();
1212

@@ -237,7 +237,7 @@ bool IslandLevel::setup(GJGameLevel* level, CCMenuItemSpriteExtra* button) {
237237

238238
log::debug("Stars: {}", m_level->m_stars);
239239

240-
this->setTitle(this->m_level->m_levelName);
240+
setTitle(m_level->m_levelName);
241241

242242
return true;
243243
}
@@ -303,7 +303,7 @@ void sLOLwshow2(GJGameLevel* level212) {
303303

304304
void IslandLevel::onInfo(CCObject* sender) {
305305
auto GLM = GameLevelManager::sharedState();
306-
auto level = GLM->getMainLevel(this->m_level->m_levelID, true);
306+
auto level = GLM->getMainLevel(m_level->m_levelID, true);
307307
sLOLwshow2(level);
308308
}
309309

src/layers/IslandSelectLayer.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -887,7 +887,7 @@ bool IslandSelectLayer::init(int page) {
887887

888888
m_background = createLayerBG();
889889
m_background->setZOrder(-4);
890-
this->addChild(m_background);
890+
addChild(m_background);
891891

892892
sprite3->setColor(ccBLACK);
893893
sprite3->setOpacity(40);
@@ -923,7 +923,7 @@ bool IslandSelectLayer::init(int page) {
923923
pageBtnsMenu->addChild(m_nextPageBtn);
924924
pageBtnsMenu->addChild(m_prevPageBtn);
925925

926-
this->addChild(pageBtnsMenu);
926+
addChild(pageBtnsMenu);
927927

928928
if (m_iLevels.level2complete == 1) {
929929
level2->setVisible(false);
@@ -1321,7 +1321,7 @@ bool IslandSelectLayer::init(int page) {
13211321
dl->animateInRandomSide();
13221322
dl->setZOrder(2);
13231323

1324-
this->addChild(dl, 3);
1324+
addChild(dl, 3);
13251325
Mod::get()->setSavedValue("islandlevel10complete", 1);
13261326
}
13271327

@@ -1436,7 +1436,7 @@ void IslandSelectLayer::scrollLayerMoved(CCPoint point) {
14361436
const int pageCount = 3;
14371437
const float threshold = 0.7f;
14381438

1439-
float x = -point.x / this->m_fWindowWidth;
1439+
float x = -point.x / m_fWindowWidth;
14401440
while (x < 0.0f) {
14411441
x += pageCount;
14421442
}

src/modify/FollowRewardPage.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ bool MyFollowRewardPage::init() {
88
if (!FollowRewardPage::init())
99
return false;
1010

11-
if (auto layer = this->getChildByType<CCLayer*>(0)) {
11+
if (auto layer = getChildByType<CCLayer*>(0)) {
1212
if (auto title = layer->getChildByType<CCLabelBMFont*>(0)) {
1313
title->setString("Follow OmgRod!");
1414
}
1515
}
1616

17-
m_fields->m_rewardsPage = typeinfo_cast<RewardsPage*>(this->getParent());
17+
m_fields->m_rewardsPage = typeinfo_cast<RewardsPage*>(getParent());
1818

1919
return true;
2020
}
@@ -91,7 +91,7 @@ void MyFollowRewardPage::onSpecialItem(CCObject* sender) {
9191
360.f,
9292
[&](auto layer, bool btn2) {
9393
if (btn2) {
94-
this->onSpecialItemConfirm();
94+
onSpecialItemConfirm();
9595
}
9696
}
9797
);

src/modify/GJGarageLayer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ bool MyGJGarageLayer::init() {
66
if (!GJGarageLayer::init())
77
return false;
88

9-
auto menu = this->getChildByID("top-left-menu");
9+
auto menu = getChildByID("top-left-menu");
1010
menu->getChildByID("shop-button")->getChildByType<CCSprite*>(0)->setDisplayFrame(CCSpriteFrameCache::get()->spriteFrameByName("GDS_shopRope.png"_spr));
1111

12-
if (auto shardsMenu = this->getChildByID("shards-menu")) {
12+
if (auto shardsMenu = getChildByID("shards-menu")) {
1313
if (auto shardsButton = shardsMenu->getChildByID("shards-button")) {
1414
shardsButton->setVisible(false);
1515
}

src/modify/GJShopLayer.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ bool MyGJShopLayer::init(ShopType p0) {
1010
FMODAudioEngine::sharedEngine()->playMusic("RandomSong03.mp3"_spr, true, 0.1f, 0);
1111
auto extraMenu = CCMenu::create();
1212
extraMenu->setPosition({0, 0});
13-
this->addChild(extraMenu);
13+
addChild(extraMenu);
1414
auto particle = static_cast<CCParticleSystemQuad *>(getChildren()->objectAtIndex(7));
1515
particle->setStartColor({193, 122, 5, 255});
1616
particle->setEndColor({255, 122, 0, 0});
1717

18-
auto bg = this->getChildByType<CCSprite*>(0);
18+
auto bg = getChildByType<CCSprite*>(0);
1919
if (bg) {
2020
auto bgFrame = CCSpriteFrameCache::get()->spriteFrameByName("GDS_shopBG.png"_spr);
2121
if (bgFrame) {
@@ -25,7 +25,7 @@ bool MyGJShopLayer::init(ShopType p0) {
2525
}
2626
}
2727

28-
auto desk = this->getChildByType<CCSprite*>(3);
28+
auto desk = getChildByType<CCSprite*>(3);
2929
if (desk) {
3030
auto deskFrame = CCSpriteFrameCache::get()->spriteFrameByName("GDS_shopDesk.png"_spr);
3131
if (deskFrame) {
@@ -35,18 +35,18 @@ bool MyGJShopLayer::init(ShopType p0) {
3535
}
3636
}
3737

38-
auto oldShopkeeper = this->getChildByType<AnimatedShopKeeper*>(0);
38+
auto oldShopkeeper = getChildByType<AnimatedShopKeeper*>(0);
3939
if (oldShopkeeper) {
4040
auto newShopkeeper = AnimatedShopKeeper::create(ShopType{1});
4141
newShopkeeper->setPosition(oldShopkeeper->getPosition());
4242
newShopkeeper->setScale(oldShopkeeper->getScale());
4343
newShopkeeper->setRotation(oldShopkeeper->getRotation());
4444
newShopkeeper->setAnchorPoint(oldShopkeeper->getAnchorPoint());
45-
this->addChild(newShopkeeper);
45+
addChild(newShopkeeper);
4646
oldShopkeeper->removeFromParent();
4747
}
4848

49-
auto shopSign = this->getChildByType<CCSprite*>(1);
49+
auto shopSign = getChildByType<CCSprite*>(1);
5050
if (shopSign) {
5151
auto shopSignFrame = CCSpriteFrameCache::get()->spriteFrameByName("GDS_shopSign.png"_spr);
5252
if (shopSignFrame) {
@@ -57,7 +57,7 @@ bool MyGJShopLayer::init(ShopType p0) {
5757
}
5858

5959
if (!Mod::get()->getSavedValue<bool>("shop-yap")) {
60-
this->runAction(
60+
runAction(
6161
CCSequence::create(
6262
CCDelayTime::create(1.5f),
6363
CCCallFunc::create(this, callfunc_selector(MyGJShopLayer::showEntryDialog)),

src/modify/LevelPage.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ void MyLevelPage::updateDynamicPage(GJGameLevel* level) {
4242
auto layer = scene->getChildByType<LevelSelectLayer*>(0);
4343
if (!layer) return;
4444

45-
auto label = typeinfo_cast<CCLabelBMFont*>(this->getChildByID("coming-soon-label"));
45+
auto label = typeinfo_cast<CCLabelBMFont*>(getChildByID("coming-soon-label"));
4646
bool hasAch = AchievementManager::sharedState()->isAchievementEarned("geometry.ach.surge.vault04");
4747

4848
if (label) {
4949
label->setVisible(m_level->m_levelID == -1 && !hasAch);
5050
}
5151

52-
if (auto oldNode = this->getChildByID("coming-never-node")) {
52+
if (auto oldNode = getChildByID("coming-never-node")) {
5353
oldNode->removeFromParent();
5454
}
5555

@@ -85,13 +85,13 @@ void MyLevelPage::updateDynamicPage(GJGameLevel* level) {
8585
comingNeverNode->addChild(zigzag1);
8686
comingNeverNode->addChild(zigzag2);
8787

88-
this->addChild(comingNeverNode);
88+
addChild(comingNeverNode);
8989
}
9090
break;
9191
}
9292

9393
case -3: {
94-
if (!this->getChildByID("islands-menu"_spr)) {
94+
if (!getChildByID("islands-menu"_spr)) {
9595
auto logo = CCSprite::createWithSpriteFrameName("islandsLogo.png"_spr);
9696
logo->setScale(0.75f);
9797

@@ -106,7 +106,7 @@ void MyLevelPage::updateDynamicPage(GJGameLevel* level) {
106106
menu->addChild(logoBtn);
107107
menu->setPosition({ 0, 0 });
108108
menu->setID("islands-menu"_spr);
109-
this->addChild(menu);
109+
addChild(menu);
110110
}
111111
break;
112112
}
@@ -116,7 +116,7 @@ void MyLevelPage::updateDynamicPage(GJGameLevel* level) {
116116
}
117117

118118
if (level->m_levelID != -3) {
119-
if (auto menu = this->getChildByID("islands-menu"_spr)) {
119+
if (auto menu = getChildByID("islands-menu"_spr)) {
120120
menu->removeFromParent();
121121
}
122122
}

src/modify/LevelSelectLayer.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -122,17 +122,16 @@ bool MyLevelSelectLayer::init(int pageID) {
122122
return false;
123123
}
124124

125-
this->updatePageWithObject(pageObj, dynObj);
125+
updatePageWithObject(pageObj, dynObj);
126126

127-
if (this->m_scrollLayer)
128-
this->m_scrollLayer->repositionPagesLooped();
127+
if (m_scrollLayer)
128+
m_scrollLayer->repositionPagesLooped();
129129
else
130-
log::error("this->m_scrollLayer is null");
130+
log::error("m_scrollLayer is null");
131131

132132
return true;
133133
}
134134

135-
#ifndef GEODE_IS_IOS
136135
ccColor3B MyLevelSelectLayer::colorForPage(int pageID) {
137136
if (!m_scrollLayer || !m_scrollLayer->m_dynamicObjects) {
138137
log::error("m_scrollLayer or m_dynamicObjects is null");
@@ -166,5 +165,4 @@ ccColor3B MyLevelSelectLayer::colorForPage(int pageID) {
166165
return { 37, 44, 52 };
167166

168167
return GM->colorForIdx(colIDs[page % 8]);
169-
}
170-
#endif
168+
}

0 commit comments

Comments
 (0)