diff options
| author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2026-09-22 17:43:47 +0300 |
|---|---|---|
| committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2026-09-22 17:43:47 +0300 |
| commit | a1bcdd4180f1e86e0299ac8e5752c08a314a0a36 (patch) | |
| tree | e1c2f167d21ccfd8d4e76276977757c21874b27d /indra | |
| parent | 904e8832e5daecce17f5f5dcaa74579ca1d56782 (diff) | |
#6221 Honor the selected New Script type
Diffstat (limited to 'indra')
| -rw-r--r-- | indra/newview/llpanelcontents.cpp | 24 | ||||
| -rw-r--r-- | indra/newview/llpanelcontents.h | 1 |
2 files changed, 7 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; diff --git a/indra/newview/llpanelcontents.h b/indra/newview/llpanelcontents.h index 6167604b5f..e2909d21fc 100644 --- a/indra/newview/llpanelcontents.h +++ b/indra/newview/llpanelcontents.h @@ -85,6 +85,7 @@ protected: bool mDirtyFilter { false }; LLUUID mLastScriptObjectID; bool mLastLuaRegion { false }; + bool mNewScriptIsLua { false }; boost::signals2::connection mSimulatorFeaturesConnection; public: |
