diff --git a/indra/llappearance/lltexglobalcolor.cpp b/indra/llappearance/lltexglobalcolor.cpp index f38b98210..c3abbfd90 100644 --- a/indra/llappearance/lltexglobalcolor.cpp +++ b/indra/llappearance/lltexglobalcolor.cpp @@ -105,7 +105,8 @@ LLTexParamGlobalColor::LLTexParamGlobalColor(LLTexGlobalColor* tex_global_color) void LLTexParamGlobalColor::onGlobalColorChanged(bool upload_bake) { - mAvatarAppearance->onGlobalColorChanged(mTexGlobalColor, upload_bake); + if (mAvatarAppearance) + mAvatarAppearance->onGlobalColorChanged(mTexGlobalColor, upload_bake); } //----------------------------------------------------------------------------- diff --git a/indra/llcharacter/llcharacter.h b/indra/llcharacter/llcharacter.h index f618b446f..bfa1c0bd8 100644 --- a/indra/llcharacter/llcharacter.h +++ b/indra/llcharacter/llcharacter.h @@ -269,6 +269,9 @@ public: static std::vector< LLCharacter* > sInstances; static BOOL sAllowInstancesChange ; //debug use + virtual void setHoverOffset(const LLVector3& hover_offset, bool send_update=true) { mHoverOffset = hover_offset; } + const LLVector3& getHoverOffset() const { return mHoverOffset; } + protected: LLMotionController mMotionController; @@ -293,6 +296,8 @@ private: visual_param_index_map_t mVisualParamIndexMap; visual_param_name_map_t mVisualParamNameMap; static LLStringTable sVisualParamNames; + + LLVector3 mHoverOffset; }; #endif // LL_LLCHARACTER_H diff --git a/indra/llcharacter/llkeyframemotion.cpp b/indra/llcharacter/llkeyframemotion.cpp index 8e4c9b0fc..e223b329d 100644 --- a/indra/llcharacter/llkeyframemotion.cpp +++ b/indra/llcharacter/llkeyframemotion.cpp @@ -1047,7 +1047,8 @@ void LLKeyframeMotion::applyConstraint(JointConstraint* constraint, F32 time, U8 { case CONSTRAINT_TARGET_TYPE_GROUND: target_pos = mCharacter->getPosAgentFromGlobal(constraint->mGroundPos); -// llinfos << "Target Pos " << constraint->mGroundPos << " on " << mCharacter->findCollisionVolume(shared_data->mSourceConstraintVolume)->getName() << llendl; + target_pos += mCharacter->getHoverOffset(); +// LL_INFOS() << "Target Pos " << constraint->mGroundPos << " on " << mCharacter->findCollisionVolume(shared_data->mSourceConstraintVolume)->getName() << LL_ENDL; break; case CONSTRAINT_TARGET_TYPE_BODY: target_pos = mCharacter->getVolumePos(shared_data->mTargetConstraintVolume, shared_data->mTargetConstraintOffset); diff --git a/indra/llmessage/message_prehash.cpp b/indra/llmessage/message_prehash.cpp index 8544b37e1..4d91df196 100644 --- a/indra/llmessage/message_prehash.cpp +++ b/indra/llmessage/message_prehash.cpp @@ -1384,6 +1384,8 @@ char const* const _PREHASH_GroupAVSounds = LLMessageStringTable::getInstance()-> char const* const _PREHASH_AppearanceData = LLMessageStringTable::getInstance()->getString("AppearanceData"); char const* const _PREHASH_AppearanceVersion = LLMessageStringTable::getInstance()->getString("AppearanceVersion"); char const* const _PREHASH_CofVersion = LLMessageStringTable::getInstance()->getString("CofVersion"); +char const* const _PREHASH_AppearanceHover = LLMessageStringTable::getInstance()->getString("AppearanceHover"); +char const* const _PREHASH_HoverHeight = LLMessageStringTable::getInstance()->getString("HoverHeight"); // Aurora Sim char const* const _PREHASH_RegionSizeX = LLMessageStringTable::getInstance()->getString("RegionSizeX"); diff --git a/indra/llmessage/message_prehash.h b/indra/llmessage/message_prehash.h index 9a11ca02b..50f500f78 100644 --- a/indra/llmessage/message_prehash.h +++ b/indra/llmessage/message_prehash.h @@ -1384,6 +1384,8 @@ extern char const* const _PREHASH_GroupAVSounds; extern char const* const _PREHASH_AppearanceData; extern char const* const _PREHASH_AppearanceVersion; extern char const* const _PREHASH_CofVersion; +extern char const* const _PREHASH_AppearanceHover; +extern char const* const _PREHASH_HoverHeight; // Aurora Sim extern char const* const _PREHASH_RegionSizeX; diff --git a/indra/llui/llsliderctrl.cpp b/indra/llui/llsliderctrl.cpp index 594a2d890..365f0b3d7 100644 --- a/indra/llui/llsliderctrl.cpp +++ b/indra/llui/llsliderctrl.cpp @@ -75,7 +75,8 @@ LLSliderCtrl::LLSliderCtrl(const std::string& name, const LLRect& rect, mEditor( NULL ), mTextBox( NULL ), mTextEnabledColor( LLUI::sColorsGroup->getColor( "LabelTextColor" ) ), - mTextDisabledColor( LLUI::sColorsGroup->getColor( "LabelDisabledColor" ) ) + mTextDisabledColor(LLUI::sColorsGroup->getColor("LabelDisabledColor")), + mEditorCommitSignal(NULL) { S32 top = getRect().getHeight(); S32 bottom = 0; @@ -141,6 +142,11 @@ LLSliderCtrl::LLSliderCtrl(const std::string& name, const LLRect& rect, updateText(); } +LLSliderCtrl::~LLSliderCtrl() +{ + delete mEditorCommitSignal; +} + void LLSliderCtrl::setValue(F32 v, BOOL from_event) { mSlider->setValue( v, from_event ); @@ -238,6 +244,8 @@ void LLSliderCtrl::onEditorCommit( LLUICtrl* ctrl, const LLSD& userdata ) if( success ) { self->onCommit(); + if (self->mEditorCommitSignal) + (*(self->mEditorCommitSignal))(self, self->getValueF32()); } else { @@ -350,6 +358,12 @@ boost::signals2::connection LLSliderCtrl::setSliderMouseUpCallback( const commit return mSlider->setMouseUpCallback( cb ); } +boost::signals2::connection LLSliderCtrl::setSliderEditorCommitCallback(const commit_signal_t::slot_type& cb) +{ + if (!mEditorCommitSignal) mEditorCommitSignal = new commit_signal_t(); + return mEditorCommitSignal->connect(cb); +} + void LLSliderCtrl::onTabInto() { if( mEditor ) diff --git a/indra/llui/llsliderctrl.h b/indra/llui/llsliderctrl.h index bf1b8366e..a5bc3488c 100644 --- a/indra/llui/llsliderctrl.h +++ b/indra/llui/llsliderctrl.h @@ -62,7 +62,7 @@ public: F32 initial_value, F32 min_value, F32 max_value, F32 increment, const std::string& control_which = LLStringUtil::null ); - virtual ~LLSliderCtrl() {} // Children all cleaned up by default view destructor. + virtual ~LLSliderCtrl(); virtual LLXMLNodePtr getXML(bool save_children = true) const; static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); @@ -99,6 +99,7 @@ public: boost::signals2::connection setSliderMouseDownCallback( const commit_signal_t::slot_type& cb ); boost::signals2::connection setSliderMouseUpCallback( const commit_signal_t::slot_type& cb ); + boost::signals2::connection setSliderEditorCommitCallback(const commit_signal_t::slot_type& cb); virtual void onTabInto(); @@ -137,6 +138,8 @@ private: LLColor4 mTextEnabledColor; LLColor4 mTextDisabledColor; + + commit_signal_t* mEditorCommitSignal; }; #endif // LL_LLSLIDERCTRL_H diff --git a/indra/newview/app_settings/settings_ascent.xml b/indra/newview/app_settings/settings_ascent.xml index af0f4a826..38e39bb7a 100644 --- a/indra/newview/app_settings/settings_ascent.xml +++ b/indra/newview/app_settings/settings_ascent.xml @@ -113,6 +113,28 @@ Value 1 + AlchemyChatCommandHoverHeight + + Comment + Command to hover your height or something + Persist + 1 + Type + String + Value + /hover + + AlchemyChatCommandResyncAnim + + Comment + Command to stop/start in order to resync animations + Persist + 1 + Type + String + Value + /resync + AlchemyConnectToNeighbors Comment @@ -189,6 +211,17 @@ Boolean Value 0 + + AlchemySitOnAway + + Comment + Agent groundsits in away mode + Persist + 1 + Type + Boolean + Value + 0 AscentPowerfulWizard diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index e191928e7..2dd4904f4 100644 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -8,6 +8,17 @@ + AvatarHoverOffsetZ + + Comment + After-everything-else fixup for avatar Z position. + Persist + 1 + Type + F32 + Value + 0.0 + AOConfigNotecardID diff --git a/indra/newview/ascentprefssys.cpp b/indra/newview/ascentprefssys.cpp index 2170d0824..b172627fd 100644 --- a/indra/newview/ascentprefssys.cpp +++ b/indra/newview/ascentprefssys.cpp @@ -73,6 +73,8 @@ LLPrefsAscentSys::LLPrefsAscentSys() getChild("SinguCmdLineAway")->setCommitCallback(lineEditorControl); getChild("SinguCmdLineRegionSay")->setCommitCallback(lineEditorControl); getChild("SinguCmdLineURL")->setCommitCallback(lineEditorControl); + getChild("AlchemyChatCommandResyncAnim")->setCommitCallback(lineEditorControl); + getChild("AlchemyChatCommandHoverHeight")->setCommitCallback(lineEditorControl); //Security ---------------------------------------------------------------------------- getChild("UISndRestart")->setCommitCallback(lineEditorControl); @@ -113,10 +115,8 @@ void LLPrefsAscentSys::onCommitCheckBox(LLUICtrl* ctrl, const LLSD& value) LLVector3d lpos_global = gAgent.getPositionGlobal(); if(gAudiop) gAudiop->triggerSound(LLUUID("58a38e89-44c6-c52b-deb8-9f1ddc527319"), gAgent.getID(), 1.0f, LLAudioEngine::AUDIO_TYPE_UI, lpos_global); - LLChat chat; - chat.mSourceType = CHAT_SOURCE_SYSTEM; - chat.mText = LLTrans::getString("PowerUser1") + "\n" + LLTrans::getString("PowerUser2") + "\n" + LLTrans::getString("Unlocked:") + "\n" + LLTrans::getString("PowerUser3") + "\n- " + LLTrans::getString("RightClick") + " > " + LLTrans::getString("PowerUser4") + "\n- " + LLTrans::getString("RightClick") + " > " + LLTrans::getString("PowerUser5"); - LLFloaterChat::addChat(chat); + void cmdline_printchat(const std::string& message); + cmdline_printchat(LLTrans::getString("PowerUser1") + '\n' + LLTrans::getString("PowerUser2") + '\n' + LLTrans::getString("Unlocked:") + '\n' + LLTrans::getString("PowerUser3") + "\n- " + LLTrans::getString("RightClick") + " > " + LLTrans::getString("PowerUser4") + "\n- " + LLTrans::getString("RightClick") + " > " + LLTrans::getString("PowerUser5")); } } else if (name == "next_owner_copy") @@ -186,6 +186,8 @@ void LLPrefsAscentSys::refreshValues() mCmdLineAway = gSavedSettings.getString("SinguCmdLineAway"); mCmdLineRegionSay = gSavedSettings.getString("SinguCmdLineRegionSay"); mCmdLineURL = gSavedSettings.getString("SinguCmdLineURL"); + mCmdLineResync = gSavedSettings.getString("AlchemyChatCommandResyncAnim"); + mCmdLineHover = gSavedSettings.getString("AlchemyChatCommandHoverHeight"); //Security ---------------------------------------------------------------------------- mBroadcastViewerEffects = gSavedSettings.getBOOL("BroadcastViewerEffects"); @@ -196,6 +198,7 @@ void LLPrefsAscentSys::refreshValues() mLookAtLines = gSavedSettings.getBOOL("AlchemyLookAtLines"); mQuietSnapshotsToDisk = gSavedSettings.getBOOL("QuietSnapshotsToDisk"); mAnnounceBumps = gSavedSettings.getBOOL("AnnounceBumps"); + mSitOnAway = gSavedSettings.getBOOL("AlchemySitOnAway"); mDetachBridge = gSavedSettings.getBOOL("SGDetachBridge"); mRevokePermsOnStandUp = gSavedSettings.getBOOL("RevokePermsOnStandUp"); mDisableClickSit = gSavedSettings.getBOOL("DisableClickSit"); @@ -257,6 +260,8 @@ void LLPrefsAscentSys::refresh() childSetValue("SinguCmdLineAway", mCmdLineAway); childSetValue("SinguCmdLineRegionSay", mCmdLineRegionSay); childSetValue("SinguCmdLineURL", mCmdLineURL); + childSetValue("AlchemyChatCommandResyncAnim", mCmdLineResync); + childSetValue("AlchemyChatCommandHoverHeight", mCmdLineHover); //Security ---------------------------------------------------------------------------- getChildView("UISndRestart")->setValue(mRestartSound); @@ -328,6 +333,8 @@ void LLPrefsAscentSys::cancel() gSavedSettings.setString("SinguCmdLineAway", mCmdLineAway); gSavedSettings.setString("SinguCmdLineRegionSay", mCmdLineRegionSay); gSavedSettings.setString("SinguCmdLineURL", mCmdLineURL); + gSavedSettings.setString("AlchemyChatCommandResyncAnim", mCmdLineResync); + gSavedSettings.setString("AlchemyChatCommandHoverHeight", mCmdLineHover); //Security ---------------------------------------------------------------------------- gSavedSettings.setBOOL("BroadcastViewerEffects", mBroadcastViewerEffects); @@ -338,6 +345,7 @@ void LLPrefsAscentSys::cancel() gSavedSettings.setBOOL("AlchemyLookAtLines", mLookAtLines); gSavedSettings.setBOOL("QuietSnapshotsToDisk", mQuietSnapshotsToDisk); gSavedSettings.setBOOL("AnnounceBumps", mAnnounceBumps); + gSavedSettings.setBOOL("AlchemySitOnAway", mSitOnAway); gSavedSettings.setBOOL("SGDetachBridge", mDetachBridge); gSavedSettings.setBOOL("RevokePermsOnStandUp", mRevokePermsOnStandUp); gSavedSettings.setBOOL("DisableClickSit", mDisableClickSit); diff --git a/indra/newview/ascentprefssys.h b/indra/newview/ascentprefssys.h index 50fbdae30..c55c5cceb 100644 --- a/indra/newview/ascentprefssys.h +++ b/indra/newview/ascentprefssys.h @@ -96,6 +96,8 @@ private: std::string mCmdLineAway; std::string mCmdLineRegionSay; std::string mCmdLineURL; + std::string mCmdLineResync; + std::string mCmdLineHover; //Security ---------------------------------------------------------------------------- bool mBroadcastViewerEffects; @@ -106,6 +108,7 @@ private: bool mLookAtLines; bool mQuietSnapshotsToDisk; bool mAnnounceBumps; + bool mSitOnAway; bool mDetachBridge; bool mRevokePermsOnStandUp; bool mDisableClickSit; diff --git a/indra/newview/chatbar_as_cmdline.cpp b/indra/newview/chatbar_as_cmdline.cpp index 1183a359d..916e52b7c 100644 --- a/indra/newview/chatbar_as_cmdline.cpp +++ b/indra/newview/chatbar_as_cmdline.cpp @@ -241,6 +241,8 @@ bool cmd_line_chat(std::string revised_text, EChatType type) static LLCachedControl sSinguCmdLineAway(gSavedSettings, "SinguCmdLineAway"); static LLCachedControl sSinguCmdLineRegionSay(gSavedSettings, "SinguCmdLineRegionSay"); static LLCachedControl sSinguCmdLineURL(gSavedSettings, "SinguCmdLineURL"); + static LLCachedControl sResyncAnimCommand(gSavedSettings, "AlchemyChatCommandResyncAnim", "/resync"); + static LLCachedControl sHoverHeight(gSavedSettings, "AlchemyChatCommandHoverHeight", "/hover"); if(sAscentCmdLine) { @@ -463,6 +465,34 @@ bool cmd_line_chat(std::string revised_text, EChatType type) } return false; } + else if (command == utf8str_tolower(sHoverHeight)) // Hover height + { + F32 height; + if (i >> height) + { + gSavedPerAccountSettings.set("AvatarHoverOffsetZ", + llclamp(height, MIN_HOVER_Z, MAX_HOVER_Z)); + return false; + } + } + else if (command == utf8str_tolower(sResyncAnimCommand)) // Resync Animations + { + for (S32 i = 0; i < gObjectList.getNumObjects(); i++) + { + LLViewerObject* object = gObjectList.getObject(i); + if (object && object->isAvatar()) + { + LLVOAvatar& avatarp = *(LLVOAvatar*)object; + for (LLVOAvatar::AnimIterator it = avatarp.mPlayingAnimations.begin(), end = avatarp.mPlayingAnimations.end(); it != end; ++it) + { + const std::pair& playpair = *it; + avatarp.stopMotion(playpair.first, TRUE); + avatarp.startMotion(playpair.first); + } + } + } + return false; + } else if(command == "typingstop") { std::string text; diff --git a/indra/newview/lfsimfeaturehandler.cpp b/indra/newview/lfsimfeaturehandler.cpp index 6937e1205..65d1e6e55 100644 --- a/indra/newview/lfsimfeaturehandler.cpp +++ b/indra/newview/lfsimfeaturehandler.cpp @@ -46,13 +46,13 @@ void LFSimFeatureHandler::handleRegionChange() { if (LLViewerRegion* region = gAgent.getRegion()) { - if (region->getFeaturesReceived()) + if (region->simulatorFeaturesReceived()) { setSupportedFeatures(); } else { - region->setFeaturesReceivedCallback(boost::bind(&LFSimFeatureHandler::setSupportedFeatures, this)); + region->setSimulatorFeaturesReceivedCallback(boost::bind(&LFSimFeatureHandler::setSupportedFeatures, this)); } } } diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index a8fa1568b..ab06f2ac9 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -396,7 +396,8 @@ LLAgent::LLAgent() : mShowAvatar(TRUE), mFrameAgent(), - mIsBusy(FALSE), + mIsAwaySitting(false), + mIsDoNotDisturb(false), mControlFlags(0x00000000), mbFlagsDirty(FALSE), @@ -1427,12 +1428,13 @@ void LLAgent::setAFK() { sendAnimationRequest(ANIM_AGENT_AWAY, ANIM_REQUEST_START); setControlFlags(AGENT_CONTROL_AWAY | AGENT_CONTROL_STOP); - LL_INFOS("AFK") << "Setting Away" << LL_ENDL; gAwayTimer.start(); + + if (isAgentAvatarValid() && !gAgentAvatarp->isSitting() && gSavedSettings.getBOOL("AlchemySitOnAway")) + gAgent.setSitDownAway(true); + if (gAFKMenu) - { gAFKMenu->setLabel(LLTrans::getString("AvatarSetNotAway")); - } } } @@ -1452,14 +1454,27 @@ void LLAgent::clearAFK() { sendAnimationRequest(ANIM_AGENT_AWAY, ANIM_REQUEST_STOP); clearControlFlags(AGENT_CONTROL_AWAY); - LL_INFOS("AFK") << "Clearing Away" << LL_ENDL; + + if (isAgentAvatarValid() && gAgentAvatarp->isSitting() && gAgent.isAwaySitting()) + gAgent.setSitDownAway(false); + if (gAFKMenu) - { gAFKMenu->setLabel(LLTrans::getString("AvatarSetAway")); - } } } +//----------------------------------------------------------------------------- +// setSitDownAway(bool) +//----------------------------------------------------------------------------- +void LLAgent::setSitDownAway(bool go_away) +{ + if (go_away) + gAgent.sitDown(); + else + gAgent.standUp(); + mIsAwaySitting = go_away; +} + //----------------------------------------------------------------------------- // getAFK() //----------------------------------------------------------------------------- @@ -1469,39 +1484,25 @@ BOOL LLAgent::getAFK() const } //----------------------------------------------------------------------------- -// setBusy() +// setDoNotDisturb() //----------------------------------------------------------------------------- -void LLAgent::setBusy() +void LLAgent::setDoNotDisturb(bool pIsDoNotDisturb) { - sendAnimationRequest(ANIM_AGENT_BUSY, ANIM_REQUEST_START); - mIsBusy = TRUE; + sendAnimationRequest(ANIM_AGENT_BUSY, pIsDoNotDisturb ? ANIM_REQUEST_START : ANIM_REQUEST_STOP); + mIsDoNotDisturb = pIsDoNotDisturb; if (gBusyMenu) { - gBusyMenu->setLabel(LLTrans::getString("AvatarSetNotBusy")); + gBusyMenu->setLabel(LLTrans::getString(pIsDoNotDisturb ? "AvatarSetNotBusy" : "AvatarSetBusy")); } LLFloaterMute::getInstance()->updateButtons(); } //----------------------------------------------------------------------------- -// clearBusy() +// isDoNotDisturb() //----------------------------------------------------------------------------- -void LLAgent::clearBusy() +bool LLAgent::isDoNotDisturb() const { - mIsBusy = FALSE; - sendAnimationRequest(ANIM_AGENT_BUSY, ANIM_REQUEST_STOP); - if (gBusyMenu) - { - gBusyMenu->setLabel(LLTrans::getString("AvatarSetBusy")); - } - LLFloaterMute::getInstance()->updateButtons(); -} - -//----------------------------------------------------------------------------- -// getBusy() -//----------------------------------------------------------------------------- -BOOL LLAgent::getBusy() const -{ - return mIsBusy; + return mIsDoNotDisturb; } diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index 6294d2e0a..cb332a497 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -462,15 +462,20 @@ public: /// @brief ground-sit at agent's current position void sitDown(); + void setSitDownAway(bool away); + bool isAwaySitting() const { return mIsAwaySitting; } + +private: + bool mIsAwaySitting; + //-------------------------------------------------------------------- - // Busy + // Do Not Disturb //-------------------------------------------------------------------- public: - void setBusy(); - void clearBusy(); - BOOL getBusy() const; + void setDoNotDisturb(bool pIsDoNotDisturb); + bool isDoNotDisturb() const; private: - BOOL mIsBusy; + bool mIsDoNotDisturb; //-------------------------------------------------------------------- // Grab diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 963a546a0..a56db3f12 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -432,7 +432,7 @@ void LLAvatarActions::pay(const LLUUID& id) LLNotification::Params params("BusyModePay"); params.functor(boost::bind(&LLAvatarActions::handlePay, _1, _2, id)); - if (gAgent.getBusy()) + if (gAgent.isDoNotDisturb()) { // warn users of being in busy mode during a transaction LLNotifications::instance().add(params); @@ -1110,7 +1110,7 @@ bool LLAvatarActions::handlePay(const LLSD& notification, const LLSD& response, S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (option == 0) { - gAgent.clearBusy(); + gAgent.setDoNotDisturb(false); } LLFloaterPay::payDirectly(&give_money, avatar_id, /*is_group=*/false); diff --git a/indra/newview/llfloaterdirectory.cpp b/indra/newview/llfloaterdirectory.cpp index e6606de36..25ee21f7d 100644 --- a/indra/newview/llfloaterdirectory.cpp +++ b/indra/newview/llfloaterdirectory.cpp @@ -106,13 +106,13 @@ public: { if (LLViewerRegion* region = gAgent.getRegion()) { - if (region->getFeaturesReceived()) + if (region->simulatorFeaturesReceived()) { setMarketplaceURL(container); } else { - region->setFeaturesReceivedCallback(boost::bind(&LLPanelDirMarket::setMarketplaceURL, this, container)); + region->setSimulatorFeaturesReceivedCallback(boost::bind(&LLPanelDirMarket::setMarketplaceURL, this, container)); } } } diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 71f2221ec..b05636b4d 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -1478,7 +1478,7 @@ public: time_t timestamp = (time_t) message_params["timestamp"].asInteger(); - BOOL is_busy = gAgent.getBusy(); + bool is_do_not_disturb = gAgent.isDoNotDisturb(); BOOL is_muted = LLMuteList::getInstance()->isMuted( from_id, name, @@ -1501,7 +1501,7 @@ public: chat.mFromID = from_id; chat.mFromName = name; - if (!is_linden && (is_busy || is_muted)) + if (!is_linden && (is_do_not_disturb || is_muted)) { return; } diff --git a/indra/newview/lloverlaybar.cpp b/indra/newview/lloverlaybar.cpp index e20ead18d..fac6a04d6 100644 --- a/indra/newview/lloverlaybar.cpp +++ b/indra/newview/lloverlaybar.cpp @@ -322,7 +322,7 @@ void LLOverlayBar::refresh() } buttons_changed = true; } - buttons_changed |= updateButtonVisiblity(mNotBusy,gAgent.getBusy()) != NULL; + buttons_changed |= updateButtonVisiblity(mNotBusy, gAgent.isDoNotDisturb()) != NULL; buttons_changed |= updateButtonVisiblity(mFlyCam,LLViewerJoystick::getInstance()->getOverrideCamera()) != NULL; buttons_changed |= updateButtonVisiblity(mMouseLook,gAgent.isControlGrabbed(CONTROL_ML_LBUTTON_DOWN_INDEX)||gAgent.isControlGrabbed(CONTROL_ML_LBUTTON_UP_INDEX)) != NULL; // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) @@ -374,7 +374,7 @@ void LLOverlayBar::onClickIMReceived(void*) // static void LLOverlayBar::onClickSetNotBusy(void*) { - gAgent.clearBusy(); + gAgent.setDoNotDisturb(false); } diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index a072431fa..242962478 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -5892,15 +5892,10 @@ class LLWorldSetBusy : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { - if (gAgent.getBusy()) - { - gAgent.clearBusy(); - } - else - { - gAgent.setBusy(); + bool busy = !gAgent.isDoNotDisturb(); + gAgent.setDoNotDisturb(busy); + if (busy) LLNotificationsUtil::add("BusyModeSet"); - } return true; } }; @@ -6033,7 +6028,7 @@ bool complete_give_money(const LLSD& notification, const LLSD& response, LLObjec S32 option = LLNotification::getSelectedOption(notification, response); if (option == 0) { - gAgent.clearBusy(); + gAgent.setDoNotDisturb(false); } LLViewerObject* objectp = selection->getPrimaryObject(); @@ -6069,7 +6064,7 @@ void handle_give_money_dialog() LLNotification::Params params("BusyModePay"); params.functor(boost::bind(complete_give_money, _1, _2, LLSelectMgr::getInstance()->getSelection())); - if (gAgent.getBusy()) + if (gAgent.isDoNotDisturb()) { // warn users of being in busy mode during a transaction LLNotifications::instance().add(params); @@ -9559,13 +9554,13 @@ void region_change() LLViewerRegion* regionp = gAgent.getRegion(); if (!regionp) return; - if (regionp->getFeaturesReceived()) + if (regionp->simulatorFeaturesReceived()) { parse_simulator_features(); } else { - regionp->setFeaturesReceivedCallback(boost::bind(&parse_simulator_features)); + regionp->setSimulatorFeaturesReceivedCallback(boost::bind(&parse_simulator_features)); } } diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 567d31446..54c5f9242 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1176,7 +1176,7 @@ bool check_asset_previewable(const LLAssetType::EType asset_type) void open_inventory_offer(const uuid_vec_t& objects, const std::string& from_name) { - if (gAgent.getBusy()) return; + if (gAgent.isDoNotDisturb()) return; for (uuid_vec_t::const_iterator obj_iter = objects.begin(); obj_iter != objects.end(); ++obj_iter) @@ -1496,7 +1496,7 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& from_string = chatHistory_string = mFromName; } - bool busy = gAgent.getBusy(); + bool busy = gAgent.isDoNotDisturb(); // [RLVa:KB] - Checked: 2010-09-23 (RLVa-1.2.1) bool fRlvNotifyAccepted = false; @@ -1800,7 +1800,7 @@ void inventory_offer_handler(LLOfferInfo* info) return; } - if (gAgent.getBusy() && info->mIM != IM_TASK_INVENTORY_OFFERED) // busy mode must not affect interaction with objects (STORM-565) + if (gAgent.isDoNotDisturb() && info->mIM != IM_TASK_INVENTORY_OFFERED) // busy mode must not affect interaction with objects (STORM-565) { // Until throttling is implemented, busy mode should reject inventory instead of silently // accepting it. SEE SL-39554 @@ -2271,7 +2271,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) llinfos << "RegionID: " << region_id.asString() << llendl; // - BOOL is_do_not_disturb = gAgent.getBusy(); + bool is_do_not_disturb = gAgent.isDoNotDisturb(); BOOL is_muted = LLMuteList::getInstance()->isMuted(from_id, name, LLMute::flagTextChat) // object IMs contain sender object id in session_id (STORM-1209) || dialog == IM_FROM_TASK && LLMuteList::getInstance()->isMuted(session_id); @@ -3459,7 +3459,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) void send_do_not_disturb_message (LLMessageSystem* msg, const LLUUID& from_id, const LLUUID& session_id) { - if (gAgent.getBusy()) + if (gAgent.isDoNotDisturb()) { std::string my_name; LLAgentUI::buildFullname(my_name); @@ -3578,7 +3578,7 @@ void process_offer_callingcard(LLMessageSystem* msg, void**) if(!source_name.empty()) { - if (gAgent.getBusy() + if (gAgent.isDoNotDisturb() || LLMuteList::getInstance()->isMuted(source_id, source_name, LLMute::flagTextChat)) { // automatically decline offer @@ -3804,7 +3804,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) chat.mFromName = from_name; } - BOOL is_do_not_disturb = gAgent.getBusy(); + bool is_do_not_disturb = gAgent.isDoNotDisturb(); BOOL is_muted = FALSE; BOOL is_linden = FALSE; @@ -4783,14 +4783,7 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) } // force simulator to recognize busy state - if (gAgent.getBusy()) - { - gAgent.setBusy(); - } - else - { - gAgent.clearBusy(); - } + gAgent.setDoNotDisturb(gAgent.isDoNotDisturb()); if (isAgentAvatarValid()) { diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 4a75bc8fc..c502eab4f 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -314,7 +314,7 @@ LLViewerRegion::LLViewerRegion(const U64 &handle, mCacheDirty(FALSE), mReleaseNotesRequested(FALSE), mCapabilitiesReceived(false), - mFeaturesReceived(false), + mSimulatorFeaturesReceived(false), mGamingFlags(0), // Aurora Sim mWidth(region_width_meters) @@ -1318,6 +1318,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) { sim_features = mSimulatorFeatures; @@ -1331,9 +1351,7 @@ void LLViewerRegion::setSimulatorFeatures(const LLSD& sim_features) LL_DEBUGS("SimFeatures") << "\n" << str.str() << LL_ENDL; mSimulatorFeatures = sim_features; - mFeaturesReceived = true; - mFeaturesReceivedSignal(getRegionID()); - mFeaturesReceivedSignal.disconnect_all_slots(); + setSimulatorFeaturesReceived(true); } void LLViewerRegion::setGamingData(const LLSD& gaming_data) @@ -2026,9 +2044,9 @@ void LLViewerRegion::setCapabilitiesReceived(bool received) // in consumers by allowing them to expect this signal, regardless. if (getCapability("SimulatorFeatures").empty()) { - mFeaturesReceived = true; - mFeaturesReceivedSignal(getRegionID()); - mFeaturesReceivedSignal.disconnect_all_slots(); + mSimulatorFeaturesReceived = true; + mSimulatorFeaturesReceivedSignal(getRegionID()); + mSimulatorFeaturesReceivedSignal.disconnect_all_slots(); } } } @@ -2148,9 +2166,10 @@ bool LLViewerRegion::dynamicPathfindingEnabled() const mSimulatorFeatures["DynamicPathfindingEnabled"].asBoolean()); } -boost::signals2::connection LLViewerRegion::setFeaturesReceivedCallback(const features_received_signal_t::slot_type& cb) +bool LLViewerRegion::avatarHoverHeightEnabled() const { - return mFeaturesReceivedSignal.connect(cb); + return ( mSimulatorFeatures.has("AvatarHoverHeightEnabled") && + mSimulatorFeatures["AvatarHoverHeightEnabled"].asBoolean()); } void LLViewerRegion::resetMaterialsCapThrottle() diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index cfaef5ebc..07d4fcca4 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -105,7 +105,6 @@ public: } eObjectPartitions; typedef boost::signals2::signal caps_received_signal_t; - typedef boost::signals2::signal features_received_signal_t; LLViewerRegion(const U64 &handle, const LLHost &host, @@ -284,9 +283,6 @@ public: static bool isSpecialCapabilityName(const std::string &name); void logActiveCapabilities() const; - boost::signals2::connection setFeaturesReceivedCallback(const features_received_signal_t::slot_type& cb); - bool getFeaturesReceived() const { return mFeaturesReceived; } - /// Get LLEventPump on which we listen for capability requests /// (https://wiki.lindenlab.com/wiki/Viewer:Messaging/Messaging_Notes#Capabilities) LLEventPump& getCapAPI() const; @@ -327,12 +323,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); void setSimulatorFeatures(const LLSD& info); bool dynamicPathfindingEnabled() const; + bool avatarHoverHeightEnabled() const; + typedef enum { CACHE_MISS_TYPE_FULL = 0, @@ -480,9 +483,9 @@ private: bool mAlive; // can become false if circuit disconnects bool mCapabilitiesReceived; - bool mFeaturesReceived; + bool mSimulatorFeaturesReceived; caps_received_signal_t mCapabilitiesReceivedSignal; - features_received_signal_t mFeaturesReceivedSignal; + caps_received_signal_t mSimulatorFeaturesReceivedSignal; BOOL mReleaseNotesRequested; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index ddcd35073..564f75cb4 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -139,6 +139,11 @@ size_t strnlen(const char *s, size_t n) } #endif +const F32 MAX_HOVER_Z = 2.0; +const F32 MIN_HOVER_Z = -2.0; + +// #define OUTPUT_BREAST_DATA + using namespace LLAvatarAppearanceDefines; //----------------------------------------------------------------------------- @@ -1091,6 +1096,7 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mFreezeTimeLangolier = freeze_time; //VTResume(); // VTune + setHoverOffset(LLVector3(0.0, 0.0, 0.0)); // mVoiceVisualizer is created by the hud effects manager and uses the HUD Effects pipeline const bool needsSendToSim = false; // currently, this HUD effect doesn't need to pack and unpack data to do its job @@ -3817,7 +3823,8 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage")) { S32 central_bake_version = -1; - if (getRegion()) + LLViewerRegion* region = getRegion(); + if (region) { central_bake_version = getRegion()->getCentralBakeVersion(); } @@ -3830,9 +3837,10 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) mUseServerBakes, central_bake_version); std::string origin_string = bakedTextureOriginInfo(); debug_line += " [" + origin_string + "]"; - S32 curr_cof_version = LLAppearanceMgr::instance().getCOFVersion(); - S32 last_request_cof_version = LLAppearanceMgr::instance().getLastUpdateRequestCOFVersion(); - S32 last_received_cof_version = LLAppearanceMgr::instance().getLastAppearanceUpdateCOFVersion(); + const LLAppearanceMgr& appmgr(LLAppearanceMgr::instance()); + S32 curr_cof_version = appmgr.getCOFVersion(); + S32 last_request_cof_version = appmgr.getLastUpdateRequestCOFVersion(); + S32 last_received_cof_version = appmgr.getLastAppearanceUpdateCOFVersion(); if (isSelf()) { debug_line += llformat(" - cof: %d req: %d rcv:%d", @@ -3842,6 +3850,16 @@ 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 = region && region->avatarHoverHeightEnabled(); + debug_line += hover_enabled ? " H" : " h"; + const LLVector3& hover_offset = getHoverOffset(); + if (hover_offset[2] != 0.0) + { + debug_line += llformat(" hov_z: %f", hover_offset[2]); + debug_line += llformat(" %s", (mIsSitting ? "S" : "T")); + debug_line += llformat("%s", (isMotionActive(ANIM_AGENT_SIT_GROUND_CONSTRAINED) ? "G" : "-")); + } addDebugText(debug_line); } if (gSavedSettings.getBOOL("DebugAvatarCompositeBaked")) @@ -4023,6 +4041,9 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) LLVector3 xyVel = getVelocity(); xyVel.mV[VZ] = 0.0f; speed = xyVel.length(); + // remembering the value here prevents a display glitch if the + // animation gets toggled during this update. + bool was_sit_ground_constrained = isMotionActive(ANIM_AGENT_SIT_GROUND_CONSTRAINED); if (!(mIsSitting && getParent())) { @@ -4079,6 +4100,10 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) // correct for the fact that the pelvis is not necessarily the center // of the agent's physical representation root_pos.mdV[VZ] -= (0.5f * mBodySize.mV[VZ]) - mPelvisToFoot; + if (!mIsSitting && !was_sit_ground_constrained) + { + root_pos += LLVector3d(getHoverOffset()); + } LLVector3 newPosition = gAgent.getPosAgentFromGlobal(root_pos); @@ -4256,8 +4281,11 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) } else if (mDrawable.notNull()) { - mRoot->setPosition(mDrawable->getPosition()); - mRoot->setRotation(mDrawable->getRotation()); + LLVector3 pos = mDrawable->getPosition(); + const LLQuaternion& rot = mDrawable->getRotation(); + pos += getHoverOffset() * rot; + mRoot->setPosition(pos); + mRoot->setRotation(rot); } //------------------------------------------------------------------------- @@ -4272,6 +4300,19 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) else updateMotions(LLCharacter::NORMAL_UPDATE); + // Special handling for sitting on ground. + if (!getParent() && (mIsSitting || was_sit_ground_constrained)) + { + F32 off_z = LLVector3d(getHoverOffset()).mdV[VZ]; + if (off_z != 0.0) + { + LLVector3 pos = mRoot->getWorldPosition(); + pos.mV[VZ] += off_z; + mRoot->touch(); + mRoot->setWorldPosition(pos); + } + } + // update head position updateHeadOffset(); @@ -7934,6 +7975,8 @@ struct LLAppearanceMessageContents //U32 appearance_flags = 0; std::vector mParamWeights; std::vector mParams; + LLVector3 mHoverOffset; + bool mHoverOffsetWasSet; }; void LLVOAvatar::parseAppearanceMessage(LLMessageSystem* mesgsys, LLAppearanceMessageContents& contents) @@ -7952,6 +7995,17 @@ void LLVOAvatar::parseAppearanceMessage(LLMessageSystem* mesgsys, LLAppearanceMe //mesgsys->getU32Fast(_PREHASH_AppearanceData, _PREHASH_Flags, appearance_flags, 0); } + // Parse the AppearanceHover field, if any. + contents.mHoverOffsetWasSet = false; + if (mesgsys->has(_PREHASH_AppearanceHover)) + { + LLVector3 hover; + mesgsys->getVector3Fast(_PREHASH_AppearanceHover, _PREHASH_HoverHeight, hover); + LL_DEBUGS("Avatar") << avString() << " hover received " << hover.mV[ VX ] << "," << hover.mV[ VY ] << "," << hover.mV[ VZ ] << LL_ENDL; + contents.mHoverOffset = hover; + contents.mHoverOffsetWasSet = true; + } + // Parse visual params, if any. S32 num_blocks = mesgsys->getNumberOfBlocksFast(_PREHASH_VisualParam); bool drop_visual_params_debug = gSavedSettings.getBOOL("BlockSomeAvatarAppearanceVisualParams") && (ll_rand(2) == 0); // pretend that ~12% of AvatarAppearance messages arrived without a VisualParam block, for testing @@ -8264,6 +8318,22 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) } } + if (contents.mHoverOffsetWasSet && !isSelf()) + { + // Got an update for some other avatar + // Ignore updates for self, because we have a more authoritative value in the preferences. + setHoverOffset(contents.mHoverOffset); + LL_INFOS("Avatar") << avString() << "setting hover from message" << contents.mHoverOffset[2] << LL_ENDL; + } + + if (!contents.mHoverOffsetWasSet && !isSelf()) + { + // If we don't get a value at all, we are presumably in a + // region that does not support hover height. + llwarns << avString() << "zeroing hover because not defined in appearance message" << LL_ENDL; + setHoverOffset(LLVector3(0.0, 0.0, 0.0)); + } + setCompositeUpdatesEnabled( TRUE ); // If all of the avatars are completely baked, release the global image caches to conserve memory. diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 6dd1f0b71..ba38d5be1 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -1076,6 +1076,9 @@ private: 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; + void dump_sequential_xml(const std::string outprefix, const LLSD& content); #endif // LL_VOAVATAR_H diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index c77914e36..9a17ba3e6 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -136,6 +136,11 @@ struct LocalTextureData LLTextureEntry *mTexEntry; }; +// TODO - this class doesn't really do anything, could just use a base +// class responder if nothing else gets added. +// Singu Note: Okay, sure, it's a responder ignore then! +typedef LLHTTPClient::ResponderIgnore LLHoverHeightResponder; + //----------------------------------------------------------------------------- // Callback data //----------------------------------------------------------------------------- @@ -172,7 +177,10 @@ LLVOAvatarSelf::LLVOAvatarSelf(const LLUUID& id, mScreenp(NULL), mLastRegionHandle(0), mRegionCrossingCount(0), - mInitialBakesLoaded(false) + mInitialBakesLoaded(false), + // Value outside legal range, so will always be a mismatch the + // first time through. + mLastHoverOffsetSent(LLVector3(0.0f, 0.0f, -999.0f)) { gAgentWearables.setAvatarObject(this); gAgentCamera.setAvatarObject(this); @@ -259,11 +267,40 @@ void LLVOAvatarSelf::initInstance() return; } + setHoverIfRegionEnabled(); + //doPeriodically(output_self_av_texture_diagnostics, 30.0); doPeriodically(update_avatar_rez_metrics, 5.0); doPeriodically(check_for_unsupported_baked_appearance, 120.0); } +void LLVOAvatarSelf::setHoverIfRegionEnabled() +{ + LLViewerRegion* region = getRegion(); + if (region && region->simulatorFeaturesReceived()) + { + if (region->avatarHoverHeightEnabled()) + { + F32 hover_z = gSavedPerAccountSettings.getF32("AvatarHoverOffsetZ"); + setHoverOffset(LLVector3(0.0, 0.0, llclamp(hover_z,MIN_HOVER_Z,MAX_HOVER_Z))); + LL_INFOS("Avatar") << avString() << " set hover height from debug setting " << hover_z << LL_ENDL; + } + else + { + setHoverOffset(LLVector3(0.0, 0.0, 0.0)); + LL_INFOS("Avatar") << avString() << " zeroing hover height, region does not support" << LL_ENDL; + } + } + else + { + LL_INFOS("Avatar") << avString() << " region or simulator features not known, no change on hover" << LL_ENDL; + if (region) + { + region->setSimulatorFeaturesReceivedCallback(boost::bind(&LLVOAvatarSelf::onSimulatorFeaturesReceived,this,_1)); + } + } +} + // virtual void LLVOAvatarSelf::markDead() { @@ -808,6 +845,12 @@ void LLVOAvatarSelf::removeMissingBakedTextures() } } +void LLVOAvatarSelf::onSimulatorFeaturesReceived(const LLUUID& region_id) +{ + LL_INFOS("Avatar") << "simulator features received, setting hover based on region props" << LL_ENDL; + setHoverIfRegionEnabled(); +} + //virtual void LLVOAvatarSelf::updateRegion(LLViewerRegion *regionp) { @@ -826,6 +869,17 @@ void LLVOAvatarSelf::updateRegion(LLViewerRegion *regionp) //LL_INFOS() << "pos_from_old_region is " << global_pos_from_old_region // << " while pos_from_new_region is " << pos_from_new_region // << LL_ENDL; + + // Update hover height, or schedule callback, based on whether + // it's supported in this region. + if (regionp->simulatorFeaturesReceived()) + { + setHoverIfRegionEnabled(); + } + else + { + regionp->setSimulatorFeaturesReceivedCallback(boost::bind(&LLVOAvatarSelf::onSimulatorFeaturesReceived,this,_1)); + } } if (!regionp || (regionp->getHandle() != mLastRegionHandle)) @@ -3051,6 +3105,39 @@ bool LLVOAvatarSelf::sendAppearanceMessage(LLMessageSystem *mesgsys) const return success; } +//------------------------------------------------------------------------ +// sendHoverHeight() +//------------------------------------------------------------------------ +void LLVOAvatarSelf::sendHoverHeight() const +{ + std::string url = gAgent.getRegion()->getCapability("AgentPreferences"); + + if (!url.empty()) + { + LLSD update = LLSD::emptyMap(); + const LLVector3& hover_offset = getHoverOffset(); + update["hover_height"] = hover_offset[2]; + + LL_DEBUGS("Avatar") << avString() << "sending hover height value " << hover_offset[2] << LL_ENDL; + LLHTTPClient::post(url, update, new LLHoverHeightResponder); + + mLastHoverOffsetSent = hover_offset; + } +} + +void LLVOAvatarSelf::setHoverOffset(const LLVector3& hover_offset, bool send_update) +{ + if (getHoverOffset() != hover_offset) + { + LL_INFOS("Avatar") << avString() << " setting hover due to change " << hover_offset[2] << LL_ENDL; + LLVOAvatar::setHoverOffset(hover_offset, send_update); + } + if (send_update && (hover_offset != mLastHoverOffsetSent)) + { + LL_INFOS("Avatar") << avString() << " sending hover due to change " << hover_offset[2] << LL_ENDL; + sendHoverHeight(); + } +} //------------------------------------------------------------------------ // needsRenderBeam() diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index fea466775..4de2ac8f6 100644 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -84,6 +84,9 @@ protected: // LLViewerObject interface and related //-------------------------------------------------------------------- public: + boost::signals2::connection mRegionChangedSlot; + + void onSimulatorFeaturesReceived(const LLUUID& region_id); /*virtual*/ void updateRegion(LLViewerRegion *regionp); /*virtual*/ void idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time); @@ -356,6 +359,14 @@ public: public: bool sendAppearanceMessage(LLMessageSystem *mesgsys) const; + // -- care and feeding of hover height. + void setHoverIfRegionEnabled(); + void sendHoverHeight() const; + /*virtual*/ void setHoverOffset(const LLVector3& hover_offset, bool send_update=true); + +private: + mutable LLVector3 mLastHoverOffsetSent; + public: LLVector3 getLegacyAvatarOffset() const; diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index ed2a77155..8a5f2a299 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -3743,7 +3743,7 @@ void LLVivoxVoiceClient::messageEvent( sessionState *session = findSession(sessionHandle); if(session) { - bool is_do_not_disturb = gAgent.getBusy(); + bool is_do_not_disturb = gAgent.isDoNotDisturb(); bool is_muted = LLMuteList::getInstance()->isMuted(session->mCallerID, session->mName, LLMute::flagTextChat); bool is_linden = LLMuteList::getInstance()->isLinden(session->mName); LLChat chat; diff --git a/indra/newview/skins/default/xui/en-us/floater_about.xml b/indra/newview/skins/default/xui/en-us/floater_about.xml index a94a96aa9..266555ca1 100644 --- a/indra/newview/skins/default/xui/en-us/floater_about.xml +++ b/indra/newview/skins/default/xui/en-us/floater_about.xml @@ -12,7 +12,7 @@ -Singularity Viewer is developed and maintained by Siana Gearz, Shyotl Kuhr, Aleric Inglewood, Narv Czervik, Tigh MacFanatic, Inusaito Kanya, Sovereign Engineer and Latif Khalifa, with contributions by Damian Zhaoying, Fractured Crystal, Franxisco Romano, Fritigern Gothly, Henri Beauchamp, Kadah Coba, Kitty Barnett, Knolan Falconer, McCabe Maxsted, nhede Core, Nomade Zhao, Revolution Smythe, Selvone Franizzi, Thickbrick Sleaford, Wolfspirit Magic, Zauber Parecelsus and others. Singularity is based upon Ascent source code. Credits for Ascent include Hg Beeks, Charley Levenque, Hazim Gazov, Zwagoth Klaar, Qarl Fizz, and others. Ascent is based upon the Inertia source code. +Singularity Viewer is developed and maintained by Siana Gearz, Shyotl Kuhr, Inusaito Kanya, Aleric Inglewood, Tigh MacFanatic, Sovereign Engineer and Cinder Roxley, with contributions by Damian Zhaoying, Fractured Crystal, Franxisco Romano, Fritigern Gothly, Henri Beauchamp, Kadah Coba, Kitty Barnett, Knolan Falconer, Latif Khalifa, McCabe Maxsted, Narv Czervik, nhede Core, Nomade Zhao, Revolution Smythe, Selvone Franizzi, Sim Federal, Thickbrick Sleaford, Wolfspirit Magic, Zauber Parecelsus and others. Singularity is based upon Ascent source code. Credits for Ascent include Hg Beeks, Charley Levenque, Hazim Gazov, Zwagoth Klaar, Qarl Fizz, and others. Ascent is based upon the Inertia source code. Singularity Viewer includes source code contributions of the following residents: Able Whitman, Adam Marker, Agathos Frascati, Aimee Trescothick, Alejandro Rosenthal, Aleric Inglewood, Alissa Sabre, Angus Boyd, Ann Congrejo, Argent Stonecutter, Asuka Neely, Balp Allen, Benja Kepler, Biancaluce Robbiani, Blakar Ogre, blino Nakamura, Boroondas Gupte, Bulli Schumann, bushing Spatula, Carjay McGinnis, Catherine Pfeffer, Celierra Darling, Cron Stardust, Dale Glass, Drewan Keats, Dylan Haskell, Dzonatas Sol, Eddy Stryker, EponymousDylan Ra, Eva Nowicka, Farallon Greyskin, Feep Larsson, Flemming Congrejo, Fluf Fredriksson, Fractured Crystal, Fremont Cunningham, Geneko Nemeth, Gigs Taggart, Ginko Bayliss, Grazer Kline, Gudmund Shepherd, Hamncheese Omlet, HappySmurf Papp, Henri Beauchamp, Hikkoshi Sakai, Hiro Sommambulist, Hoze Menges, Ian Kas, Irene Muni, Iskar Ariantho, Jacek Antonelli, JB Kraft, Joghert LeSabre, Kage Pixel, Ken March, Kerutsen Sellery, Khyota Wulluf, Kunnis Basiat, Lisa Lowe, Lockhart Cordoso, maciek marksman, Magnus Balczo, Malwina Dollinger, march Korda, Matthew Dowd, McCabe Maxsted, Michelle2 Zenovka, Mm Alder, Mr Greggan, Nicholaz Beresford, Nounouch Hapmouche, Patric Mills, Paul Churchill, Paula Innis, Peekay Semyorka, Peter Lameth, Pf Shan, princess niven, Renault Clio, Ringo Tuxing, Robin Cornelius, Ryozu Kojima, Salahzar Stenvaag, Sammy Frederix, Scrippy Scofield, Seg Baphomet, Sergen Davies, SignpostMarv Martin, Simon Nolan, SpacedOut Frye, Sporked Friis, Stevex Janus, Still Defiant, Strife Onizuka, Tayra Dagostino, TBBle Kurosawa, Teardrops Fall, tenebrous pau, Tharax Ferraris, Thickbrick Sleaford, Thraxis Epsilon, tiamat bingyi, TraductoresAnonimos Alter, Tue Torok, Vadim Bigbear, Vixen Heron, Whoops Babii, Wilton Lundquist, Zarkonnen Decosta, Zi Ree, and Zipherius Turas. diff --git a/indra/newview/skins/default/xui/en-us/panel_overlaybar.xml b/indra/newview/skins/default/xui/en-us/panel_overlaybar.xml index 4fb9d4d4a..1e32d9d43 100644 --- a/indra/newview/skins/default/xui/en-us/panel_overlaybar.xml +++ b/indra/newview/skins/default/xui/en-us/panel_overlaybar.xml @@ -1,7 +1,7 @@ - Open url/slurl (usage: cmd slurl) + Resync Animations (usage: cmd) + - - Change Draw Distance (usage: cmd meters) + + Change Draw Distance (usage: cmd meters) Teleport to cam position (usage: cmd) @@ -82,6 +83,8 @@ Send region message (usage: cmd msg) + Hover Height (usage: cmd height) + @@ -98,6 +101,7 @@ + diff --git a/indra/newview/skins/default/xui/en-us/wlfPanel_AdvSettings_expanded.xml b/indra/newview/skins/default/xui/en-us/wlfPanel_AdvSettings_expanded.xml index 424be37ec..4b3c5caf0 100644 --- a/indra/newview/skins/default/xui/en-us/wlfPanel_AdvSettings_expanded.xml +++ b/indra/newview/skins/default/xui/en-us/wlfPanel_AdvSettings_expanded.xml @@ -1,8 +1,8 @@ - - - Cam Preset: - + diff --git a/indra/newview/wlfPanel_AdvSettings.cpp b/indra/newview/wlfPanel_AdvSettings.cpp index bb40fb896..a69de701e 100644 --- a/indra/newview/wlfPanel_AdvSettings.cpp +++ b/indra/newview/wlfPanel_AdvSettings.cpp @@ -47,13 +47,21 @@ #include "llfloaterwindlight.h" #include "llfloaterwater.h" +#include "llagent.h" #include "llagentcamera.h" #include "lldaycyclemanager.h" #include "llenvmanager.h" +#include "llviewerregion.h" +#include "llvoavatarself.h" #include "llwaterparammanager.h" #include "llwlparamset.h" #include "llwlparammanager.h" +// Hover funcs +void syncFromPreferenceSetting(LLSliderCtrl* sldrCtrl); +void onHoverSliderMoved(const LLSD& val); +void onHoverSliderFinalCommit(const LLSD& val); + wlfPanel_AdvSettings::wlfPanel_AdvSettings() : mExpanded(false) { setVisible(false); @@ -76,6 +84,7 @@ void wlfPanel_AdvSettings::build() mConnections.clear(); deleteAllChildren(); mExpanded = gSavedSettings.getBOOL("wlfAdvSettingsPopup"); + if (mRegionChangedSlot.connected()) mRegionChangedSlot.disconnect(); LLUICtrlFactory::instance().buildPanel(this, mExpanded ? "wlfPanel_AdvSettings_expanded.xml" : "wlfPanel_AdvSettings.xml", &getFactoryMap()); } @@ -140,6 +149,7 @@ BOOL wlfPanel_AdvSettings::postBuild() if (mExpanded) { + // Windlight getChild("use_estate_wl")->setCommitCallback(boost::bind(&wlfPanel_AdvSettings::onUseRegionSettings, this, _2)); mWaterPresetCombo = getChild("WLWaterPresetsCombo"); @@ -174,6 +184,7 @@ BOOL wlfPanel_AdvSettings::postBuild() updateTimeSlider(); updateRlvVisibility(); + // Camera Presets const U32 preset(gSavedSettings.getU32("CameraPreset")); if (preset == CAMERA_PRESET_REAR_VIEW) getChildView("Rear")->setValue(true); @@ -181,6 +192,35 @@ BOOL wlfPanel_AdvSettings::postBuild() getChildView("Front")->setValue(true); else if (preset == CAMERA_PRESET_GROUP_VIEW) getChildView("Group")->setValue(true); + + // Hover height + mHoverHeight = getChild("HoverHeightSlider"); + mHoverHeight->setMinValue(MIN_HOVER_Z); + mHoverHeight->setMaxValue(MAX_HOVER_Z); + mHoverHeight->setSliderMouseUpCallback(boost::bind(onHoverSliderFinalCommit, _2)); + mHoverHeight->setSliderEditorCommitCallback(boost::bind(onHoverSliderFinalCommit, _2)); + mHoverHeight->setCommitCallback(boost::bind(onHoverSliderMoved, _2)); + + // Initialize slider from pref setting. + syncFromPreferenceSetting(mHoverHeight); + // Update slider on future pref changes. + if (LLControlVariable* control = gSavedPerAccountSettings.getControl("AvatarHoverOffsetZ")) + { + control->getCommitSignal()->connect(boost::bind(&syncFromPreferenceSetting, mHoverHeight)); + } + else + { + llwarns << "Control not found for AvatarHoverOffsetZ" << LL_ENDL; + } + + updateEditHoverEnabled(); + + if (!mRegionChangedSlot.connected()) + { + mRegionChangedSlot = gAgent.addRegionChangedCallback(boost::bind(&wlfPanel_AdvSettings::onRegionChanged, this)); + } + // Set up based on initial region. + onRegionChanged(); } return TRUE; } @@ -411,3 +451,71 @@ void wlfPanel_AdvSettings::updateTimeSlider() } mTimeSlider->setValue(val); } + +// Hover junk +void syncFromPreferenceSetting(LLSliderCtrl* sldrCtrl) +{ + F32 value = gSavedPerAccountSettings.getF32("AvatarHoverOffsetZ"); + + sldrCtrl->setValue(value,FALSE); + + if (isAgentAvatarValid()) + { + LLVector3 offset(0.0, 0.0, llclamp(value,MIN_HOVER_Z,MAX_HOVER_Z)); + LL_INFOS("Avatar") << "setting hover from preference setting " << offset[2] << LL_ENDL; + gAgentAvatarp->setHoverOffset(offset); + } +} + +void onHoverSliderMoved(const LLSD& val) +{ + F32 value = val.asFloat(); + LLVector3 offset(0.0, 0.0, llclamp(value,MIN_HOVER_Z,MAX_HOVER_Z)); + LL_INFOS("Avatar") << "setting hover from slider moved" << offset[2] << LL_ENDL; + gAgentAvatarp->setHoverOffset(offset, false); +} + +// Do send-to-the-server work when slider drag completes, or new +// value entered as text. +void onHoverSliderFinalCommit(const LLSD& val) +{ + F32 value = val.asFloat(); + gSavedPerAccountSettings.setF32("AvatarHoverOffsetZ", value); + + LLVector3 offset(0.0, 0.0, llclamp(value,MIN_HOVER_Z,MAX_HOVER_Z)); + LL_INFOS("Avatar") << "setting hover from slider final commit " << offset[2] << LL_ENDL; + gAgentAvatarp->setHoverOffset(offset, true); // will send update this time. +} + +void wlfPanel_AdvSettings::onRegionChanged() +{ + LLViewerRegion* region = gAgent.getRegion(); + if (region && region->simulatorFeaturesReceived()) + { + updateEditHoverEnabled(); + } + else if (region) + { + region->setSimulatorFeaturesReceivedCallback(boost::bind(&wlfPanel_AdvSettings::onSimulatorFeaturesReceived, this, _1)); + } +} + +void wlfPanel_AdvSettings::onSimulatorFeaturesReceived(const LLUUID& region_id) +{ + const LLViewerRegion* region = gAgent.getRegion(); + if (region && (region->getRegionID()==region_id)) + { + updateEditHoverEnabled(); + } +} + +void wlfPanel_AdvSettings::updateEditHoverEnabled() +{ + const LLViewerRegion* region = gAgent.getRegion(); + bool enabled = region && region->avatarHoverHeightEnabled(); + mHoverHeight->setEnabled(enabled); + if (enabled) + { + syncFromPreferenceSetting(mHoverHeight); + } +} diff --git a/indra/newview/wlfPanel_AdvSettings.h b/indra/newview/wlfPanel_AdvSettings.h index 17b2ddc9a..1bf1b9691 100644 --- a/indra/newview/wlfPanel_AdvSettings.h +++ b/indra/newview/wlfPanel_AdvSettings.h @@ -79,14 +79,20 @@ protected: // void populateDayCyclePresetsList(); void updateTimeSlider(); + void onRegionChanged(); + void onSimulatorFeaturesReceived(const LLUUID& region_id); + void updateEditHoverEnabled(); + LLComboBox* mWaterPresetCombo; LLComboBox* mSkyPresetCombo; // LLComboBox* mDayCyclePresetCombo; LLSliderCtrl* mTimeSlider; + LLSliderCtrl* mHoverHeight; bool mExpanded; boost::ptr_list mConnections; + boost::signals2::connection mRegionChangedSlot; }; #endif // LL_wlfPanel_AdvSettings_H diff --git a/scripts/messages/message_template.msg b/scripts/messages/message_template.msg index 1ec83cb85..ce7e2a442 100644 --- a/scripts/messages/message_template.msg +++ b/scripts/messages/message_template.msg @@ -3594,6 +3594,10 @@ version 2.0 { CofVersion S32 } { Flags U32 } } + { + AppearanceHover Variable + { HoverHeight LLVector3 } + } } // AvatarSitResponse - response to a request to sit on an object