From aa67d6cd7a60838c343cf89bac20e438e524daa8 Mon Sep 17 00:00:00 2001 From: Bennett Goble Date: Sat, 30 Mar 2024 21:21:55 -0700 Subject: Remove BuildParams This file is no longer used. --- BuildParams | 73 ------------------------------------------------------------- build.sh | 3 --- 2 files changed, 76 deletions(-) delete mode 100644 BuildParams diff --git a/BuildParams b/BuildParams deleted file mode 100644 index dda25e3e63..0000000000 --- a/BuildParams +++ /dev/null @@ -1,73 +0,0 @@ -# BuildParams -# -# Please refer to: -# https://wiki.secondlife.com/wiki/Automated_Build_System - -# Variants (NOTE: 'Release' must be last for uploads to work correctly) -variants = "RelWithDebInfo Release" - -# Use Public Upload Locations -public_build = true -build_docs = true - -# enable Doxygen building on Linux for TeamCity (it can be done manually on any platform) -build_Linux_Doxygen = true - -# Need viewer-build-variables as well as other shared repositories -buildscripts_shared_more_NAMEs="build_secrets build_variables git_hooks" - -# Python 3 / SL-15742 -BUILDSCRIPTS_PY3 = "true" - -################################################################ -#### Examples of how to set the viewer_channel #### -# -# To build a Release or Release candidate in build bingo: -# bingo.viewer_channel = "Second Life Release" -# -# To build a Beta for the 'Bingo' project in build bingo: -# bingo.viewer_channel = "Second Life Beta Bingo" -# -# To build a Project viewer for the 'Bingo' project in build bingo: -# bingo.viewer_channel = "Second Life Project Bingo" -# -# If left unset, viewer_channel defaults to 'Second Life Test', -# which is appropriate for individual developer builds. -# -# All Linden Lab builds (and only Linden Lab builds) -# should use a viewer_channel that begins with "Second Life" -################################################################ -viewer_channel = "Second Life Test" - - -################################################################ -# Special packaging parameters. -# These parameters can be used to create additional packages -# which identify themselves in a distinct way with either -# a sourceid (sent to web services) or a channel name (sent to login) -# the default sourceid should always be a null string: -sourceid = "" -# the additional_packages variable is a blank separated list of package prefixes: -# additional_packages = "" -# to set the special values for a package, create variables using each prefix: -# additional_packages = "Foo Bar" -# Foo_sourceid = "bingo" -# Foo_viewer_channel_suffix = "Foo" -# Bar_sourceid = "bongo" -# Bar_viewer_channel_suffix = "Bar" -# the viewer_channel_suffix is prefixed by a blank and then appended to the viewer_channel -# for the package in a setting that overrides the compiled-in value -################################################################ -additional_packages = "EDU" -Linux.additional_packages = "" - -# The EDU package allows us to create a separate release channel whose expirations -# are synchronized as much as possible with the academic year -EDU_sourceid = "" -EDU_viewer_channel_suffix = "edu" - -# Notifications - to configure email notices use the TeamCity parameter -# setting screen for your project or build configuration to set the -# environment variable 'email' to a space-separated list of email addresses -email="" - diff --git a/build.sh b/build.sh index 251a04a6dd..806718e077 100755 --- a/build.sh +++ b/build.sh @@ -6,9 +6,6 @@ # it relies on the environment that sets up, functions it provides, and # the build result post-processing it does. # -# The shared buildscript build.sh invokes this because it is named 'build.sh', -# which is the default custom build script name in buildscripts/hg/BuildParams -# # PLEASE NOTE: # # * This script is interpreted on three platforms, including windows and cygwin -- cgit v1.2.3 From 6e761c0d7d4a028108292f49dbfe832d1b650945 Mon Sep 17 00:00:00 2001 From: Bennett Goble Date: Wed, 10 Apr 2024 21:21:09 -0700 Subject: Remove unused fix-incredibuild.py --- indra/fix-incredibuild.py | 61 ----------------------------------------------- 1 file changed, 61 deletions(-) delete mode 100755 indra/fix-incredibuild.py diff --git a/indra/fix-incredibuild.py b/indra/fix-incredibuild.py deleted file mode 100755 index 678ee4329e..0000000000 --- a/indra/fix-incredibuild.py +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env python3 -## -## $LicenseInfo:firstyear=2011&license=viewerlgpl$ -## Second Life Viewer Source Code -## Copyright (C) 2011, Linden Research, Inc. -## -## This library is free software; you can redistribute it and/or -## modify it under the terms of the GNU Lesser General Public -## License as published by the Free Software Foundation; -## version 2.1 of the License only. -## -## This library is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## Lesser General Public License for more details. -## -## You should have received a copy of the GNU Lesser General Public -## License along with this library; if not, write to the Free Software -## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -## -## Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA -## $/LicenseInfo$ - -import sys -import os -import glob - -def delete_file_types(path, filetypes): - if os.path.exists(path): - print('Cleaning: ' + path) - orig_dir = os.getcwd(); - os.chdir(path) - filelist = [] - for type in filetypes: - filelist.extend(glob.glob(type)) - for file in filelist: - os.remove(file) - os.chdir(orig_dir) - -def main(): - build_types = ['*.exp','*.exe','*.pdb','*.idb', - '*.ilk','*.lib','*.obj','*.ib_pdb_index'] - pch_types = ['*.pch'] - delete_file_types("build-vc80/newview/Release", build_types) - delete_file_types("build-vc80/newview/secondlife-bin.dir/Release/", - pch_types) - delete_file_types("build-vc80/newview/RelWithDebInfo", build_types) - delete_file_types("build-vc80/newview/secondlife-bin.dir/RelWithDebInfo/", - pch_types) - delete_file_types("build-vc80/newview/Debug", build_types) - delete_file_types("build-vc80/newview/secondlife-bin.dir/Debug/", - pch_types) - - - delete_file_types("build-vc80/test/RelWithDebInfo", build_types) - delete_file_types("build-vc80/test/test.dir/RelWithDebInfo/", - pch_types) - - -if __name__ == "__main__": - main() -- cgit v1.2.3 From e84107b25efdc838966408cff5e214717a3c11a6 Mon Sep 17 00:00:00 2001 From: Bennett Goble Date: Thu, 11 Apr 2024 00:16:17 -0700 Subject: CI: Remove python-version from matrix Drop python version from matrix configuration as it's always 3.11. --- .github/workflows/build.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ddb0f44150..f18b31ef0f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -13,7 +13,6 @@ jobs: matrix: runner: [windows-large, macos-12-xl] configuration: [Release, ReleaseOS] - python-version: ["3.11"] include: - runner: macos-12-xl developer_dir: "/Applications/Xcode_14.0.1.app/Contents/Developer" @@ -67,7 +66,7 @@ jobs: - name: Setup python uses: actions/setup-python@v5 with: - python-version: ${{ matrix.python-version }} + python-version: "3.11" - name: Checkout build variables uses: actions/checkout@v4 -- cgit v1.2.3 From d378c721bb3b59482c259cdce9cb74f5645f36d6 Mon Sep 17 00:00:00 2001 From: Bennett Goble Date: Thu, 11 Apr 2024 13:32:48 -0700 Subject: CI: adopt xz compression Move towards packaging artifacts with xz, which offers higher compression ratios and faster decode time. --- .github/workflows/build.yaml | 58 +++++++++++++++------------------------- build.sh | 10 +++---- indra/newview/CMakeLists.txt | 12 ++++----- indra/newview/viewer_manifest.py | 14 +++++----- 4 files changed, 40 insertions(+), 54 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f18b31ef0f..44f32c1c5d 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -12,13 +12,10 @@ jobs: strategy: matrix: runner: [windows-large, macos-12-xl] - configuration: [Release, ReleaseOS] + configuration: [Release] include: - runner: macos-12-xl developer_dir: "/Applications/Xcode_14.0.1.app/Contents/Developer" - exclude: - - runner: macos-12-xl - configuration: ReleaseOS runs-on: ${{ matrix.runner }} outputs: viewer_channel: ${{ steps.build.outputs.viewer_channel }} @@ -100,7 +97,7 @@ jobs: - name: Determine source branch id: which-branch - uses: secondlife/viewer-build-util/which-branch@v1 + uses: secondlife/viewer-build-util/which-branch@v2 with: token: ${{ github.token }} @@ -223,7 +220,7 @@ jobs: - name: Upload executable if: matrix.configuration != 'ReleaseOS' && steps.build.outputs.viewer_app - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: "${{ steps.build.outputs.artifact }}-app" path: | @@ -233,7 +230,7 @@ jobs: # artifact for that too. - name: Upload symbol file if: matrix.configuration != 'ReleaseOS' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: "${{ steps.build.outputs.artifact }}-symbols" path: | @@ -241,7 +238,7 @@ jobs: - name: Upload metadata if: matrix.configuration != 'ReleaseOS' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: "${{ steps.build.outputs.artifact }}-metadata" # emitted by build.sh, possibly multiple lines @@ -249,7 +246,7 @@ jobs: ${{ steps.build.outputs.metadata }} - name: Upload physics package - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 # should only be set for viewer-private if: matrix.configuration != 'ReleaseOS' && steps.build.outputs.physicstpv with: @@ -270,7 +267,7 @@ jobs: steps: - name: Sign and package Windows viewer if: env.AZURE_KEY_VAULT_URI && env.AZURE_CERT_NAME && env.AZURE_CLIENT_ID && env.AZURE_CLIENT_SECRET && env.AZURE_TENANT_ID - uses: secondlife/viewer-build-util/sign-pkg-windows@v1 + uses: secondlife/viewer-build-util/sign-pkg-windows@v2 with: vault_uri: "${{ env.AZURE_KEY_VAULT_URI }}" cert_name: "${{ env.AZURE_CERT_NAME }}" @@ -309,7 +306,7 @@ jobs: - name: Sign and package Mac viewer if: env.SIGNING_CERT_MACOS && env.SIGNING_CERT_MACOS_IDENTITY && env.SIGNING_CERT_MACOS_PASSWORD && steps.note-creds.outputs.note_user && steps.note-creds.outputs.note_pass && steps.note-creds.outputs.note_team - uses: secondlife/viewer-build-util/sign-pkg-mac@v1 + uses: secondlife/viewer-build-util/sign-pkg-mac@v2 with: channel: ${{ needs.build.outputs.viewer_channel }} imagename: ${{ needs.build.outputs.imagename }} @@ -329,7 +326,7 @@ jobs: steps: - name: Post Windows symbols if: env.BUGSPLAT_USER && env.BUGSPLAT_PASS - uses: secondlife/viewer-build-util/post-bugsplat-windows@v1 + uses: secondlife/viewer-build-util/post-bugsplat-windows@v2 with: username: ${{ env.BUGSPLAT_USER }} password: ${{ env.BUGSPLAT_PASS }} @@ -346,7 +343,7 @@ jobs: steps: - name: Post Mac symbols if: env.BUGSPLAT_USER && env.BUGSPLAT_PASS - uses: secondlife/viewer-build-util/post-bugsplat-mac@v1 + uses: secondlife/viewer-build-util/post-bugsplat-mac@v2 with: username: ${{ env.BUGSPLAT_USER }} password: ${{ env.BUGSPLAT_PASS }} @@ -359,31 +356,20 @@ jobs: runs-on: ubuntu-latest if: github.ref_type == 'tag' && startsWith(github.ref_name, 'Second_Life_') steps: - - uses: actions/download-artifact@v3 - with: - name: Windows-installer - - - uses: actions/download-artifact@v3 - with: - name: macOS-installer - - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: - name: Windows-metadata - - - name: Rename windows metadata - run: | - mv autobuild-package.xml Windows-autobuild-package.xml - mv newview/viewer_version.txt Windows-viewer_version.txt + pattern: "*-installer" - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: - name: macOS-metadata - - - name: Rename macOS metadata + pattern: "*-metadata" + + - name: Rename metadata run: | - mv autobuild-package.xml macOS-autobuild-package.xml - mv newview/viewer_version.txt macOS-viewer_version.txt + cp Windows-metadata/autobuild-package.xml Windows-autobuild-package.xml + cp Windows-metadata/newview/viewer_version.txt Windows-viewer_version.txt + cp macOS-metadata/autobuild-package.xml macOS-autobuild-package.xml + cp macOS-metadata/newview/viewer_version.txt macOS-viewer_version.txt # forked from softprops/action-gh-release - name: Create GitHub release @@ -406,8 +392,8 @@ jobs: append_body: true fail_on_unmatched_files: true files: | - *.dmg - *.exe + macOS-installer/*.dmg + Windows-installer/*.exe *-autobuild-package.xml *-viewer_version.txt diff --git a/build.sh b/build.sh index 806718e077..46a287ea32 100755 --- a/build.sh +++ b/build.sh @@ -82,7 +82,7 @@ installer_Linux() { local package_name="$1" local package_dir="$(build_dir_Linux)/newview/" - local pattern=".*$(viewer_channel_suffix ${package_name})_[0-9]+_[0-9]+_[0-9]+_[0-9]+_i686\\.tar\\.bz2\$" + local pattern=".*$(viewer_channel_suffix ${package_name})_[0-9]+_[0-9]+_[0-9]+_[0-9]+_i686\\.tar\\.xz\$" # since the additional packages are built after the base package, # sorting oldest first ensures that the unqualified package is returned # even if someone makes a qualified name that duplicates the last word of the base name @@ -170,7 +170,7 @@ pre_build() # This name is consumed by indra/newview/CMakeLists.txt. Make it # absolute because we've had troubles with relative pathnames. abs_build_dir="$(cd "$build_dir"; pwd)" - VIEWER_SYMBOL_FILE="$(native_path "$abs_build_dir/newview/$variant/secondlife-symbols-$symplat-${AUTOBUILD_ADDRSIZE}.tar.bz2")" + VIEWER_SYMBOL_FILE="$(native_path "$abs_build_dir/newview/$variant/secondlife-symbols-$symplat-${AUTOBUILD_ADDRSIZE}.tar.xz")" fi # honor autobuild_configure_parameters same as sling-buildscripts @@ -414,10 +414,10 @@ do fi if [ -d "$build_dir/doxygen/html" ] then - tar -c -f "$build_dir/viewer-doxygen.tar.bz2" --strip-components 3 "$build_dir/doxygen/html" - python_cmd "$helpers/codeticket.py" addoutput "Doxygen Tarball" "$build_dir/viewer-doxygen.tar.bz2" \ + tar -cJf "$build_dir/viewer-doxygen.tar.xz" --strip-components 3 "$build_dir/doxygen/html" + python_cmd "$helpers/codeticket.py" addoutput "Doxygen Tarball" "$build_dir/viewer-doxygen.tar.xz" \ || fatal "Upload of doxygen tarball failed" - metadata+=("$build_dir/viewer-doxygen.tar.bz2") + metadata+=("$build_dir/viewer-doxygen.tar.xz") fi ;; *) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 355f35c558..39f6117c69 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1820,7 +1820,7 @@ if (WINDOWS) if (PACKAGE) add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/event_host.tar.bz2 + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/event_host.tar.xz COMMAND ${PYTHON_EXECUTABLE} ARGS ${CMAKE_CURRENT_SOURCE_DIR}/event_host_manifest.py @@ -1864,7 +1864,7 @@ if (WINDOWS) ) # temporarily disable packaging of event_host until hg subrepos get # sorted out on the parabuild cluster... - #${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/event_host.tar.bz2) + #${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/event_host.tar.xz) endif (PACKAGE) elseif (DARWIN) @@ -1984,7 +1984,7 @@ if (LINUX) #endif (NOT USE_BUGSPLAT) add_custom_command( - OUTPUT ${product}.tar.bz2 + OUTPUT ${product}.tar.xz COMMAND ${PYTHON_EXECUTABLE} ARGS ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py @@ -2038,7 +2038,7 @@ if (LINUX) add_custom_target(copy_l_viewer_manifest ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.copy_touched) if (PACKAGE) - add_custom_target(llpackage ALL DEPENDS ${product}.tar.bz2) + add_custom_target(llpackage ALL DEPENDS ${product}.tar.xz) # Make sure we don't run two instances of viewer_manifest.py at the same time. add_dependencies(llpackage copy_l_viewer_manifest) check_message_template(llpackage) @@ -2169,12 +2169,12 @@ if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND VIE OUTPUT_VARIABLE PARENT_DIRECTORY_CYGWIN OUTPUT_STRIP_TRAILING_WHITESPACE) add_custom_command(OUTPUT "${VIEWER_SYMBOL_FILE}" - # Use of 'tar ...j' here assumes VIEWER_SYMBOL_FILE endswith .tar.bz2; + # Use of 'tar ...j' here assumes VIEWER_SYMBOL_FILE endswith .tar.xz; # testing a string suffix is painful enough in CMake language that # we'll continue assuming it until forced to generalize. COMMAND "tar" ARGS - "cjf" + "cJf" "${VIEWER_SYMBOL_FILE_CYGWIN}" "-C" "${PARENT_DIRECTORY_CYGWIN}" diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index c7f32d0da9..4de4dc8fc5 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -525,7 +525,7 @@ class Windows_x86_64_Manifest(ViewerManifest): 'secondlife-bin.*', '*_Setup.exe', '*.bat', - '*.tar.bz2'))) + '*.tar.xz'))) with self.prefix(src=os.path.join(pkgdir, "VMP")): # include the compiled launcher scripts so that it gets included in the file_list @@ -1183,9 +1183,9 @@ class Darwin_x86_64_Manifest(ViewerManifest): # causes problems, especially with frameworks: a framework's top # level must contain symlinks into its Versions/Current, which # must itself be a symlink to some specific Versions subdir. - tarpath = os.path.join(RUNNER_TEMP, "viewer.tar.bz2") + tarpath = os.path.join(RUNNER_TEMP, "viewer.tar.xz") print(f'Creating {tarpath} from {self.get_dst_prefix()}') - with tarfile.open(tarpath, mode="w:bz2") as tarball: + with tarfile.open(tarpath, mode="w:xz") as tarball: # Store in the tarball as just 'Second Life Mumble.app' # instead of 'Users/someone/.../newview/Release/Second...' # It's at this point that we rename 'Second Life Release.app' @@ -1272,7 +1272,7 @@ class LinuxManifest(ViewerManifest): self.run_command(['find', self.get_dst_prefix(), '-type', 'f', '-perm', old, '-exec', 'chmod', new, '{}', ';']) - self.package_file = installer_name + '.tar.bz2' + self.package_file = installer_name + '.tar.xz' # temporarily move directory tree so that it has the right # name in the tarfile @@ -1285,10 +1285,10 @@ class LinuxManifest(ViewerManifest): # --numeric-owner hides the username of the builder for # security etc. self.run_command(['tar', '-C', self.get_build_prefix(), - '--numeric-owner', '-cjf', - tempname + '.tar.bz2', installer_name]) + '--numeric-owner', '-cJf', + tempname + '.tar.xz', installer_name]) else: - print("Skipping %s.tar.bz2 for non-Release build (%s)" % \ + print("Skipping %s.tar.xz for non-Release build (%s)" % \ (installer_name, self.args['buildtype'])) finally: self.run_command(["mv", tempname, realname]) -- cgit v1.2.3 From d7614a89b68e3cd1b49ce16ffcccf8be43ea503b Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 15 Apr 2024 23:40:36 +0300 Subject: viewer#1213 My Environments 'Apply' buttons enabled for folders --- indra/newview/llfloatermyenvironment.cpp | 20 +++++++++++--------- indra/newview/llfloatermyenvironment.h | 2 +- .../skins/default/xui/en/menu_settings_gear.xml | 3 +++ 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/indra/newview/llfloatermyenvironment.cpp b/indra/newview/llfloatermyenvironment.cpp index 21d106c8b1..e916777eb2 100644 --- a/indra/newview/llfloatermyenvironment.cpp +++ b/indra/newview/llfloatermyenvironment.cpp @@ -318,13 +318,13 @@ bool LLFloaterMyEnvironment::canAction(const std::string &context) if (context == PARAMETER_EDIT) { - return (selected.size() == 1) && isSettingSelected(selected.front()); + return (selected.size() == 1) && isSettingId(selected.front()); } else if (context == PARAMETER_COPY) { for (std::vector::iterator it = selected.begin(); it != selected.end(); it++) { - if(!isSettingSelected(*it)) + if(!isSettingId(*it)) { return false; } @@ -340,7 +340,7 @@ bool LLFloaterMyEnvironment::canAction(const std::string &context) LLClipboard::instance().pasteFromClipboard(ids); for (std::vector::iterator it = ids.begin(); it != ids.end(); it++) { - if (!isSettingSelected(*it)) + if (!isSettingId(*it)) { return false; } @@ -349,7 +349,7 @@ bool LLFloaterMyEnvironment::canAction(const std::string &context) } else if (context == PARAMETER_COPYUUID) { - return (selected.size() == 1) && isSettingSelected(selected.front()); + return (selected.size() == 1) && isSettingId(selected.front()); } return false; @@ -365,16 +365,18 @@ bool LLFloaterMyEnvironment::canApply(const std::string &context) if (context == PARAMETER_REGION) { - return LLEnvironment::instance().canAgentUpdateRegionEnvironment(); + return isSettingId(selected.front()) && LLEnvironment::instance().canAgentUpdateRegionEnvironment(); } else if (context == PARAMETER_PARCEL) { - return LLEnvironment::instance().canAgentUpdateParcelEnvironment(); + return isSettingId(selected.front()) && LLEnvironment::instance().canAgentUpdateParcelEnvironment(); } - else + else if (context == PARAMETER_LOCAL) { - return (context == PARAMETER_LOCAL); + return isSettingId(selected.front()); } + + return false; } //------------------------------------------------------------------------- @@ -436,7 +438,7 @@ LLUUID LLFloaterMyEnvironment::findItemByAssetId(LLUUID asset_id, bool copyable_ return LLUUID::null; } -bool LLFloaterMyEnvironment::isSettingSelected(LLUUID item_id) +bool LLFloaterMyEnvironment::isSettingId(const LLUUID& item_id) { LLInventoryItem* itemp = gInventory.getItem(item_id); diff --git a/indra/newview/llfloatermyenvironment.h b/indra/newview/llfloatermyenvironment.h index fea0981590..2d6e234700 100644 --- a/indra/newview/llfloatermyenvironment.h +++ b/indra/newview/llfloatermyenvironment.h @@ -69,7 +69,7 @@ private: void getSelectedIds(uuid_vec_t& ids) const; void refreshButtonStates(); - bool isSettingSelected(LLUUID item_id); + static bool isSettingId(const LLUUID &item_id); static LLUUID findItemByAssetId(LLUUID asset_id, bool copyable_only, bool ignore_library); }; diff --git a/indra/newview/skins/default/xui/en/menu_settings_gear.xml b/indra/newview/skins/default/xui/en/menu_settings_gear.xml index 57f4aa8655..96cbac4478 100644 --- a/indra/newview/skins/default/xui/en/menu_settings_gear.xml +++ b/indra/newview/skins/default/xui/en/menu_settings_gear.xml @@ -24,6 +24,9 @@ + Date: Tue, 16 Apr 2024 00:38:35 +0300 Subject: viewer#1215 My Environments' trash button is missing a notification --- indra/newview/llfloatermyenvironment.cpp | 60 +++++++++++++++++++++----------- indra/newview/llfloatermyenvironment.h | 1 + 2 files changed, 41 insertions(+), 20 deletions(-) diff --git a/indra/newview/llfloatermyenvironment.cpp b/indra/newview/llfloatermyenvironment.cpp index e916777eb2..bc12a5707c 100644 --- a/indra/newview/llfloatermyenvironment.cpp +++ b/indra/newview/llfloatermyenvironment.cpp @@ -38,7 +38,9 @@ #include "llcheckboxctrl.h" #include "llviewerinventory.h" #include "llenvironment.h" +#include "llnotificationsutil.h" #include "llparcel.h" +#include "lltrans.h" #include "llviewerparcelmgr.h" //========================================================================= @@ -223,6 +225,35 @@ void LLFloaterMyEnvironment::onFilterEdit(const std::string& search_string) mInventoryList->setFilterSubString(search_string); } +void LLFloaterMyEnvironment::onItemsRemovalConfirmation(const LLSD& notification, const LLSD& response, uuid_vec_t item_ids) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (option == 0) + { + const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH); + for (const LLUUID& itemid : item_ids) + { + LLInventoryItem* inv_item = gInventory.getItem(itemid); + + if (inv_item && inv_item->getInventoryType() == LLInventoryType::IT_SETTINGS) + { + LLInventoryModel::update_list_t update; + LLInventoryModel::LLCategoryUpdate old_folder(inv_item->getParentUUID(), -1); + update.push_back(old_folder); + LLInventoryModel::LLCategoryUpdate new_folder(trash_id, 1); + update.push_back(new_folder); + gInventory.accountForUpdate(update); + + LLPointer new_item = new LLViewerInventoryItem(inv_item); + new_item->setParent(trash_id); + new_item->updateParentOnServer(FALSE); + gInventory.updateItem(new_item); + } + } + gInventory.notifyObservers(); + } +} + void LLFloaterMyEnvironment::onDeleteSelected() { uuid_vec_t selected; @@ -231,27 +262,16 @@ void LLFloaterMyEnvironment::onDeleteSelected() if (selected.empty()) return; - const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH); - for (const LLUUID& itemid: selected) - { - LLInventoryItem* inv_item = gInventory.getItem(itemid); - - if (inv_item && inv_item->getInventoryType() == LLInventoryType::IT_SETTINGS) + LLSD args; + args["QUESTION"] = LLTrans::getString(selected.size() > 1 ? "DeleteItems" : "DeleteItem"); + LLNotificationsUtil::add( + "DeleteItems", + args, + LLSD(), + [this, selected](const LLSD& notification, const LLSD& response) { - LLInventoryModel::update_list_t update; - LLInventoryModel::LLCategoryUpdate old_folder(inv_item->getParentUUID(), -1); - update.push_back(old_folder); - LLInventoryModel::LLCategoryUpdate new_folder(trash_id, 1); - update.push_back(new_folder); - gInventory.accountForUpdate(update); - - LLPointer new_item = new LLViewerInventoryItem(inv_item); - new_item->setParent(trash_id); - new_item->updateParentOnServer(FALSE); - gInventory.updateItem(new_item); - } - } - gInventory.notifyObservers(); + onItemsRemovalConfirmation(notification, response, selected); + }); } diff --git a/indra/newview/llfloatermyenvironment.h b/indra/newview/llfloatermyenvironment.h index 2d6e234700..d28ba80265 100644 --- a/indra/newview/llfloatermyenvironment.h +++ b/indra/newview/llfloatermyenvironment.h @@ -60,6 +60,7 @@ private: void onFilterCheckChange(); void onFilterEdit(const std::string& search_string); void onSelectionChange(); + void onItemsRemovalConfirmation(const LLSD& notification, const LLSD& response, uuid_vec_t item_ids); void onDeleteSelected(); void onDoCreate(const LLSD &data); void onDoApply(const std::string &context); -- cgit v1.2.3 From 495a402b4acad516dc4359697f73a528282f8226 Mon Sep 17 00:00:00 2001 From: Kyler Eastridge Date: Fri, 12 Apr 2024 10:45:16 -0400 Subject: Make it so that reset skeleton is a networked ViewerEffect --- indra/newview/CMakeLists.txt | 2 + indra/newview/llhudeffectresetskeleton.cpp | 207 +++++++++++++++++++++++++++++ indra/newview/llhudeffectresetskeleton.h | 59 ++++++++ indra/newview/llhudobject.cpp | 4 + indra/newview/llhudobject.h | 3 +- indra/newview/llviewermenu.cpp | 48 ++++++- 6 files changed, 318 insertions(+), 5 deletions(-) create mode 100644 indra/newview/llhudeffectresetskeleton.cpp create mode 100644 indra/newview/llhudeffectresetskeleton.h diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 39f6117c69..b669199f2b 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -325,6 +325,7 @@ set(viewer_SOURCE_FILES llhudeffectpointat.cpp llhudeffecttrail.cpp llhudeffectblob.cpp + llhudeffectresetskeleton.cpp llhudicon.cpp llhudmanager.cpp llhudnametag.cpp @@ -980,6 +981,7 @@ set(viewer_HEADER_FILES llhudeffectpointat.h llhudeffecttrail.h llhudeffectblob.h + llhudeffectresetskeleton.h llhudicon.h llhudmanager.h llhudnametag.h diff --git a/indra/newview/llhudeffectresetskeleton.cpp b/indra/newview/llhudeffectresetskeleton.cpp new file mode 100644 index 0000000000..8afa231fc5 --- /dev/null +++ b/indra/newview/llhudeffectresetskeleton.cpp @@ -0,0 +1,207 @@ +/** + * @file llhudeffectresetskeleton.cpp + * @brief LLHUDEffectResetSkeleton class implementation + * + * $LicenseInfo:firstyear=2024&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2024, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llhudeffectresetskeleton.h" + +#include "llagent.h" +#include "llviewerobjectlist.h" +#include "llvoavatar.h" +#include "message.h" + +// packet layout +const S32 TARGET_OBJECT = 0; // This is to allow for targetting owned animesh +const S32 RESET_ANIMATIONS = 16; //This can also be a flags if needed +const S32 PKT_SIZE = 17; + +//----------------------------------------------------------------------------- +// LLHUDEffectResetSkeleton() +//----------------------------------------------------------------------------- +LLHUDEffectResetSkeleton::LLHUDEffectResetSkeleton(const U8 type) : + LLHUDEffect(type) +{ +} + +//----------------------------------------------------------------------------- +// ~LLHUDEffectResetSkeleton() +//----------------------------------------------------------------------------- +LLHUDEffectResetSkeleton::~LLHUDEffectResetSkeleton() +{ +} + +//----------------------------------------------------------------------------- +// packData() +//----------------------------------------------------------------------------- +void LLHUDEffectResetSkeleton::packData(LLMessageSystem *mesgsys) +{ + // Pack the default data + LLHUDEffect::packData(mesgsys); + + // Pack the type-specific data. Uses a fun packed binary format. Whee! + U8 packed_data[PKT_SIZE]; + memset(packed_data, 0, PKT_SIZE); + + // pack both target object and position + // position interpreted as offset if target object is non-null + if (mTargetObject) + { + htolememcpy(&(packed_data[TARGET_OBJECT]), mTargetObject->mID.mData, MVT_LLUUID, 16); + } + else + { + htolememcpy(&(packed_data[TARGET_OBJECT]), LLUUID::null.mData, MVT_LLUUID, 16); + } + + U8 resetAnimations = (U8)mResetAnimations; + htolememcpy(&(packed_data[RESET_ANIMATIONS]), &resetAnimations, MVT_U8, 1); + + mesgsys->addBinaryDataFast(_PREHASH_TypeData, packed_data, PKT_SIZE); +} + +//----------------------------------------------------------------------------- +// unpackData() +//----------------------------------------------------------------------------- +void LLHUDEffectResetSkeleton::unpackData(LLMessageSystem *mesgsys, S32 blocknum) +{ + LLVector3d new_target; + U8 packed_data[PKT_SIZE]; + + + LLHUDEffect::unpackData(mesgsys, blocknum); + + LLUUID source_id; + mesgsys->getUUIDFast(_PREHASH_Effect, _PREHASH_AgentID, source_id, blocknum); + + LLViewerObject *objp = gObjectList.findObject(source_id); + if (objp && objp->isAvatar()) + { + setSourceObject(objp); + } + else + { + //LL_WARNS() << "Could not find source avatar for ResetSkeleton effect" << LL_ENDL; + return; + } + + S32 size = mesgsys->getSizeFast(_PREHASH_Effect, blocknum, _PREHASH_TypeData); + if (size != PKT_SIZE) + { + LL_WARNS() << "ResetSkeleton effect with bad size " << size << LL_ENDL; + return; + } + + mesgsys->getBinaryDataFast(_PREHASH_Effect, _PREHASH_TypeData, packed_data, PKT_SIZE, blocknum); + + LLUUID target_id; + htolememcpy(target_id.mData, &(packed_data[TARGET_OBJECT]), MVT_LLUUID, 16); + + if (target_id.isNull()) + { + target_id = source_id; + } + + objp = gObjectList.findObject(target_id); + + if (objp) + { + setTargetObject(objp); + } + + U8 resetAnimations = 0; + htolememcpy(&resetAnimations, &(packed_data[RESET_ANIMATIONS]), MVT_U8, 1); + + // Pre-emptively assume this is going to be flags in the future. + // It isn't needed now, but this will assure that only bit 1 is set + mResetAnimations = resetAnimations & 1; + + update(); +} + +//----------------------------------------------------------------------------- +// setTargetObjectAndOffset() +//----------------------------------------------------------------------------- +void LLHUDEffectResetSkeleton::setTargetObject(LLViewerObject *objp) +{ + mTargetObject = objp; +} + + +//----------------------------------------------------------------------------- +// markDead() +//----------------------------------------------------------------------------- +void LLHUDEffectResetSkeleton::markDead() +{ + LLHUDEffect::markDead(); +} + +void LLHUDEffectResetSkeleton::setSourceObject(LLViewerObject* objectp) +{ + // restrict source objects to avatars + if (objectp && objectp->isAvatar()) + { + LLHUDEffect::setSourceObject(objectp); + } +} + +//----------------------------------------------------------------------------- +// update() +//----------------------------------------------------------------------------- +void LLHUDEffectResetSkeleton::update() +{ + // If the target object is dead, set the target object to NULL + if (mTargetObject.isNull() || mTargetObject->isDead()) + { + markDead(); + return; + } + + if (mSourceObject.isNull() || mSourceObject->isDead()) + { + markDead(); + return; + } + + bool owned = false; + if(mTargetObject->isAnimatedObject()) + { + owned = mTargetObject->mOwnerID == mSourceObject->getID(); + } + else + { + owned = mTargetObject->getID() == mSourceObject->getID(); + } + + if (owned) + { + if (mTargetObject->isAvatar() || mTargetObject->isAnimatedObject()) + { + ((LLVOAvatar*)(LLViewerObject*)mTargetObject)->resetSkeleton(mResetAnimations); + } + } + + markDead(); +} diff --git a/indra/newview/llhudeffectresetskeleton.h b/indra/newview/llhudeffectresetskeleton.h new file mode 100644 index 0000000000..ddac84165f --- /dev/null +++ b/indra/newview/llhudeffectresetskeleton.h @@ -0,0 +1,59 @@ +/** + * @file llhudeffectresetskeleton.h + * @brief LLHUDEffectResetSkeleton class definition + * + * $LicenseInfo:firstyear=2024&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2024, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLHUDEFFECTRESETSKELETON_H +#define LL_LLHUDEFFECTRESETSKELETON_H + +#include "llhudeffect.h" + +class LLViewerObject; +class LLVOAvatar; + + +class LLHUDEffectResetSkeleton final : public LLHUDEffect +{ +public: + friend class LLHUDObject; + + /*virtual*/ void markDead(); + /*virtual*/ void setSourceObject(LLViewerObject* objectp); + + void setTargetObject(LLViewerObject *objp); + void setResetAnimations(bool enable){ mResetAnimations = enable; }; + +protected: + LLHUDEffectResetSkeleton(const U8 type); + ~LLHUDEffectResetSkeleton(); + + /*virtual*/ void packData(LLMessageSystem *mesgsys); + /*virtual*/ void unpackData(LLMessageSystem *mesgsys, S32 blocknum); + + void update(); +private: + bool mResetAnimations; +}; + +#endif // LL_LLHUDEFFECTRESETSKELETON_H diff --git a/indra/newview/llhudobject.cpp b/indra/newview/llhudobject.cpp index 292045f25d..6bc5a10e1f 100644 --- a/indra/newview/llhudobject.cpp +++ b/indra/newview/llhudobject.cpp @@ -36,6 +36,7 @@ #include "llhudeffecttrail.h" #include "llhudeffectlookat.h" #include "llhudeffectpointat.h" +#include "llhudeffectresetskeleton.h" #include "llhudnametag.h" #include "llvoicevisualizer.h" @@ -241,6 +242,9 @@ LLHUDEffect *LLHUDObject::addHUDEffect(const U8 type) case LL_HUD_EFFECT_BLOB: hud_objectp = new LLHUDEffectBlob(type); break; + case LL_HUD_EFFECT_RESET_SKELETON: + hud_objectp = new LLHUDEffectResetSkeleton(type); + break; default: LL_WARNS() << "Unknown type of hud effect:" << (U32) type << LL_ENDL; } diff --git a/indra/newview/llhudobject.h b/indra/newview/llhudobject.h index ce128519ea..c27b5a5118 100644 --- a/indra/newview/llhudobject.h +++ b/indra/newview/llhudobject.h @@ -96,7 +96,8 @@ public: LL_HUD_EFFECT_POINTAT, LL_HUD_EFFECT_VOICE_VISUALIZER, // Ventrella LL_HUD_NAME_TAG, - LL_HUD_EFFECT_BLOB + LL_HUD_EFFECT_BLOB, + LL_HUD_EFFECT_RESET_SKELETON }; protected: static void sortObjects(); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 94efab3f4b..58b9d7a366 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -84,6 +84,7 @@ #include "lltoolface.h" #include "llhints.h" #include "llhudeffecttrail.h" +#include "llhudeffectresetskeleton.h" #include "llhudmanager.h" #include "llimview.h" #include "llinventorybridge.h" @@ -6505,7 +6506,19 @@ class LLAvatarResetSkeleton: public view_listener_t } if(avatar) { - avatar->resetSkeleton(false); + bool owned = false; + if(avatar->isAnimatedObject()) + { + owned = avatar->mOwnerID == gAgent.getID(); + } + else + { + owned = avatar->getID() == gAgent.getID(); + } + LLHUDEffectResetSkeleton* effectp = (LLHUDEffectResetSkeleton*)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_RESET_SKELETON, owned); + effectp->setSourceObject(gAgentAvatarp); + effectp->setTargetObject((LLViewerObject*)avatar); + effectp->setResetAnimations(false); } return true; } @@ -6532,7 +6545,19 @@ class LLAvatarResetSkeletonAndAnimations : public view_listener_t LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()); if (avatar) { - avatar->resetSkeleton(true); + bool owned = false; + if(avatar->isAnimatedObject()) + { + owned = avatar->mOwnerID == gAgent.getID(); + } + else + { + owned = avatar->getID() == gAgent.getID(); + } + LLHUDEffectResetSkeleton* effectp = (LLHUDEffectResetSkeleton*)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_RESET_SKELETON, owned); + effectp->setSourceObject(gAgentAvatarp); + effectp->setTargetObject((LLViewerObject*)avatar); + effectp->setResetAnimations(true); } return true; } @@ -6545,11 +6570,26 @@ class LLAvatarResetSelfSkeletonAndAnimations : public view_listener_t LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()); if (avatar) { - avatar->resetSkeleton(true); + bool owned = false; + if(avatar->isAnimatedObject()) + { + owned = avatar->mOwnerID == gAgent.getID(); + } + else + { + owned = avatar->getID() == gAgent.getID(); + } + LLHUDEffectResetSkeleton* effectp = (LLHUDEffectResetSkeleton*)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_RESET_SKELETON, owned); + effectp->setSourceObject(gAgentAvatarp); + effectp->setTargetObject((LLViewerObject*)avatar); + effectp->setResetAnimations(true); } else { - gAgentAvatarp->resetSkeleton(true); + LLHUDEffectResetSkeleton* effectp = (LLHUDEffectResetSkeleton*)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_RESET_SKELETON, true); + effectp->setSourceObject(gAgentAvatarp); + effectp->setTargetObject(gAgentAvatarp); + effectp->setResetAnimations(true); } return true; } -- cgit v1.2.3 From 180a2aaacb1c86772c323a6c0d270d332d13c9e5 Mon Sep 17 00:00:00 2001 From: Kyler Eastridge Date: Tue, 16 Apr 2024 13:10:49 -0400 Subject: Remove animesh networked skeleton reset for now --- indra/newview/llhudeffectresetskeleton.cpp | 29 ++++++++++++--------- indra/newview/llviewermenu.cpp | 42 +++++++++++++----------------- 2 files changed, 34 insertions(+), 37 deletions(-) diff --git a/indra/newview/llhudeffectresetskeleton.cpp b/indra/newview/llhudeffectresetskeleton.cpp index 8afa231fc5..21f7cbde26 100644 --- a/indra/newview/llhudeffectresetskeleton.cpp +++ b/indra/newview/llhudeffectresetskeleton.cpp @@ -118,7 +118,13 @@ void LLHUDEffectResetSkeleton::unpackData(LLMessageSystem *mesgsys, S32 blocknum LLUUID target_id; htolememcpy(target_id.mData, &(packed_data[TARGET_OBJECT]), MVT_LLUUID, 16); - + + // The purpose for having a target ID is if we want to reset animesh, or + // other things in the future. + // I implemented this, but due to issues regarding various permission + // checks, I scrapped it for now. --Chaser Zaks + // See https://github.com/secondlife/viewer/pull/1212 for additional info + if (target_id.isNull()) { target_id = source_id; @@ -185,22 +191,19 @@ void LLHUDEffectResetSkeleton::update() return; } - bool owned = false; - if(mTargetObject->isAnimatedObject()) + if (mTargetObject->isAvatar()) { - owned = mTargetObject->mOwnerID == mSourceObject->getID(); + // Only the owner of a avatar can reset their skeleton like this + if (mSourceObject->getID() == mTargetObject->getID()) + { + LLVOAvatar* avatar = (LLVOAvatar*)(LLViewerObject*)mTargetObject; + avatar->resetSkeleton(mResetAnimations); + } } else { - owned = mTargetObject->getID() == mSourceObject->getID(); - } - - if (owned) - { - if (mTargetObject->isAvatar() || mTargetObject->isAnimatedObject()) - { - ((LLVOAvatar*)(LLViewerObject*)mTargetObject)->resetSkeleton(mResetAnimations); - } + LL_WARNS() << mSourceObject->getID() << " attempted to reset skeleton on " + << mTargetObject->getID() << ", but it is not a avatar!" << LL_ENDL; } markDead(); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 58b9d7a366..cb2a58d675 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -6506,19 +6506,17 @@ class LLAvatarResetSkeleton: public view_listener_t } if(avatar) { - bool owned = false; - if(avatar->isAnimatedObject()) + if(avatar->getID() == gAgent.getID()) { - owned = avatar->mOwnerID == gAgent.getID(); + LLHUDEffectResetSkeleton* effectp = (LLHUDEffectResetSkeleton*)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_RESET_SKELETON, owned); + effectp->setSourceObject(gAgentAvatarp); + effectp->setTargetObject((LLViewerObject*)avatar); + effectp->setResetAnimations(false); } else { - owned = avatar->getID() == gAgent.getID(); + effectp->setResetAnimations(false); } - LLHUDEffectResetSkeleton* effectp = (LLHUDEffectResetSkeleton*)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_RESET_SKELETON, owned); - effectp->setSourceObject(gAgentAvatarp); - effectp->setTargetObject((LLViewerObject*)avatar); - effectp->setResetAnimations(false); } return true; } @@ -6545,19 +6543,17 @@ class LLAvatarResetSkeletonAndAnimations : public view_listener_t LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()); if (avatar) { - bool owned = false; - if(avatar->isAnimatedObject()) + if(avatar->getID() == gAgent.getID()) { - owned = avatar->mOwnerID == gAgent.getID(); + LLHUDEffectResetSkeleton* effectp = (LLHUDEffectResetSkeleton*)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_RESET_SKELETON, true); + effectp->setSourceObject(gAgentAvatarp); + effectp->setTargetObject((LLViewerObject*)avatar); + effectp->setResetAnimations(true); } else { - owned = avatar->getID() == gAgent.getID(); + effectp->setResetAnimations(true); } - LLHUDEffectResetSkeleton* effectp = (LLHUDEffectResetSkeleton*)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_RESET_SKELETON, owned); - effectp->setSourceObject(gAgentAvatarp); - effectp->setTargetObject((LLViewerObject*)avatar); - effectp->setResetAnimations(true); } return true; } @@ -6570,19 +6566,17 @@ class LLAvatarResetSelfSkeletonAndAnimations : public view_listener_t LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()); if (avatar) { - bool owned = false; - if(avatar->isAnimatedObject()) + if(avatar->getID() == gAgent.getID()) { - owned = avatar->mOwnerID == gAgent.getID(); + LLHUDEffectResetSkeleton* effectp = (LLHUDEffectResetSkeleton*)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_RESET_SKELETON, true); + effectp->setSourceObject(gAgentAvatarp); + effectp->setTargetObject((LLViewerObject*)avatar); + effectp->setResetAnimations(true); } else { - owned = avatar->getID() == gAgent.getID(); + effectp->setResetAnimations(true); } - LLHUDEffectResetSkeleton* effectp = (LLHUDEffectResetSkeleton*)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_RESET_SKELETON, owned); - effectp->setSourceObject(gAgentAvatarp); - effectp->setTargetObject((LLViewerObject*)avatar); - effectp->setResetAnimations(true); } else { -- cgit v1.2.3 From 7723da1398abbd359623cc7138f83409e7b71aa5 Mon Sep 17 00:00:00 2001 From: Kyler Eastridge Date: Tue, 16 Apr 2024 13:47:09 -0400 Subject: Cleaned up code a bit, fixed issue with referencing effectp instead of avatar --- indra/newview/llhudeffectresetskeleton.cpp | 2 +- indra/newview/llviewermenu.cpp | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/indra/newview/llhudeffectresetskeleton.cpp b/indra/newview/llhudeffectresetskeleton.cpp index 21f7cbde26..aceb306955 100644 --- a/indra/newview/llhudeffectresetskeleton.cpp +++ b/indra/newview/llhudeffectresetskeleton.cpp @@ -196,7 +196,7 @@ void LLHUDEffectResetSkeleton::update() // Only the owner of a avatar can reset their skeleton like this if (mSourceObject->getID() == mTargetObject->getID()) { - LLVOAvatar* avatar = (LLVOAvatar*)(LLViewerObject*)mTargetObject; + LLVOAvatar* avatar = mTargetObject->asAvatar(); avatar->resetSkeleton(mResetAnimations); } } diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index cb2a58d675..569e0d6e0c 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -6506,16 +6506,16 @@ class LLAvatarResetSkeleton: public view_listener_t } if(avatar) { - if(avatar->getID() == gAgent.getID()) + if(avatar->getID() == gAgentID) { - LLHUDEffectResetSkeleton* effectp = (LLHUDEffectResetSkeleton*)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_RESET_SKELETON, owned); + LLHUDEffectResetSkeleton* effectp = (LLHUDEffectResetSkeleton*)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_RESET_SKELETON, true); effectp->setSourceObject(gAgentAvatarp); effectp->setTargetObject((LLViewerObject*)avatar); effectp->setResetAnimations(false); } else { - effectp->setResetAnimations(false); + avatar->setResetAnimations(false); } } return true; @@ -6543,7 +6543,7 @@ class LLAvatarResetSkeletonAndAnimations : public view_listener_t LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()); if (avatar) { - if(avatar->getID() == gAgent.getID()) + if(avatar->getID() == gAgentID) { LLHUDEffectResetSkeleton* effectp = (LLHUDEffectResetSkeleton*)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_RESET_SKELETON, true); effectp->setSourceObject(gAgentAvatarp); @@ -6552,7 +6552,7 @@ class LLAvatarResetSkeletonAndAnimations : public view_listener_t } else { - effectp->setResetAnimations(true); + avatar->setResetAnimations(true); } } return true; @@ -6566,7 +6566,7 @@ class LLAvatarResetSelfSkeletonAndAnimations : public view_listener_t LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()); if (avatar) { - if(avatar->getID() == gAgent.getID()) + if(avatar->getID() == gAgentID) { LLHUDEffectResetSkeleton* effectp = (LLHUDEffectResetSkeleton*)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_RESET_SKELETON, true); effectp->setSourceObject(gAgentAvatarp); @@ -6575,7 +6575,7 @@ class LLAvatarResetSelfSkeletonAndAnimations : public view_listener_t } else { - effectp->setResetAnimations(true); + avatar->setResetAnimations(true); } } else -- cgit v1.2.3 From 79b560dcfb33f71da04ecc6c1290e39819ecaf11 Mon Sep 17 00:00:00 2001 From: Kyler Eastridge Date: Tue, 16 Apr 2024 14:25:51 -0400 Subject: Fix bad copypasting of code, hopefully for good this time --- indra/newview/llviewermenu.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 569e0d6e0c..109710beb3 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -6515,7 +6515,7 @@ class LLAvatarResetSkeleton: public view_listener_t } else { - avatar->setResetAnimations(false); + avatar->resetSkeleton(false); } } return true; @@ -6552,7 +6552,7 @@ class LLAvatarResetSkeletonAndAnimations : public view_listener_t } else { - avatar->setResetAnimations(true); + avatar->resetSkeleton(true); } } return true; @@ -6575,7 +6575,7 @@ class LLAvatarResetSelfSkeletonAndAnimations : public view_listener_t } else { - avatar->setResetAnimations(true); + avatar->resetSkeleton(true); } } else -- cgit v1.2.3