MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / open

Function open

src/OpenLoco/src/Ui/Windows/Options.cpp:2680–2721  ·  view source on GitHub ↗

0x004BF7B9

Source from the content-addressed store, hash-verified

2678
2679 // 0x004BF7B9
2680 Window* open()
2681 {
2682 Window* window = WindowManager::bringToFront(WindowType::options);
2683 if (window != nullptr)
2684 {
2685 return window;
2686 }
2687
2688 // 0x004BF833 (create_options_window)
2689 window = WindowManager::createWindowCentred(
2690 WindowType::options,
2691 Display::kWindowSize,
2692 WindowFlags::none,
2693 Display::getEvents());
2694
2695 window->setWidgets(Display::_widgets);
2696 window->number = 0;
2697 window->currentTab = 0;
2698 window->frameNo = 0;
2699 window->rowHover = -1;
2700 window->object = nullptr;
2701
2702 auto interface = ObjectManager::get<InterfaceSkinObject>();
2703 window->setColour(WindowColour::primary, interface->windowTitlebarColour);
2704 window->setColour(WindowColour::secondary, interface->windowOptionsColour);
2705
2706 prepareObjectSelectionList();
2707 populateAvailableCurrencies();
2708 setPreferredCurrencyNameBuffer();
2709
2710 Display::applyScreenModeRestrictions(*window);
2711
2712 window->holdableWidgets = 0;
2713 window->eventHandlers = &Display::getEvents();
2714 window->activatedWidgets = 0;
2715
2716 window->callOnResize();
2717 window->callPrepareDraw();
2718 window->initScrollWidgets();
2719
2720 return window;
2721 }
2722
2723 // 0x004BF823
2724 Window* openAudioSettings()

Callers 3

openKeyboardShortcutsFunction · 0.70
changePreferredFaceFunction · 0.70
openAudioSettingsFunction · 0.70

Calls 11

bringToFrontFunction · 0.85
createWindowCentredFunction · 0.85
setWidgetsMethod · 0.80
callOnResizeMethod · 0.80
callPrepareDrawMethod · 0.80
initScrollWidgetsMethod · 0.80
setColourMethod · 0.45

Tested by

no test coverage detected