summaryrefslogtreecommitdiff
path: root/indra/llui/lluicolortable.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui/lluicolortable.h')
-rw-r--r--indra/llui/lluicolortable.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/indra/llui/lluicolortable.h b/indra/llui/lluicolortable.h
index 7232077cab..0c6286e5eb 100644
--- a/indra/llui/lluicolortable.h
+++ b/indra/llui/lluicolortable.h
@@ -42,7 +42,7 @@ class LLUIColorTable : public LLSingleton<LLUIColorTable>
LOG_CLASS(LLUIColorTable);
// consider using sorted vector, can be much faster
- typedef std::map<std::string, LLUIColor> string_color_map_t;
+ typedef std::map<std::string, LLUIColor, std::less<>> string_color_map_t;
public:
struct ColorParams : LLInitParam::ChoiceBlock<ColorParams>
@@ -75,13 +75,17 @@ public:
void clear();
// color lookup
- LLUIColor getColor(const std::string& name, const LLColor4& default_color = LLColor4::magenta) const;
+ LLUIColor getColor(std::string_view name, const LLColor4& default_color = LLColor4::magenta) const;
// if the color is in the table, it's value is changed, otherwise it is added
- void setColor(const std::string& name, const LLColor4& color);
+ void setColor(std::string_view name, const LLColor4& color);
// returns true if color_name exists in the table
- bool colorExists(const std::string& color_name) const;
+ bool colorExists(std::string_view color_name) const;
+
+ bool isDefault(std::string_view color_name) const;
+
+ void resetToDefault(std::string_view color_name);
// loads colors from settings files
bool loadFromSettings();
@@ -89,13 +93,16 @@ public:
// saves colors specified by the user to the users skin directory
void saveUserSettings() const;
+ const auto& getLoadedColors() { return mLoadedColors; }
+ const auto& getUserColors() { return mUserSetColors; }
+
private:
bool loadFromFilename(const std::string& filename, string_color_map_t& table);
void insertFromParams(const Params& p, string_color_map_t& table);
void clearTable(string_color_map_t& table);
- void setColor(const std::string& name, const LLColor4& color, string_color_map_t& table);
+ void setColor(std::string_view name, const LLColor4& color, string_color_map_t& table);
string_color_map_t mLoadedColors;
string_color_map_t mUserSetColors;