From b592b3c6585db0ef9c9b8f83f7e3bb44269737ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Liru=20F=C3=A6rs?= Date: Thu, 10 Oct 2019 02:39:11 -0400 Subject: [PATCH] Fix whoopses from mid-development commits Fixes compiles and fixes menu crash and missing menu file --- indra/newview/llnamebox.cpp | 15 ++++++++------- indra/newview/llnameeditor.cpp | 9 ++++----- .../default/xui/en-us/menu_nameeditor_avatar.xml | 3 +++ 3 files changed, 15 insertions(+), 12 deletions(-) create mode 100644 indra/newview/skins/default/xui/en-us/menu_nameeditor_avatar.xml diff --git a/indra/newview/llnamebox.cpp b/indra/newview/llnamebox.cpp index 54e362726..d73a1ae6d 100644 --- a/indra/newview/llnamebox.cpp +++ b/indra/newview/llnamebox.cpp @@ -61,16 +61,17 @@ void LLNameBox::showProfile() // virtual BOOL LLNameBox::handleRightMouseDown(S32 x, S32 y, MASK mask) { - if (!mAllowInteract) return; - - if (!LLTextBox::handleRightMouseDown(x, y, mask)) + auto handled = LLTextBox::handleRightMouseDown(x, y, mask); + if (mAllowInteract && !handled) { // Singu TODO: Generic menus for groups - if (mIsGroup || mNameID.isNull()) return FALSE; - - showMenu(this, sMenus[0], x, y); + if (!mIsGroup && mNameID.notNull()) + { + showMenu(this, sMenus[0], x, y); + handled = true; + } } - return TRUE; + return handled; } // virtual diff --git a/indra/newview/llnameeditor.cpp b/indra/newview/llnameeditor.cpp index 86c9f89a6..7d507509c 100644 --- a/indra/newview/llnameeditor.cpp +++ b/indra/newview/llnameeditor.cpp @@ -59,20 +59,19 @@ LLNameEditor::LLNameEditor(const std::string& name, const LLRect& rect, // virtual 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; // 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"; } - else if (!simple_menu && !mIsGroup) + else if (simple_menu && !mIsGroup) { new_menu = "menu_nameeditor_avatar.xml"; } if (!new_menu.empty()) setContextMenu(LLUICtrlFactory::instance().buildMenu(new_menu, LLMenuGL::sMenuContainer)); + sActive = this; return LLLineEditor::handleRightMouseDown(x, y, mask); } diff --git a/indra/newview/skins/default/xui/en-us/menu_nameeditor_avatar.xml b/indra/newview/skins/default/xui/en-us/menu_nameeditor_avatar.xml new file mode 100644 index 000000000..7f7f6995a --- /dev/null +++ b/indra/newview/skins/default/xui/en-us/menu_nameeditor_avatar.xml @@ -0,0 +1,3 @@ + + +