From 66f39dece85d38afb1d8272ca89112ea70e05494 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 15 Sep 2023 21:30:26 +0100 Subject: DRTVWR-589 - lua file browser added run button to allow re-running same script --- indra/newview/llfloaterluadebug.cpp | 12 ++++++++++++ indra/newview/llfloaterluadebug.h | 1 + indra/newview/lluilistener.cpp | 2 +- indra/newview/skins/default/xui/en/floater_lua_debug.xml | 10 ++++++++++ 4 files changed, 24 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llfloaterluadebug.cpp b/indra/newview/llfloaterluadebug.cpp index e7d220c503..9ca554d4ad 100644 --- a/indra/newview/llfloaterluadebug.cpp +++ b/indra/newview/llfloaterluadebug.cpp @@ -57,6 +57,7 @@ BOOL LLFloaterLUADebug::postBuild() getChild("execute_btn")->setClickedCallback(boost::bind(&LLFloaterLUADebug::onExecuteClicked, this)); getChild("browse_btn")->setClickedCallback(boost::bind(&LLFloaterLUADebug::onBtnBrowse, this)); + getChild("run_btn")->setClickedCallback(boost::bind(&LLFloaterLUADebug::onBtnRun, this)); #if !LL_WINDOWS getChild("execute_btn")->setEnabled(false); @@ -85,6 +86,17 @@ void LLFloaterLUADebug::onBtnBrowse() (new LLFilePickerReplyThread(boost::bind(&LLFloaterLUADebug::runSelectedScript, this, _1), LLFilePicker::FFLOAD_LUA, false))->getFile(); } +void LLFloaterLUADebug::onBtnRun() +{ + std::vector filenames; + std::string filepath = mScriptPath->getText(); + if (!filepath.empty()) + { + filenames.push_back(filepath); + runSelectedScript(filenames); + } +} + void LLFloaterLUADebug::runSelectedScript(const std::vector &filenames) { mResultOutput->setValue(""); diff --git a/indra/newview/llfloaterluadebug.h b/indra/newview/llfloaterluadebug.h index a7a3b695d4..300d954aea 100644 --- a/indra/newview/llfloaterluadebug.h +++ b/indra/newview/llfloaterluadebug.h @@ -49,6 +49,7 @@ class LLFloaterLUADebug : void onExecuteClicked(); void onBtnBrowse(); + void onBtnRun(); void runSelectedScript(const std::vector &filenames); diff --git a/indra/newview/lluilistener.cpp b/indra/newview/lluilistener.cpp index 956f5cf187..97a2be6aa3 100644 --- a/indra/newview/lluilistener.cpp +++ b/indra/newview/lluilistener.cpp @@ -67,7 +67,7 @@ void LLUIListener::call(const LLSD& event) const // API: we provide no reply. Therefore, a typo in the script will // provide no feedback whatsoever to that script. To rub the coder's // nose in such an error, crump rather than quietly ignoring it. - LL_ERRS("LLUIListener") << "function '" << event["function"] << "' not found" << LL_ENDL; + LL_WARNS("LLUIListener") << "function '" << event["function"] << "' not found" << LL_ENDL; } else { diff --git a/indra/newview/skins/default/xui/en/floater_lua_debug.xml b/indra/newview/skins/default/xui/en/floater_lua_debug.xml index 7ed6c35151..05f4db009e 100644 --- a/indra/newview/skins/default/xui/en/floater_lua_debug.xml +++ b/indra/newview/skins/default/xui/en/floater_lua_debug.xml @@ -95,4 +95,14 @@ name="browse_btn" top_delta="-2" width="75" /> +