summaryrefslogtreecommitdiff
path: root/indra/newview/llsettingsbase.h
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2017-11-03 11:28:08 -0700
committerRider Linden <rider@lindenlab.com>2017-11-03 11:28:08 -0700
commit61e6632a713041e8e4ccebf72874767238bf8a48 (patch)
treed1134597b1ac03812fccf0ef21171f9577bc522d /indra/newview/llsettingsbase.h
parent2161788711f6d89564afc933707b6a0b8c1b0562 (diff)
Initial day cycle impl.
Diffstat (limited to 'indra/newview/llsettingsbase.h')
-rw-r--r--indra/newview/llsettingsbase.h34
1 files changed, 32 insertions, 2 deletions
diff --git a/indra/newview/llsettingsbase.h b/indra/newview/llsettingsbase.h
index f7015fb12b..205351c401 100644
--- a/indra/newview/llsettingsbase.h
+++ b/indra/newview/llsettingsbase.h
@@ -46,6 +46,9 @@ class LLSettingsBase: private boost::noncopyable
friend class LLSettingsDayCycle;
public:
+ static const std::string SETTING_ID;
+ static const std::string SETTING_NAME;
+
typedef std::map<std::string, S32> parammapping_t;
typedef boost::shared_ptr<LLSettingsBase> ptr_t;
@@ -63,6 +66,32 @@ public:
inline bool isDirty() const { return mDirty; }
inline void setDirtyFlag(bool dirty) { mDirty = dirty; }
+ inline LLUUID getId() const
+ {
+ return getValue(SETTING_ID).asUUID();
+ }
+
+ inline std::string getName() const
+ {
+ return getValue(SETTING_NAME).asString();
+ }
+
+ inline void setName(std::string val)
+ {
+ setValue(SETTING_NAME, val);
+ }
+
+ inline void replaceSettings(LLSD settings)
+ {
+ mSettings = settings;
+ setDirtyFlag(true);
+ }
+
+ inline LLSD getSettings() const
+ {
+ return mSettings;
+ }
+
//---------------------------------------------------------------------
//
inline void setValue(const std::string &name, const LLSD &value)
@@ -71,7 +100,7 @@ public:
mDirty = true;
}
- inline LLSD getValue(const std::string &name, const LLSD &deflt = LLSD())
+ inline LLSD getValue(const std::string &name, const LLSD &deflt = LLSD()) const
{
if (!mSettings.has(name))
return deflt;
@@ -121,13 +150,14 @@ public:
// TODO: This is temporary
virtual void exportSettings(std::string name) const;
+ virtual void blend(const ptr_t &end, F32 blendf) = 0;
+
protected:
LLSettingsBase();
LLSettingsBase(const LLSD setting);
typedef std::set<std::string> stringset_t;
- virtual ptr_t blend(const ptr_t &end, F32 blendf) const = 0;
// combining settings objects. Customize for specific setting types
virtual void lerpSettings(const LLSettingsBase &other, F32 mix);