| 50 | } |
| 51 | |
| 52 | void 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 | |
| 71 | bool RateLevelLayer::init(int) |
| 72 | { |