Encapsulate LFIDBearer::sActive, set with member setActive

This function caches the current type when active,
in the future it could be more useful than that.

sActive is now const, getActive returns const,
IDBearers display information, the interface should only be used for that
This commit is contained in:
Liru Færs
2020-01-06 12:22:31 -05:00
parent f73fb6424b
commit 6839cba56a
10 changed files with 31 additions and 20 deletions

View File

@@ -30,7 +30,8 @@ const std::array<const std::string, LFIDBearer::COUNT> LFIDBearer::sMenuStrings
};
std::array<LLMenuGL*, LFIDBearer::COUNT> LFIDBearer::sMenus {};
LFIDBearer* LFIDBearer::sActive = nullptr;
const LFIDBearer* LFIDBearer::sActive = nullptr;
LFIDBearer::Type LFIDBearer::sActiveType = LFIDBearer::AVATAR;
void LFIDBearer::buildMenus()
{
@@ -49,7 +50,7 @@ LLMenuGL* LFIDBearer::showMenu(LLView* self, const std::string& menu_name, S32 x
void LFIDBearer::showMenu(LLView* self, LLMenuGL* menu, S32 x, S32 y)
{
sActive = this; // Menu listeners rely on this
setActive(); // Menu listeners rely on this
menu->buildDrawLabels();
menu->updateParent(LLMenuGL::sMenuContainer);
LLMenuGL::showPopup(self, menu, x, y);