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

Function getSelectedItem

src/OpenLoco/src/Ui/Dropdown.cpp:1082–1093  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1080 }
1081
1082 std::optional<DropdownItemId> getSelectedItem(int32_t index)
1083 {
1084 if (index == -1 && _dropdownUseDefault)
1085 {
1086 index = Dropdown::getHighlightedItem();
1087 }
1088 if (index >= 0 && static_cast<size_t>(index) < _dropdownIds.size())
1089 {
1090 return _dropdownIds[index];
1091 }
1092 return std::nullopt;
1093 }
1094
1095 std::optional<int> dropdownIndexFromPoint(Ui::Window* window, int x, int y)
1096 {

Callers

nothing calls this directly

Calls 2

getHighlightedItemFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected