summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelcontents.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2026-09-21 16:32:19 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2026-09-21 16:32:19 +0300
commit904e8832e5daecce17f5f5dcaa74579ca1d56782 (patch)
tree4916cff2e8db3ea6c7602a571b45fce3f3ec1818 /indra/newview/llpanelcontents.cpp
parentf767219366b8dbaeea95a22bd9953a587f473298 (diff)
#6221 Select Lua as the default script type when region features arrive
Diffstat (limited to 'indra/newview/llpanelcontents.cpp')
-rw-r--r--indra/newview/llpanelcontents.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/indra/newview/llpanelcontents.cpp b/indra/newview/llpanelcontents.cpp
index 43dd1bfe40..506772dec3 100644
--- a/indra/newview/llpanelcontents.cpp
+++ b/indra/newview/llpanelcontents.cpp
@@ -111,6 +111,7 @@ LLPanelContents::LLPanelContents()
LLPanelContents::~LLPanelContents()
{
+ mSimulatorFeaturesConnection.disconnect();
// Children all cleaned up by default view destructor.
}
@@ -119,6 +120,7 @@ void LLPanelContents::getState(LLViewerObject *objectp )
{
if( !objectp )
{
+ mSimulatorFeaturesConnection.disconnect();
mLastScriptObjectID.setNull();
getChildView("button new script")->setEnabled(false);
getChildView("button new notecard")->setEnabled(false);
@@ -154,6 +156,12 @@ void LLPanelContents::getState(LLViewerObject *objectp )
region->getSimulatorFeatures(simulatorFeatures);
lua_region = simulatorFeatures["LuaScriptsEnabled"].asBoolean();
}
+ mSimulatorFeaturesConnection.disconnect();
+ if (region && !region->simulatorFeaturesReceived())
+ {
+ mSimulatorFeaturesConnection = region->setSimulatorFeaturesReceivedCallback(
+ boost::bind(&LLPanelContents::onSimulatorFeaturesReceived, this, _1));
+ }
LLComboBox* new_script = getChild<LLComboBox>("button new script");
new_script->setEnabledByValue("lua", lua_region);
if (mLastScriptObjectID != objectp->getID() || mLastLuaRegion != lua_region)
@@ -187,6 +195,11 @@ void LLPanelContents::getState(LLViewerObject *objectp )
}
}
+void LLPanelContents::onSimulatorFeaturesReceived(const LLUUID&)
+{
+ refresh();
+}
+
void LLPanelContents::onFilterEdit()
{
const std::string& filter_substring = mFilterEditor->getText();