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

Function onDropdown

src/OpenLoco/src/Ui/Windows/VehicleList.cpp:865–885  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

863 }
864
865 static void onDropdown(Ui::Window& self, WidgetIndex_t widgetIndex, [[maybe_unused]] const WidgetId id, int16_t itemIndex)
866 {
867 if (widgetIndex == Widx::company_select)
868 {
869 return onCompanyDropdown(self, itemIndex);
870 }
871
872 if (widgetIndex == filter_type_btn && itemIndex != -1)
873 {
874 if (self.var_850 != itemIndex)
875 {
876 self.var_850 = itemIndex;
877 self.var_852 = 0xFFFF;
878 }
879 }
880
881 else if (widgetIndex == cargo_type_btn && itemIndex != -1)
882 {
883 self.var_852 = Dropdown::getItemArgument(itemIndex, 3);
884 }
885 }
886
887 // 0x004C24CA
888 static std::optional<FormatArguments> tooltip([[maybe_unused]] Window& self, [[maybe_unused]] WidgetIndex_t widgetIndex, [[maybe_unused]] const WidgetId id)

Callers

nothing calls this directly

Calls 2

onCompanyDropdownFunction · 0.85
getItemArgumentFunction · 0.85

Tested by

no test coverage detected