| 
				
				
					
				
				
				 | 
			
			 | 
			@@ -34,7 +34,13 @@ float frameRateLimit = 70.0; | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			bool frameRateSync = true; | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			bool skipLoadOnLaunch = false; | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			std::string patchPath; | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			std::set<plugin::Model*> favoriteModels; | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			std::set<plugin::Model*> favoriteModels = {}; | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			std::vector<NVGcolor> cableColors = { | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
				nvgRGB(0xc9, 0xb7, 0x0e), // yellow | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
				nvgRGB(0x0c, 0x8e, 0x15), // green | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
				nvgRGB(0xc9, 0x18, 0x47), // red | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
				nvgRGB(0x09, 0x86, 0xad), // blue | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			}; | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
  | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
  | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			json_t *toJson() { | 
		
		
	
	
		
			
				| 
				
					
				
				
					
				
				
				 | 
			
			 | 
			@@ -91,6 +97,13 @@ json_t *toJson() { | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
				} | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
				json_object_set_new(rootJ, "favoriteModels", favoriteModelsJ); | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
  | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
				json_t *cableColorsJ = json_array(); | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
				for (NVGcolor cableColor : cableColors) { | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
					std::string colorStr = color::toHexString(cableColor); | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
					json_array_append_new(cableColorsJ, json_string(colorStr.c_str())); | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
				} | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
				json_object_set_new(rootJ, "cableColors", cableColorsJ); | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
  | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
				return rootJ; | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			} | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
  | 
		
		
	
	
		
			
				| 
				
					
				
				
					
				
				
				 | 
			
			 | 
			@@ -177,7 +190,6 @@ void fromJson(json_t *rootJ) { | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
				if (patchPathJ) | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
					patchPath = json_string_value(patchPathJ); | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
  | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
  | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
				json_t *favoriteModelsJ = json_object_get(rootJ, "favoriteModels"); | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
				// Legacy: "favorites" was defined under "moduleBrowser" until 1.0. | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
				if (!favoriteModelsJ) { | 
		
		
	
	
		
			
				| 
				
				
				
					
				
				 | 
			
			 | 
			@@ -186,6 +198,7 @@ void fromJson(json_t *rootJ) { | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
						favoriteModelsJ = json_object_get(rootJ, "favorites"); | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
				} | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
				if (favoriteModelsJ) { | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
					favoriteModels.clear(); | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
					size_t i; | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
					json_t *favoriteJ; | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
					json_array_foreach(favoriteModelsJ, i, favoriteJ) { | 
		
		
	
	
		
			
				| 
				
				
				
					
				
				 | 
			
			 | 
			@@ -201,6 +214,17 @@ void fromJson(json_t *rootJ) { | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
						favoriteModels.insert(model); | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
					} | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
				} | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
  | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
				json_t *cableColorsJ = json_object_get(rootJ, "cableColors"); | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
				if (cableColorsJ) { | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
					cableColors.clear(); | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
					size_t i; | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
					json_t *cableColorJ; | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
					json_array_foreach(cableColorsJ, i, cableColorJ) { | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
						std::string colorStr = json_string_value(cableColorJ); | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
						cableColors.push_back(color::fromHexString(colorStr)); | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
					} | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
				} | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			} | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			
  | 
		
		
	
		
			
			 | 
			 | 
			
			 | 
			void save(const std::string &path) { | 
		
		
	
	
		
			
				| 
				
					
				
				
				
				 | 
			
			 | 
			
  |