diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llpanelavatar.cpp | 95 |
1 files changed, 81 insertions, 14 deletions
diff --git a/linden/indra/newview/llpanelavatar.cpp b/linden/indra/newview/llpanelavatar.cpp index 8c367fa..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 @@ | |||
86 | std::list<LLPanelAvatar*> LLPanelAvatar::sAllPanels; | 87 | std::list<LLPanelAvatar*> LLPanelAvatar::sAllPanels; |
87 | BOOL LLPanelAvatar::sAllowFirstLife = FALSE; | 88 | BOOL LLPanelAvatar::sAllowFirstLife = FALSE; |
88 | 89 | ||
90 | extern void callback_invite_to_group(LLUUID group_id, void *user_data); | ||
89 | extern void handle_lure(const LLUUID& invitee); | 91 | extern void handle_lure(const LLUUID& invitee); |
90 | extern void handle_pay_by_id(const LLUUID& payee); | 92 | extern 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()); |
@@ -1433,6 +1436,8 @@ void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const std::string &name | |||
1433 | } | 1436 | } |
1434 | childSetVisible("Instant Message...",FALSE); | 1437 | childSetVisible("Instant Message...",FALSE); |
1435 | childSetEnabled("Instant Message...",FALSE); | 1438 | childSetEnabled("Instant Message...",FALSE); |
1439 | childSetVisible("Invite to Group...",FALSE); | ||
1440 | childSetEnabled("Invite to Group...",FALSE); | ||
1436 | childSetVisible("Mute",FALSE); | 1441 | childSetVisible("Mute",FALSE); |
1437 | childSetEnabled("Mute",FALSE); | 1442 | childSetEnabled("Mute",FALSE); |
1438 | childSetVisible("Offer Teleport...",FALSE); | 1443 | childSetVisible("Offer Teleport...",FALSE); |
@@ -1445,6 +1450,14 @@ void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const std::string &name | |||
1445 | childSetEnabled("Add Friend...",FALSE); | 1450 | childSetEnabled("Add Friend...",FALSE); |
1446 | childSetVisible("Pay...",FALSE); | 1451 | childSetVisible("Pay...",FALSE); |
1447 | 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); | ||
1448 | } | 1461 | } |
1449 | else | 1462 | else |
1450 | { | 1463 | { |
@@ -1456,6 +1469,8 @@ void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const std::string &name | |||
1456 | 1469 | ||
1457 | childSetVisible("Instant Message...",TRUE); | 1470 | childSetVisible("Instant Message...",TRUE); |
1458 | childSetEnabled("Instant Message...",FALSE); | 1471 | childSetEnabled("Instant Message...",FALSE); |
1472 | childSetVisible("Invite to Group...",TRUE); | ||
1473 | childSetEnabled("Invite to Group...",FALSE); | ||
1459 | childSetVisible("Mute",TRUE); | 1474 | childSetVisible("Mute",TRUE); |
1460 | childSetEnabled("Mute",FALSE); | 1475 | childSetEnabled("Mute",FALSE); |
1461 | 1476 | ||
@@ -1482,20 +1497,20 @@ void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const std::string &name | |||
1482 | childSetEnabled("Add Friend...", !avatar_is_friend); | 1497 | childSetEnabled("Add Friend...", !avatar_is_friend); |
1483 | childSetVisible("Pay...",TRUE); | 1498 | childSetVisible("Pay...",TRUE); |
1484 | 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); | ||
1485 | } | 1512 | } |
1486 | } | 1513 | } |
1487 | |||
1488 | BOOL is_god = FALSE; | ||
1489 | if (gAgent.isGodlike()) is_god = TRUE; | ||
1490 | |||
1491 | childSetVisible("Kick", is_god); | ||
1492 | childSetEnabled("Kick", is_god); | ||
1493 | childSetVisible("Freeze", is_god); | ||
1494 | childSetEnabled("Freeze", is_god); | ||
1495 | childSetVisible("Unfreeze", is_god); | ||
1496 | childSetEnabled("Unfreeze", is_god); | ||
1497 | childSetVisible("csr_btn", is_god); | ||
1498 | childSetEnabled("csr_btn", is_god); | ||
1499 | } | 1514 | } |
1500 | 1515 | ||
1501 | 1516 | ||
@@ -1538,9 +1553,18 @@ void LLPanelAvatar::resetGroupList() | |||
1538 | LLSD row; | 1553 | LLSD row; |
1539 | 1554 | ||
1540 | row["id"] = id ; | 1555 | row["id"] = id ; |
1541 | row["columns"][0]["value"] = group_string; | ||
1542 | row["columns"][0]["font"] = "SANSSERIF_SMALL"; | 1556 | row["columns"][0]["font"] = "SANSSERIF_SMALL"; |
1543 | 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 | } | ||
1544 | group_list->addElement(row); | 1568 | group_list->addElement(row); |
1545 | } | 1569 | } |
1546 | group_list->sortByColumnIndex(0, TRUE); | 1570 | group_list->sortByColumnIndex(0, TRUE); |
@@ -1563,6 +1587,22 @@ void LLPanelAvatar::onClickIM(void* userdata) | |||
1563 | gIMMgr->addSession(name, IM_NOTHING_SPECIAL, self->mAvatarID); | 1587 | gIMMgr->addSession(name, IM_NOTHING_SPECIAL, self->mAvatarID); |
1564 | } | 1588 | } |
1565 | 1589 | ||
1590 | void 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 | |||
1566 | 1606 | ||
1567 | // static | 1607 | // static |
1568 | //----------------------------------------------------------------------------- | 1608 | //----------------------------------------------------------------------------- |
@@ -1780,6 +1820,7 @@ void LLPanelAvatar::processAvatarPropertiesReply(LLMessageSystem *msg, void**) | |||
1780 | continue; | 1820 | continue; |
1781 | } | 1821 | } |
1782 | self->childSetEnabled("Instant Message...",TRUE); | 1822 | self->childSetEnabled("Instant Message...",TRUE); |
1823 | self->childSetEnabled("Invite to Group...",TRUE); | ||
1783 | self->childSetEnabled("Pay...",TRUE); | 1824 | self->childSetEnabled("Pay...",TRUE); |
1784 | self->childSetEnabled("Mute",TRUE); | 1825 | self->childSetEnabled("Mute",TRUE); |
1785 | 1826 | ||
@@ -2000,8 +2041,34 @@ void LLPanelAvatar::processAvatarGroupsReply(LLMessageSystem *msg, void**) | |||
2000 | 2041 | ||
2001 | LLSD row; | 2042 | LLSD row; |
2002 | row["id"] = group_id; | 2043 | row["id"] = group_id; |
2003 | row["columns"][0]["value"] = group_string; | ||
2004 | 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 | } | ||
2005 | if (group_list) | 2072 | if (group_list) |
2006 | { | 2073 | { |
2007 | group_list->addElement(row); | 2074 | group_list->addElement(row); |