MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / GetSlotColour

Method GetSlotColour

src/ai/ai_gui.cpp:182–188  ·  view source on GitHub ↗

* Get colour to display text in for a given company slot. * @param cid Company to display. * @param max_slot Maximum company ID that can be an AI. * @returns Colour to display text for company. */

Source from the content-addressed store, hash-verified

180 * @returns Colour to display text for company.
181 */
182 TextColour GetSlotColour(CompanyID cid, CompanyID max_slot) const
183 {
184 if (this->selected_slot == cid) return TC_WHITE;
185 if (IsEditable(cid)) return cid < max_slot ? TC_ORANGE : TC_SILVER;
186 if (Company::IsValidAiID(cid)) return TC_GREEN;
187 return TC_SILVER;
188 }
189
190 void DrawWidget(const Rect &r, WidgetID widget) const override
191 {

Callers 1

DrawWidgetMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected