2021-12-05 17:54:36 +00:00
|
|
|
#include "NsLupTeleport.h"
|
|
|
|
#include "dZoneManager.h"
|
|
|
|
#include "GameMessages.h"
|
2023-05-13 22:22:00 +00:00
|
|
|
#include "Amf3.h"
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
void NsLupTeleport::OnStartup(Entity* self) {
|
2023-07-17 22:55:33 +00:00
|
|
|
self->SetVar(u"currentZone", (int32_t)Game::zoneManager->GetZoneID().GetMapID());
|
2021-12-05 17:54:36 +00:00
|
|
|
self->SetVar(u"choiceZone", m_ChoiceZoneID);
|
|
|
|
self->SetVar(u"teleportAnim", m_TeleportAnim);
|
|
|
|
self->SetVar(u"teleportString", m_TeleportString);
|
|
|
|
self->SetVar(u"spawnPoint", m_SpawnPoint);
|
|
|
|
|
|
|
|
args = {};
|
|
|
|
|
2023-05-13 22:22:00 +00:00
|
|
|
args.Insert("callbackClient", std::to_string(self->GetObjectID()));
|
|
|
|
args.Insert("strIdentifier", "choiceDoor");
|
|
|
|
args.Insert("title", "%[UI_CHOICE_DESTINATION]");
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-05-13 22:22:00 +00:00
|
|
|
AMFArrayValue* choiceOptions = args.InsertArray("options");
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
{
|
2023-05-13 22:22:00 +00:00
|
|
|
AMFArrayValue* nsArgs = choiceOptions->PushArray();
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-05-13 22:22:00 +00:00
|
|
|
nsArgs->Insert("image", "textures/ui/zone_thumnails/Nimbus_Station.dds");
|
|
|
|
nsArgs->Insert("caption", "%[UI_CHOICE_NS]");
|
|
|
|
nsArgs->Insert("identifier", "zoneID_1200");
|
|
|
|
nsArgs->Insert("tooltipText", "%[UI_CHOICE_NS_HOVER]");
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
{
|
2023-05-13 22:22:00 +00:00
|
|
|
AMFArrayValue* ntArgs = choiceOptions->PushArray();
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2023-05-13 22:22:00 +00:00
|
|
|
ntArgs->Insert("image", "textures/ui/zone_thumnails/Nexus_Tower.dds");
|
|
|
|
ntArgs->Insert("caption", "%[UI_CHOICE_NT]");
|
|
|
|
ntArgs->Insert("identifier", "zoneID_1900");
|
|
|
|
ntArgs->Insert("tooltipText", "%[UI_CHOICE_NT_HOVER]");
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void NsLupTeleport::OnUse(Entity* self, Entity* user) {
|
|
|
|
auto* player = user;
|
2022-07-28 13:39:57 +00:00
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
if (CheckChoice(self, player)) {
|
2023-05-13 22:22:00 +00:00
|
|
|
GameMessages::SendUIMessageServerToSingleClient(player, player->GetSystemAddress(), "QueueChoiceBox", args);
|
2021-12-05 17:54:36 +00:00
|
|
|
} else {
|
|
|
|
BaseOnUse(self, player);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void NsLupTeleport::OnMessageBoxResponse(Entity* self, Entity* sender, int32_t button, const std::u16string& identifier, const std::u16string& userData) {
|
|
|
|
BaseOnMessageBoxResponse(self, sender, button, identifier, userData);
|
|
|
|
}
|
|
|
|
|
|
|
|
void NsLupTeleport::OnChoiceBoxResponse(Entity* self, Entity* sender, int32_t button, const std::u16string& buttonIdentifier, const std::u16string& identifier) {
|
|
|
|
BaseChoiceBoxRespond(self, sender, button, buttonIdentifier, identifier);
|
|
|
|
}
|
|
|
|
|
|
|
|
void NsLupTeleport::OnTimerDone(Entity* self, std::string timerName) {
|
|
|
|
BaseOnTimerDone(self, timerName);
|
|
|
|
}
|
|
|
|
|
|
|
|
void NsLupTeleport::OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1, int32_t param2, int32_t param3) {
|
|
|
|
BaseOnFireEventServerSide(self, sender, args, param1, param2, param3);
|
|
|
|
}
|