diff options
Diffstat (limited to 'indra/newview/lltoolpie.cpp')
-rw-r--r-- | indra/newview/lltoolpie.cpp | 43 |
1 files changed, 27 insertions, 16 deletions
diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index 5ed8dc5fb9..74fbce890d 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -1243,8 +1243,6 @@ bool LLToolPie::handleMediaClick(const LLPickInfo& pick) return false; } - - // Does this face have media? const LLTextureEntry* tep = objectp->getTE(pick.mObjectFace); if(!tep) @@ -1257,11 +1255,11 @@ bool LLToolPie::handleMediaClick(const LLPickInfo& pick) viewer_media_t media_impl = mep ? LLViewerMedia::getMediaImplFromTextureID(mep->getMediaID()) : NULL; - if (gSavedSettings.getBOOL("MediaOnAPrimUI") - && media_impl.notNull()) + if (gSavedSettings.getBOOL("MediaOnAPrimUI")) { - if (!LLViewerMediaFocus::getInstance()->isFocusedOnFace(pick.getObject(), pick.mObjectFace) ) + if (!LLViewerMediaFocus::getInstance()->isFocusedOnFace(pick.getObject(), pick.mObjectFace) || media_impl.isNull()) { + // It's okay to give this a null impl LLViewerMediaFocus::getInstance()->setFocusFace(pick.getObject(), pick.mObjectFace, media_impl, pick.mNormal); } else @@ -1445,28 +1443,29 @@ BOOL LLToolPie::pickRightMouseDownCallback() { LLParcelSelectionHandle selection = LLViewerParcelMgr::getInstance()->selectParcelAt( mPick.mPosGlobal ); gMenuHolder->setParcelSelection(selection); - gPieLand->show(x, y); + gMenuLand->show(x, y); showVisualContextMenuEffect(); } else if (mPick.mObjectID == gAgent.getID() ) { - if(!gPieSelf) + if(!gMenuAvatarSelf) { //either at very early startup stage or at late quitting stage, //this event is ignored. return TRUE ; } - gPieSelf->show(x, y); + gMenuAvatarSelf->show(x, y); } else if (object) { gMenuHolder->setObjectSelection(LLSelectMgr::getInstance()->getSelection()); + bool is_other_attachment = (object->isAttachment() && !object->isHUDAttachment() && !object->permYouOwner()); if (object->isAvatar() - || (object->isAttachment() && !object->isHUDAttachment() && !object->permYouOwner())) + || is_other_attachment) { // Find the attachment's avatar while( object && object->isAttachment()) @@ -1477,20 +1476,30 @@ BOOL LLToolPie::pickRightMouseDownCallback() // Object is an avatar, so check for mute by id. LLVOAvatar* avatar = (LLVOAvatar*)object; std::string name = avatar->getFullname(); + std::string mute_msg; if (LLMuteList::getInstance()->isMuted(avatar->getID(), avatar->getFullname())) { - gMenuHolder->childSetText("Avatar Mute", std::string("Unmute")); // *TODO:Translate + mute_msg = LLTrans::getString("UnmuteAvatar"); } else { - gMenuHolder->childSetText("Avatar Mute", std::string("Mute")); // *TODO:Translate + mute_msg = LLTrans::getString("MuteAvatar"); } - gPieAvatar->show(x, y); + if (is_other_attachment) + { + gMenuAttachmentOther->getChild<LLUICtrl>("Avatar Mute")->setValue(mute_msg); + gMenuAttachmentOther->show(x, y); + } + else + { + gMenuAvatarOther->getChild<LLUICtrl>("Avatar Mute")->setValue(mute_msg); + gMenuAvatarOther->show(x, y); + } } else if (object->isAttachment()) { - gPieAttachment->show(x, y); + gMenuAttachmentSelf->show(x, y); } else { @@ -1501,16 +1510,18 @@ BOOL LLToolPie::pickRightMouseDownCallback() { name = node->mName; } + std::string mute_msg; if (LLMuteList::getInstance()->isMuted(object->getID(), name)) { - gMenuHolder->childSetText("Object Mute", std::string("Unmute")); // *TODO:Translate + mute_msg = LLTrans::getString("UnmuteObject"); } else { - gMenuHolder->childSetText("Object Mute", std::string("Mute")); // *TODO:Translate + mute_msg = LLTrans::getString("MuteObject"); } - gPieObject->show(x, y); + gMenuHolder->childSetText("Object Mute", mute_msg); + gMenuObject->show(x, y); showVisualContextMenuEffect(); } |