diff --git a/mod.json b/mod.json index 89bb495..2cf958d 100644 --- a/mod.json +++ b/mod.json @@ -42,7 +42,8 @@ "spritesheets": { "countries": ["resources/countries/*.png"], "gauntlets": ["resources/gauntlets/*.png"], - "betterprogression": ["resources/betterprogression/*.png"] + "betterprogression": ["resources/betterprogression/*.png"], + "badges": ["resources/badges/*.png"] } }, "settings": { diff --git a/resources/contributorBadge.png b/resources/badges/contributorBadge.png similarity index 100% rename from resources/contributorBadge.png rename to resources/badges/contributorBadge.png diff --git a/resources/gdutils_badge.png b/resources/badges/gdutils_badge.png similarity index 100% rename from resources/gdutils_badge.png rename to resources/badges/gdutils_badge.png diff --git a/resources/robtop_badge.png b/resources/badges/robtop_badge.png similarity index 100% rename from resources/robtop_badge.png rename to resources/badges/robtop_badge.png diff --git a/resources/badges/ul_dev_badge.png b/resources/badges/ul_dev_badge.png new file mode 100644 index 0000000..638a780 Binary files /dev/null and b/resources/badges/ul_dev_badge.png differ diff --git a/resources/badges/ul_helper_badge.png b/resources/badges/ul_helper_badge.png new file mode 100644 index 0000000..f4ee07b Binary files /dev/null and b/resources/badges/ul_helper_badge.png differ diff --git a/resources/badges/ul_officer_badge.png b/resources/badges/ul_officer_badge.png new file mode 100644 index 0000000..b8db504 Binary files /dev/null and b/resources/badges/ul_officer_badge.png differ diff --git a/src/MoreLeaderboards/MoreLeaderboardsCell.cpp b/src/MoreLeaderboards/MoreLeaderboardsCell.cpp index bd3d5ef..1a7cc5b 100644 --- a/src/MoreLeaderboards/MoreLeaderboardsCell.cpp +++ b/src/MoreLeaderboards/MoreLeaderboardsCell.cpp @@ -22,7 +22,7 @@ void MoreLeaderboardsCell::loadFromDict(cocos2d::CCDictionary* content) usernameTemp = name; } else if (id == "3") { if (name == "0") { - auto robtopbadge = cocos2d::CCSprite::create("robtop_badge.png"_spr); + auto robtopbadge = cocos2d::CCSprite::createWithSpriteFrameName("robtop_badge.png"_spr); robtopbadge->setPosition({ 30, 20 }); robtopbadge->setScale(0.05f); this->m_mainLayer->addChild(robtopbadge); diff --git a/src/Utils/NewProfilePage.cpp b/src/Utils/NewProfilePage.cpp index c7756af..6020bd1 100644 --- a/src/Utils/NewProfilePage.cpp +++ b/src/Utils/NewProfilePage.cpp @@ -156,6 +156,51 @@ This badge is given to users that have contributed to the project by having merg )->show(); } +void NewProfilePage::onULDevBadgePressed(CCObject* pSender) { + FLAlertLayer::create( + nullptr, + "UL Developer", + R"text( +Updated Leaderboard Developer is a user that has contributed to the Updated Leaderboard project by writing code and managing the project. + +They are responsible for all the updates and content that is added to the Updated Leaderboard project. + )text", + "OK", + nullptr, + 350.0f + )->show(); +} + +void NewProfilePage::onULOfficerBadgePressed(CCObject* pSender) { + FLAlertLayer::create( + nullptr, + "UL Manager", + R"text( +Updated Leaderboard Manager is a user that is handling the Updated Leaderboard project by managing the project with others UL Helpers. + +They are responsible of the management and the Helper team of the Updated Leaderboard project and they have the same permissions as the UL Helpers. + )text", + "OK", + nullptr, + 350.0f + )->show(); +} + +void NewProfilePage::onULHelperBadgePressed(CCObject* pSender) { + FLAlertLayer::create( + nullptr, + "UL Helper", + R"text( +Updated Leaderboard Helper is a user that is helping the Updated Leaderboard project by managing the project with others UL Managers. + +They are responsible of the management of the leaderboards by adding new users, checking for cheaters and managing the leaderboards with the UL Managers. + )text", + "OK", + nullptr, + 350.0f + )->show(); +} + void NewProfilePage::onRobTopBadgePressed(CCObject* pSender) { FLAlertLayer::create( nullptr, @@ -199,10 +244,26 @@ class $modify(ProfilePage) { if (accountID_data == accountID) { if (badge == 1) { + if (!layer->getChildByIDRecursive("gdutils-dev-badge")) { + CCMenu* username_menu = typeinfo_cast(layer->getChildByIDRecursive("username-menu")); + + auto badgeGDUtil = CCSprite::createWithSpriteFrameName("gdutils_badge.png"_spr); + badgeGDUtil->setScale(.3f); + auto badgeGDUtilBtn = CCMenuItemSpriteExtra::create( + badgeGDUtil, + layer, + menu_selector(NewProfilePage::onGDUtilsDevBadgePressed) + ); + + badgeGDUtilBtn->setID("gdutils-dev-badge"); + username_menu->addChild(badgeGDUtilBtn); + username_menu->updateLayout(); + } + } else if (badge == 2) { if (!layer->getChildByIDRecursive("gdutils-contributor-badge")) { CCMenu* username_menu = typeinfo_cast(layer->getChildByIDRecursive("username-menu")); - auto badgeGDUtil = CCSprite::create("contributorBadge.png"_spr); + auto badgeGDUtil = CCSprite::createWithSpriteFrameName("contributorBadge.png"_spr); badgeGDUtil->setScale(1.075f); auto badgeGDUtilBtn = CCMenuItemSpriteExtra::create( badgeGDUtil, @@ -214,19 +275,51 @@ class $modify(ProfilePage) { username_menu->addChild(badgeGDUtilBtn); username_menu->updateLayout(); } - } else if (badge == 2) { - if (!layer->getChildByIDRecursive("gdutils-dev-badge")) { + } else if (badge == 5) { + if (!layer->getChildByIDRecursive("gdutils-ul-developer-badge")) { CCMenu* username_menu = typeinfo_cast(layer->getChildByIDRecursive("username-menu")); - auto badgeGDUtil = CCSprite::create("gdutils_badge.png"_spr); - badgeGDUtil->setScale(.3f); + auto badgeGDUtil = CCSprite::createWithSpriteFrameName("ul_dev_badge.png"_spr); + badgeGDUtil->setScale(.75f); auto badgeGDUtilBtn = CCMenuItemSpriteExtra::create( badgeGDUtil, layer, - menu_selector(NewProfilePage::onGDUtilsDevBadgePressed) + menu_selector(NewProfilePage::onULDevBadgePressed) ); - badgeGDUtilBtn->setID("gdutils-dev-badge"); + badgeGDUtilBtn->setID("gdutils-ul-developer-badge"); + username_menu->addChild(badgeGDUtilBtn); + username_menu->updateLayout(); + } + } else if (badge == 6) { + if (!layer->getChildByIDRecursive("gdutils-ul-officer-badge")) { + CCMenu* username_menu = typeinfo_cast(layer->getChildByIDRecursive("username-menu")); + + auto badgeGDUtil = CCSprite::createWithSpriteFrameName("ul_officer_badge.png"_spr); + badgeGDUtil->setScale(.75f); + auto badgeGDUtilBtn = CCMenuItemSpriteExtra::create( + badgeGDUtil, + layer, + menu_selector(NewProfilePage::onULOfficerBadgePressed) + ); + + badgeGDUtilBtn->setID("gdutils-ul-officer-badge"); + username_menu->addChild(badgeGDUtilBtn); + username_menu->updateLayout(); + } + } else if (badge == 7) { + if (!layer->getChildByIDRecursive("gdutils-ul-helper-badge")) { + CCMenu* username_menu = typeinfo_cast(layer->getChildByIDRecursive("username-menu")); + + auto badgeGDUtil = CCSprite::createWithSpriteFrameName("ul_helper_badge.png"_spr); + badgeGDUtil->setScale(.75f); + auto badgeGDUtilBtn = CCMenuItemSpriteExtra::create( + badgeGDUtil, + layer, + menu_selector(NewProfilePage::onULHelperBadgePressed) + ); + + badgeGDUtilBtn->setID("gdutils-ul-helper-badge"); username_menu->addChild(badgeGDUtilBtn); username_menu->updateLayout(); } @@ -278,7 +371,7 @@ class $modify(ProfilePage) { modbadge->removeFromParentAndCleanup(true); if (a2->m_userName == "RobTop") { - auto robtopSpr = CCSprite::create("robtop_badge.png"_spr); + auto robtopSpr = CCSprite::createWithSpriteFrameName("robtop_badge.png"_spr); robtopSpr->setScale(.04f); badgeBtn = CCMenuItemSpriteExtra::create( robtopSpr, diff --git a/src/Utils/NewProfilePage.h b/src/Utils/NewProfilePage.h index e1cef65..9414e48 100644 --- a/src/Utils/NewProfilePage.h +++ b/src/Utils/NewProfilePage.h @@ -10,5 +10,8 @@ class NewProfilePage : public CCLayer { void onBadgePressed(CCObject* pSender); void onGDUtilsDevBadgePressed(CCObject* pSender); void onGDUtilsContributorBadgePressed(CCObject* pSender); + void onULDevBadgePressed(CCObject* pSender); + void onULOfficerBadgePressed(CCObject* pSender); + void onULHelperBadgePressed(CCObject* pSender); void onRobTopBadgePressed(CCObject* pSender); };