From 86acf69babd625c3aa8cb5f8444a4bffee83afa7 Mon Sep 17 00:00:00 2001 From: Siana Gearz Date: Mon, 31 Jan 2011 21:04:06 +0100 Subject: [PATCH] Integrate group limit with Hippo Grid Manager --- indra/newview/llfloatergroups.cpp | 10 ++++++---- indra/newview/llstartup.cpp | 4 ++-- indra/newview/llstartup.h | 1 - indra/newview/llviewermessage.cpp | 5 ++++- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/indra/newview/llfloatergroups.cpp b/indra/newview/llfloatergroups.cpp index 6b5204634..132c2abec 100644 --- a/indra/newview/llfloatergroups.cpp +++ b/indra/newview/llfloatergroups.cpp @@ -58,7 +58,8 @@ #include "lluictrlfactory.h" #include "llviewerwindow.h" #include "llimview.h" -#include "llstartup.h" + +#include "hippolimits.h" // static std::map 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("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("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"); } diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 4de53f149..0bbe36a69 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -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"); diff --git a/indra/newview/llstartup.h b/indra/newview/llstartup.h index 0e8824364..8f5c7b855 100644 --- a/indra/newview/llstartup.h +++ b/indra/newview/llstartup.h @@ -79,7 +79,6 @@ extern bool gAgentMovementCompleted; extern LLPointer gStartImageGL; extern std::string gInitialOutfit; extern std::string gInitialOutfitGender; // "male" or "female" -extern S32 gMaxAgentGroups; class LLStartUp { diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 7332240df..914408fac 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -153,6 +153,9 @@ # include "shcommandhandler.h" #endif //shy_mod +#include "hippogridmanager.h" +#include "hippolimits.h" + #include #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)