diff --git a/src/MoreLeaderboards/CustomScoreCell.cpp b/src/MoreLeaderboards/CustomScoreCell.cpp index b1a3c17..f0388c1 100644 --- a/src/MoreLeaderboards/CustomScoreCell.cpp +++ b/src/MoreLeaderboards/CustomScoreCell.cpp @@ -158,6 +158,12 @@ class $modify(CustomScoreCell, GJScoreCell) { platformer_sprite->setPositionX(30); platformer_sprite->setScale(1.2f); + auto pointercrate = CCSprite::createWithSpriteFrameName("diffIcon_06_btn_001.png"); + auto pointercrate_text = CCLabelBMFont::create("PC", "goldFont.fnt"); + pointercrate_text->setPosition(28, 0); + pointercrate_text->setScale(0.5f); + pointercrate->addChild(pointercrate_text); + auto easydemon_sprite_classic = CCSprite::createWithSpriteFrameName("diffIcon_07_btn_001.png"); easydemon_sprite_classic->addChild(classic_sprite); auto mediumdemon_sprite_classic = CCSprite::createWithSpriteFrameName("diffIcon_08_btn_001.png"); @@ -389,6 +395,25 @@ class $modify(CustomScoreCell, GJScoreCell) { demon_icon->setZOrder(demon_icon_z); statsMenu->addChild(extreme_sprite_classic); + demon_label->removeFromParent(); + demon_label = CCLabelBMFont::create(count_diff.c_str(), "bigFont.fnt"); + demon_label->setPosition(demon_label_pos); + demon_label->setScale(demon_label_scale); + demon_label->setZOrder(demon_label_z); + demon_label->setTag(demon_label_tag); + demon_label->setLayoutOptions(demon_label_layout); + statsMenu->addChild(demon_label); + break; + case StatsListType::Pointercrate: + demon_icon->removeFromParent(); + demon_icon = pointercrate; + demon_icon->setPosition(demon_icon_pos); + demon_icon->setScale(demon_icon_scale); + demon_icon->setLayoutOptions(demon_icon_layout); + demon_icon->setTag(demon_icon_tag); + demon_icon->setZOrder(demon_icon_z); + statsMenu->addChild(pointercrate); + demon_label->removeFromParent(); demon_label = CCLabelBMFont::create(count_diff.c_str(), "bigFont.fnt"); demon_label->setPosition(demon_label_pos); diff --git a/src/MoreLeaderboards/MoreLeaderboards.cpp b/src/MoreLeaderboards/MoreLeaderboards.cpp index f273f93..84c2743 100644 --- a/src/MoreLeaderboards/MoreLeaderboards.cpp +++ b/src/MoreLeaderboards/MoreLeaderboards.cpp @@ -2,6 +2,7 @@ #include "Newtab.h" #include #include +#include StatsListType MoreLeaderboards::g_tab = StatsListType::Stars; bool MoreLeaderboards::modFilter = false; @@ -546,6 +547,9 @@ void MoreLeaderboards::startLoadingMore() { case StatsListType::BetterProgression: type = "betterProgression"; break; + case StatsListType::Pointercrate: + type = "pointercratePoints"; + break; } const geode::utils::MiniFunction expect = [this](std::string const& error) { @@ -975,6 +979,11 @@ void MoreLeaderboards::changeTabPage() { platformer_sprite->setScale(1.2f); auto better_progression = CCSprite::create("better_progression.png"_spr); + auto pointercrate = CCSprite::createWithSpriteFrameName("diffIcon_06_btn_001.png"); + auto pointercrate_text = CCLabelBMFont::create("PC", "goldFont.fnt"); + pointercrate_text->setPosition(28, 0); + pointercrate_text->setScale(0.5f); + pointercrate->addChild(pointercrate_text); auto easydemon_sprite_classic = CCSprite::createWithSpriteFrameName("diffIcon_07_btn_001.png"); easydemon_sprite_classic->addChild(classic_sprite); @@ -1046,14 +1055,25 @@ void MoreLeaderboards::changeTabPage() { break; case 1: - MoreLeaderboards::g_tab = StatsListType::BetterProgression; - - m_tab1 = NewTabButton::create(TabBaseColor::Unselected, TabBaseColor::Selected, better_progression, this, menu_selector(MoreLeaderboards::onTab)); - m_tab1->setPosition(-140.f, 132); - m_tab1->setTag(static_cast(StatsListType::BetterProgression)); - m_tab1->setZOrder(30); - m_tab1->setScale(0.8f); - m_menu->addChild(m_tab1); + if (geode::Loader::get()->isModLoaded("itzkiba.better_progression")) { + MoreLeaderboards::g_tab = StatsListType::BetterProgression; + + m_tab1 = NewTabButton::create(TabBaseColor::Unselected, TabBaseColor::Selected, better_progression, this, menu_selector(MoreLeaderboards::onTab)); + m_tab1->setPosition(-140.f, 132); + m_tab1->setTag(static_cast(StatsListType::BetterProgression)); + m_tab1->setZOrder(30); + m_tab1->setScale(0.8f); + m_menu->addChild(m_tab1); + } else { + MoreLeaderboards::g_tab = StatsListType::Pointercrate; + + m_tab1 = NewTabButton::create(TabBaseColor::Unselected, TabBaseColor::Selected, pointercrate, this, menu_selector(MoreLeaderboards::onTab)); + m_tab1->setPosition(-140.f, 132); + m_tab1->setTag(static_cast(StatsListType::Pointercrate)); + m_tab1->setZOrder(30); + m_tab1->setScale(0.8f); + m_menu->addChild(m_tab1); + } m_tab2 = NewTabButton::create(TabBaseColor::Unselected, TabBaseColor::Selected, easydemon_sprite_classic, this, menu_selector(MoreLeaderboards::onTab)); m_tab2->setPosition(-86.f, 132); @@ -1129,6 +1149,15 @@ void MoreLeaderboards::changeTabPage() { m_tab5->setScale(0.8f); m_menu->addChild(m_tab5); + if (geode::Loader::get()->isModLoaded("itzkiba.better_progression")) { + m_tab6 = NewTabButton::create(TabBaseColor::Unselected, TabBaseColor::Selected, pointercrate, this, menu_selector(MoreLeaderboards::onTab)); + m_tab6->setPosition(138.f, 132); + m_tab6->setTag(static_cast(StatsListType::Pointercrate)); + m_tab6->setZOrder(30); + m_tab6->setScale(0.8f); + m_menu->addChild(m_tab6); + } + break; } diff --git a/src/MoreLeaderboards/MoreLeaderboards.h b/src/MoreLeaderboards/MoreLeaderboards.h index 0da5363..0c4cbca 100644 --- a/src/MoreLeaderboards/MoreLeaderboards.h +++ b/src/MoreLeaderboards/MoreLeaderboards.h @@ -25,7 +25,8 @@ enum class StatsListType { platformerDemonsHard, platformerDemonsInsane, platformerDemonsExtreme, - BetterProgression + BetterProgression, + Pointercrate }; class MoreLeaderboards : public CCLayer {