Merge branch 'V2MultiWear' of git://github.com/Shyotl/SingularityViewer into V2MultiWear
Conflicts: indra/newview/llfloateravatarlist.cpp indra/newview/llfloatermessagelog.cpp indra/newview/llstartup.cpp indra/newview/llviewermenu.cpp indra/newview/llviewermessage.cpp indra/newview/skins/default/xui/fr/menu_inventory.xml
This commit is contained in:
@@ -236,63 +236,35 @@ LLAvatarListEntry::ACTIVITY_TYPE LLAvatarListEntry::getActivity()
|
||||
return mActivityType;
|
||||
}
|
||||
|
||||
LLFloaterAvatarList* LLFloaterAvatarList::sInstance = NULL;
|
||||
|
||||
LLFloaterAvatarList::LLFloaterAvatarList() : LLFloater(std::string("radar"))
|
||||
{
|
||||
llassert_always(sInstance == NULL);
|
||||
sInstance = this;
|
||||
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_radar.xml");
|
||||
mUpdateRate = gSavedSettings.getU32("RadarUpdateRate") * 3 + 3;
|
||||
}
|
||||
|
||||
LLFloaterAvatarList::~LLFloaterAvatarList()
|
||||
{
|
||||
gIdleCallbacks.deleteFunction(LLFloaterAvatarList::callbackIdle);
|
||||
sInstance = NULL;
|
||||
}
|
||||
//static
|
||||
void LLFloaterAvatarList::createInstance(bool visible)
|
||||
{
|
||||
sInstance = new LLFloaterAvatarList();
|
||||
LLUICtrlFactory::getInstance()->buildFloater(sInstance, "floater_radar.xml");
|
||||
if(!visible)
|
||||
{
|
||||
sInstance->setVisible(FALSE);
|
||||
gSavedSettings.setBOOL("ShowRadar", FALSE);
|
||||
}
|
||||
if(gHippoGridManager->getConnectedGrid()->isSecondLife()){
|
||||
LLScrollListCtrl* list = sInstance->getChild<LLScrollListCtrl>("avatar_list");
|
||||
list->getColumn(1)->setWidth(0);
|
||||
list->getColumn(6)->setWidth(0);
|
||||
list->getColumn(6)->mDynamicWidth = FALSE;
|
||||
list->getColumn(6)->mRelWidth = 0;
|
||||
list->getColumn(1)->mDynamicWidth = TRUE;
|
||||
list->getColumn(1)->mRelWidth = -1;
|
||||
list->updateLayout();
|
||||
}
|
||||
}
|
||||
|
||||
//static
|
||||
void LLFloaterAvatarList::toggle(void*)
|
||||
{
|
||||
if (sInstance)
|
||||
{
|
||||
if (sInstance->getVisible()
|
||||
// [RLVa:KB]
|
||||
|| gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)
|
||||
if(gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
|
||||
{
|
||||
if(instanceExists())
|
||||
getInstance()->close();
|
||||
}
|
||||
else
|
||||
// [/RLVa:KB]
|
||||
)
|
||||
|
||||
{
|
||||
sInstance->close(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
sInstance->open();
|
||||
}
|
||||
if(!instanceExists() || !getInstance()->getVisible())
|
||||
{
|
||||
showInstance();
|
||||
}
|
||||
else
|
||||
{
|
||||
showInstance();
|
||||
getInstance()->close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -303,17 +275,7 @@ void LLFloaterAvatarList::showInstance()
|
||||
if(gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
|
||||
return;
|
||||
// [/RLVa:KB]
|
||||
if (sInstance)
|
||||
{
|
||||
if (!sInstance->getVisible())
|
||||
{
|
||||
sInstance->open();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
createInstance(true);
|
||||
}
|
||||
getInstance()->open();
|
||||
}
|
||||
|
||||
void LLFloaterAvatarList::draw()
|
||||
@@ -324,12 +286,11 @@ void LLFloaterAvatarList::draw()
|
||||
void LLFloaterAvatarList::onOpen()
|
||||
{
|
||||
gSavedSettings.setBOOL("ShowRadar", TRUE);
|
||||
sInstance->setVisible(TRUE);
|
||||
}
|
||||
|
||||
void LLFloaterAvatarList::onClose(bool app_quitting)
|
||||
{
|
||||
sInstance->setVisible(FALSE);
|
||||
setVisible(FALSE);
|
||||
if (!app_quitting)
|
||||
{
|
||||
gSavedSettings.setBOOL("ShowRadar", FALSE);
|
||||
@@ -387,12 +348,23 @@ BOOL LLFloaterAvatarList::postBuild()
|
||||
|
||||
gIdleCallbacks.addFunction(LLFloaterAvatarList::callbackIdle);
|
||||
|
||||
if(gHippoGridManager->getConnectedGrid()->isSecondLife()){
|
||||
LLScrollListCtrl* list = sInstance->getChild<LLScrollListCtrl>("avatar_list");
|
||||
list->getColumn(1)->setWidth(0);
|
||||
list->getColumn(6)->setWidth(0);
|
||||
list->getColumn(6)->mDynamicWidth = FALSE;
|
||||
list->getColumn(6)->mRelWidth = 0;
|
||||
list->getColumn(1)->mDynamicWidth = TRUE;
|
||||
list->getColumn(1)->mRelWidth = -1;
|
||||
list->updateLayout();
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void updateParticleActivity(LLDrawable *drawablep)
|
||||
{
|
||||
if (LLFloaterAvatarList::getInstance())
|
||||
if (LLFloaterAvatarList::instanceExists())
|
||||
{
|
||||
LLViewerObject *vobj = drawablep->getVObj();
|
||||
if (vobj && vobj->isParticleSource())
|
||||
@@ -409,10 +381,6 @@ void updateParticleActivity(LLDrawable *drawablep)
|
||||
|
||||
void LLFloaterAvatarList::updateAvatarList()
|
||||
{
|
||||
if (sInstance != this) return;
|
||||
|
||||
//if(LLStartUp::getStartupState() < STATE_STARTED)return;
|
||||
|
||||
//llinfos << "radar refresh: updating map" << llendl;
|
||||
|
||||
// Check whether updates are enabled
|
||||
@@ -672,7 +640,7 @@ void LLFloaterAvatarList::expireAvatarList()
|
||||
void LLFloaterAvatarList::refreshAvatarList()
|
||||
{
|
||||
// Don't update list when interface is hidden
|
||||
if (!sInstance->getVisible()) return;
|
||||
if (!getVisible()) return;
|
||||
|
||||
// We rebuild the list fully each time it's refreshed
|
||||
// The assumption is that it's faster to refill it and sort than
|
||||
@@ -1545,15 +1513,13 @@ void LLFloaterAvatarList::callbackFreeze(const LLSD& notification, const LLSD& r
|
||||
{
|
||||
S32 option = LLNotification::getSelectedOption(notification, response);
|
||||
|
||||
LLFloaterAvatarList *self = LLFloaterAvatarList::sInstance;
|
||||
|
||||
if (option == 0)
|
||||
{
|
||||
self->doCommand(cmd_freeze);
|
||||
getInstance()->doCommand( cmd_freeze );
|
||||
}
|
||||
else if (option == 1)
|
||||
{
|
||||
self->doCommand(cmd_unfreeze);
|
||||
getInstance()->doCommand( cmd_unfreeze );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1562,15 +1528,13 @@ void LLFloaterAvatarList::callbackEject(const LLSD& notification, const LLSD& re
|
||||
{
|
||||
S32 option = LLNotification::getSelectedOption(notification, response);
|
||||
|
||||
LLFloaterAvatarList *self = LLFloaterAvatarList::sInstance;
|
||||
|
||||
if (option == 0)
|
||||
{
|
||||
self->doCommand(cmd_eject);
|
||||
getInstance()->doCommand( cmd_eject );
|
||||
}
|
||||
else if (option == 1)
|
||||
{
|
||||
self->doCommand(cmd_ban);
|
||||
getInstance()->doCommand( cmd_ban );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1579,22 +1543,21 @@ void LLFloaterAvatarList::callbackEjectFromEstate(const LLSD& notification, cons
|
||||
{
|
||||
S32 option = LLNotification::getSelectedOption(notification, response);
|
||||
|
||||
LLFloaterAvatarList *self = LLFloaterAvatarList::sInstance;
|
||||
|
||||
if (option == 0)
|
||||
{
|
||||
self->doCommand(cmd_estate_eject);
|
||||
getInstance()->doCommand( cmd_estate_eject );
|
||||
}
|
||||
}
|
||||
|
||||
//static
|
||||
void LLFloaterAvatarList::callbackIdle(void *userdata) {
|
||||
if (LLFloaterAvatarList::sInstance != NULL)
|
||||
void LLFloaterAvatarList::callbackIdle(void *userdata)
|
||||
{
|
||||
if (instanceExists())
|
||||
{
|
||||
// Do not update at every frame: this would be insane !
|
||||
if (gFrameCount % LLFloaterAvatarList::sInstance->mUpdateRate == 0)
|
||||
if (gFrameCount % getInstance()->mUpdateRate == 0)
|
||||
{
|
||||
LLFloaterAvatarList::sInstance->updateAvatarList();
|
||||
getInstance()->updateAvatarList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user