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

Method updateWidgets

source/frontend/StarTeamBar.cpp:360–373  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

358}
359
360void TeamMemberMenu::updateWidgets() {
361 bool isLeader = m_owner->m_client->teamClient()->isTeamLeader();
362 bool isSelf = m_owner->m_client->mainPlayer()->clientContext()->playerUuid() == m_memberUuid;
363
364 fetchChild<ButtonWidget>("beamToShip")->setEnabled(m_canBeam);
365 fetchChild<ButtonWidget>("makeLeader")->setEnabled(isLeader && !isSelf);
366 fetchChild<ButtonWidget>("removeFromTeam")->setEnabled(isLeader || isSelf);
367
368 auto assets = Root::singleton().assets();
369 if (isSelf)
370 fetchChild<ButtonWidget>("removeFromTeam")->setText(assets->json("/interface/windowconfig/teammembermenu.config:removeSelfText").toString());
371 else
372 fetchChild<ButtonWidget>("removeFromTeam")->setText(assets->json("/interface/windowconfig/teammembermenu.config:removeOtherText").toString());
373}
374
375void TeamMemberMenu::beamToShip() {
376 if (m_canBeam)

Callers

nothing calls this directly

Calls 11

singletonClass · 0.85
isTeamLeaderMethod · 0.80
teamClientMethod · 0.80
playerUuidMethod · 0.80
mainPlayerMethod · 0.80
assetsMethod · 0.80
jsonMethod · 0.80
clientContextMethod · 0.45
setEnabledMethod · 0.45
setTextMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected