Skip to content

Commit

Permalink
fix cell crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
Cvolton committed Aug 18, 2023
1 parent e27c001 commit 9e96097
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/layers/DailyCell.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ using namespace geode::prelude;
class DailyCell : public TableViewCell {
GJGameLevel* m_level;

DailyCell(const char* name, cocos2d::CCSize size);
void draw() override;
void onView(cocos2d::CCObject* sender);
void onLeaderboards(cocos2d::CCObject* sender);
Expand All @@ -16,6 +15,7 @@ class DailyCell : public TableViewCell {
int getAwardedDiamonds();

public:
DailyCell(const char* name, cocos2d::CCSize size);
void loadFromLevel(GJGameLevel* level);
static DailyCell* create(const char* key, cocos2d::CCSize size);
};
2 changes: 1 addition & 1 deletion src/layers/DailyListView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ void DailyListView::loadCell(TableViewCell* cell, int index) {
}

TableViewCell* DailyListView::getListCell(const char* key) {
return DailyCell::create(key, { this->m_width, 55.0f });
return new DailyCell(key, { this->m_width, 55.0f });
}
2 changes: 1 addition & 1 deletion src/layers/LeaderboardListView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ void LeaderboardListView::loadCell(TableViewCell* cell, int index) {
}

TableViewCell* LeaderboardListView::getListCell(const char* key) {
return GJScoreCell::create(key, this->m_width, this->m_itemSeparation);
return new GJScoreCell(key, this->m_width, this->m_itemSeparation);
}
2 changes: 1 addition & 1 deletion src/layers/LevelSearchListView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ void LevelSearchListView::loadCell(TableViewCell* cell, int index) {
}

TableViewCell* LevelSearchListView::getListCell(const char* key) {
return LevelCell::create(key, this->m_width, this->m_itemSeparation);
return new LevelCell(key, this->m_width, this->m_itemSeparation);
}
2 changes: 1 addition & 1 deletion src/layers/RewardCell.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ using namespace geode::prelude;

class RewardCell : public TableViewCell {
GJGameLevel* level;
RewardCell(const char* name, cocos2d::CCSize size);
void draw() override;

public:
RewardCell(const char* name, cocos2d::CCSize size);
void loadFromReward(GJRewardItem* reward);
static RewardCell* create(const char* key, cocos2d::CCSize size);
};
2 changes: 1 addition & 1 deletion src/layers/RewardListView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ void RewardListView::loadCell(TableViewCell* cell, int index) {
}

TableViewCell* RewardListView::getListCell(const char* key) {
return RewardCell::create(key, { this->m_width, this->m_itemSeparation });
return new RewardCell(key, { this->m_width, this->m_itemSeparation });
}

0 comments on commit 9e96097

Please sign in to comment.