Add waypoint teleport handling

This commit is contained in:
AconiteGodOfSWG
2020-11-18 18:08:28 -05:00
parent 4a4b652e6e
commit 09d85dd222
3 changed files with 13 additions and 2 deletions
@@ -310,6 +310,7 @@ namespace Cui
MAKE_ID(ITEM_EQUIP_APPEARANCE, none, item_equip_appearance, CursorPaths::equip);
MAKE_ID(ITEM_UNEQUIP_APPEARANCE,none, item_unequip_appearance, CursorPaths::unequip);
MAKE_ID(OPEN_STORYTELLER_RECIPE,none, open_storyteller_recipe, 0);
MAKE_ID(GOD_TELEPORT, none, god_teleport, 0);
#undef MAKE_ID
@@ -168,6 +168,7 @@ namespace Cui
ITEM_EQUIP_APPEARANCE,
ITEM_UNEQUIP_APPEARANCE,
OPEN_STORYTELLER_RECIPE,
GOD_TELEPORT,
CLIENT_MENU_LAST,
@@ -1798,8 +1798,13 @@ bool CuiRadialMenuManager::populateMenu (CuiMenuInfoHelper & helper, const Objec
helper.addRootMenu (ITEM_MAIL, got);
}
}
else
else {
isUnownedWaypoint = true;
}
// allow players flagged as admin to radial and teleport directly to a waypoint
if (PlayerObject::isAdmin()) {
helper.addRootMenu(GOD_TELEPORT, got);
}
}
//allow bringing up ship page on ground only for players, in ground or space for gods
@@ -1892,7 +1897,6 @@ void CuiRadialMenuManager::performDefaultAction (Object & object, bool allowOpen
Cui::MenuInfoTypes::executeCommandForMenu(EXAMINE, object.getNetworkId(), 0);
return;
}
else if (omrd->isOutOfRange ())
{
ClientObject const * const clientObject = object.asClientObject();
@@ -2407,6 +2411,11 @@ void CuiRadialMenuManager::performMenuAction (int sel, int index, bool serverNot
}
}
}
else if (sel == GOD_TELEPORT) {
ClientWaypointObject const * const cwo = dynamic_cast<ClientWaypointObject const *>(clientObject);
GenericValueTypeMessage<std::pair<NetworkId, std::string> > const msg("handleWaypointWarp", std::make_pair(cwo->getNetworkId(), ""));
GameNetwork::send(msg, true);
}
else if (sel == SHIP_MANAGE_COMPONENTS)
{
if(clientObject)