summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermenu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewermenu.cpp')
-rw-r--r--indra/newview/llviewermenu.cpp100
1 files changed, 100 insertions, 0 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 5a1228768c..135384ab52 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"
@@ -2188,6 +2192,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 //
@@ -6775,6 +6786,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)
@@ -6903,6 +6943,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();
@@ -10026,6 +10119,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
@@ -10130,6 +10226,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");
@@ -10230,6 +10327,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));