diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index d07a0dc159..6f149234e4 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -97,6 +97,7 @@ LLButton::Params::Params() image_overlay_disabled_color("image_overlay_disabled_color", LLColor4::white % 0.3f), image_overlay_selected_color("image_overlay_selected_color", LLColor4::white), flash_color("flash_color"), + flash_alt_color("flash_alt_color"), // [FS communication UI] pad_right("pad_right", LLBUTTON_H_PAD), pad_left("pad_left", LLBUTTON_H_PAD), pad_bottom("pad_bottom"), @@ -134,6 +135,7 @@ LLButton::LLButton(const LLButton::Params& p) mMouseDownFrame(0), mMouseHeldDownCount(0), mFlashing( false ), + mIsAltFlashColor(false), // [FS communication UI] mCurGlowStrength(0.f), mNeedsHighlight(false), mUnselectedLabel(p.label()), @@ -156,6 +158,7 @@ LLButton::LLButton(const LLButton::Params& p) mDisabledSelectedLabelColor(p.label_color_disabled_selected()), mImageColor(p.image_color()), mFlashBgColor(p.flash_color()), + mFlashAltBgColor(p.flash_alt_color()), // [FS communication UI] mDisabledImageColor(p.image_color_disabled()), mImageOverlay(p.image_overlay()), mImageOverlayColor(p.image_overlay_color()), @@ -840,7 +843,10 @@ void LLButton::draw() // provide fade-in and fade-out via flash_color if (mFlashingTimer) { - LLColor4 flash_color = mFlashBgColor.get(); + // [FS communication UI] + //LLColor4 flash_color = mFlashBgColor.get(); + LLColor4 flash_color = mIsAltFlashColor ? mFlashAltBgColor.get() : mFlashBgColor.get(); + // [FS communication UI] use_glow_effect = true; glow_type = LLRender::BT_ALPHA; // blend the glow @@ -1118,7 +1124,10 @@ void LLButton::setToggleState(bool b) } } -void LLButton::setFlashing(bool b, bool force_flashing/* = false */) +// [FS communication UI] +//void LLButton::setFlashing(bool b, bool force_flashing/* = false */) +void LLButton::setFlashing(bool b, bool force_flashing/* = false */, bool alternate_color/*= false */) +// [FS communication UI] { mForceFlashing = force_flashing; if (mFlashingTimer) @@ -1131,6 +1140,9 @@ void LLButton::setFlashing(bool b, bool force_flashing/* = false */) mFlashing = b; mFrameTimer.reset(); } + + // [FS communication UI] + mIsAltFlashColor = alternate_color; } bool LLButton::toggleState() diff --git a/indra/llui/llbutton.h b/indra/llui/llbutton.h index 43a7cd6b3b..ad6d911a67 100644 --- a/indra/llui/llbutton.h +++ b/indra/llui/llbutton.h @@ -100,7 +100,9 @@ public: image_overlay_color, image_overlay_selected_color, image_overlay_disabled_color, - flash_color; + flash_color, + flash_alt_color; // [FS communication UI] + // layout Optional pad_right; @@ -217,7 +219,10 @@ public: void setToggleState(bool b); void setHighlight(bool b); - void setFlashing( bool b, bool force_flashing = false ); + // [FS communication UI] + //void setFlashing( bool b, bool force_flashing = false ); + void setFlashing(bool b, bool force_flashing = false, bool alternate_color = false); + // [FS communication UI] bool getFlashing() const { return mFlashing; } LLFlashTimer* getFlashTimer() {return mFlashingTimer;} void setFlashColor(const LLUIColor &color) { mFlashBgColor = color; }; @@ -361,6 +366,8 @@ protected: LLPointer mImageFlash; LLUIColor mFlashBgColor; + // [FS communication UI] + LLUIColor mFlashAltBgColor; LLUIColor mImageColor; LLUIColor mDisabledImageColor; @@ -373,6 +380,8 @@ protected: bool mUseEllipses; bool mUseFontColor; bool mFlashing; + // [FS communication UI] + bool mIsAltFlashColor; LLFontGL::HAlign mHAlign; S32 mLeftHPad; diff --git a/indra/llui/llmultifloater.cpp b/indra/llui/llmultifloater.cpp index 355e5ad13b..e668939263 100644 --- a/indra/llui/llmultifloater.cpp +++ b/indra/llui/llmultifloater.cpp @@ -461,10 +461,16 @@ bool LLMultiFloater::isFloaterFlashing(LLFloater* floaterp) Requires: floaterp != NULL **/ -void LLMultiFloater::setFloaterFlashing(LLFloater* floaterp, bool flashing) +// [FS communication UI] +//void LLMultiFloater::setFloaterFlashing(LLFloater* floaterp, bool flashing) +void LLMultiFloater::setFloaterFlashing(LLFloater* floaterp, bool flashing, bool alternate_color) +// [FS communication UI] { if ( floaterp && floaterp->getHost() == this ) - mTabContainer->setTabPanelFlashing(floaterp, flashing); + // [FS communication UI] + //mTabContainer->setTabPanelFlashing(floaterp, flashing); + mTabContainer->setTabPanelFlashing(floaterp, flashing, alternate_color); + // [FS communication UI] } void LLMultiFloater::onTabSelected() diff --git a/indra/llui/llmultifloater.h b/indra/llui/llmultifloater.h index 95e3b2d788..75f92a33cd 100644 --- a/indra/llui/llmultifloater.h +++ b/indra/llui/llmultifloater.h @@ -68,7 +68,10 @@ public: virtual bool isFloaterFlashing(LLFloater* floaterp); virtual S32 getFloaterCount() const; - virtual void setFloaterFlashing(LLFloater* floaterp, bool flashing); + // [FS communication UI] + //virtual void setFloaterFlashing(LLFloater* floaterp, bool flashing); + virtual void setFloaterFlashing(LLFloater* floaterp, bool flashing, bool alternate_color = false); + // [FS communication UI] virtual bool closeAllFloaters(); //Returns false if the floater could not be closed due to pending confirmation dialogs // Update torn off status and add title bar //void setTabContainer(LLTabContainer* tab_container) { if (!mTabContainer) mTabContainer = tab_container; } // LL Code diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index a800c9891f..8c9888c029 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -1806,12 +1806,18 @@ bool LLTabContainer::getTabPanelFlashing(LLPanel *child) return false; } -void LLTabContainer::setTabPanelFlashing(LLPanel* child, bool state ) +// [FS communication UI] +//void LLTabContainer::setTabPanelFlashing(LLPanel* child, bool state ) +void LLTabContainer::setTabPanelFlashing(LLPanel* child, bool state, bool alternate_color) +// [FS communication UI] { LLTabTuple* tuple = getTabByPanel(child); if( tuple ) { - tuple->mButton->setFlashing( state ); + // [FS communication UI] + //tuple->mButton->setFlashing( state ); + tuple->mButton->setFlashing(state, false, alternate_color); + // [FS communication UI] } } diff --git a/indra/llui/lltabcontainer.h b/indra/llui/lltabcontainer.h index 243687623d..937e939eb6 100644 --- a/indra/llui/lltabcontainer.h +++ b/indra/llui/lltabcontainer.h @@ -222,7 +222,10 @@ public: void setCurrentPanelIndex(S32 index) { mCurrentTabIdx = index; } bool getTabPanelFlashing(LLPanel* child); - void setTabPanelFlashing(LLPanel* child, bool state); + // [FS communication UI] + //void setTabPanelFlashing(LLPanel* child, bool state); + void setTabPanelFlashing(LLPanel* child, bool state, bool alternate_color = false); + // [FS communication UI] void setTabImage(LLPanel* child, std::string img_name, const LLColor4& color = LLColor4::white); void setTabImage(LLPanel* child, const LLUUID& img_id, const LLColor4& color = LLColor4::white); void setTabImage(LLPanel* child, LLIconCtrl* icon); diff --git a/indra/newview/fsfloaterimcontainer.cpp b/indra/newview/fsfloaterimcontainer.cpp index 1fc05de338..a4db0dc21a 100644 --- a/indra/newview/fsfloaterimcontainer.cpp +++ b/indra/newview/fsfloaterimcontainer.cpp @@ -39,6 +39,7 @@ #include "llchicletbar.h" #include "llemojihelper.h" #include "lltoolbarview.h" +#include "llurlregistry.h" #include "llvoiceclient.h" constexpr F32 VOICE_STATUS_UPDATE_INTERVAL = 1.0f; @@ -316,6 +317,9 @@ void FSFloaterIMContainer::removeFloater(LLFloater* floaterp) gSavedSettings.setBOOL(setting_name, true); floaterp->setCanClose(true); } + + mFlashingTabStates.erase(floaterp); + LLMultiFloater::removeFloater(floaterp); } // [/SL:KB] @@ -345,21 +349,17 @@ void FSFloaterIMContainer::onCloseFloater(LLUUID& id) } } -void FSFloaterIMContainer::onNewMessageReceived(const LLSD& data) +void FSFloaterIMContainer::onNewMessageReceived(const LLSD& msg) { - LLUUID session_id = data["session_id"].asUUID(); + LLUUID session_id = msg["session_id"].asUUID(); LLFloater* floaterp = get_ptr_in_map(mSessions, session_id); LLFloater* current_floater = LLMultiFloater::getActiveFloater(); // KC: Don't flash tab on friend status changes per setting if (floaterp && current_floater && floaterp != current_floater - && (gSavedSettings.getBOOL("FSIMChatFlashOnFriendStatusChange") || !data.has("from_id") || data["from_id"].asUUID().notNull())) + && (gSavedSettings.getBOOL("FSIMChatFlashOnFriendStatusChange") || !msg.has("from_id") || msg["from_id"].asUUID().notNull())) { - if (LLMultiFloater::isFloaterFlashing(floaterp)) - { - LLMultiFloater::setFloaterFlashing(floaterp, false); - } - LLMultiFloater::setFloaterFlashing(floaterp, true); + startFlashingTab(floaterp, msg["message"].asString()); } } @@ -559,16 +559,15 @@ void FSFloaterIMContainer::addFlashingSession(const LLUUID& session_id) uuid_vec_t::iterator found = std::find(mFlashingSessions.begin(), mFlashingSessions.end(), session_id); if (found == mFlashingSessions.end()) { - mFlashingSessions.push_back(session_id); + mFlashingSessions.emplace_back(session_id); } + + checkFlashing(); } void FSFloaterIMContainer::checkFlashing() { - if (mFlashingSessions.empty()) - { - gToolBarView->flashCommand(LLCommandId("chat"), false); - } + gToolBarView->flashCommand(LLCommandId("chat"), !mFlashingSessions.empty(), isMinimized()); } void FSFloaterIMContainer::sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id) @@ -584,5 +583,21 @@ void FSFloaterIMContainer::sessionIDUpdated(const LLUUID& old_session_id, const void FSFloaterIMContainer::tabOpen(LLFloater* opened_floater, bool from_click) { LLEmojiHelper::instance().hideHelper(nullptr, true); + + mFlashingTabStates.erase(opened_floater); +} + +void FSFloaterIMContainer::startFlashingTab(LLFloater* floater, const std::string& message) +{ + const bool contains_mention = LLUrlRegistry::getInstance()->containsAgentMention(message); + + auto& [session_floater, is_alt_flashing] = *(mFlashingTabStates.try_emplace(floater, false).first); + is_alt_flashing = is_alt_flashing || contains_mention; + + if (LLMultiFloater::isFloaterFlashing(floater)) + { + LLMultiFloater::setFloaterFlashing(floater, false); + } + LLMultiFloater::setFloaterFlashing(floater, true, is_alt_flashing); } // EOF diff --git a/indra/newview/fsfloaterimcontainer.h b/indra/newview/fsfloaterimcontainer.h index af7ebdec35..50b9b36d1f 100644 --- a/indra/newview/fsfloaterimcontainer.h +++ b/indra/newview/fsfloaterimcontainer.h @@ -63,7 +63,7 @@ public: virtual void setVisible(bool b); /*virtual*/ void setMinimized(bool b); - void onNewMessageReceived(const LLSD& data); // public so nearbychat can call it directly. TODO: handle via callback. -AO + void onNewMessageReceived(const LLSD& msg); // public so nearbychat can call it directly. TODO: handle via callback. -AO virtual void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id, bool has_offline_msg); virtual void sessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) {}; @@ -78,6 +78,8 @@ public: void tabOpen(LLFloater* opened_floater, bool from_click); + void startFlashingTab(LLFloater* floater, const std::string& message); + private: enum eVoiceState { @@ -105,6 +107,8 @@ private: bool mIsAddingNewSession; + std::map mFlashingTabStates; + // [SL:KB] - Patch: UI-TabRearrange | Checked: 2012-05-05 (Catznip-3.3.0) protected: void onIMTabRearrange(S32 tab_index, LLPanel* tab_panel); diff --git a/indra/newview/fsfloaternearbychat.cpp b/indra/newview/fsfloaternearbychat.cpp index 67f8c6b34d..80e58347e8 100644 --- a/indra/newview/fsfloaternearbychat.cpp +++ b/indra/newview/fsfloaternearbychat.cpp @@ -276,11 +276,11 @@ void FSFloaterNearbyChat::addMessage(const LLChat& chat,bool archive,const LLSD // AO: IF tab mode active, flash our tab if (isChatMultiTab()) { - LLMultiFloater* hostp = getHost(); // KC: Don't flash tab on system messages - if (!isInVisibleChain() && hostp && (chat.mSourceType == CHAT_SOURCE_AGENT || chat.mSourceType == CHAT_SOURCE_OBJECT)) + if (FSFloaterIMContainer* container = dynamic_cast(getHost()); + !isInVisibleChain() && container && (chat.mSourceType == CHAT_SOURCE_AGENT || chat.mSourceType == CHAT_SOURCE_OBJECT)) { - hostp->setFloaterFlashing(this, true); + container->startFlashingTab(this, chat.mText); } } diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 4c88a4b814..37895abff6 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -468,7 +468,6 @@ void notify_of_message(const LLSD& msg, bool is_dnd_msg) && gSavedSettings.getBOOL("FSNotifyNearbyChatFlash")) { im_container->addFlashingSession(session_id); - gToolBarView->flashCommand(LLCommandId("chat"), true, im_container->isMinimized()); } return; } @@ -492,7 +491,6 @@ void notify_of_message(const LLSD& msg, bool is_dnd_msg) && gSavedSettings.getBOOL("FSNotifyIMFlash")) { im_container->addFlashingSession(session_id); - gToolBarView->flashCommand(LLCommandId("chat"), true, im_container->isMinimized()); } // (Group-)IMs in chat console diff --git a/indra/newview/skins/ansastorm/colors.xml b/indra/newview/skins/ansastorm/colors.xml index 882ca15d06..83300c00ae 100644 --- a/indra/newview/skins/ansastorm/colors.xml +++ b/indra/newview/skins/ansastorm/colors.xml @@ -1437,4 +1437,7 @@ + diff --git a/indra/newview/skins/ansastorm/themes/blood/colors.xml b/indra/newview/skins/ansastorm/themes/blood/colors.xml index b24d4988f7..8fa84ec3d3 100644 --- a/indra/newview/skins/ansastorm/themes/blood/colors.xml +++ b/indra/newview/skins/ansastorm/themes/blood/colors.xml @@ -1190,4 +1190,7 @@ + diff --git a/indra/newview/skins/ansastorm/themes/classic_brown/colors.xml b/indra/newview/skins/ansastorm/themes/classic_brown/colors.xml index 7b4d059737..f2b592947a 100644 --- a/indra/newview/skins/ansastorm/themes/classic_brown/colors.xml +++ b/indra/newview/skins/ansastorm/themes/classic_brown/colors.xml @@ -1430,4 +1430,7 @@ + diff --git a/indra/newview/skins/ansastorm/themes/ectoplasma/colors.xml b/indra/newview/skins/ansastorm/themes/ectoplasma/colors.xml index 39c6ad5bd0..1bf7400ef2 100644 --- a/indra/newview/skins/ansastorm/themes/ectoplasma/colors.xml +++ b/indra/newview/skins/ansastorm/themes/ectoplasma/colors.xml @@ -1178,4 +1178,7 @@ + diff --git a/indra/newview/skins/default/xui/en/widgets/button.xml b/indra/newview/skins/default/xui/en/widgets/button.xml index 7b2476fcf2..1722a5475a 100644 --- a/indra/newview/skins/default/xui/en/widgets/button.xml +++ b/indra/newview/skins/default/xui/en/widgets/button.xml @@ -18,6 +18,7 @@ image_color="ButtonImageColor" image_color_disabled="ButtonImageColor" flash_color="ButtonFlashBgColor" + flash_alt_color="MentionFlashBgColor" font="SansSerifSmall" hover_glow_amount="0.25" halign="center" diff --git a/indra/newview/skins/starlightcui/xui/en/widgets/button.xml b/indra/newview/skins/starlightcui/xui/en/widgets/button.xml index 0c60fc06cb..627feeff18 100644 --- a/indra/newview/skins/starlightcui/xui/en/widgets/button.xml +++ b/indra/newview/skins/starlightcui/xui/en/widgets/button.xml @@ -18,6 +18,7 @@ image_color="SL-CustomMain" image_color_disabled="ButtonImageColor" flash_color="SL-CustomMain" + flash_alt_color="MentionFlashBgColor" font="SansSerifSmall" hover_glow_amount="0.25" halign="center"