From ec6d5c4bba867e8d2e1ff55fac7bdae094ab1225 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Tue, 24 Feb 2015 13:36:24 +0100 Subject: [PATCH] Live update bumps floater while it is open --- indra/newview/llfloaterbump.cpp | 21 ++++++++++++++++++++- indra/newview/llfloaterbump.h | 8 ++++++++ indra/newview/llviewermessage.cpp | 18 ++++++++++++++++++ 3 files changed, 46 insertions(+), 1 deletion(-) diff --git a/indra/newview/llfloaterbump.cpp b/indra/newview/llfloaterbump.cpp index 33cc00f425..12e33c3750 100755 --- a/indra/newview/llfloaterbump.cpp +++ b/indra/newview/llfloaterbump.cpp @@ -45,7 +45,8 @@ // Default constructor LLFloaterBump::LLFloaterBump(const LLSD& key) -: LLFloater(key) +: LLFloater(key), + mDirty(false) // Instant bump list floater update { } @@ -68,6 +69,24 @@ BOOL LLFloaterBump::postBuild() // virtual void LLFloaterBump::onOpen(const LLSD& key) { +// Instant bump list floater update + updateList(); +} + +void LLFloaterBump::draw() +{ + if (mDirty) + { + updateList(); + mDirty = false; + } + + LLFloater::draw(); +} + +void LLFloaterBump::updateList() +{ +// LLScrollListCtrl* list = getChild("bump_list"); if (!list) return; diff --git a/indra/newview/llfloaterbump.h b/indra/newview/llfloaterbump.h index 8802e3d059..a2789d25b8 100755 --- a/indra/newview/llfloaterbump.h +++ b/indra/newview/llfloaterbump.h @@ -45,11 +45,19 @@ public: /*virtual*/ void onOpen(const LLSD& key); // FIRE-13888: Add copy function to bumps list BOOL postBuild(); + + // Instant bump list floater update + /*virtual*/ void draw(); + void setDirty() { mDirty = true; } private: LLFloaterBump(const LLSD& key); virtual ~LLFloaterBump(); + + // Instant bump list floater update + void updateList(); + bool mDirty; }; // FIRE-13888: Add copy function to bumps list diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index c66c205081..46c2ffa444 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -131,6 +131,7 @@ #include "fslslbridge.h" #include "fsmoneytracker.h" #include "fswsassetblacklist.h" +#include "llfloaterbump.h" #include "llfloaterreg.h" #include "llgiveinventory.h" #include "llnotificationmanager.h" @@ -7720,6 +7721,13 @@ void mean_name_callback(const LLUUID &id, const std::string& full_name, bool is_ mcd->mFullName = full_name; } } + // Instant bump list floater update + LLFloaterBump* floater = LLFloaterReg::findTypedInstance("bumps"); + if (floater) + { + floater->setDirty(); + } + // } void process_mean_collision_alert_message(LLMessageSystem *msgsystem, void **user_data) @@ -7823,6 +7831,16 @@ void process_mean_collision_alert_message(LLMessageSystem *msgsystem, void **use gMeanCollisionList.push_front(mcd); gCacheName->get(perp, false, boost::bind(&mean_name_callback, _1, _2, _3)); } + // Instant bump list floater update + else + { + LLFloaterBump* floater = LLFloaterReg::findTypedInstance("bumps"); + if (floater) + { + floater->setDirty(); + } + } + // } }