MCPcopy Create free account
hub / github.com/deathkiller/jazz2-native / OnShow

Method OnShow

Sources/Jazz2/UI/Menu/MultiplayerGameModeSelectSection.cpp:37–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35 }
36
37 void MultiplayerGameModeSelectSection::OnShow(IMenuContainer* root)
38 {
39 ScrollableMenuSection::OnShow(root);
40
41 if (auto* underlyingSection = dynamic_cast<CreateServerOptionsSection*>(_root->GetUnderlyingSection())) {
42 auto gameMode = underlyingSection->GetGameMode();
43 for (std::size_t i = 0; i < _items.size(); i++) {
44 if (_items[i].Item.Mode == gameMode) {
45 _selectedIndex = (std::int32_t)i;
46 break;
47 }
48 }
49 }
50 }
51
52 void MultiplayerGameModeSelectSection::OnDraw(Canvas* canvas)
53 {

Callers

nothing calls this directly

Calls 3

GetUnderlyingSectionMethod · 0.45
GetGameModeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected