Combine commonly created scroll list menus into single menus identified by menu_num instead of their menu_file

sScrollListMenus is an array such that it will hold more menus in the future, such as groups.
fmenu_file still exists and will still exhibit its old behavior if used.
This commit is contained in:
Inusaito Sayori
2014-01-24 21:41:56 -05:00
parent aaf06fa2cc
commit 2450b435a7
12 changed files with 29 additions and 14 deletions

View File

@@ -57,6 +57,8 @@
static LLRegisterWidget<LLScrollListCtrl> r("scroll_list");
LLMenuGL* sScrollListMenus[1] = {}; // List menus that recur, such as general avatars or groups menus
// local structures & classes.
struct SortScrollListItem
{
@@ -2552,7 +2554,15 @@ void LLScrollListCtrl::setScrollListParameters(LLXMLNodePtr node)
node->getAttribute_bool("mouse_wheel_opaque", mMouseWheelOpaque);
}
if (node->hasAttribute("menu_file"))
if (node->hasAttribute("menu_num"))
{
// Some scroll lists use common menus identified by number
// 0 is menu_avs_list.xml, 1 will be for groups, 2 could be for lists of objects
S32 menu_num;
node->getAttributeS32("menu_num", menu_num);
mPopupMenu = sScrollListMenus[menu_num];
}
else if (node->hasAttribute("menu_file"))
{
std::string menu_file;
node->getAttributeString("menu_file", menu_file);