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

Function dropdownRegisterSelection

src/OpenLoco/src/Input/MouseInput.cpp:893–922  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

891 }
892
893 static void dropdownRegisterSelection(int16_t item)
894 {
895 auto window = WindowManager::find(_pressedWindowType, _pressedWindowNumber);
896 if (window == nullptr)
897 {
898 return;
899 }
900
901 WindowManager::close(Ui::WindowType::dropdown, 0);
902 window = WindowManager::find(_pressedWindowType, _pressedWindowNumber);
903
904 bool flagSet = hasFlag(Flags::widgetPressed);
905 resetFlag(Flags::widgetPressed);
906 if (flagSet)
907 {
908 WindowManager::invalidateWidget(_pressedWindowType, _pressedWindowNumber, _pressedWidgetIndex);
909 }
910
911 Input::state(State::normal);
912
913 Ui::ToolTip::setTooltipTimeout(0);
914 Ui::ToolTip::setWidgetIndex(_pressedWidgetIndex);
915 Ui::ToolTip::setWindowType(_pressedWindowType);
916 Ui::ToolTip::setWindowNumber(_pressedWindowNumber);
917
918 if (WindowManager::getCurrentModalType() == Ui::WindowType::undefined || WindowManager::getCurrentModalType() == window->type)
919 {
920 window->callOnDropdown(_pressedWidgetIndex, window->widgets[_pressedWidgetIndex].id, item);
921 }
922 }
923
924 // 0x004C7AE7
925 static void stateWidgetPressed(MouseButton button, int32_t x, int32_t y, Ui::Window* window, Ui::Widget* widget, Ui::WidgetIndex_t widgetIndex)

Callers 1

stateWidgetPressedFunction · 0.85

Calls 12

findFunction · 0.85
invalidateWidgetFunction · 0.85
setTooltipTimeoutFunction · 0.85
setWidgetIndexFunction · 0.85
setWindowTypeFunction · 0.85
setWindowNumberFunction · 0.85
getCurrentModalTypeFunction · 0.85
callOnDropdownMethod · 0.80
closeFunction · 0.50
hasFlagFunction · 0.50
resetFlagFunction · 0.50
stateFunction · 0.50

Tested by

no test coverage detected