mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 00:00:04 +00:00 
			
		
		
		
	Adding STP to list of palettes
This commit is contained in:
		
							parent
							
								
									5e20ff9311
								
							
						
					
					
						commit
						41fda1e9cf
					
				
					 4 changed files with 21 additions and 18 deletions
				
			
		|  | @ -13,7 +13,7 @@ namespace settings | |||
| static const std::string logPrefix_ = "[scwx::qt::settings::palette_settings] "; | ||||
| 
 | ||||
| static const std::vector<std::string> paletteNames_ = { | ||||
|    "BR", "BV", "SW", "ZDR", "PHI", "CC", "???"}; | ||||
|    "BR", "BV", "SW", "ZDR", "PHI", "CC", "STP", "???"}; | ||||
| 
 | ||||
| static const std::string DEFAULT_KEY     = "Default"; | ||||
| static const std::string DEFAULT_PALETTE = ""; | ||||
|  | @ -27,10 +27,10 @@ public: | |||
| 
 | ||||
|    void SetDefaults() | ||||
|    { | ||||
|       std::for_each( | ||||
|          paletteNames_.cbegin(), | ||||
|          paletteNames_.cend(), | ||||
|          [&](const std::string& name) { palette_[name] = DEFAULT_PALETTE; }); | ||||
|       std::for_each(paletteNames_.cbegin(), | ||||
|                     paletteNames_.cend(), | ||||
|                     [&](const std::string& name) | ||||
|                     { palette_[name] = DEFAULT_PALETTE; }); | ||||
|    } | ||||
| 
 | ||||
|    std::unordered_map<std::string, std::string> palette_; | ||||
|  | @ -66,10 +66,10 @@ boost::json::value PaletteSettings::ToJson() const | |||
| { | ||||
|    boost::json::object json; | ||||
| 
 | ||||
|    std::for_each( | ||||
|       paletteNames_.cbegin(), | ||||
|       paletteNames_.cend(), | ||||
|       [&](const std::string& name) { json[name] = p->palette_[name]; }); | ||||
|    std::for_each(paletteNames_.cbegin(), | ||||
|                  paletteNames_.cend(), | ||||
|                  [&](const std::string& name) | ||||
|                  { json[name] = p->palette_[name]; }); | ||||
| 
 | ||||
|    return json; | ||||
| } | ||||
|  | @ -94,7 +94,8 @@ PaletteSettings::Load(const boost::json::value* json, bool& jsonDirty) | |||
|    { | ||||
|       std::for_each(paletteNames_.cbegin(), | ||||
|                     paletteNames_.cend(), | ||||
|                     [&](const std::string& name) { | ||||
|                     [&](const std::string& name) | ||||
|                     { | ||||
|                        jsonDirty |= !util::json::FromJsonString( | ||||
|                           json->as_object(), | ||||
|                           name, | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat