diff options
Diffstat (limited to 'indra/llinventory')
-rw-r--r-- | indra/llinventory/llinventorysettings.cpp | 8 | ||||
-rw-r--r-- | indra/llinventory/llinventorysettings.h | 1 | ||||
-rw-r--r-- | indra/llinventory/llparcel.cpp | 3 | ||||
-rw-r--r-- | indra/llinventory/llparcel.h | 9 | ||||
-rw-r--r-- | indra/llinventory/llsettingsbase.cpp | 1 | ||||
-rw-r--r-- | indra/llinventory/llsettingsbase.h | 7 | ||||
-rw-r--r-- | indra/llinventory/llsettingsdaycycle.cpp | 63 | ||||
-rw-r--r-- | indra/llinventory/llsettingsdaycycle.h | 4 |
8 files changed, 81 insertions, 15 deletions
diff --git a/indra/llinventory/llinventorysettings.cpp b/indra/llinventory/llinventorysettings.cpp index 8887c23a6c..fdad50e8d4 100644 --- a/indra/llinventory/llinventorysettings.cpp +++ b/indra/llinventory/llinventorysettings.cpp @@ -89,7 +89,6 @@ LLSettingsType::type_e LLSettingsType::fromInventoryFlags(U32 flags) return (LLSettingsType::type_e)(flags & LLInventoryItemFlags::II_FLAGS_SUBTYPE_MASK); } - LLInventoryType::EIconName LLSettingsType::getIconName(LLSettingsType::type_e type) { const SettingsEntry *entry = LLSettingsDictionary::instance().lookup(type); @@ -98,6 +97,13 @@ LLInventoryType::EIconName LLSettingsType::getIconName(LLSettingsType::type_e ty return entry->mIconName; } +std::string LLSettingsType::getDefaultName(LLSettingsType::type_e type) +{ + const SettingsEntry *entry = LLSettingsDictionary::instance().lookup(type); + if (!entry) + return getDefaultName(ST_INVALID); + return entry->mDefaultNewName; +} void LLSettingsType::initClass(LLTranslationBridge::ptr_t &trans) { diff --git a/indra/llinventory/llinventorysettings.h b/indra/llinventory/llinventorysettings.h index fb08190ea9..906540689c 100644 --- a/indra/llinventory/llinventorysettings.h +++ b/indra/llinventory/llinventorysettings.h @@ -46,6 +46,7 @@ public: static type_e fromInventoryFlags(U32 flags); static LLInventoryType::EIconName getIconName(type_e type); + static std::string getDefaultName(type_e type); static void initClass(LLTranslationBridge::ptr_t &trans); static void cleanupClass(); diff --git a/indra/llinventory/llparcel.cpp b/indra/llinventory/llparcel.cpp index 0908613c10..aff7f86fd4 100644 --- a/indra/llinventory/llparcel.cpp +++ b/indra/llinventory/llparcel.cpp @@ -231,6 +231,9 @@ void LLParcel::init(const LLUUID &owner_id, setAllowGroupAVSounds(TRUE); setAllowAnyAVSounds(TRUE); setHaveNewParcelLimitData(FALSE); + + setRegionAllowEnvironmentOverride(FALSE); + setParcelEnvironmentVersion(-1); } void LLParcel::overrideOwner(const LLUUID& owner_id, BOOL is_group_owned) diff --git a/indra/llinventory/llparcel.h b/indra/llinventory/llparcel.h index 6ef389d246..2497a069d7 100644 --- a/indra/llinventory/llparcel.h +++ b/indra/llinventory/llparcel.h @@ -511,6 +511,10 @@ public: { return mRegionDenyAgeUnverifiedOverride; } BOOL getRegionAllowAccessOverride() const { return mRegionAllowAccessoverride; } + BOOL getRegionAllowEnvironmentOverride() const + { return mRegionAllowEnvironmentOverride; } + S32 getParcelEnvironmentVersion() const + { return mCurrentEnvironmentVersion; } BOOL getAllowGroupAVSounds() const { return mAllowGroupAVSounds; } @@ -581,6 +585,9 @@ public: void setRegionDenyAnonymousOverride(BOOL override) { mRegionDenyAnonymousOverride = override; } void setRegionDenyAgeUnverifiedOverride(BOOL override) { mRegionDenyAgeUnverifiedOverride = override; } void setRegionAllowAccessOverride(BOOL override) { mRegionAllowAccessoverride = override; } + void setRegionAllowEnvironmentOverride(BOOL override) { mRegionAllowEnvironmentOverride = override; } + + void setParcelEnvironmentVersion(S32 version) { mCurrentEnvironmentVersion = version; } // Accessors for parcel sellWithObjects void setPreviousOwnerID(LLUUID prev_owner) { mPreviousOwnerID = prev_owner; } @@ -662,8 +669,10 @@ protected: BOOL mRegionDenyAnonymousOverride; BOOL mRegionDenyAgeUnverifiedOverride; BOOL mRegionAllowAccessoverride; + BOOL mRegionAllowEnvironmentOverride; BOOL mAllowGroupAVSounds; BOOL mAllowAnyAVSounds; + S32 mCurrentEnvironmentVersion; bool mIsDefaultDayCycle; diff --git a/indra/llinventory/llsettingsbase.cpp b/indra/llinventory/llsettingsbase.cpp index 8bcf8a4973..e00dd2199c 100644 --- a/indra/llinventory/llsettingsbase.cpp +++ b/indra/llinventory/llsettingsbase.cpp @@ -300,7 +300,6 @@ bool LLSettingsBase::validate() { LL_WARNS("SETTINGS") << "Validation warnings: " << result["warnings"] << LL_ENDL; } - LL_WARNS("SETTINGS") << "Validation success is " << result["success"] << LL_ENDL; return result["success"].asBoolean(); } diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index a74579e7a6..beaeac2d04 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -244,10 +244,15 @@ public: inline void setAssetId(LLUUID value) { // note that this skips setLLSD - LL_WARNS("LAPRAS") << "Settings asset id set to:{" << value << "}" << LL_ENDL; mSettings[SETTING_ASSETID] = value; } + inline void clearAssetId() + { + if (mSettings.has(SETTING_ASSETID)) + mSettings.erase(SETTING_ASSETID); + } + protected: LLSettingsBase(); diff --git a/indra/llinventory/llsettingsdaycycle.cpp b/indra/llinventory/llsettingsdaycycle.cpp index ab01a585c6..a43eae16fe 100644 --- a/indra/llinventory/llsettingsdaycycle.cpp +++ b/indra/llinventory/llsettingsdaycycle.cpp @@ -498,6 +498,58 @@ LLSettingsDay::CycleTrack_t &LLSettingsDay::getCycleTrack(S32 track) return mDayTracks[track]; } +bool LLSettingsDay::clearCycleTrack(S32 track) +{ + if ((track < 0) || (track >= TRACK_MAX)) + { + LL_WARNS("DAYCYCLE") << "Attempt to clear track (#" << track << ") out of range!" << LL_ENDL; + return false; + } + mDayTracks[track].clear(); + clearAssetId(); + setDirtyFlag(true); + return true; +} + +bool LLSettingsDay::replaceCycleTrack(S32 track, const CycleTrack_t &source) +{ + if (source.empty()) + { + LL_WARNS("DAYCYCLE") << "Attempt to copy an empty track." << LL_ENDL; + return false; + } + + { + LLSettingsBase::ptr_t first((*source.begin()).second); + std::string setting_type = first->getSettingsType(); + + if (((setting_type == "water") && (track != 0)) || + ((setting_type == "sky") && (track == 0))) + { + LL_WARNS("DAYCYCLE") << "Attempt to copy track missmatch" << LL_ENDL; + return false; + } + } + + if (!clearCycleTrack(track)) + return false; + + mDayTracks[track] = source; + return true; +} + + +bool LLSettingsDay::isTrackEmpty(S32 track) const +{ + if ((track < 0) || (track >= TRACK_MAX)) + { + LL_WARNS("DAYCYCLE") << "Attempt to test track (#" << track << ") out of range!" << LL_ENDL; + return true; + } + + return mDayTracks[track].empty(); +} + //========================================================================= void LLSettingsDay::startDayCycle() { @@ -690,17 +742,6 @@ LLSettingsDay::CycleTrack_t::value_type LLSettingsDay::getSettingsNearKeyframe(c return CycleTrack_t::value_type(TrackPosition(INVALID_TRACKPOS), LLSettingsBase::ptr_t()); } -void LLSettingsDay::clearTrack(S32 track) -{ - if ((track < 0) || (track >= TRACK_MAX)) - { - LL_WARNS("DAYCYCLE") << "Attempt to clear track (#" << track << ") out of range!" << LL_ENDL; - return; - } - - mDayTracks[track].clear(); -} - LLSettingsBase::TrackPosition LLSettingsDay::getUpperBoundFrame(S32 track, const LLSettingsBase::TrackPosition& keyframe) { return get_wrapping_atafter(mDayTracks[track], keyframe)->first; diff --git a/indra/llinventory/llsettingsdaycycle.h b/indra/llinventory/llsettingsdaycycle.h index e2f095aa74..484c59e57f 100644 --- a/indra/llinventory/llsettingsdaycycle.h +++ b/indra/llinventory/llsettingsdaycycle.h @@ -103,7 +103,6 @@ public: void setSettingsAtKeyframe(const LLSettingsBase::ptr_t &settings, const LLSettingsBase::TrackPosition& keyframe, S32 track); LLSettingsBase::ptr_t getSettingsAtKeyframe(const LLSettingsBase::TrackPosition& keyframe, S32 track) const; CycleTrack_t::value_type getSettingsNearKeyframe(const LLSettingsBase::TrackPosition &keyframe, S32 track, F32 fudge) const; - void clearTrack(S32 track); //--------------------------------------------------------------------- void startDayCycle(); @@ -116,6 +115,9 @@ public: void setInitialized(bool value = true) { mInitialized = value; } CycleTrack_t & getCycleTrack(S32 track); + bool clearCycleTrack(S32 track); + bool replaceCycleTrack(S32 track, const CycleTrack_t &source); + bool isTrackEmpty(S32 track) const; virtual validation_list_t getValidationList() const SETTINGS_OVERRIDE; static validation_list_t validationList(); |