diff options
Diffstat (limited to 'indra/newview/llviewermenu.cpp')
| -rw-r--r-- | indra/newview/llviewermenu.cpp | 127 | 
1 files changed, 126 insertions, 1 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index f7688b762f..452a2cec50 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -39,6 +39,7 @@  #include "llfloaterreg.h"  #include "llfloatersidepanelcontainer.h"  #include "llinventorypanel.h" +#include "llsidepanelinventory.h"  #include "llnotifications.h"  #include "llnotificationsutil.h"  #include "llviewereventrecorder.h" @@ -52,6 +53,9 @@  #include "llagentui.h"  #include "llagentwearables.h"  #include "llagentpilot.h" +// [SL:KB] - Patch: Appearance-PhantomAttach | Checked: Catznip-5.0 +#include "llattachmentsmgr.h" +// [/SL:KB]  #include "llcompilequeue.h"  #include "llconsole.h"  #include "lldebugview.h" @@ -73,6 +77,7 @@  #include "llfloaterpay.h"  #include "llfloaterreporter.h"  #include "llfloatersearch.h" +#include "fsfloatersearch.h"  #include "llfloaterscriptdebug.h"  #include "llfloatersnapshot.h"  #include "llfloatertools.h" @@ -148,6 +153,7 @@  #include "llviewershadermgr.h"  #include "gltfscenemanager.h"  #include "gltf/asset.h" +#include "rlvcommon.h"  using namespace LLAvatarAppearanceDefines; @@ -2173,6 +2179,13 @@ class LLAdvancedRebakeTextures : public view_listener_t  }; +// [SL:KB] - Patch: Appearance-PhantomAttach | Checked: Catznip-5.0 +void handle_refresh_attachments() +{ +    LLAttachmentsMgr::instance().refreshAttachments(); +} +// [/SL:KB] +  #if 1 //ndef LL_RELEASE_FOR_DOWNLOAD  ///////////////////////////  // DEBUG AVATAR TEXTURES // @@ -4496,7 +4509,7 @@ void handle_object_sit(LLViewerObject* object, const LLVector3& offset)  {      // get object selection offset -    if (object && object->getPCode() == LL_PCODE_VOLUME) +    if (gAgent.isAllowedToSit() && object && object->getPCode() == LL_PCODE_VOLUME)      {          gMessageSystem->newMessageFast(_PREHASH_AgentRequestSit); @@ -6307,6 +6320,8 @@ void show_debug_menus()          gMenuBarView->setItemVisible("Advanced", debug);  //      gMenuBarView->setItemEnabled("Advanced", debug); // Don't disable Advanced keyboard shortcuts when hidden +        Rlv::Util::menuToggleVisible(); +          gMenuBarView->setItemVisible("Debug", qamode);          gMenuBarView->setItemEnabled("Debug", qamode); @@ -6538,6 +6553,26 @@ bool handle_zoom_to_object(const LLUUID& object_id)      return false;  } +void handle_teleport_to_object(LLUUID object_id) +{ +    LLViewerObject* object = gObjectList.findObject(object_id); + +    if (object) +    { +        gAgentCamera.setFocusOnAvatar(FALSE, ANIMATE); + +        LLBBox bbox = object->getBoundingBoxAgent() ; + +        LLVector3 obj_to_cam = LLViewerCamera::getInstance()->getOrigin() - bbox.getCenterAgent(); +        obj_to_cam.normVec(); + + +            LLVector3d object_center_global = gAgent.getPosGlobalFromAgent(bbox.getCenterAgent()); + +            gAgent.teleportViaLocation(object_center_global); +    } +} +  class LLAvatarInviteToGroup : public view_listener_t  {      bool handleEvent(const LLSD& userdata) @@ -6640,6 +6675,35 @@ class LLAvatarToggleSearch : public view_listener_t      }  }; +// <FS:CR> Resync Animations +class FSToolsResyncAnimations : public view_listener_t +{ +    bool handleEvent(const LLSD& userdata) +    { +        for (S32 i = 0; i < gObjectList.getNumObjects(); i++) +        { +            LLViewerObject* object = gObjectList.getObject(i); +            if (object && +                object->isAvatar()) +            { +                LLVOAvatar* avatarp = (LLVOAvatar*)object; +                if (avatarp) +                { +                    for (LLVOAvatar::AnimIterator anim_it = avatarp->mPlayingAnimations.begin(); +                         anim_it != avatarp->mPlayingAnimations.end(); +                         anim_it++) +                    { +                        avatarp->stopMotion(anim_it->first, true); +                        avatarp->startMotion(anim_it->first); +                    } +                } +            } +        } +        return true; +    } +}; +// </FS:CR> Resync Animations +  class LLAvatarResetSkeleton : public view_listener_t  {      bool handleEvent(const LLSD& userdata) @@ -6806,6 +6870,59 @@ void handle_give_money_dialog()      }  } +LLFloaterSidePanelContainer* get_favorite_inventory_folder() +{ +    LLUUID folder_id = LLUUID(gSavedPerAccountSettings.getString("FavoriteFolder")); +    if (!folder_id.isNull()) +    { +        LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("inventory"); +        for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); iter != inst_list.end();) +        { +            LLFloaterSidePanelContainer* inventory_container = dynamic_cast<LLFloaterSidePanelContainer*>(*iter++); +            if (inventory_container) +            { +                LLSidepanelInventory* sidepanel_inventory = dynamic_cast<LLSidepanelInventory*>(inventory_container->findChild<LLPanel>("main_panel", true)); +                if (sidepanel_inventory) +                { +                    LLPanelMainInventory* main_inventory = sidepanel_inventory->getMainInventoryPanel(); +                    if (main_inventory && main_inventory->isSingleFolderMode() +                        && (main_inventory->getCurrentSFVRoot() == folder_id)) +                    { +                        return inventory_container; +                    } +                } +            } +        } +    } + +    return NULL; +} + +void toggle_favorite_inventory_folder() +{ +    LLUUID folder_id = LLUUID(gSavedPerAccountSettings.getString("FavoriteFolder")); +    if ((folder_id.isNull()) || (!gInventory.getCategory(folder_id))) +    { +        LLNotificationsUtil::add("MissingFavoriteFolder"); +        return; +    } + +    LLFloaterSidePanelContainer* inventory_container = get_favorite_inventory_folder(); +    if (inventory_container) +    { +        inventory_container->closeFloater(); +    } +    else +    { +        LLPanelMainInventory::newFolderWindow(folder_id); +    } +} + +bool favorite_inventory_folder_visible() +{ +    return (get_favorite_inventory_folder() != NULL); +} +  bool enable_pay_avatar()  {      LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); @@ -7653,6 +7770,7 @@ bool enable_detach(const LLSD&)      // Only enable detach if all faces of object are selected      if (!object ||          !object->isAttachment() || +        object->isLocked() ||          !LLSelectMgr::getInstance()->getSelection()->contains(object,SELECT_ALL_TES ))      {          return false; @@ -9974,6 +10092,9 @@ void initialize_menus()      view_listener_t::addMenu(new LLAdvancedCheckDebugCharacterVis(), "Advanced.CheckDebugCharacterVis");      view_listener_t::addMenu(new LLAdvancedDumpAttachments(), "Advanced.DumpAttachments");      view_listener_t::addMenu(new LLAdvancedRebakeTextures(), "Advanced.RebakeTextures"); +// [SL:KB] - Patch: Appearance-PhantomAttach | Checked: Catznip-5.0 +    commit.add("Advanced.RefreshAttachments", boost::bind(&handle_refresh_attachments)); +// [/SL:KB]      view_listener_t::addMenu(new LLAdvancedDebugAvatarTextures(), "Advanced.DebugAvatarTextures");      view_listener_t::addMenu(new LLAdvancedDumpAvatarLocalTextures(), "Advanced.DumpAvatarLocalTextures");      // Advanced > Network @@ -10081,6 +10202,7 @@ void initialize_menus()      view_listener_t::addMenu(new LLAvatarToggleMyProfile(), "Avatar.ToggleMyProfile");      view_listener_t::addMenu(new LLAvatarTogglePicks(), "Avatar.TogglePicks");      view_listener_t::addMenu(new LLAvatarToggleSearch(), "Avatar.ToggleSearch"); +    view_listener_t::addMenu(new FSToolsResyncAnimations(), "Tools.ResyncAnimations");  // <FS:CR> Resync Animations      view_listener_t::addMenu(new LLAvatarResetSkeleton(), "Avatar.ResetSkeleton");      view_listener_t::addMenu(new LLAvatarEnableResetSkeleton(), "Avatar.EnableResetSkeleton");      view_listener_t::addMenu(new LLAvatarResetSkeletonAndAnimations(), "Avatar.ResetSkeletonAndAnimations"); @@ -10182,6 +10304,9 @@ void initialize_menus()      commit.add("Inventory.NewWindow", boost::bind(&LLPanelMainInventory::newWindow)); +    commit.add("Inventory.OpenFavoriteFolder", boost::bind(&toggle_favorite_inventory_folder)); +    enable.add("Inventory.IsFavoriteFolderOpen", boost::bind(&favorite_inventory_folder_visible)); +      enable.add("EnablePayObject", boost::bind(&enable_pay_object));      enable.add("EnablePayAvatar", boost::bind(&enable_pay_avatar));      enable.add("EnableEdit", boost::bind(&enable_object_edit));  | 
