aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llpanelavatar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llpanelavatar.cpp')
-rw-r--r--linden/indra/newview/llpanelavatar.cpp115
1 files changed, 100 insertions, 15 deletions
diff --git a/linden/indra/newview/llpanelavatar.cpp b/linden/indra/newview/llpanelavatar.cpp
index d48237f..e101ea2 100644
--- a/linden/indra/newview/llpanelavatar.cpp
+++ b/linden/indra/newview/llpanelavatar.cpp
@@ -51,6 +51,7 @@
51 51
52#include "llfloaterfriends.h" 52#include "llfloaterfriends.h"
53#include "llfloatergroupinfo.h" 53#include "llfloatergroupinfo.h"
54#include "llfloatergroups.h"
54#include "llfloaterworldmap.h" 55#include "llfloaterworldmap.h"
55#include "llfloatermute.h" 56#include "llfloatermute.h"
56#include "llfloateravatarinfo.h" 57#include "llfloateravatarinfo.h"
@@ -86,6 +87,7 @@
86std::list<LLPanelAvatar*> LLPanelAvatar::sAllPanels; 87std::list<LLPanelAvatar*> LLPanelAvatar::sAllPanels;
87BOOL LLPanelAvatar::sAllowFirstLife = FALSE; 88BOOL LLPanelAvatar::sAllowFirstLife = FALSE;
88 89
90extern void callback_invite_to_group(LLUUID group_id, void *user_data);
89extern void handle_lure(const LLUUID& invitee); 91extern void handle_lure(const LLUUID& invitee);
90extern void handle_pay_by_id(const LLUUID& payee); 92extern void handle_pay_by_id(const LLUUID& payee);
91 93
@@ -428,6 +430,7 @@ BOOL LLPanelAvatarSecondLife::postBuild(void)
428 430
429 childSetAction("Find on Map", LLPanelAvatar::onClickTrack, getPanelAvatar()); 431 childSetAction("Find on Map", LLPanelAvatar::onClickTrack, getPanelAvatar());
430 childSetAction("Instant Message...", LLPanelAvatar::onClickIM, getPanelAvatar()); 432 childSetAction("Instant Message...", LLPanelAvatar::onClickIM, getPanelAvatar());
433 childSetAction("Invite to Group...", LLPanelAvatar::onClickGroupInvite, getPanelAvatar());
431 434
432 childSetAction("Add Friend...", LLPanelAvatar::onClickAddFriend, getPanelAvatar()); 435 childSetAction("Add Friend...", LLPanelAvatar::onClickAddFriend, getPanelAvatar());
433 childSetAction("Pay...", LLPanelAvatar::onClickPay, getPanelAvatar()); 436 childSetAction("Pay...", LLPanelAvatar::onClickPay, getPanelAvatar());
@@ -789,6 +792,9 @@ void LLPanelAvatarClassified::refresh()
789 S32 tab_count = tabs ? tabs->getTabCount() : 0; 792 S32 tab_count = tabs ? tabs->getTabCount() : 0;
790 793
791 bool allow_new = tab_count < MAX_CLASSIFIEDS; 794 bool allow_new = tab_count < MAX_CLASSIFIEDS;
795// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a)
796 allow_new &= !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC);
797// [/RLVa:KB]
792 bool allow_delete = (tab_count > 0); 798 bool allow_delete = (tab_count > 0);
793 bool show_help = (tab_count == 0); 799 bool show_help = (tab_count == 0);
794 800
@@ -924,6 +930,12 @@ void LLPanelAvatarClassified::processAvatarClassifiedReply(LLMessageSystem* msg,
924// static 930// static
925void LLPanelAvatarClassified::onClickNew(void* data) 931void LLPanelAvatarClassified::onClickNew(void* data)
926{ 932{
933// [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-04 (RLVa-1.0.0a)
934 if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))
935 {
936 return;
937 }
938// [/RLVa:KB]
927 LLPanelAvatarClassified* self = (LLPanelAvatarClassified*)data; 939 LLPanelAvatarClassified* self = (LLPanelAvatarClassified*)data;
928 940
929 gViewerWindow->alertXml("AddClassified",callbackNew,self); 941 gViewerWindow->alertXml("AddClassified",callbackNew,self);
@@ -1020,7 +1032,10 @@ void LLPanelAvatarPicks::refresh()
1020 BOOL self = (gAgent.getID() == getPanelAvatar()->getAvatarID()); 1032 BOOL self = (gAgent.getID() == getPanelAvatar()->getAvatarID());
1021 LLTabContainer* tabs = getChild<LLTabContainer>("picks tab"); 1033 LLTabContainer* tabs = getChild<LLTabContainer>("picks tab");
1022 S32 tab_count = tabs ? tabs->getTabCount() : 0; 1034 S32 tab_count = tabs ? tabs->getTabCount() : 0;
1023 childSetEnabled("New...", self && tab_count < MAX_AVATAR_PICKS); 1035// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a)
1036 childSetEnabled("New...", self && tab_count < MAX_AVATAR_PICKS && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) );
1037// [/RLVa:KB]
1038 //childSetEnabled("New...", self && tab_count < MAX_AVATAR_PICKS);
1024 childSetEnabled("Delete...", self && tab_count > 0); 1039 childSetEnabled("Delete...", self && tab_count > 0);
1025 childSetVisible("New...", self && getPanelAvatar()->isEditable()); 1040 childSetVisible("New...", self && getPanelAvatar()->isEditable());
1026 childSetVisible("Delete...", self && getPanelAvatar()->isEditable()); 1041 childSetVisible("Delete...", self && getPanelAvatar()->isEditable());
@@ -1098,6 +1113,12 @@ void LLPanelAvatarPicks::processAvatarPicksReply(LLMessageSystem* msg, void**)
1098// static 1113// static
1099void LLPanelAvatarPicks::onClickNew(void* data) 1114void LLPanelAvatarPicks::onClickNew(void* data)
1100{ 1115{
1116// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a)
1117 if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))
1118 {
1119 return;
1120 }
1121// [/RLVa:KB]
1101 LLPanelAvatarPicks* self = (LLPanelAvatarPicks*)data; 1122 LLPanelAvatarPicks* self = (LLPanelAvatarPicks*)data;
1102 LLPanelPick* panel_pick = new LLPanelPick(FALSE); 1123 LLPanelPick* panel_pick = new LLPanelPick(FALSE);
1103 LLTabContainer* tabs = self->getChild<LLTabContainer>("picks tab"); 1124 LLTabContainer* tabs = self->getChild<LLTabContainer>("picks tab");
@@ -1415,6 +1436,8 @@ void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const std::string &name
1415 } 1436 }
1416 childSetVisible("Instant Message...",FALSE); 1437 childSetVisible("Instant Message...",FALSE);
1417 childSetEnabled("Instant Message...",FALSE); 1438 childSetEnabled("Instant Message...",FALSE);
1439 childSetVisible("Invite to Group...",FALSE);
1440 childSetEnabled("Invite to Group...",FALSE);
1418 childSetVisible("Mute",FALSE); 1441 childSetVisible("Mute",FALSE);
1419 childSetEnabled("Mute",FALSE); 1442 childSetEnabled("Mute",FALSE);
1420 childSetVisible("Offer Teleport...",FALSE); 1443 childSetVisible("Offer Teleport...",FALSE);
@@ -1427,6 +1450,14 @@ void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const std::string &name
1427 childSetEnabled("Add Friend...",FALSE); 1450 childSetEnabled("Add Friend...",FALSE);
1428 childSetVisible("Pay...",FALSE); 1451 childSetVisible("Pay...",FALSE);
1429 childSetEnabled("Pay...",FALSE); 1452 childSetEnabled("Pay...",FALSE);
1453 childSetVisible("Kick",FALSE);
1454 childSetEnabled("Kick",FALSE);
1455 childSetVisible("Freeze",FALSE);
1456 childSetEnabled("Freeze",FALSE);
1457 childSetVisible("Unfreeze",FALSE);
1458 childSetEnabled("Unfreeze",FALSE);
1459 childSetVisible("csr_btn", FALSE);
1460 childSetEnabled("csr_btn", FALSE);
1430 } 1461 }
1431 else 1462 else
1432 { 1463 {
@@ -1438,6 +1469,8 @@ void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const std::string &name
1438 1469
1439 childSetVisible("Instant Message...",TRUE); 1470 childSetVisible("Instant Message...",TRUE);
1440 childSetEnabled("Instant Message...",FALSE); 1471 childSetEnabled("Instant Message...",FALSE);
1472 childSetVisible("Invite to Group...",TRUE);
1473 childSetEnabled("Invite to Group...",FALSE);
1441 childSetVisible("Mute",TRUE); 1474 childSetVisible("Mute",TRUE);
1442 childSetEnabled("Mute",FALSE); 1475 childSetEnabled("Mute",FALSE);
1443 1476
@@ -1464,20 +1497,20 @@ void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const std::string &name
1464 childSetEnabled("Add Friend...", !avatar_is_friend); 1497 childSetEnabled("Add Friend...", !avatar_is_friend);
1465 childSetVisible("Pay...",TRUE); 1498 childSetVisible("Pay...",TRUE);
1466 childSetEnabled("Pay...",FALSE); 1499 childSetEnabled("Pay...",FALSE);
1500
1501 BOOL is_god = FALSE;
1502 if (gAgent.isGodlike()) is_god = TRUE;
1503
1504 childSetVisible("Kick", is_god);
1505 childSetEnabled("Kick", is_god);
1506 childSetVisible("Freeze", is_god);
1507 childSetEnabled("Freeze", is_god);
1508 childSetVisible("Unfreeze", is_god);
1509 childSetEnabled("Unfreeze", is_god);
1510 childSetVisible("csr_btn", is_god);
1511 childSetEnabled("csr_btn", is_god);
1467 } 1512 }
1468 } 1513 }
1469
1470 BOOL is_god = FALSE;
1471 if (gAgent.isGodlike()) is_god = TRUE;
1472
1473 childSetVisible("Kick", is_god);
1474 childSetEnabled("Kick", is_god);
1475 childSetVisible("Freeze", is_god);
1476 childSetEnabled("Freeze", is_god);
1477 childSetVisible("Unfreeze", is_god);
1478 childSetEnabled("Unfreeze", is_god);
1479 childSetVisible("csr_btn", is_god);
1480 childSetEnabled("csr_btn", is_god);
1481} 1514}
1482 1515
1483 1516
@@ -1520,9 +1553,18 @@ void LLPanelAvatar::resetGroupList()
1520 LLSD row; 1553 LLSD row;
1521 1554
1522 row["id"] = id ; 1555 row["id"] = id ;
1523 row["columns"][0]["value"] = group_string;
1524 row["columns"][0]["font"] = "SANSSERIF_SMALL"; 1556 row["columns"][0]["font"] = "SANSSERIF_SMALL";
1525 row["columns"][0]["width"] = 0; 1557 row["columns"][0]["width"] = 0;
1558 if (group_data.mListInProfile)
1559 {
1560 row["columns"][0]["value"] = group_string;
1561 row["columns"][0]["color"] = gColors.getColor("ScrollUnselectedColor").getValue();
1562 }
1563 else
1564 {
1565 row["columns"][0]["value"] = group_string + " " + getString("HiddenLabel");
1566 row["columns"][0]["color"] = gColors.getColor("ScriptBgReadOnlyColor").getValue();
1567 }
1526 group_list->addElement(row); 1568 group_list->addElement(row);
1527 } 1569 }
1528 group_list->sortByColumnIndex(0, TRUE); 1570 group_list->sortByColumnIndex(0, TRUE);
@@ -1545,6 +1587,22 @@ void LLPanelAvatar::onClickIM(void* userdata)
1545 gIMMgr->addSession(name, IM_NOTHING_SPECIAL, self->mAvatarID); 1587 gIMMgr->addSession(name, IM_NOTHING_SPECIAL, self->mAvatarID);
1546} 1588}
1547 1589
1590void LLPanelAvatar::onClickGroupInvite(void* userdata)
1591{
1592 LLPanelAvatar* self = (LLPanelAvatar*) userdata;
1593 if (self->getAvatarID().notNull())
1594 {
1595 LLFloaterGroupPicker* widget;
1596 widget = LLFloaterGroupPicker::showInstance(LLSD(gAgent.getID()));
1597 if (widget)
1598 {
1599 widget->center();
1600 widget->setPowersMask(GP_MEMBER_INVITE);
1601 widget->setSelectCallback(callback_invite_to_group, (void *)&(self->getAvatarID()));
1602 }
1603 }
1604}
1605
1548 1606
1549// static 1607// static
1550//----------------------------------------------------------------------------- 1608//-----------------------------------------------------------------------------
@@ -1762,6 +1820,7 @@ void LLPanelAvatar::processAvatarPropertiesReply(LLMessageSystem *msg, void**)
1762 continue; 1820 continue;
1763 } 1821 }
1764 self->childSetEnabled("Instant Message...",TRUE); 1822 self->childSetEnabled("Instant Message...",TRUE);
1823 self->childSetEnabled("Invite to Group...",TRUE);
1765 self->childSetEnabled("Pay...",TRUE); 1824 self->childSetEnabled("Pay...",TRUE);
1766 self->childSetEnabled("Mute",TRUE); 1825 self->childSetEnabled("Mute",TRUE);
1767 1826
@@ -1982,8 +2041,34 @@ void LLPanelAvatar::processAvatarGroupsReply(LLMessageSystem *msg, void**)
1982 2041
1983 LLSD row; 2042 LLSD row;
1984 row["id"] = group_id; 2043 row["id"] = group_id;
1985 row["columns"][0]["value"] = group_string;
1986 row["columns"][0]["font"] = "SANSSERIF_SMALL"; 2044 row["columns"][0]["font"] = "SANSSERIF_SMALL";
2045
2046 LLGroupData *group_data = NULL;
2047
2048 if (avatar_id == agent_id) // own avatar
2049 {
2050 // Search for this group in the agent's groups list
2051 LLDynamicArray<LLGroupData>::iterator i;
2052 for (i = gAgent.mGroups.begin(); i != gAgent.mGroups.end(); i++)
2053 {
2054 if (i->mID == group_id)
2055 {
2056 group_data = &*i;
2057 break;
2058 }
2059 }
2060 }
2061 // Set normal color if not found or if group is visible in profile
2062 if (!group_data || group_data->mListInProfile)
2063 {
2064 row["columns"][0]["value"] = group_string;
2065 row["columns"][0]["color"] = gColors.getColor("ScrollUnselectedColor").getValue();
2066 }
2067 else
2068 {
2069 row["columns"][0]["value"] = group_string + " " + self->getString("HiddenLabel");
2070 row["columns"][0]["color"] = gColors.getColor("ScriptBgReadOnlyColor").getValue();
2071 }
1987 if (group_list) 2072 if (group_list)
1988 { 2073 {
1989 group_list->addElement(row); 2074 group_list->addElement(row);