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

Function showBelow

src/OpenLoco/src/Ui/Dropdown.cpp:685–730  ·  view source on GitHub ↗

0x004CC989

Source from the content-addressed store, hash-verified

683
684 // 0x004CC989
685 void showBelow(Window* window, WidgetIndex_t widgetIndex, size_t count, int8_t itemHeight, uint8_t flags)
686 {
687 assert(count < std::numeric_limits<uint8_t>::max());
688
689 WindowManager::close(WindowType::dropdown, 0);
690 _dropdownFlags = Flags::none;
691
692 if (Input::state() != Input::State::widgetPressed || Input::hasFlag(Input::Flags::widgetPressed))
693 {
694 _dropdownFlags = _dropdownFlags | Flags::unk1;
695 }
696
697 if (Input::getPressedWindowType() != WindowType::undefined)
698 {
699 WindowManager::invalidateWidget(Input::getPressedWindowType(), Input::getPressedWindowNumber(), Input::getPressedWidgetIndex());
700 }
701
702 Input::setPressedWidgetIndex(widgetIndex);
703 Input::setPressedWindowType(window->type);
704 Input::setPressedWindowNumber(window->number);
705 WindowManager::invalidateWidget(window->type, window->number, widgetIndex);
706
707 auto widget = window->widgets[widgetIndex];
708 auto colour = window->getColour(widget.windowColour).translucent();
709
710 auto x = widget.left + window->x;
711 auto y = widget.top + window->y;
712
713 if (colour.isTranslucent())
714 {
715 colour = kDropdownColourTable[enumValue(colour.c())];
716 colour = colour.translucent();
717 }
718
719 Input::resetFlag(Input::Flags::flag1);
720 Input::resetFlag(Input::Flags::flag2);
721
722 if (flags & (1 << 7))
723 {
724 Input::setFlag(Input::Flags::flag1);
725 }
726
727 flags &= ~(1 << 7);
728
729 common::showText(x, y, widget.width(), widget.height(), itemHeight, colour, count, flags);
730 }
731
732 // 0x004CC989
733 void showBelow(Window* window, WidgetIndex_t widgetIndex, size_t count, uint8_t flags)

Callers 15

showMethod · 0.85
playerMouseDownFunction · 0.85
audioMenuMouseDownFunction · 0.85
cheatsMenuMouseDownFunction · 0.85
railroadMenuMouseDownFunction · 0.85
portMenuMouseDownFunction · 0.85
vehiclesMenuMouseDownFunction · 0.85
stationsMenuMouseDownFunction · 0.85
zoomMenuMouseDownFunction · 0.85
rotateMenuMouseDownFunction · 0.85
viewMenuMouseDownFunction · 0.85

Calls 15

getPressedWindowTypeFunction · 0.85
invalidateWidgetFunction · 0.85
getPressedWindowNumberFunction · 0.85
getPressedWidgetIndexFunction · 0.85
setPressedWidgetIndexFunction · 0.85
setPressedWindowTypeFunction · 0.85
setPressedWindowNumberFunction · 0.85
enumValueFunction · 0.85
showTextFunction · 0.85
translucentMethod · 0.80
getColourMethod · 0.80
cMethod · 0.80

Tested by

no test coverage detected