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

Function open

src/OpenLoco/src/Ui/Windows/MusicSelection.cpp:119–150  ·  view source on GitHub ↗

0x004C1602

Source from the content-addressed store, hash-verified

117
118 // 0x004C1602
119 Window* open()
120 {
121 Window* window = WindowManager::bringToFront(WindowType::musicSelection, 0);
122 if (window != nullptr)
123 {
124 return window;
125 }
126
127 window = WindowManager::createWindow(
128 WindowType::musicSelection,
129 kWindowSizeDefault,
130 WindowFlags::resizable,
131 getEvents());
132
133 window->setWidgets(_widgets);
134 window->initScrollWidgets();
135
136 auto interface = ObjectManager::get<InterfaceSkinObject>();
137 window->setColour(WindowColour::primary, interface->windowTitlebarColour);
138 window->setColour(WindowColour::secondary, interface->windowOptionsColour);
139
140 window->rowCount = Jukebox::kNumMusicTracks;
141 window->rowHover = -1;
142
143 setSortMode(*window, Jukebox::MusicSortMode::original);
144
145 // Set status bar text
146 uint16_t numTracksSelected = std::ranges::count(Config::get().audio.customJukebox, true);
147 updateStatusBar(*window, numTracksSelected);
148
149 return window;
150 }
151
152 static void onResize(Ui::Window& self)
153 {

Callers

nothing calls this directly

Calls 9

bringToFrontFunction · 0.85
setSortModeFunction · 0.85
countFunction · 0.85
updateStatusBarFunction · 0.85
setWidgetsMethod · 0.80
initScrollWidgetsMethod · 0.80
createWindowFunction · 0.50
getFunction · 0.50
setColourMethod · 0.45

Tested by

no test coverage detected