summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelcontents.cpp
diff options
context:
space:
mode:
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;