Skip to content

Commit db785af

Browse files
committed
fix(main): Fixed data from comment badges not sent for badges on badge menu
1 parent 272e49a commit db785af

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

mod.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"geode": "4.0.1",
2+
"geode": "4.2.1",
33
"gd": {
44
"win": "2.2074",
55
"android": "2.2074",

src/main.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ class $modify(CustomCommentCell, CommentCell) {
120120

121121
CCMenuItemSpriteExtra* badge_api_plus = typeinfo_cast<CCMenuItemSpriteExtra*>(this->getChildByIDRecursive("badgeAPI-plus-badge"));
122122
if (badge_api_plus) {
123-
auto badge_api_plus_item = static_cast<CCArray*>(badge_api_plus->getUserObject());
123+
auto badge_api_plus_item = static_cast<CCArray*>(static_cast<CCNode*>(badge_api_plus)->getUserObject());
124124

125125
// Check if badges are already loaded on BadgeMenu and then remove those on the profile page
126126
CCObject* childObj;
@@ -177,6 +177,7 @@ class $modify(CustomCommentCell, CommentCell) {
177177
new_child->setID(child->getID());
178178
new_child->setTag(child->getTag());
179179
new_child->setNormalImage(sprite);
180+
new_child->setUserObject(child->getUserObject());
180181
new_child->updateSprite();
181182
childsRescaled->addObject(new_child);
182183
} else {
@@ -191,8 +192,6 @@ class $modify(CustomCommentCell, CommentCell) {
191192
}
192193

193194
void loadFromComment(GJComment* p0) {
194-
if (this->getChildByIDRecursive("mod-badge")) this->getChildByIDRecursive("mod-badge")->removeFromParent();
195-
196195
CommentCell::loadFromComment(p0);
197196

198197
if (m_fields->loaded) {
@@ -362,8 +361,6 @@ class $modify(CustomProfilePage, ProfilePage) {
362361
}
363362

364363
void loadPageFromUserInfo(GJUserScore* a2) {
365-
if (this->getChildByIDRecursive("mod-badge")) this->getChildByIDRecursive("mod-badge")->removeFromParent();
366-
367364
ProfilePage::loadPageFromUserInfo(a2);
368365

369366
if (m_fields->loaded) {

0 commit comments

Comments
 (0)