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

Function zoomMenuDropdown

src/OpenLoco/src/Ui/Windows/ToolbarTopCommon.cpp:302–328  ·  view source on GitHub ↗

0x0043A86D

Source from the content-addressed store, hash-verified

300
301 // 0x0043A86D
302 void zoomMenuDropdown(Window* window, [[maybe_unused]] WidgetIndex_t widgetIndex, int16_t itemIndex)
303 {
304 if (itemIndex == -1)
305 {
306 itemIndex = Dropdown::getHighlightedItem();
307 }
308
309 window = WindowManager::getMainWindow();
310
311 if (itemIndex == 0)
312 {
313 window->viewportZoomIn(false);
314 TownManager::updateLabels();
315 StationManager::updateLabels();
316 }
317 else if (itemIndex == 1)
318 {
319 _zoomTicks = 0;
320 window->viewportZoomOut(false);
321 TownManager::updateLabels();
322 StationManager::updateLabels();
323 }
324 else if (itemIndex == 2)
325 {
326 MapWindow::open();
327 }
328 }
329
330 // 0x0043A624
331 void rotateMenuDropdown(Window* window, [[maybe_unused]] WidgetIndex_t widgetIndex, int16_t itemIndex)

Callers 1

onDropdownFunction · 0.85

Calls 6

getHighlightedItemFunction · 0.85
getMainWindowFunction · 0.85
viewportZoomInMethod · 0.80
viewportZoomOutMethod · 0.80
openFunction · 0.70
updateLabelsFunction · 0.50

Tested by

no test coverage detected