diff options
Diffstat (limited to 'indra/newview/llviewermenu.cpp')
| -rw-r--r-- | indra/newview/llviewermenu.cpp | 200 |
1 files changed, 199 insertions, 1 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 554c7ebcb2..6dc87e9aa3 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" @@ -147,6 +151,7 @@ #include "llviewershadermgr.h" #include "gltfscenemanager.h" #include "gltf/asset.h" +#include "rlvcommon.h" using namespace LLAvatarAppearanceDefines; @@ -2230,6 +2235,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 // @@ -4052,6 +4064,44 @@ void handle_avatar_eject(const LLSD& avatar_id) } } +void handle_avatar_estate_kick(const LLSD& avatar_id) +{ + LLUUID id = avatar_id.asUUID(); + if (id.isNull()) + { + LLVOAvatar* avatar = find_avatar_from_object( + LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()); + if (avatar) id = avatar->getID(); + } + if (id.notNull()) + { + LLAvatarActions::estateKickAvatar(id); + } +} + +void handle_avatar_estate_ban(const LLSD& avatar_id) +{ + LLUUID id = avatar_id.asUUID(); + if (id.isNull()) + { + LLVOAvatar* avatar = find_avatar_from_object( + LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()); + if (avatar) id = avatar->getID(); + } + if (id.notNull()) + { + LLAvatarActions::estateBanAvatar(id); + } +} + +bool enable_estate_eject_ban(const LLSD& avatar_id) +{ + LLViewerRegion* region = gAgent.getRegion(); + if (!region) return false; + if (gAgent.isGodlike()) return true; + return region->getOwner() == gAgent.getID() || region->isEstateManager(); +} + bool my_profile_visible() { LLFloater* floaterp = LLAvatarActions::getProfileFloater(gAgentID); @@ -4622,7 +4672,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); @@ -4765,12 +4815,37 @@ class LLViewMouselook : public view_listener_t { bool handleEvent(const LLSD& userdata) { + // When OTS is enabled M toggles OTS mode (shoulder cam). + // When disabled M toggles normal first-person mouselook. + if (gSavedSettings.getBOOL("OTSEnabled")) + { + if (!gAgentCamera.cameraOTS()) + { + gAgentCamera.changeCameraToOTS(); + } + else + { + gAgentCamera.changeCameraFromOTS(); + } + return true; + } + if (!gAgentCamera.cameraMouselook()) { gAgentCamera.changeCameraToMouselook(); } else { + // NaCl: restore FOV on mouselook exit + LLVector3 mlFovValues = gSavedSettings.getVector3("_NACL_MLFovValues"); + F32 cameraAngle = gSavedSettings.getF32("CameraAngle"); + if (mlFovValues.mV[VZ] > 0.0f) + { + mlFovValues.mV[VY] = cameraAngle; + mlFovValues.mV[VZ] = 0.0f; + gSavedSettings.setVector3("_NACL_MLFovValues", mlFovValues); + gSavedSettings.setF32("CameraAngle", mlFovValues.mV[VX]); + } gAgentCamera.changeCameraToDefault(); } return true; @@ -6433,6 +6508,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); @@ -6664,6 +6741,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) @@ -6766,6 +6863,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) @@ -6929,6 +7055,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(); @@ -7037,6 +7216,13 @@ void handle_hover_height() LLFloaterReg::showInstance("edit_hover_height"); } +// Firestorm port: Quick Preferences floater (hover height, bandwidth) +void handle_quick_prefs() +{ + LLFloaterReg::toggleInstance("quick_prefs"); +} +// End Firestorm port + void handle_edit_physics() { LLFloaterSidePanelContainer::showPanel("appearance", LLSD().with("type", "edit_physics")); @@ -7776,6 +7962,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; @@ -9865,6 +10052,7 @@ void initialize_menus() commit.add("EditShape", boost::bind(&handle_edit_shape)); commit.add("HoverHeight", boost::bind(&handle_hover_height)); commit.add("EditPhysics", boost::bind(&handle_edit_physics)); + commit.add("QuickPrefs", boost::bind(&handle_quick_prefs)); // Firestorm port // View menu view_listener_t::addMenu(new LLViewMouselook(), "View.Mouselook"); @@ -10105,6 +10293,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 @@ -10204,6 +10395,9 @@ void initialize_menus() view_listener_t::addMenu(new LLAvatarVisibleDebug(), "Avatar.VisibleDebug"); view_listener_t::addMenu(new LLAvatarInviteToGroup(), "Avatar.InviteToGroup"); commit.add("Avatar.Eject", boost::bind(&handle_avatar_eject, LLSD())); + commit.add("Avatar.EstateKick", boost::bind(&handle_avatar_estate_kick, _2)); + commit.add("Avatar.EstateBan", boost::bind(&handle_avatar_estate_ban, _2)); + enable.add("Avatar.EnableEstateEjectBan", boost::bind(&enable_estate_eject_ban, _2)); commit.add("Avatar.ShowInspector", boost::bind(&handle_avatar_show_inspector)); view_listener_t::addMenu(new LLAvatarSendIM(), "Avatar.SendIM"); view_listener_t::addMenu(new LLAvatarCall(), "Avatar.Call"); @@ -10212,6 +10406,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"); @@ -10315,6 +10510,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)); |
