From fd82aa010c4ff369484304d00822dc286d9c720e Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Wed, 5 Feb 2025 14:29:45 +0200 Subject: #3423 Adapt the code to the changes on a server --- indra/llmessage/message_prehash.cpp | 3 +- indra/llmessage/message_prehash.h | 3 +- indra/newview/llpreviewscript.cpp | 34 +++++++++++++++------- .../default/xui/en/floater_live_lsleditor.xml | 4 +++ 4 files changed, 32 insertions(+), 12 deletions(-) diff --git a/indra/llmessage/message_prehash.cpp b/indra/llmessage/message_prehash.cpp index df16184e76..fab07c018c 100644 --- a/indra/llmessage/message_prehash.cpp +++ b/indra/llmessage/message_prehash.cpp @@ -715,7 +715,8 @@ char const* const _PREHASH_AttachedSoundGainChange = LLMessageStringTable::getIn char const* const _PREHASH_LocationID = LLMessageStringTable::getInstance()->getString("LocationID"); char const* const _PREHASH_Running = LLMessageStringTable::getInstance()->getString("Running"); char const* const _PREHASH_Mono = LLMessageStringTable::getInstance()->getString("Mono"); -char const* const _PREHASH_CompileTarget = LLMessageStringTable::getInstance()->getString("CompileTarget"); +char const* const _PREHASH_Luau = LLMessageStringTable::getInstance()->getString("Luau"); +char const* const _PREHASH_LuauLanguage = LLMessageStringTable::getInstance()->getString("LuauLanguage"); char const* const _PREHASH_AgentThrottle = LLMessageStringTable::getInstance()->getString("AgentThrottle"); char const* const _PREHASH_NeighborList = LLMessageStringTable::getInstance()->getString("NeighborList"); char const* const _PREHASH_PathTaperX = LLMessageStringTable::getInstance()->getString("PathTaperX"); diff --git a/indra/llmessage/message_prehash.h b/indra/llmessage/message_prehash.h index 0feb6ecad8..83b480392c 100644 --- a/indra/llmessage/message_prehash.h +++ b/indra/llmessage/message_prehash.h @@ -715,7 +715,8 @@ extern char const* const _PREHASH_AttachedSoundGainChange; extern char const* const _PREHASH_LocationID; extern char const* const _PREHASH_Running; extern char const* const _PREHASH_Mono; -extern char const* const _PREHASH_CompileTarget; +extern char const* const _PREHASH_Luau; +extern char const* const _PREHASH_LuauLanguage; extern char const* const _PREHASH_AgentThrottle; extern char const* const _PREHASH_NeighborList; extern char const* const _PREHASH_PathTaperX; 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)); diff --git a/indra/newview/skins/default/xui/en/floater_live_lsleditor.xml b/indra/newview/skins/default/xui/en/floater_live_lsleditor.xml index 4d15522c76..c5124e2119 100644 --- a/indra/newview/skins/default/xui/en/floater_live_lsleditor.xml +++ b/indra/newview/skins/default/xui/en/floater_live_lsleditor.xml @@ -145,5 +145,9 @@ label="Lua" name="compile_target_luau" value="luau" /> + -- cgit v1.3