diff options
| author | Jonathan Yap <none@none> | 2010-11-16 18:10:18 -0500 |
|---|---|---|
| committer | Jonathan Yap <none@none> | 2010-11-16 18:10:18 -0500 |
| commit | 3b85391839da9077129830258d4a1d1ce6069cb3 (patch) | |
| tree | f6f5551eab69a80adfb3f4d1b3a776bacae4eeca /indra/newview/llviewermessage.cpp | |
| parent | 5cbbb565f1bba870ec6db0b266e8768ecbdb7826 (diff) | |
| parent | 978402adea173635c72cf8e81c375bbcc6bdd4ed (diff) | |
Viewer 2.4 (as of 15 Nov 2010) with llTextBox support merged in
Diffstat (limited to 'indra/newview/llviewermessage.cpp')
| -rw-r--r-- | indra/newview/llviewermessage.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 7c0fc681a4..700b5e9fb1 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -39,6 +39,7 @@ #include "llfloaterreg.h" #include "llfollowcamparams.h" #include "llinventorydefines.h" +#include "lllslconstants.h" #include "llregionhandle.h" #include "llsdserialize.h" #include "llteleportflags.h" @@ -6435,8 +6436,22 @@ const char* SCRIPT_DIALOG_HEADER = "Script Dialog:\n"; bool callback_script_dialog(const LLSD& notification, const LLSD& response) { LLNotificationForm form(notification["form"]); - std::string button = LLNotification::getSelectedOptionName(response); - S32 button_idx = LLNotification::getSelectedOption(notification, response); + + std::string rtn_text; + S32 button_idx; + button_idx = LLNotification::getSelectedOption(notification, response); + if (response[TEXTBOX_MAGIC_TOKEN].isDefined()) + { + if (response[TEXTBOX_MAGIC_TOKEN].isString()) + rtn_text = response[TEXTBOX_MAGIC_TOKEN].asString(); + else + rtn_text.clear(); // bool marks empty string + } + else + { + rtn_text = LLNotification::getSelectedOptionName(response); + } + // Didn't click "Ignore" if (button_idx != -1) { @@ -6449,7 +6464,7 @@ bool callback_script_dialog(const LLSD& notification, const LLSD& response) msg->addUUID("ObjectID", notification["payload"]["object_id"].asUUID()); msg->addS32("ChatChannel", notification["payload"]["chat_channel"].asInteger()); msg->addS32("ButtonIndex", button_idx); - msg->addString("ButtonLabel", button); + msg->addString("ButtonLabel", rtn_text); msg->sendReliable(LLHost(notification["payload"]["sender"].asString())); } |
