Live update bumps floater while it is open

Ansariel 2015-02-24 13:36:24 +01:00
parent 7d79ee75b9
commit ec6d5c4bba
3 changed files with 46 additions and 1 deletions

View File

@ -45,7 +45,8 @@
// Default constructor
LLFloaterBump::LLFloaterBump(const LLSD& key)
: LLFloater(key)
: LLFloater(key),
mDirty(false) // <FS:Ansariel> Instant bump list floater update
{
}
@ -68,6 +69,24 @@ BOOL LLFloaterBump::postBuild()
// virtual
void LLFloaterBump::onOpen(const LLSD& key)
{
// <FS:Ansariel> Instant bump list floater update
updateList();
}
void LLFloaterBump::draw()
{
if (mDirty)
{
updateList();
mDirty = false;
}
LLFloater::draw();
}
void LLFloaterBump::updateList()
{
// </FS:Ansariel>
LLScrollListCtrl* list = getChild<LLScrollListCtrl>("bump_list");
if (!list)
return;

View File

@ -45,11 +45,19 @@ public:
/*virtual*/ void onOpen(const LLSD& key);
// <FS:Ansariel> FIRE-13888: Add copy function to bumps list
BOOL postBuild();
// <FS:Ansariel> Instant bump list floater update
/*virtual*/ void draw();
void setDirty() { mDirty = true; }
private:
LLFloaterBump(const LLSD& key);
virtual ~LLFloaterBump();
// <FS:Ansariel> Instant bump list floater update
void updateList();
bool mDirty;
};
// <FS:Ansariel> FIRE-13888: Add copy function to bumps list

View File

@ -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;
}
}
// <FS:Ansariel> Instant bump list floater update
LLFloaterBump* floater = LLFloaterReg::findTypedInstance<LLFloaterBump>("bumps");
if (floater)
{
floater->setDirty();
}
// </FS:Ansariel>
}
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));
}
// <FS:Ansariel> Instant bump list floater update
else
{
LLFloaterBump* floater = LLFloaterReg::findTypedInstance<LLFloaterBump>("bumps");
if (floater)
{
floater->setDirty();
}
}
// </FS:Ansariel>
}
}