summaryrefslogtreecommitdiff
path: root/indra/newview/llpreviewscript.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2025-02-11 10:57:45 +0200
committerAndrey Lihatskiy <alihatskiy@productengine.com>2025-02-11 18:44:11 +0200
commita54ac5a67f4457266c13885f13b25ea5e2b12929 (patch)
treefabd3927ffbfc9eb9a800e568538323d4ee1b521 /indra/newview/llpreviewscript.cpp
parentfd82aa010c4ff369484304d00822dc286d9c720e (diff)
#3423 Gray out Lua selection on unsupported regions
Diffstat (limited to 'indra/newview/llpreviewscript.cpp')
-rw-r--r--indra/newview/llpreviewscript.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp
index 300fa30420..c540046df1 100644
--- a/indra/newview/llpreviewscript.cpp
+++ b/indra/newview/llpreviewscript.cpp
@@ -2478,13 +2478,25 @@ void LLLiveLSLEditor::processScriptRunningReply(LLMessageSystem* msg, void**)
}
instance->mCompileTarget->setValue(compile_target);
+
+ bool lua_scripts_enabled = false;
+
+ // TODO: better handling of this
+ LLViewerRegion* region = gAgent.getRegion();
+ if (region && region->simulatorFeaturesReceived())
+ {
+ LLSD simulatorFeatures;
+ region->getSimulatorFeatures(simulatorFeatures);
+ lua_scripts_enabled = simulatorFeatures["LuaScriptsEnabled"].asBoolean();
+ }
+
if (LLScrollListItem* luau_item = instance->mCompileTarget->findItemByValue("luau"))
{
- luau_item->setEnabled(luau);
+ luau_item->setEnabled(lua_scripts_enabled);
}
if (LLScrollListItem* lsl_luau_item = instance->mCompileTarget->findItemByValue("lsl_luau"))
{
- lsl_luau_item->setEnabled(luau);
+ lsl_luau_item->setEnabled(lua_scripts_enabled);
}
instance->mCompileTarget->setEnabled(instance->getIsModifiable() && have_script_upload_cap(object_id));