Fix whoopses from mid-development commits
Fixes compiles and fixes menu crash and missing menu file
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
<menu name="Avatar Name Editor Menu" filename="menu_avs_list.xml">
|
||||
<menu name="Text" filename="menu_texteditor.xml"/>
|
||||
</menu>
|
||||
Reference in New Issue
Block a user