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

Method OnClickCompanyAdmin

src/network/network_gui.cpp:1618–1631  ·  view source on GitHub ↗

* Admin button on a Company is clicked. * @param w The instance of this window. * @param pt The point where this button was clicked. * @param company_id The company this button was assigned to. */

Source from the content-addressed store, hash-verified

1616 * @param company_id The company this button was assigned to.
1617 */
1618 static void OnClickCompanyAdmin([[maybe_unused]] NetworkClientListWindow *w, [[maybe_unused]] Point pt, CompanyID company_id)
1619 {
1620 DropDownList list;
1621 list.push_back(MakeDropDownListStringItem(STR_NETWORK_CLIENT_LIST_ADMIN_COMPANY_RESET, DD_COMPANY_ADMIN_RESET, NetworkCompanyHasClients(company_id)));
1622
1623 Rect wi_rect;
1624 wi_rect.left = pt.x;
1625 wi_rect.right = pt.x;
1626 wi_rect.top = pt.y;
1627 wi_rect.bottom = pt.y;
1628
1629 w->dd_company_id = company_id;
1630 ShowDropDownListAt(w, std::move(list), -1, WID_CL_MATRIX, wi_rect, COLOUR_GREY, DropDownOption::InstantClose);
1631 }
1632 /**
1633 * Chat button on a Client is clicked.
1634 * @param w The instance of this window.

Callers

nothing calls this directly

Calls 4

NetworkCompanyHasClientsFunction · 0.85
ShowDropDownListAtFunction · 0.85
push_backMethod · 0.80

Tested by

no test coverage detected