diff --git a/src/layers/RewardHistory/RewardCell.cpp b/src/layers/RewardHistory/RewardCell.cpp index f1554cf..29524dc 100644 --- a/src/layers/RewardHistory/RewardCell.cpp +++ b/src/layers/RewardHistory/RewardCell.cpp @@ -8,19 +8,24 @@ void RewardCell::loadFromData(CCObject* object) { const char* chestTexture = "chest_01_02_001.png"; float chestSize = 0.35f; + const char* chestTitle = Mod::get()->getSavedValue("reward-cell-title").c_str(); switch(reward->m_rewardType) { default: break; case GJRewardType::Small: chestTexture = "chest_01_02_001.png"; break; case GJRewardType::Large: chestTexture = "chest_02_02_001.png"; chestSize = 0.275f; break; - case GJRewardType::SmallTreasure: chestTexture = "chest_03_02_001.png"; chestSize = 0.275f; break; - case GJRewardType::LargeTreasure: chestTexture = "chest_04_02_001.png"; chestSize = 0.275f; break; + case GJRewardType::SmallTreasure: chestTexture = "chest_03_02_001.png"; chestSize = 0.275f; chestTitle = "1 Key"; break; + case GJRewardType::LargeTreasure: chestTexture = "chest_04_02_001.png"; chestSize = 0.275f; chestTitle = "5 Key"; break; + case GJRewardType::Key10Treasure: chestTexture = "chest_05_02_001.png"; chestSize = 0.275f; chestTitle = "10 Key"; break; + case GJRewardType::Key25Treasure: chestTexture = "chest_06_02_001.png"; chestSize = 0.275f; chestTitle = "25 Key"; break; + case GJRewardType::Key50Treasure: chestTexture = "chest_07_02_001.png"; chestSize = 0.275f; chestTitle = "50 Key"; break; + case GJRewardType::Key100Treasure: chestTexture = "chest_08_02_001.png"; chestSize = 0.275f; chestTitle = "100 Key"; break; } CCSprite* chest = CCSprite::createWithSpriteFrameName(chestTexture); chest->setPosition({25, 22}); chest->setScale(chestSize); this->m_mainLayer->addChild(chest); - auto title = CCLabelBMFont::create(CCString::createWithFormat(reward->m_chestID != 0 ? "%s Chest %i" : "%s Chest", Mod::get()->getSavedValue("reward-cell-title").c_str(), reward->m_chestID)->getCString(), "bigFont.fnt"); + auto title = CCLabelBMFont::create(CCString::createWithFormat(reward->m_chestID != 0 ? "%s Chest %i" : "%s Chest", chestTitle, reward->m_chestID)->getCString(), "bigFont.fnt"); title->setAnchorPoint({ 0.0f, .5f }); title->setPosition(rowX, 31.5f); title->limitLabelWidth(356-rowX, .65f, .4f); @@ -45,13 +50,17 @@ void RewardCell::loadFromData(CCObject* object) { case SpecialRewardItem::Orbs: textureName = "currencyOrbIcon_001.png"; scale = .7f; break; case SpecialRewardItem::Diamonds: textureName = "diamond_small01_001.png"; break; case SpecialRewardItem::CustomItem: textureName = "collaborationIcon_001.png"; scale = .5f; break; + case SpecialRewardItem::EarthShard: textureName = "shard0201ShardSmall_001.png"; break; + case SpecialRewardItem::BloodShard: textureName = "shard0202ShardSmall_001.png"; break; + case SpecialRewardItem::MetalShard: textureName = "shard0203ShardSmall_001.png"; break; + case SpecialRewardItem::LightShard: textureName = "shard0204ShardSmall_001.png"; break; + case SpecialRewardItem::SoulShard: textureName = "shard0205ShardSmall_001.png"; break; default: scale = 0.7f; } lastSprite = CCSprite::createWithSpriteFrameName(textureName); if(rewardObj->m_specialRewardItem == SpecialRewardItem::CustomItem) { - //TODO: reverse GJItemIcon - //lastSprite = GJItemIcon::createBrowserIcon(rewardObj->m_unlockType, rewardObj->m_itemID); + lastSprite = GJItemIcon::createBrowserItem(rewardObj->m_unlockType, rewardObj->m_itemID); } if(lastText == nullptr) lastSprite->setPosition({rowX + 1, rowY}); else lastSprite->setPosition({lastText->getPositionX() + (lastText->getContentSize().width * lastText->getScaleX()) + 11.f, rowY}); @@ -70,12 +79,6 @@ void RewardCell::loadFromData(CCObject* object) { this->m_backgroundLayer->setOpacity(255); } -void RewardCell::draw() { - // just call StatsCell::draw, no one will notice - // this is stolen from betteredit blame fod - reinterpret_cast(this)->StatsCell::draw(); -} - RewardCell::RewardCell(const char* name, CCSize size) : GenericListCell(name, size) {} diff --git a/src/layers/RewardHistory/RewardCell.h b/src/layers/RewardHistory/RewardCell.h index 0794946..53ca156 100644 --- a/src/layers/RewardHistory/RewardCell.h +++ b/src/layers/RewardHistory/RewardCell.h @@ -5,8 +5,6 @@ using namespace geode::prelude; class RewardCell : public GenericListCell { - void draw(); - public: RewardCell(const char* name, cocos2d::CCSize size); void loadFromData(CCObject* object);