Integrate group limit with Hippo Grid Manager

This commit is contained in:
Siana Gearz
2011-01-31 21:04:06 +01:00
parent 2550e2b6f2
commit 86acf69bab
4 changed files with 12 additions and 8 deletions

View File

@@ -58,7 +58,8 @@
#include "lluictrlfactory.h"
#include "llviewerwindow.h"
#include "llimview.h"
#include "llstartup.h"
#include "hippolimits.h"
// static
std::map<const LLUUID, LLFloaterGroupPicker*> LLFloaterGroupPicker::sInstances;
@@ -203,7 +204,8 @@ void LLPanelGroups::reset()
group_list->operateOnAll(LLCtrlListInterface::OP_DELETE);
}
childSetTextArg("groupcount", "[COUNT]", llformat("%d",gAgent.mGroups.count()));
childSetTextArg("groupcount", "[MAX]", llformat("%d", gMaxAgentGroups));
childSetTextArg("groupcount", "[MAX]", llformat("%d", gHippoLimits->getMaxAgentGroups()));
const std::string none_text = getString("none");
init_group_list(getChild<LLScrollListCtrl>("group list"), gAgent.getGroupID(), none_text);
@@ -215,7 +217,7 @@ BOOL LLPanelGroups::postBuild()
childSetCommitCallback("group list", onGroupList, this);
childSetTextArg("groupcount", "[COUNT]", llformat("%d",gAgent.mGroups.count()));
childSetTextArg("groupcount", "[MAX]", llformat("%d", gMaxAgentGroups));
childSetTextArg("groupcount", "[MAX]", llformat("%d", gHippoLimits->getMaxAgentGroups()));
const std::string none_text = getString("none");
init_group_list(getChild<LLScrollListCtrl>("group list"), gAgent.getGroupID(), none_text);
@@ -275,7 +277,7 @@ void LLPanelGroups::enableButtons()
childDisable("IM");
childDisable("Leave");
}
if(gAgent.mGroups.count() < gMaxAgentGroups)
if(gAgent.mGroups.count() < gHippoLimits->getMaxAgentGroups())
{
childEnable("Create");
}

View File

@@ -229,8 +229,6 @@ std::string gInitialOutfitGender;
std::string SCREEN_HOME_FILENAME = "screen_home.bmp";
std::string SCREEN_LAST_FILENAME = "screen_last.bmp";
S32 gMaxAgentGroups = DEFAULT_MAX_AGENT_GROUPS;
//
// Imported globals
//
@@ -1181,6 +1179,8 @@ bool idle_startup()
requested_options.push_back("buddy-list");
requested_options.push_back("ui-config");
#endif
requested_options.push_back("max_groups");
requested_options.push_back("max-agent-groups");
requested_options.push_back("map-server-url");
requested_options.push_back("tutorial_setting");
requested_options.push_back("login-flags");

View File

@@ -79,7 +79,6 @@ extern bool gAgentMovementCompleted;
extern LLPointer<LLImageGL> gStartImageGL;
extern std::string gInitialOutfit;
extern std::string gInitialOutfitGender; // "male" or "female"
extern S32 gMaxAgentGroups;
class LLStartUp
{

View File

@@ -153,6 +153,9 @@
# include "shcommandhandler.h"
#endif //shy_mod
#include "hippogridmanager.h"
#include "hippolimits.h"
#include <boost/tokenizer.hpp>
#if LL_WINDOWS // For Windows specific error handler
@@ -666,7 +669,7 @@ bool join_group_response(const LLSD& notification, const LLSD& response)
if(option == 0 && !group_id.isNull())
{
// check for promotion or demotion.
S32 max_groups = gMaxAgentGroups;
S32 max_groups = gHippoLimits->getMaxAgentGroups();
if(gAgent.isInGroup(group_id)) ++max_groups;
if(gAgent.mGroups.count() < max_groups)