Skip to content

Commit

Permalink
add ncs icon to levelcell
Browse files Browse the repository at this point in the history
  • Loading branch information
Cvolton committed Jun 4, 2024
1 parent 76acb91 commit 1632407
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/LevelCell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,15 @@ struct LevelCellIDs : Modify<LevelCellIDs, LevelCell> {
getChildOfType<CCLabelBMFont>(m_mainLayer, labelOffset)->setID("song-name");
labelOffset++;

if(auto practiceTxt = ::getChildBySpriteFrameName(m_mainLayer, "ncs_small_001.png")) {
practiceTxt->setID("ncs-icon");
spriteOffset++;
}

size_t containerSpriteOffset = 0;
size_t containerLabelOffset = 0;
//we can use label offset because nothing else has been made yet, the +1 is the CCMenu that contains all buttons
auto container = getChildOfType<CCNode>(m_mainLayer, labelOffset + 1);
auto container = getChildOfType<CCNode>(m_mainLayer, labelOffset + spriteOffset + 1);
if(container) {
container->setID("difficulty-container");
getChildOfType<CCSprite>(container, containerSpriteOffset)->setID("difficulty-sprite");
Expand Down

0 comments on commit 1632407

Please sign in to comment.