diff options
| author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2025-02-05 14:29:45 +0200 |
|---|---|---|
| committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2025-02-11 10:17:25 +0200 |
| commit | fd82aa010c4ff369484304d00822dc286d9c720e (patch) | |
| tree | b345cd26fbd3cf7e1c5ee172ee851aef4a997e4c /indra/newview/llpreviewscript.cpp | |
| parent | 7f88aedbc3b53496bc99d8e0e64a818c7a3f6d6f (diff) | |
#3423 Adapt the code to the changes on a server
Diffstat (limited to 'indra/newview/llpreviewscript.cpp')
| -rw-r--r-- | indra/newview/llpreviewscript.cpp | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index 432aaa8f18..300fa30420 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -2451,26 +2451,40 @@ void LLLiveLSLEditor::processScriptRunningReply(LLMessageSystem* msg, void**) msg->getBOOLFast(_PREHASH_Script, _PREHASH_Running, running); instance->mRunningCheckbox->set(running); + bool mono = false, luau = false, luau_language = false; + msg->getBOOLFast(_PREHASH_Script, _PREHASH_Mono, mono); + msg->getBOOLFast(_PREHASH_Script, _PREHASH_Luau, luau); + msg->getBOOLFast(_PREHASH_Script, _PREHASH_LuauLanguage, luau_language); + std::string compile_target; - msg->getStringFast(_PREHASH_Script, _PREHASH_CompileTarget, compile_target); - if (compile_target.empty()) // Old sim not providing CompileTarget field + if (luau) { - bool mono; - msg->getBOOLFast(_PREHASH_Script, _PREHASH_Mono, mono); // Use Mono field - instance->mCompileTarget->setValue(mono ? "mono" : "lso2"); + if (luau_language) + { + compile_target = "luau"; + } + else + { + compile_target = "lsl_luau"; + } } - else if (instance->mCompileTarget->valueExists(compile_target)) + else if (mono) { - instance->mCompileTarget->setValue(compile_target); // Use CompileTarget field + compile_target = "mono"; } else { - instance->mCompileTarget->setValue("mono"); // Use default value + compile_target = "lsl2"; } - if (LLScrollListItem* item = instance->mCompileTarget->findItemByValue("luau")) + instance->mCompileTarget->setValue(compile_target); + if (LLScrollListItem* luau_item = instance->mCompileTarget->findItemByValue("luau")) + { + luau_item->setEnabled(luau); + } + if (LLScrollListItem* lsl_luau_item = instance->mCompileTarget->findItemByValue("lsl_luau")) { - item->setEnabled(!compile_target.empty()); + lsl_luau_item->setEnabled(luau); } instance->mCompileTarget->setEnabled(instance->getIsModifiable() && have_script_upload_cap(object_id)); |
