diff --git a/indra/newview/llinspectavatar.cpp b/indra/newview/llinspectavatar.cpp index 624eddcf92..ac78e06a4e 100644 --- a/indra/newview/llinspectavatar.cpp +++ b/indra/newview/llinspectavatar.cpp @@ -317,10 +317,16 @@ void LLInspectAvatar::onOpen(const LLSD& data) mAvatarID = data["avatar_id"]; // Undo CHUI-90 and make avatar inspector useful again - BOOL self = mAvatarID == gAgent.getID(); + BOOL self = mAvatarID == gAgentID; - getChild("gear_self_btn")->setVisible(self); getChild("gear_btn")->setVisible(!self); + LLMenuButton* gear_self_btn = getChild("gear_self_btn"); + gear_self_btn->setVisible(self); + + if (self) + { + gear_self_btn->setMenu(gMenuInspectSelf); + } // // Position the inspector relative to the mouse cursor @@ -356,6 +362,7 @@ void LLInspectAvatar::onOpen(const LLSD& data) void LLInspectAvatar::onClose(bool app_quitting) { getChild("gear_btn")->hideMenu(); + getChild("gear_self_btn")->hideMenu(); } // diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 464ee62504..d1f3ae5101 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -222,6 +222,12 @@ PieMenu *gPieMenuLand = NULL; PieMenu *gPieMenuMuteParticle = NULL; // Pie menu +// FIRE-7893: Detach function on inspect self toast without function +LLToggleableMenu *gMenuInspectSelf = NULL; +LLContextMenu *gInspectSelfDetachScreenMenu = NULL; +LLContextMenu *gInspectSelfDetachMenu = NULL; +// + const std::string SAVE_INTO_TASK_INVENTORY("Save Object Back to Object Contents"); LLMenuGL* gAttachSubMenu = NULL; @@ -573,6 +579,14 @@ void init_menus() "menu_pie_mute_particle.xml", gMenuHolder, registry); // Pie menu + // FIRE-7893: Detach function on inspect self toast without function + gMenuInspectSelf = LLUICtrlFactory::createFromFile( + "menu_inspect_self_gear.xml", gMenuHolder, registry); + + gInspectSelfDetachScreenMenu = gMenuHolder->getChild("Inspect Self Detach HUD", true); + gInspectSelfDetachMenu = gMenuHolder->getChild("Inspect Self Detach", true); + // + /// /// set up the colors /// @@ -2893,6 +2907,11 @@ void cleanup_menus() gPieMenuMuteParticle = NULL; // + // FIRE-7893: Detach function on inspect self toast without function + delete gMenuInspectSelf; + gMenuInspectSelf = NULL; + // + delete gMenuBarView; gMenuBarView = NULL; diff --git a/indra/newview/llviewermenu.h b/indra/newview/llviewermenu.h index b84d55ff83..f6e40c1d91 100644 --- a/indra/newview/llviewermenu.h +++ b/indra/newview/llviewermenu.h @@ -29,6 +29,7 @@ #include "llmenugl.h" #include "llsafehandle.h" +#include "lltoggleablemenu.h" // FIRE-7893: Detach function on inspect self toast without function #include "piemenu.h" class LLMessageSystem; @@ -248,6 +249,12 @@ extern PieMenu* gPieAttachBodyPartMenus[PIE_MAX_SLICES]; extern PieMenu* gPieDetachBodyPartMenus[PIE_MAX_SLICES]; // Pie Menu +// FIRE-7893: Detach function on inspect self toast without function +extern LLToggleableMenu *gMenuInspectSelf; +extern LLContextMenu *gInspectSelfDetachScreenMenu; +extern LLContextMenu *gInspectSelfDetachMenu; +// + extern LLMenuItemCallGL* gAutorespondMenu; extern LLMenuItemCallGL* gAutorespondNonFriendsMenu; diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index f2022109dd..a37e8319ae 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -583,6 +583,8 @@ BOOL LLVOAvatarSelf::buildMenus() if (gDetachBodyPartPieMenus[i]) { gDetachPieMenu->appendContextSubMenu( gDetachBodyPartPieMenus[i] ); + // FIRE-7893: "Detach" sub-menu on inspect menu without function + gInspectSelfDetachMenu->appendContextSubMenu( gDetachBodyPartPieMenus[i] ); } else { @@ -611,6 +613,8 @@ BOOL LLVOAvatarSelf::buildMenus() LLMenuItemCallGL* item = LLUICtrlFactory::create(item_params); gDetachPieMenu->addChild(item); + // FIRE-7893: "Detach" sub-menu on inspect menu without function + gInspectSelfDetachMenu->addChild(item); break; } @@ -754,6 +758,8 @@ BOOL LLVOAvatarSelf::buildMenus() item_params.on_enable.parameter = iter->first; item = LLUICtrlFactory::create(item_params); gDetachScreenPieMenu->addChild(item); + // FIRE-7893: "Detach" sub-menu on inspect menu without function + gInspectSelfDetachScreenMenu->addChild(item); // Pie menu slice_params.name =(slice_params.label ); diff --git a/indra/newview/skins/default/xui/de/menu_inspect_self_gear.xml b/indra/newview/skins/default/xui/de/menu_inspect_self_gear.xml index 5979194bfb..bf00b14195 100644 --- a/indra/newview/skins/default/xui/de/menu_inspect_self_gear.xml +++ b/indra/newview/skins/default/xui/de/menu_inspect_self_gear.xml @@ -17,8 +17,8 @@ - - + + diff --git a/indra/newview/skins/default/xui/en/inspect_avatar.xml b/indra/newview/skins/default/xui/en/inspect_avatar.xml index 75378b567a..cd4c7a4360 100644 --- a/indra/newview/skins/default/xui/en/inspect_avatar.xml +++ b/indra/newview/skins/default/xui/en/inspect_avatar.xml @@ -173,7 +173,6 @@ follows="top|left" height="20" image_overlay="OptionsMenu_Off" - menu_filename="menu_inspect_self_gear.xml" name="gear_self_btn" right="-5" top_delta="0" diff --git a/indra/newview/skins/default/xui/en/menu_inspect_self_gear.xml b/indra/newview/skins/default/xui/en/menu_inspect_self_gear.xml index ef83bdfbd6..520f84503e 100644 --- a/indra/newview/skins/default/xui/en/menu_inspect_self_gear.xml +++ b/indra/newview/skins/default/xui/en/menu_inspect_self_gear.xml @@ -1,7 +1,7 @@ + name="Gear Menu"> + name="Inspect Self Detach HUD" /> + name="Inspect Self Detach" />