From 0eba34d5a8951b2ed7f77e652a3e77c428e62d59 Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Sun, 28 Dec 2014 13:33:21 -0500 Subject: [PATCH] Can haz groups left count in groups list. Translators, this is in panel_groups.xml and panel_groups_horiz.xml called groupcount Inspired by Alchemy<3 --- indra/newview/llfloatergroups.cpp | 17 ++++++++++++----- indra/newview/llfloatergroups.h | 3 +++ .../skins/default/xui/en-us/panel_groups.xml | 2 +- .../default/xui/en-us/panel_groups_horiz.xml | 2 +- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/indra/newview/llfloatergroups.cpp b/indra/newview/llfloatergroups.cpp index 8be4611bf..5367bcc6d 100644 --- a/indra/newview/llfloatergroups.cpp +++ b/indra/newview/llfloatergroups.cpp @@ -182,20 +182,27 @@ LLPanelGroups::~LLPanelGroups() gAgent.removeListener(this); } +void LLPanelGroups::setTexts() +{ + LLUICtrl* ctrl(getChild("groupcount")); + size_t count(gAgent.mGroups.size()); + ctrl->setTextArg("[COUNT]", llformat("%d", count)); + int maxgroups(gHippoLimits->getMaxAgentGroups()); + ctrl->setTextArg("[MAX]", llformat("%d", maxgroups)); + ctrl->setTextArg("[LEFT]", llformat("%d", maxgroups - count)); +} + // clear the group list, and get a fresh set of info. void LLPanelGroups::reset() { - getChild("groupcount")->setTextArg("[COUNT]", llformat("%d",gAgent.mGroups.size())); - getChild("groupcount")->setTextArg("[MAX]", llformat("%d", gHippoLimits->getMaxAgentGroups())); - + setTexts(); init_group_list(getChild("group list"), gAgent.getGroupID()); enableButtons(); } BOOL LLPanelGroups::postBuild() { - getChild("groupcount")->setTextArg("[COUNT]", llformat("%d",gAgent.mGroups.size())); - getChild("groupcount")->setTextArg("[MAX]", llformat("%d",gHippoLimits->getMaxAgentGroups())); + setTexts(); LLScrollListCtrl *list = getChild("group list"); if (list) diff --git a/indra/newview/llfloatergroups.h b/indra/newview/llfloatergroups.h index 8af8e03c3..229b75754 100644 --- a/indra/newview/llfloatergroups.h +++ b/indra/newview/llfloatergroups.h @@ -106,6 +106,9 @@ protected: // initialize based on the type BOOL postBuild(); + // set the text displays + void setTexts(); + // highlight_id is a group id to highlight void enableButtons(); diff --git a/indra/newview/skins/default/xui/en-us/panel_groups.xml b/indra/newview/skins/default/xui/en-us/panel_groups.xml index c5debb960..7071f9ae9 100644 --- a/indra/newview/skins/default/xui/en-us/panel_groups.xml +++ b/indra/newview/skins/default/xui/en-us/panel_groups.xml @@ -26,7 +26,7 @@ bottom="5" drop_shadow_visible="true" enabled="true" follows="left|bottom" font="SansSerifSmall" h_pad="0" halign="left" height="16" left="12" mouse_opaque="false" name="groupcount" v_pad="0" width="248"> - You belong to [COUNT] groups (of [MAX] maximum). + You belong to [COUNT] groups (of [MAX] max, [LEFT] left).