MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / onDropdown

Method onDropdown

src/openrct2-ui/scripting/CustomWindow.cpp:670–687  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

668 }
669
670 void onDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) override
671 {
672 if (dropdownIndex == -1)
673 return;
674
675 auto widgetDesc = _info.GetCustomWidgetDesc(this, widgetIndex);
676 if (widgetDesc != nullptr)
677 {
678 if (widgetDesc->Type == "colourpicker")
679 {
680 UpdateWidgetColour(this, widgetIndex, ColourDropDownIndexToColour(dropdownIndex));
681 }
682 else if (widgetDesc->Type == "dropdown")
683 {
684 UpdateWidgetSelectedIndex(this, widgetIndex - 1, dropdownIndex);
685 }
686 }
687 }
688
689 void onTextInput(WidgetIndex widgetIndex, std::string_view text) override
690 {

Callers

nothing calls this directly

Calls 4

UpdateWidgetColourFunction · 0.85
GetCustomWidgetDescMethod · 0.80

Tested by

no test coverage detected