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

@@ -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);
}