From a54ac5a67f4457266c13885f13b25ea5e2b12929 Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Tue, 11 Feb 2025 10:57:45 +0200 Subject: #3423 Gray out Lua selection on unsupported regions --- indra/newview/llpreviewscript.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'indra/newview/llpreviewscript.cpp') 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)); -- cgit v1.3