MCPcopy Create free account
hub / github.com/Open-GD/OpenGD / selectRating

Method selectRating

Source/RateLevelLayer.cpp:52–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50}
51
52void RateLevelLayer::selectRating(Node* btn)
53{
54 auto tag = btn->getTag();
55
56 if (tag == m_dSelectedDiff)
57 return;
58
59 btn->setColor(SELECTED_COLOR);
60
61 if (auto oldSelected = btn->getParent()->getChildByTag(m_dSelectedDiff))
62 oldSelected->setColor(UNSELECTED_COLOR);
63 else
64 {
65 static_cast<ButtonSprite*>(m_pSubmitButton->getSprite())->setColor(SELECTED_COLOR);
66 }
67
68 m_dSelectedDiff = tag;
69}
70
71bool RateLevelLayer::init(int)
72{

Callers

nothing calls this directly

Calls 2

setColorMethod · 0.45
getSpriteMethod · 0.45

Tested by

no test coverage detected