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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user