diff --git a/src/LevelInfoLayer.cpp b/src/LevelInfoLayer.cpp index 69ce8a7..9193053 100644 --- a/src/LevelInfoLayer.cpp +++ b/src/LevelInfoLayer.cpp @@ -218,4 +218,38 @@ struct LevelInfoLayerIDs : Modify { return true; } + + void updateLabelValues() { + LevelInfoLayer::updateLabelValues(); + + size_t coinIdx = 1; + for(auto& coin : CCArrayExt(m_coins)) { + coin->setID(fmt::format("coin-icon-{}", coinIdx++)); + } + } + + void setupPlatformerStats() { + LevelInfoLayer::setupPlatformerStats(); + + size_t labelOffset = 1; + if(m_level->m_bestPoints) { + static_cast(this->getChildren()->objectAtIndex(this->getChildrenCount() - labelOffset))->setID("points-label"); + labelOffset++; + } + + log::info("best time: {}", this->getChildren()->objectAtIndex(this->getChildrenCount() - labelOffset)); + static_cast(this->getChildren()->objectAtIndex(this->getChildrenCount() - labelOffset))->setID("best-time-label"); + labelOffset++; + } + + void setupProgressBars() { + LevelInfoLayer::setupProgressBars(); + + static_cast(this->getChildren()->objectAtIndex(this->getChildrenCount() - 1))->setID("practice-mode-label"); + static_cast(this->getChildren()->objectAtIndex(this->getChildrenCount() - 2))->setID("normal-mode-label"); + static_cast(this->getChildren()->objectAtIndex(this->getChildrenCount() - 3))->setID("practice-mode-percentage"); + static_cast(this->getChildren()->objectAtIndex(this->getChildrenCount() - 4))->setID("normal-mode-percentage"); + static_cast(this->getChildren()->objectAtIndex(this->getChildrenCount() - 5))->setID("practice-mode-bar"); + static_cast(this->getChildren()->objectAtIndex(this->getChildrenCount() - 6))->setID("normal-mode-bar"); + } }; \ No newline at end of file