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

Method OnClickClientAdmin

src/network/network_gui.cpp:1596–1610  ·  view source on GitHub ↗

* Admin button on a Client is clicked. * @param w The instance of this window. * @param pt The point where this button was clicked. * @param client_id The client this button was assigned to. */

Source from the content-addressed store, hash-verified

1594 * @param client_id The client this button was assigned to.
1595 */
1596 static void OnClickClientAdmin([[maybe_unused]] NetworkClientListWindow *w, [[maybe_unused]] Point pt, ClientID client_id)
1597 {
1598 DropDownList list;
1599 list.push_back(MakeDropDownListStringItem(STR_NETWORK_CLIENT_LIST_ADMIN_CLIENT_KICK, DD_CLIENT_ADMIN_KICK));
1600 list.push_back(MakeDropDownListStringItem(STR_NETWORK_CLIENT_LIST_ADMIN_CLIENT_BAN, DD_CLIENT_ADMIN_BAN));
1601
1602 Rect wi_rect;
1603 wi_rect.left = pt.x;
1604 wi_rect.right = pt.x;
1605 wi_rect.top = pt.y;
1606 wi_rect.bottom = pt.y;
1607
1608 w->dd_client_id = client_id;
1609 ShowDropDownListAt(w, std::move(list), -1, WID_CL_MATRIX, wi_rect, COLOUR_GREY, DropDownOption::InstantClose);
1610 }
1611
1612 /**
1613 * Admin button on a Company is clicked.

Callers

nothing calls this directly

Calls 3

ShowDropDownListAtFunction · 0.85
push_backMethod · 0.80

Tested by

no test coverage detected