From cf8860224084c6dfa96a5068e27293a2ce144120 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 1 Feb 2017 10:57:12 +0200 Subject: MAINT-725 Script debug floater functionality is borked, rendering it completely useless for scripters --- indra/newview/llfloaterscriptdebug.cpp | 31 +++++++++++++++++++++- indra/newview/llfloaterscriptdebug.h | 3 +++ .../skins/default/xui/en/floater_script_debug.xml | 1 + indra/newview/skins/default/xui/en/menu_viewer.xml | 10 +++++++ 4 files changed, 44 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterscriptdebug.cpp b/indra/newview/llfloaterscriptdebug.cpp index 5f4bc9d301..468537e659 100644 --- a/indra/newview/llfloaterscriptdebug.cpp +++ b/indra/newview/llfloaterscriptdebug.cpp @@ -81,6 +81,36 @@ BOOL LLFloaterScriptDebug::postBuild() return FALSE; } +void LLFloaterScriptDebug::setVisible(BOOL visible) +{ + if(visible) + { + LLFloaterScriptDebugOutput* floater_output = LLFloaterReg::findTypedInstance("script_debug_output", LLUUID::null); + if (floater_output == NULL) + { + floater_output = dynamic_cast(LLFloaterReg::showInstance("script_debug_output", LLUUID::null, FALSE)); + if (floater_output) + { + addFloater(floater_output, false); + } + } + + } + LLMultiFloater::setVisible(visible); +} + +void LLFloaterScriptDebug::closeFloater(bool app_quitting/* = false*/) +{ + if(app_quitting) + { + LLMultiFloater::closeFloater(app_quitting); + } + else + { + setVisible(false); + } +} + LLFloater* LLFloaterScriptDebug::addOutputWindow(const LLUUID &object_id) { LLMultiFloater* host = LLFloaterReg::showTypedInstance("script_debug", LLSD()); @@ -125,7 +155,6 @@ void LLFloaterScriptDebug::addScriptLine(const std::string &utf8mesg, const std: floater_label = user_name; } - addOutputWindow(LLUUID::null); addOutputWindow(source_id); // add to "All" floater diff --git a/indra/newview/llfloaterscriptdebug.h b/indra/newview/llfloaterscriptdebug.h index 6d9d1eb500..8c08b234f3 100644 --- a/indra/newview/llfloaterscriptdebug.h +++ b/indra/newview/llfloaterscriptdebug.h @@ -38,7 +38,10 @@ public: LLFloaterScriptDebug(const LLSD& key); virtual ~LLFloaterScriptDebug(); virtual BOOL postBuild(); + virtual void setVisible(BOOL visible); static void show(const LLUUID& object_id); + + /*virtual*/ void closeFloater(bool app_quitting = false); static void addScriptLine(const std::string &utf8mesg, const std::string &user_name, const LLColor4& color, const LLUUID& source_id); protected: diff --git a/indra/newview/skins/default/xui/en/floater_script_debug.xml b/indra/newview/skins/default/xui/en/floater_script_debug.xml index 53d4925214..cd88048d6b 100644 --- a/indra/newview/skins/default/xui/en/floater_script_debug.xml +++ b/indra/newview/skins/default/xui/en/floater_script_debug.xml @@ -7,6 +7,7 @@ help_topic="script_debug_floater" save_rect="true" title="Script Warning/Error" + reuse_instance="true" width="450"> + + + + -- cgit v1.2.3