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

Method ExecuteSelected

Sources/Jazz2/UI/Menu/PauseSection.cpp:132–164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130 }
131
132 void PauseSection::ExecuteSelected()
133 {
134 switch (_items[_selectedIndex].Type) {
135 case Item::Resume: {
136 _root->PlaySfx("MenuSelect"_s, 0.6f);
137 if (auto inGameMenu = runtime_cast<InGameMenu>(_root)) {
138 inGameMenu->ResumeGame();
139 }
140 break;
141 }
142#if defined(WITH_MULTIPLAYER)
143 case Item::Spectate: {
144 _root->PlaySfx("MenuSelect"_s, 0.6f);
145 if (auto inGameMenu = runtime_cast<InGameMenu>(_root)) {
146 inGameMenu->ToggleSpectate();
147 }
148 break;
149 }
150#endif
151 case Item::Options: {
152 _root->PlaySfx("MenuSelect"_s, 0.6f);
153 _root->SwitchToSection<OptionsSection>();
154 break;
155 }
156 case Item::Exit: {
157 _root->PlaySfx("MenuSelect"_s, 0.6f);
158 if (auto inGameMenu = runtime_cast<InGameMenu>(_root)) {
159 inGameMenu->GoToMainMenu();
160 }
161 break;
162 }
163 }
164 }
165}

Callers

nothing calls this directly

Calls 4

ToggleSpectateMethod · 0.80
PlaySfxMethod · 0.45
ResumeGameMethod · 0.45
GoToMainMenuMethod · 0.45

Tested by

no test coverage detected