summaryrefslogtreecommitdiff
path: root/indra/newview
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
parentf767219366b8dbaeea95a22bd9953a587f473298 (diff)
#6221 Select Lua as the default script type when region features arrive
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llpanelcontents.cpp13
-rw-r--r--indra/newview/llpanelcontents.h3
2 files changed, 16 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();
diff --git a/indra/newview/llpanelcontents.h b/indra/newview/llpanelcontents.h
index d576b72353..6167604b5f 100644
--- a/indra/newview/llpanelcontents.h
+++ b/indra/newview/llpanelcontents.h
@@ -35,6 +35,7 @@
#include "llvoinventorylistener.h"
#include "llscripteditorws.h"
#include "v3math.h"
+#include <boost/signals2/connection.hpp>
class LLButton;
class LLPanelObjectInventory;
@@ -79,10 +80,12 @@ public:
protected:
void getState(LLViewerObject *object);
void onFilterEdit();
+ void onSimulatorFeaturesReceived(const LLUUID& region_id);
bool mDirtyFilter { false };
LLUUID mLastScriptObjectID;
bool mLastLuaRegion { false };
+ boost::signals2::connection mSimulatorFeaturesConnection;
public:
class LLFilterEditor* mFilterEditor;