Merge pull request #65 from AngeldarkRaymaker/FIRE-34968

FIRE-34968: Poser Bugsplat & Issue creating user pose-save directory
master
Beq Janus 2025-01-20 19:04:24 +00:00 committed by GitHub
commit b0688b7e84
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 15 additions and 6 deletions

View File

@ -341,8 +341,8 @@ void FSFloaterPoser::createUserPoseDirectoryIfNeeded()
std::string userPath =
gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, POSE_SAVE_SUBDIRECTORY);
userPath = userPath + gDirUtilp->getDirDelimiter() + std::string(POSE_PRESETS_HANDS_SUBDIRECTORY);
if (gDirUtilp->fileExists(userPath))
std::string userHandPresetsPath = userPath + gDirUtilp->getDirDelimiter() + std::string(POSE_PRESETS_HANDS_SUBDIRECTORY);
if (gDirUtilp->fileExists(userHandPresetsPath))
return;
try
@ -353,8 +353,11 @@ void FSFloaterPoser::createUserPoseDirectoryIfNeeded()
LLFile::mkdir(userPath);
}
LL_WARNS("Poser") << "Couldn't find folder: " << userPath << " - creating one." << LL_ENDL;
LLFile::mkdir(userPath);
if (!gDirUtilp->fileExists(userHandPresetsPath))
{
LL_WARNS("Poser") << "Couldn't find folder: " << userHandPresetsPath << " - creating one." << LL_ENDL;
LLFile::mkdir(userHandPresetsPath);
}
std::string sourcePresetPath =
gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, POSE_SAVE_SUBDIRECTORY, std::string(POSE_PRESETS_HANDS_SUBDIRECTORY));
@ -366,10 +369,10 @@ void FSFloaterPoser::createUserPoseDirectoryIfNeeded()
for (auto pose : posesToCopy)
{
std::string source = sourcePresetPath + gDirUtilp->getDirDelimiter() + pose;
std::string destination = userPath + gDirUtilp->getDirDelimiter() + pose;
std::string destination = userHandPresetsPath + gDirUtilp->getDirDelimiter() + pose;
if (!LLFile::copy(source, destination))
LL_WARNS("LLDiskCache") << "Failed to copy " << source << " to " << destination << LL_ENDL;
LL_WARNS("Poser") << "Failed to copy " << source << " to " << destination << LL_ENDL;
}
}
catch (const std::exception& e)
@ -874,6 +877,9 @@ void FSFloaterPoser::loadPoseFromXml(LLVOAvatar* avatar, const std::string& pose
void FSFloaterPoser::startPosingSelf()
{
if (!gAgentAvatarp || gAgentAvatarp.isNull())
return;
setUiSelectedAvatar(gAgentAvatarp->getID());
LLVOAvatar* avatar = getAvatarByUuid(gAgentAvatarp->getID());
if (!avatar)
@ -888,6 +894,9 @@ void FSFloaterPoser::startPosingSelf()
void FSFloaterPoser::stopPosingSelf()
{
if (!gAgentAvatarp || gAgentAvatarp.isNull())
return;
LLVOAvatar* avatar = getAvatarByUuid(gAgentAvatarp->getID());
if (!avatar)
return;