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

Function playerDropdownClick

src/OpenLoco/src/Ui/Windows/PlayerInfoPanel.cpp:130–150  ·  view source on GitHub ↗

0x43AB87

Source from the content-addressed store, hash-verified

128
129 // 0x43AB87
130 static void playerDropdownClick(int16_t itemIndex)
131 {
132 if (itemIndex == -1)
133 {
134 itemIndex = Dropdown::getHighlightedItem();
135 }
136
137 // If its index is bigger than the list then its the company list extra item
138 if (static_cast<uint16_t>(itemIndex) >= _sortedCompanies.size())
139 {
140 CompanyList::open();
141 }
142 else
143 {
144 auto company = _sortedCompanies[itemIndex];
145 if (!company->empty())
146 {
147 CompanyWindow::open(company->id());
148 }
149 }
150 }
151
152 static const WindowEventList& getEvents();
153

Callers 1

onDropdownFunction · 0.85

Calls 5

getHighlightedItemFunction · 0.85
openFunction · 0.70
sizeMethod · 0.45
emptyMethod · 0.45
idMethod · 0.45

Tested by

no test coverage detected