summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2026-09-08 14:59:48 +0300
committerAndrey Lihatskiy <118752495+marchcat@users.noreply.github.com>2026-09-09 20:12:26 +0300
commitbd6296230bf977ca0e12503976f19c61131edfb2 (patch)
treee05f51ce12dc0d54f6e8c29f59012790772bdf4c /indra
parent905d5c4bf0aa99eae52f9254b3e5e5d88abb0aae (diff)
#6221 Default object scripts to Lua in Lua regions
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llpanelcontents.cpp10
-rw-r--r--indra/newview/llpanelcontents.h2
2 files changed, 11 insertions, 1 deletions
diff --git a/indra/newview/llpanelcontents.cpp b/indra/newview/llpanelcontents.cpp
index c0b96ced2f..43dd1bfe40 100644
--- a/indra/newview/llpanelcontents.cpp
+++ b/indra/newview/llpanelcontents.cpp
@@ -119,6 +119,7 @@ void LLPanelContents::getState(LLViewerObject *objectp )
{
if( !objectp )
{
+ mLastScriptObjectID.setNull();
getChildView("button new script")->setEnabled(false);
getChildView("button new notecard")->setEnabled(false);
mPublishButton->setEnabled(false);
@@ -153,7 +154,14 @@ void LLPanelContents::getState(LLViewerObject *objectp )
region->getSimulatorFeatures(simulatorFeatures);
lua_region = simulatorFeatures["LuaScriptsEnabled"].asBoolean();
}
- getChild<LLComboBox>("button new script")->setEnabledByValue("lua", lua_region);
+ LLComboBox* new_script = getChild<LLComboBox>("button new script");
+ new_script->setEnabledByValue("lua", lua_region);
+ if (mLastScriptObjectID != objectp->getID() || mLastLuaRegion != lua_region)
+ {
+ new_script->setValue(lua_region ? "lua" : "lsl");
+ }
+ mLastScriptObjectID = objectp->getID();
+ mLastLuaRegion = lua_region;
getChildView("button permissions")->setEnabled(!objectp->isPermanentEnforced());
mPanelInventoryObject->setEnabled(!objectp->isPermanentEnforced());
diff --git a/indra/newview/llpanelcontents.h b/indra/newview/llpanelcontents.h
index bbbd828f3c..d576b72353 100644
--- a/indra/newview/llpanelcontents.h
+++ b/indra/newview/llpanelcontents.h
@@ -81,6 +81,8 @@ protected:
void onFilterEdit();
bool mDirtyFilter { false };
+ LLUUID mLastScriptObjectID;
+ bool mLastLuaRegion { false };
public:
class LLFilterEditor* mFilterEditor;