MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / onMouseUpOverview

Method onMouseUpOverview

src/openrct2-ui/windows/Player.cpp:481–510  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

479 }
480
481 void onMouseUpOverview(WidgetIndex widgetIndex)
482 {
483 switch (widgetIndex)
484 {
485 case WIDX_LOCATE:
486 {
487 WindowBase* mainWindow = WindowGetMain();
488 if (mainWindow != nullptr)
489 {
490 int32_t player = Network::GetPlayerIndex(static_cast<uint8_t>(number));
491 if (player == -1)
492 {
493 return;
494 }
495 auto coord = Network::GetPlayerLastActionCoord(player);
496 if (coord.x || coord.y || coord.z)
497 {
498 WindowScrollToLocation(*mainWindow, coord);
499 }
500 }
501 }
502 break;
503 case WIDX_KICK:
504 {
505 auto kickPlayerAction = GameActions::PlayerKickAction(number);
506 GameActions::Execute(&kickPlayerAction, getGameState());
507 }
508 break;
509 }
510 }
511
512 void onDropdownOverview(WidgetIndex widgetIndex, int32_t dropdownIndex)
513 {

Callers

nothing calls this directly

Calls 6

WindowGetMainFunction · 0.85
GetPlayerIndexFunction · 0.85
GetPlayerLastActionCoordFunction · 0.85
WindowScrollToLocationFunction · 0.85
PlayerKickActionClass · 0.85
ExecuteFunction · 0.50

Tested by

no test coverage detected