From 626ee6777e68c0df36c82290c8e00eaebe43b8b4 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 29 Sep 2014 16:39:08 -0400 Subject: SL-92 WIP - can edit hover height debug setting via slider --- indra/newview/skins/default/xui/en/menu_attachment_self.xml | 8 ++++++++ indra/newview/skins/default/xui/en/menu_avatar_self.xml | 8 ++++++++ 2 files changed, 16 insertions(+) (limited to 'indra/newview/skins/default') diff --git a/indra/newview/skins/default/xui/en/menu_attachment_self.xml b/indra/newview/skins/default/xui/en/menu_attachment_self.xml index bcbc8d5b86..c6ae844d67 100755 --- a/indra/newview/skins/default/xui/en/menu_attachment_self.xml +++ b/indra/newview/skins/default/xui/en/menu_attachment_self.xml @@ -91,6 +91,14 @@ name="Edit Outfit"> + + + + + + + + Date: Mon, 1 Dec 2014 16:34:43 -0500 Subject: Added missing xui file --- .../default/xui/en/floater_edit_hover_height.xml | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100755 indra/newview/skins/default/xui/en/floater_edit_hover_height.xml (limited to 'indra/newview/skins/default') 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 new file mode 100755 index 0000000000..29d06b9b4e --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_edit_hover_height.xml @@ -0,0 +1,39 @@ + + + + + -- cgit v1.3 From 57363fdfd6921394be42000869e2d711e7212ea4 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 5 Jan 2015 14:13:19 -0500 Subject: SL-92 WIP - More consistent enforcement of min/max hover values. Setting is stored as a per-account F32 value. --- indra/newview/app_settings/settings_per_account.xml | 6 +----- indra/newview/llfloaterhoverheight.cpp | 15 ++++++++------- indra/newview/llvoavatar.cpp | 3 +++ indra/newview/llvoavatar.h | 3 +++ indra/newview/llvoavatarself.cpp | 3 ++- .../skins/default/xui/en/floater_edit_hover_height.xml | 2 -- 6 files changed, 17 insertions(+), 15 deletions(-) (limited to 'indra/newview/skins/default') diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index 7975fe9e3a..97d81153a7 100755 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -7,13 +7,9 @@ Persist 1 Type - Vector3 + F32 Value - 0.0 - 0.0 - 0.0 - DoNotDisturbResponseChanged diff --git a/indra/newview/llfloaterhoverheight.cpp b/indra/newview/llfloaterhoverheight.cpp index 9efb168b55..dc8a3d6fb8 100755 --- a/indra/newview/llfloaterhoverheight.cpp +++ b/indra/newview/llfloaterhoverheight.cpp @@ -42,12 +42,14 @@ LLFloaterHoverHeight::LLFloaterHoverHeight(const LLSD& key) : LLFloater(key) void LLFloaterHoverHeight::syncFromPreferenceSetting(void *user_data) { - LLVector3 offset = gSavedPerAccountSettings.getVector3("AvatarPosFinalOffset"); - F32 value = offset[2]; + F32 value = gSavedPerAccountSettings.getF32("AvatarPosFinalOffset"); LLFloaterHoverHeight *self = static_cast(user_data); LLSliderCtrl* sldrCtrl = self->getChild("HoverHeightSlider"); sldrCtrl->setValue(value,FALSE); + + //value = sldrCtrl->getValueF32(); + //gAgentAvatarp->mHoverOffset = LLVector3(0.0, 0.0, value); if (isAgentAvatarValid()) { gAgentAvatarp->sendHoverHeight(); @@ -57,6 +59,8 @@ void LLFloaterHoverHeight::syncFromPreferenceSetting(void *user_data) BOOL LLFloaterHoverHeight::postBuild() { LLSliderCtrl* sldrCtrl = getChild("HoverHeightSlider"); + sldrCtrl->setMinValue(MIN_HOVER_Z); + sldrCtrl->setMaxValue(MAX_HOVER_Z); sldrCtrl->setSliderMouseUpCallback(boost::bind(&LLFloaterHoverHeight::onFinalCommit,this)); sldrCtrl->setSliderEditorCommitCallback(boost::bind(&LLFloaterHoverHeight::onFinalCommit,this)); childSetCommitCallback("HoverHeightSlider", &LLFloaterHoverHeight::onSliderMoved, NULL); @@ -81,8 +85,7 @@ void LLFloaterHoverHeight::onSliderMoved(LLUICtrl* ctrl, void* userData) { LLSliderCtrl* sldrCtrl = static_cast(ctrl); F32 value = sldrCtrl->getValueF32(); - LLVector3 offset = gSavedPerAccountSettings.getVector3("AvatarPosFinalOffset"); - offset[2] = value; + LLVector3 offset(0.0, 0.0, llclamp(value,MIN_HOVER_Z,MAX_HOVER_Z)); gAgentAvatarp->mHoverOffset = offset; } @@ -92,9 +95,7 @@ void LLFloaterHoverHeight::onFinalCommit() { LLSliderCtrl* sldrCtrl = getChild("HoverHeightSlider"); F32 value = sldrCtrl->getValueF32(); - LLVector3 offset = gSavedPerAccountSettings.getVector3("AvatarPosFinalOffset"); - offset[2] = value; - gSavedPerAccountSettings.setVector3("AvatarPosFinalOffset",offset); + gSavedPerAccountSettings.setF32("AvatarPosFinalOffset",value); } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index a6d006f13b..fd741e7e5f 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -111,6 +111,9 @@ extern F32 ANIM_SPEED_MAX; extern F32 ANIM_SPEED_MIN; extern U32 JOINT_COUNT_REQUIRED_FOR_FULLRIG; +const F32 MAX_HOVER_Z = 2.0; +const F32 MIN_HOVER_Z = -2.0; + // #define OUTPUT_BREAST_DATA using namespace LLAvatarAppearanceDefines; diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index a3f599e2d7..a12e688087 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -1021,6 +1021,9 @@ protected: // Shared with LLVOAvatarSelf extern const F32 SELF_ADDITIONAL_PRI; extern const S32 MAX_TEXTURE_VIRTUAL_SIZE_RESET_INTERVAL; +extern const F32 MAX_HOVER_Z; +extern const F32 MIN_HOVER_Z; + std::string get_sequential_numbered_file_name(const std::string& prefix, const std::string& suffix); void dump_sequential_xml(const std::string outprefix, const LLSD& content); diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 6e0c9cb68c..1b5901e581 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -239,7 +239,8 @@ void LLVOAvatarSelf::initInstance() return; } - mHoverOffset = gSavedPerAccountSettings.getVector3("AvatarPosFinalOffset"); + F32 hover_z = gSavedPerAccountSettings.getF32("AvatarPosFinalOffset"); + mHoverOffset = LLVector3(0.0, 0.0, llclamp(hover_z,MIN_HOVER_Z,MAX_HOVER_Z)); LL_INFOS("Avatar") << avString() << " set hover height from debug setting " << mHoverOffset[2] << LL_ENDL; //doPeriodically(output_self_av_texture_diagnostics, 30.0); 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 29d06b9b4e..8fc20d28fb 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 @@ -23,8 +23,6 @@ follows="top|left" height="15" increment="0.001" - max_val="2" - min_val="-2" initial_value="0.0" label="Height" label_width="60" -- cgit v1.3 From d5ab47b1bc9eac98c1f443fa965a91a8f2cf0af7 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 13 Jan 2015 17:18:15 -0500 Subject: SL-92 WIP - added signal for simulator features received. Use to keep hover floater UI synced with region support for hover. --- indra/newview/llfloaterhoverheight.cpp | 40 ++++++++++++++++++++++ indra/newview/llfloaterhoverheight.h | 7 ++++ indra/newview/llviewermenu.cpp | 2 +- indra/newview/llviewerregion.cpp | 30 ++++++++++++++++ indra/newview/llviewerregion.h | 12 ++++++- indra/newview/llvoavatar.cpp | 2 ++ .../default/xui/en/floater_edit_hover_height.xml | 1 + 7 files changed, 92 insertions(+), 2 deletions(-) (limited to 'indra/newview/skins/default') 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 ®ion_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("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 ®ion_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">