Fix whoopses from mid-development commits

Fixes compiles and fixes menu crash and missing menu file
This commit is contained in:
Liru Færs
2019-10-10 02:39:11 -04:00
parent d277f1750d
commit b592b3c658
3 changed files with 15 additions and 12 deletions

View File

@@ -61,16 +61,17 @@ void LLNameBox::showProfile()
// virtual // virtual
BOOL LLNameBox::handleRightMouseDown(S32 x, S32 y, MASK mask) BOOL LLNameBox::handleRightMouseDown(S32 x, S32 y, MASK mask)
{ {
if (!mAllowInteract) return; auto handled = LLTextBox::handleRightMouseDown(x, y, mask);
if (mAllowInteract && !handled)
if (!LLTextBox::handleRightMouseDown(x, y, mask))
{ {
// Singu TODO: Generic menus for groups // Singu TODO: Generic menus for groups
if (mIsGroup || mNameID.isNull()) return FALSE; if (!mIsGroup && mNameID.notNull())
{
showMenu(this, sMenus[0], x, y); showMenu(this, sMenus[0], x, y);
handled = true;
}
} }
return TRUE; return handled;
} }
// virtual // virtual

View File

@@ -59,20 +59,19 @@ LLNameEditor::LLNameEditor(const std::string& name, const LLRect& rect,
// virtual // virtual
BOOL LLNameEditor::handleRightMouseDown(S32 x, S32 y, MASK mask) BOOL LLNameEditor::handleRightMouseDown(S32 x, S32 y, MASK mask)
{ {
if (!mAllowInteract) return; bool simple_menu = mContextMenuHandle.get()->getName() == "rclickmenu";
bool simple_menu = mContextMenuHandle.get()->getName() != "rclickmenu";
std::string new_menu; std::string new_menu;
// Singu TODO: Generic menus for groups // Singu TODO: Generic menus for groups
if ((mIsGroup || mNameID.isNull()) && simple_menu) if (!simple_menu && (mIsGroup || !mAllowInteract || mNameID.isNull())) // If no ID or blocking interaction switch to simple menu
{ {
new_menu = "menu_texteditor.xml"; new_menu = "menu_texteditor.xml";
} }
else if (!simple_menu && !mIsGroup) else if (simple_menu && !mIsGroup)
{ {
new_menu = "menu_nameeditor_avatar.xml"; new_menu = "menu_nameeditor_avatar.xml";
} }
if (!new_menu.empty()) setContextMenu(LLUICtrlFactory::instance().buildMenu(new_menu, LLMenuGL::sMenuContainer)); if (!new_menu.empty()) setContextMenu(LLUICtrlFactory::instance().buildMenu(new_menu, LLMenuGL::sMenuContainer));
sActive = this;
return LLLineEditor::handleRightMouseDown(x, y, mask); return LLLineEditor::handleRightMouseDown(x, y, mask);
} }

View File

@@ -0,0 +1,3 @@
<menu name="Avatar Name Editor Menu" filename="menu_avs_list.xml">
<menu name="Text" filename="menu_texteditor.xml"/>
</menu>