diff options
-rw-r--r-- | indra/newview/app_settings/Camera/Front.xml | 20 | ||||
-rw-r--r-- | indra/newview/app_settings/Camera/Pennys Gamer.xml | 20 | ||||
-rw-r--r-- | indra/newview/app_settings/Camera/Rear.xml | 20 | ||||
-rw-r--r-- | indra/newview/app_settings/Camera/Side.xml | 20 | ||||
-rw-r--r-- | indra/newview/llpresetsmanager.cpp | 33 |
5 files changed, 106 insertions, 7 deletions
diff --git a/indra/newview/app_settings/Camera/Front.xml b/indra/newview/app_settings/Camera/Front.xml new file mode 100644 index 0000000000..6f2ea9da17 --- /dev/null +++ b/indra/newview/app_settings/Camera/Front.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" ?> +<llsd xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="llsd.xsd"> + + <key>FocusOffsetRearView</key> + <map> + <key>Comment</key> + <string>Initial focus point offset relative to avatar for the camera preset Rear View (x-axis is forward)</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Vector3D</string> + <key>Value</key> + <array> + <real>1.0</real> + <real>0.0</real> + <real>1.0</real> + </array> + </map> +</llsd> diff --git a/indra/newview/app_settings/Camera/Pennys Gamer.xml b/indra/newview/app_settings/Camera/Pennys Gamer.xml new file mode 100644 index 0000000000..6f2ea9da17 --- /dev/null +++ b/indra/newview/app_settings/Camera/Pennys Gamer.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" ?> +<llsd xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="llsd.xsd"> + + <key>FocusOffsetRearView</key> + <map> + <key>Comment</key> + <string>Initial focus point offset relative to avatar for the camera preset Rear View (x-axis is forward)</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Vector3D</string> + <key>Value</key> + <array> + <real>1.0</real> + <real>0.0</real> + <real>1.0</real> + </array> + </map> +</llsd> diff --git a/indra/newview/app_settings/Camera/Rear.xml b/indra/newview/app_settings/Camera/Rear.xml new file mode 100644 index 0000000000..6f2ea9da17 --- /dev/null +++ b/indra/newview/app_settings/Camera/Rear.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" ?> +<llsd xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="llsd.xsd"> + + <key>FocusOffsetRearView</key> + <map> + <key>Comment</key> + <string>Initial focus point offset relative to avatar for the camera preset Rear View (x-axis is forward)</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Vector3D</string> + <key>Value</key> + <array> + <real>1.0</real> + <real>0.0</real> + <real>1.0</real> + </array> + </map> +</llsd> diff --git a/indra/newview/app_settings/Camera/Side.xml b/indra/newview/app_settings/Camera/Side.xml new file mode 100644 index 0000000000..6f2ea9da17 --- /dev/null +++ b/indra/newview/app_settings/Camera/Side.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" ?> +<llsd xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="llsd.xsd"> + + <key>FocusOffsetRearView</key> + <map> + <key>Comment</key> + <string>Initial focus point offset relative to avatar for the camera preset Rear View (x-axis is forward)</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Vector3D</string> + <key>Value</key> + <array> + <real>1.0</real> + <real>0.0</real> + <real>1.0</real> + </array> + </map> +</llsd> diff --git a/indra/newview/llpresetsmanager.cpp b/indra/newview/llpresetsmanager.cpp index 3daa6894f0..d4535c69c8 100644 --- a/indra/newview/llpresetsmanager.cpp +++ b/indra/newview/llpresetsmanager.cpp @@ -40,6 +40,7 @@ #include "llfloaterreg.h" #include "llfeaturemanager.h" #include "llagentcamera.h" +#include "llfile.h" LLPresetsManager::LLPresetsManager() { @@ -112,20 +113,38 @@ void LLPresetsManager::startWatching(const std::string& subdirectory) std::string LLPresetsManager::getPresetsDir(const std::string& subdirectory) { std::string presets_path = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, PRESETS_DIR); - std::string full_path; if (!gDirUtilp->fileExists(presets_path)) { LLFile::mkdir(presets_path); } - full_path = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, PRESETS_DIR, subdirectory); - if (!gDirUtilp->fileExists(full_path)) + std::string dest_path = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, PRESETS_DIR, subdirectory); + if (!gDirUtilp->fileExists(dest_path)) { - LLFile::mkdir(full_path); + LLFile::mkdir(dest_path); + + if (PRESETS_CAMERA == subdirectory) + { + std::string source_dir = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "Camera"); + LLDirIterator dir_iter(source_dir, "*.xml"); + bool found = true; + while (found) + { + std::string file; + found = dir_iter.next(file); + + if (found) + { + std::string source = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "Camera", file); + std::string dest = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, PRESETS_DIR, "Camera", file); + LLFile::copy(source, dest); + } + } + } } - return full_path; + return dest_path; } void LLPresetsManager::loadPresetNamesFromDir(const std::string& dir, preset_name_list_t& presets, EDefaultOptions default_option) @@ -234,7 +253,7 @@ bool LLPresetsManager::savePreset(const std::string& subdirectory, std::string n } else { - LL_WARNS() << "preferences floater instance not found" << LL_ENDL; + LL_WARNS("Presets") << "preferences floater instance not found" << LL_ENDL; } } else if(PRESETS_CAMERA == subdirectory) @@ -387,7 +406,7 @@ void LLPresetsManager::loadPreset(const std::string& subdirectory, std::string n } else { - LL_WARNS() << "failed to load preset '"<<name<<"' from '"<<full_path<<"'" << LL_ENDL; + LL_WARNS("Presets") << "failed to load preset '"<<name<<"' from '"<<full_path<<"'" << LL_ENDL; } } |