From f8b927f29f4adbee50ead87d26a9f0531231e540 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Sun, 24 May 2009 22:32:56 -0500 Subject: Added Teleport Home confirmation and callback methods. LLAgent::teleportHomeConfirm() LLAgent::teleportHomeCallback() --- ChangeLog.txt | 8 ++++++++ linden/indra/newview/llagent.cpp | 15 +++++++++++++++ linden/indra/newview/llagent.h | 2 ++ 3 files changed, 25 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index b26fc7e..d7048ad 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,6 +1,14 @@ 2009-05-24 Jacek Antonelli * linden/indra/newview/llagent.cpp: + Added Teleport Home confirmation and callback methods. + LLAgent::teleportHomeConfirm() + LLAgent::teleportHomeCallback() + * linden/indra/newview/llagent.h: + Ditto. + + + * linden/indra/newview/llagent.cpp: Moved LLAgent::teleportHome() definition. Was in llagent.h for no good reason, now in llagent.cpp. * linden/indra/newview/llagent.h: diff --git a/linden/indra/newview/llagent.cpp b/linden/indra/newview/llagent.cpp index 7f6cd0c..46dc6f3 100644 --- a/linden/indra/newview/llagent.cpp +++ b/linden/indra/newview/llagent.cpp @@ -5932,6 +5932,21 @@ void LLAgent::teleportHome() teleportViaLandmark(LLUUID::null); } +void LLAgent::teleportHomeConfirm() +{ + gViewerWindow->alertXml("ConfirmTeleportHome", LLAgent::teleportHomeCallback, (void *)this); +} + +// static +void LLAgent::teleportHomeCallback(S32 option, void *userdata) +{ + if( option == 0 ) + { + // They confirmed it. Here we go! + ((LLAgent *) userdata)->teleportHome(); + } +} + void LLAgent::setTeleportState(ETeleportState state) { diff --git a/linden/indra/newview/llagent.h b/linden/indra/newview/llagent.h index bc06e92..dd204af 100644 --- a/linden/indra/newview/llagent.h +++ b/linden/indra/newview/llagent.h @@ -463,6 +463,8 @@ public: // go home void teleportHome(); + void teleportHomeConfirm(); + static void teleportHomeCallback(S32 option, void *userdata); // to an invited location void teleportViaLure(const LLUUID& lure_id, BOOL godlike); -- cgit v1.1