MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / OpenWindowsForCurrentStep

Function OpenWindowsForCurrentStep

src/openrct2/Editor.cpp:354–408  ·  view source on GitHub ↗

* * rct2: 0x0067009A */

Source from the content-addressed store, hash-verified

352 * rct2: 0x0067009A
353 */
354 void OpenWindowsForCurrentStep()
355 {
356 if (!isInEditorMode())
357 {
358 return;
359 }
360
361 auto* windowMgr = Ui::GetWindowManager();
362
363 switch (getGameState().editorStep)
364 {
365 case Editor::Step::objectSelection:
366 if (windowMgr->FindByClass(WindowClass::editorObjectSelection) != nullptr)
367 {
368 return;
369 }
370
371 if (windowMgr->FindByClass(WindowClass::installTrack) != nullptr)
372 {
373 return;
374 }
375
376 if (gLegacyScene == LegacyScene::trackDesignsManager)
377 {
378 ObjectManagerUnloadAllObjects();
379 }
380
381 ContextOpenWindow(WindowClass::editorObjectSelection);
382 break;
383 case Editor::Step::inventionsListSetUp:
384 if (windowMgr->FindByClass(WindowClass::editorInventionList) != nullptr)
385 {
386 return;
387 }
388
389 ContextOpenWindow(WindowClass::editorInventionList);
390 break;
391 case Editor::Step::optionsSelection:
392 case Editor::Step::objectiveSelection:
393 case Editor::Step::scenarioDetails:
394 if (windowMgr->FindByClass(WindowClass::editorScenarioOptions) != nullptr)
395 {
396 return;
397 }
398
399 ContextOpenWindow(WindowClass::editorScenarioOptions);
400 break;
401 case Editor::Step::landscapeEditor:
402 case Editor::Step::saveScenario:
403 case Editor::Step::rollerCoasterDesigner:
404 case Editor::Step::designsManager:
405 case Editor::Step::invalid:
406 break;
407 }
408 }
409
410 static void FinaliseMainView()
411 {

Callers 1

gameStateUpdateLogicFunction · 0.85

Calls 5

isInEditorModeFunction · 0.85
GetWindowManagerFunction · 0.85
ContextOpenWindowFunction · 0.85
FindByClassMethod · 0.45

Tested by

no test coverage detected