summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2015-01-13 17:18:15 -0500
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2015-01-13 17:18:15 -0500
commitd5ab47b1bc9eac98c1f443fa965a91a8f2cf0af7 (patch)
treebc50c7b6a71bb9b5a800bdb7c9ffea6f47c4483f /indra/newview
parentee63c30ea748857f68ac352a9751816644322ec3 (diff)
SL-92 WIP - added signal for simulator features received. Use to keep hover floater UI synced with region support for hover.
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llfloaterhoverheight.cpp40
-rwxr-xr-xindra/newview/llfloaterhoverheight.h7
-rwxr-xr-xindra/newview/llviewermenu.cpp2
-rwxr-xr-xindra/newview/llviewerregion.cpp30
-rwxr-xr-xindra/newview/llviewerregion.h12
-rwxr-xr-xindra/newview/llvoavatar.cpp2
-rwxr-xr-xindra/newview/skins/default/xui/en/floater_edit_hover_height.xml1
7 files changed, 92 insertions, 2 deletions
diff --git a/indra/newview/llfloaterhoverheight.cpp b/indra/newview/llfloaterhoverheight.cpp
index 2ac61efc0c..69b58b3af5 100755
--- a/indra/newview/llfloaterhoverheight.cpp
+++ b/indra/newview/llfloaterhoverheight.cpp
@@ -77,6 +77,13 @@ BOOL LLFloaterHoverHeight::postBuild()
LL_WARNS() << "Control not found for AvatarHoverOffsetZ" << LL_ENDL;
}
+ updateEditEnabled();
+
+ if (!mRegionBoundarySlot.connected())
+ {
+ mRegionBoundarySlot = gAgent.addRegionChangedCallback(boost::bind(&LLFloaterHoverHeight::onRegionChanged,this));
+ }
+
return TRUE;
}
@@ -98,4 +105,37 @@ void LLFloaterHoverHeight::onFinalCommit()
gSavedPerAccountSettings.setF32("AvatarHoverOffsetZ",value);
}
+void LLFloaterHoverHeight::onRegionChanged()
+{
+ LLViewerRegion *region = gAgent.getRegion();
+ if (region && region->simulatorFeaturesReceived())
+ {
+ updateEditEnabled();
+ }
+ else if (region)
+ {
+ region->setSimulatorFeaturesReceivedCallback(boost::bind(&LLFloaterHoverHeight::onSimulatorFeaturesReceived,this,_1));
+ }
+}
+
+void LLFloaterHoverHeight::onSimulatorFeaturesReceived(const LLUUID &region_id)
+{
+ LLViewerRegion *region = gAgent.getRegion();
+ if (region && (region->getRegionID()==region_id))
+ {
+ updateEditEnabled();
+ }
+}
+
+void LLFloaterHoverHeight::updateEditEnabled()
+{
+ bool enabled = gAgent.getRegion() && gAgent.getRegion()->avatarHoverHeightEnabled();
+ LLSliderCtrl* sldrCtrl = getChild<LLSliderCtrl>("HoverHeightSlider");
+ sldrCtrl->setEnabled(enabled);
+ if (enabled)
+ {
+ syncFromPreferenceSetting(this);
+ }
+}
+
diff --git a/indra/newview/llfloaterhoverheight.h b/indra/newview/llfloaterhoverheight.h
index 586871374f..8fd24d8813 100755
--- a/indra/newview/llfloaterhoverheight.h
+++ b/indra/newview/llfloaterhoverheight.h
@@ -40,6 +40,13 @@ public:
void onFinalCommit();
static void syncFromPreferenceSetting(void *user_data);
+
+ void onRegionChanged();
+ void onSimulatorFeaturesReceived(const LLUUID &region_id);
+ void updateEditEnabled();
+
+
+ boost::signals2::connection mRegionBoundarySlot;
};
#endif
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 302dd6f889..c7bf8a1c31 100755
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -3885,7 +3885,7 @@ class LLEnableHoverHeight : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
- return true;
+ return gAgent.getRegion() && gAgent.getRegion()->avatarHoverHeightEnabled();
}
};
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index 11cbf3fc24..b05e771f96 100755
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -424,6 +424,7 @@ LLViewerRegion::LLViewerRegion(const U64 &handle,
mCacheDirty(FALSE),
mReleaseNotesRequested(FALSE),
mCapabilitiesReceived(false),
+ mSimulatorFeaturesReceived(false),
mBitsReceived(0.f),
mPacketsReceived(0.f),
mDead(FALSE),
@@ -2027,6 +2028,26 @@ void LLViewerRegion::getInfo(LLSD& info)
info["Region"]["Handle"]["y"] = (LLSD::Integer)y;
}
+boost::signals2::connection LLViewerRegion::setSimulatorFeaturesReceivedCallback(const caps_received_signal_t::slot_type& cb)
+{
+ return mSimulatorFeaturesReceivedSignal.connect(cb);
+}
+
+void LLViewerRegion::setSimulatorFeaturesReceived(bool received)
+{
+ mSimulatorFeaturesReceived = received;
+ if (received)
+ {
+ mSimulatorFeaturesReceivedSignal(getRegionID());
+ mSimulatorFeaturesReceivedSignal.disconnect_all_slots();
+ }
+}
+
+bool LLViewerRegion::simulatorFeaturesReceived() const
+{
+ return mSimulatorFeaturesReceived;
+}
+
void LLViewerRegion::getSimulatorFeatures(LLSD& sim_features) const
{
sim_features = mSimulatorFeatures;
@@ -2040,6 +2061,9 @@ void LLViewerRegion::setSimulatorFeatures(const LLSD& sim_features)
LLSDSerialize::toPrettyXML(sim_features, str);
LL_INFOS() << str.str() << LL_ENDL;
mSimulatorFeatures = sim_features;
+
+ setSimulatorFeaturesReceived(true);
+
}
//this is called when the parent is not cacheable.
@@ -3088,6 +3112,12 @@ bool LLViewerRegion::dynamicPathfindingEnabled() const
return ( mSimulatorFeatures.has("DynamicPathfindingEnabled") &&
mSimulatorFeatures["DynamicPathfindingEnabled"].asBoolean());
}
+
+bool LLViewerRegion::avatarHoverHeightEnabled() const
+{
+ return ( mSimulatorFeatures.has("AvatarHoverHeightEnabled") &&
+ mSimulatorFeatures["AvatarHoverHeightEnabled"].asBoolean());
+}
/* Static Functions */
void log_capabilities(const CapabilityMap &capmap)
diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h
index 1e225553b8..aaa1466939 100755
--- a/indra/newview/llviewerregion.h
+++ b/indra/newview/llviewerregion.h
@@ -309,12 +309,19 @@ public:
bool meshRezEnabled() const;
bool meshUploadEnabled() const;
+ // has region received its simulator features list? Requires an additional query after caps received.
+ void setSimulatorFeaturesReceived(bool);
+ bool simulatorFeaturesReceived() const;
+ boost::signals2::connection setSimulatorFeaturesReceivedCallback(const caps_received_signal_t::slot_type& cb);
+
void getSimulatorFeatures(LLSD& info) const;
void setSimulatorFeatures(const LLSD& info);
bool dynamicPathfindingEnabled() const;
+ bool avatarHoverHeightEnabled() const;
+
typedef enum
{
CACHE_MISS_TYPE_FULL = 0,
@@ -512,6 +519,7 @@ private:
BOOL mCacheDirty;
BOOL mAlive; // can become false if circuit disconnects
BOOL mCapabilitiesReceived;
+ BOOL mSimulatorFeaturesReceived;
BOOL mReleaseNotesRequested;
BOOL mDead; //if true, this region is in the process of deleting.
BOOL mPaused; //pause processing the objects in the region
@@ -532,11 +540,13 @@ private:
CacheMissItem::cache_miss_list_t mCacheMissList;
caps_received_signal_t mCapabilitiesReceivedSignal;
+ caps_received_signal_t mSimulatorFeaturesReceivedSignal;
+
LLSD mSimulatorFeatures;
// the materials capability throttle
LLFrameTimer mMaterialsCapThrottleTimer;
-LLFrameTimer mRenderInfoRequestTimer;
+ LLFrameTimer mRenderInfoRequestTimer;
};
inline BOOL LLViewerRegion::getRegionProtocol(U64 protocol) const
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 059a03a072..10bc6ad336 100755
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -3220,6 +3220,8 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent)
debug_line += llformat(" - cof rcv:%d", last_received_cof_version);
}
debug_line += llformat(" bsz-z: %f avofs-z: %f", mBodySize[2], mAvatarOffset[2]);
+ bool hover_enabled = getRegion() && getRegion()->avatarHoverHeightEnabled();
+ debug_line += hover_enabled ? " H" : " h";
if (mHoverOffset[2] != 0.0)
{
debug_line += llformat(" hov_z: %f", mHoverOffset[2]);
diff --git a/indra/newview/skins/default/xui/en/floater_edit_hover_height.xml b/indra/newview/skins/default/xui/en/floater_edit_hover_height.xml
index 8fc20d28fb..8ec6735a01 100755
--- a/indra/newview/skins/default/xui/en/floater_edit_hover_height.xml
+++ b/indra/newview/skins/default/xui/en/floater_edit_hover_height.xml
@@ -18,6 +18,7 @@
title="SET HOVER HEIGHT"
width="515">
<slider
+ enabled="false"
control_name="HoverHeightSlider"
decimal_digits="3"
follows="top|left"