From 6451ba34580e4646c5f36df0ed12c1feefcddd20 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Sat, 26 Dec 2009 22:18:51 -0700 Subject: Added script creation resource to the script editor's help menu --- linden/indra/newview/llpreviewscript.cpp | 29 ++++++++++++++++++++++ linden/indra/newview/llpreviewscript.h | 2 ++ linden/indra/newview/llweb.cpp | 7 ++++++ linden/indra/newview/llweb.h | 3 +++ .../default/xui/en-us/floater_script_ed_panel.xml | 5 ++++ .../skins/default/xui/en-us/notifications.xml | 12 +++++++++ 6 files changed, 58 insertions(+) (limited to 'linden/indra') diff --git a/linden/indra/newview/llpreviewscript.cpp b/linden/indra/newview/llpreviewscript.cpp index 082b95c..ccec75b 100644 --- a/linden/indra/newview/llpreviewscript.cpp +++ b/linden/indra/newview/llpreviewscript.cpp @@ -446,6 +446,10 @@ void LLScriptEdCore::initMenu() menuItem->setMenuCallback(onBtnSaveToDisc, this); menuItem->setEnabledCallback(NULL); + menuItem = getChild("Launch Autoscript..."); + menuItem->setMenuCallback(onBtnAutoscript, this); + menuItem->setEnabledCallback(NULL); + menuItem = getChild("LSL Wiki Help..."); menuItem->setMenuCallback(onBtnDynamicHelp, this); menuItem->setEnabledCallback(NULL); @@ -676,6 +680,22 @@ bool LLScriptEdCore::onHelpWebDialog(const LLSD& notification, const LLSD& respo } // static +bool LLScriptEdCore::onHelpAutoscript(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotification::getSelectedOption(notification, response); + + switch(option) + { + case 0: + LLWeb::loadURLInternal(notification["payload"]["autoscript_url"]); + break; + default: + break; + } + return false; +} + +// static void LLScriptEdCore::onBtnHelp(void* userdata) { LLScriptEdCore* corep = (LLScriptEdCore*)userdata; @@ -685,6 +705,15 @@ void LLScriptEdCore::onBtnHelp(void* userdata) } // static +void LLScriptEdCore::onBtnAutoscript(void* userdata) +{ + LLScriptEdCore* corep = (LLScriptEdCore*)userdata; + LLSD payload; + payload["autoscript_url"] = corep->getString("autoscript_url"); + LLNotifications::instance().add("WebLaunchAutoscript", LLSD(), payload, onHelpAutoscript); +} + +// static void LLScriptEdCore::onBtnDynamicHelp(void* userdata) { LLScriptEdCore* corep = (LLScriptEdCore*)userdata; diff --git a/linden/indra/newview/llpreviewscript.h b/linden/indra/newview/llpreviewscript.h index ee7d773..fc9ba4b 100644 --- a/linden/indra/newview/llpreviewscript.h +++ b/linden/indra/newview/llpreviewscript.h @@ -87,6 +87,7 @@ public: bool handleReloadFromServerDialog(const LLSD& notification, const LLSD& response); static bool onHelpWebDialog(const LLSD& notification, const LLSD& response); + static bool onHelpAutoscript(const LLSD& notification, const LLSD& response); static void onBtnHelp(void* userdata); static void onBtnDynamicHelp(void* userdata); static void onCheckLock(LLUICtrl*, void*); @@ -100,6 +101,7 @@ public: static void onBtnUndoChanges(void*); static void onBtnSaveToDisc(void*); static void onBtnLoadFromDisc(void*); + static void onBtnAutoscript(void* userdata); static void onSearchMenu(void* userdata); static void onUndoMenu(void* userdata); diff --git a/linden/indra/newview/llweb.cpp b/linden/indra/newview/llweb.cpp index a5691d8..6425156 100644 --- a/linden/indra/newview/llweb.cpp +++ b/linden/indra/newview/llweb.cpp @@ -69,6 +69,13 @@ void LLWeb::loadURLExternal(const std::string& url) // static +void LLWeb::loadURLInternal(const std::string& url) +{ + LLFloaterMediaBrowser::showInstance(url); +} + + +// static std::string LLWeb::escapeURL(const std::string& url) { // The CURL curl_escape() function escapes colons, slashes, diff --git a/linden/indra/newview/llweb.h b/linden/indra/newview/llweb.h index 278821b..51b7bbf 100644 --- a/linden/indra/newview/llweb.h +++ b/linden/indra/newview/llweb.h @@ -51,6 +51,9 @@ public: // Loads unescaped url in external browser. static void loadURLExternal(const std::string& url); + //Loads unescaped url in internal browser. + static void loadURLInternal(const std::string& url); + // Returns escaped (eg, " " to "%20") url static std::string escapeURL(const std::string& url); diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_script_ed_panel.xml b/linden/indra/newview/skins/default/xui/en-us/floater_script_ed_panel.xml index 653c75b..b4577e6 100644 --- a/linden/indra/newview/skins/default/xui/en-us/floater_script_ed_panel.xml +++ b/linden/indra/newview/skins/default/xui/en-us/floater_script_ed_panel.xml @@ -73,6 +73,8 @@ width="112"> + @@ -89,4 +91,7 @@ Running + + http://www.3greeneggs.com/autoscript/ + diff --git a/linden/indra/newview/skins/default/xui/en-us/notifications.xml b/linden/indra/newview/skins/default/xui/en-us/notifications.xml index e8391ba..bc1a6fc 100644 --- a/linden/indra/newview/skins/default/xui/en-us/notifications.xml +++ b/linden/indra/newview/skins/default/xui/en-us/notifications.xml @@ -6616,6 +6616,18 @@ Go to the Official Imprudence Forums to discuss the Imprudence Project. yestext="Go to page"/> + + Launch autoscript generator (by 3greeneggs.com)? + + + -- cgit v1.1