MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / selectCharacter

Method selectCharacter

source/frontend/StarCharSelection.cpp:78–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76}
77
78void 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
94void CharSelectionPane::updateCharacterPlates() {
95

Callers

nothing calls this directly

Calls 12

singletonClass · 0.85
loadPlayerMethod · 0.80
isPermaDeadMethod · 0.80
toArrayMethod · 0.80
jsonMethod · 0.80
assetsMethod · 0.80
playAudioMethod · 0.80
sizeMethod · 0.45
getMethod · 0.45
isAdminMethod · 0.45
toStringMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected