| 76 | } |
| 77 | |
| 78 | void CharSelectionPane::selectCharacter(unsigned buttonIndex) { |
| 79 | if (m_downScroll + buttonIndex < m_filteredList.size()) { |
| 80 | auto playerUuid = m_filteredList.get(m_downScroll + buttonIndex); |
| 81 | auto player = m_playerStorage->loadPlayer(playerUuid); |
| 82 | if (player->isPermaDead() && !player->isAdmin()) { |
| 83 | auto sound = Random::randValueFrom( |
| 84 | Root::singleton().assets()->json("/interface.config:buttonClickFailSound").toArray(), "") |
| 85 | .toString(); |
| 86 | if (!sound.empty()) |
| 87 | context()->playAudio(sound); |
| 88 | } else |
| 89 | m_selectCallback(player); |
| 90 | } else |
| 91 | m_createCallback(); |
| 92 | } |
| 93 | |
| 94 | void CharSelectionPane::updateCharacterPlates() { |
| 95 |
nothing calls this directly
no test coverage detected