summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelcontents.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2026-09-22 17:43:47 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2026-09-22 17:43:47 +0300
commita1bcdd4180f1e86e0299ac8e5752c08a314a0a36 (patch)
treee1c2f167d21ccfd8d4e76276977757c21874b27d /indra/newview/llpanelcontents.cpp
parent904e8832e5daecce17f5f5dcaa74579ca1d56782 (diff)
#6221 Honor the selected New Script type
Diffstat (limited to 'indra/newview/llpanelcontents.cpp')
-rw-r--r--indra/newview/llpanelcontents.cpp24
1 files changed, 6 insertions, 18 deletions
diff --git a/indra/newview/llpanelcontents.cpp b/indra/newview/llpanelcontents.cpp
index 506772dec3..d9301d60f8 100644
--- a/indra/newview/llpanelcontents.cpp
+++ b/indra/newview/llpanelcontents.cpp
@@ -166,7 +166,8 @@ void LLPanelContents::getState(LLViewerObject *objectp )
new_script->setEnabledByValue("lua", lua_region);
if (mLastScriptObjectID != objectp->getID() || mLastLuaRegion != lua_region)
{
- new_script->setValue(lua_region ? "lua" : "lsl");
+ mNewScriptIsLua = lua_region;
+ new_script->setValue(mNewScriptIsLua ? "lua" : "lsl");
}
mLastScriptObjectID = objectp->getID();
mLastLuaRegion = lua_region;
@@ -290,31 +291,18 @@ void LLPanelContents::onNewScriptFlyoutCommit(LLUICtrl* ctrl)
LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getFirstRootObject(children_ok);
if (!object) return;
- U8 script_language;
const std::string value = ctrl->getValue().asString();
if (value == "lsl")
{
- script_language = SST_LSL;
+ mNewScriptIsLua = false;
}
else if (value == "lua")
{
- script_language = SST_LUA;
- }
- else
- {
- script_language = SST_LSL;
- LLViewerRegion* region = object->getRegion();
- if (region && region->simulatorFeaturesReceived())
- {
- LLSD simulatorFeatures;
- region->getSimulatorFeatures(simulatorFeatures);
- if (simulatorFeatures["LuaScriptsEnabled"].asBoolean())
- {
- script_language = SST_LUA;
- }
- }
+ mNewScriptIsLua = true;
}
+ ctrl->setValue(mNewScriptIsLua ? "lua" : "lsl");
+ const U8 script_language = mNewScriptIsLua ? SST_LUA : SST_LSL;
std::string vm = (script_language == SST_LUA) ? "luau" : "mono";
LLSD params;