skin coloring fixes
This commit is contained in:
		
							parent
							
								
									bc7fbcca16
								
							
						
					
					
						commit
						92ac4093a4
					
				|  | @ -49,7 +49,7 @@ panels: | |||
| labels: | ||||
|   default: | ||||
|     font: tibia-10px-antialised | ||||
|     text color: [238, 238, 238, 255] | ||||
|     text color: [191, 191, 191, 255] | ||||
| 
 | ||||
| windows: | ||||
|   default: | ||||
|  |  | |||
|  | @ -44,7 +44,6 @@ void UIButtonSkin::load(const YAML::Node& node) | |||
|     m_font = g_fonts.get(tmp); | ||||
| 
 | ||||
|     node["text color"] >> m_textColor; | ||||
|     m_textColor = Color::white; | ||||
| } | ||||
| 
 | ||||
| void UIButtonSkin::draw(UIElement *element) | ||||
|  |  | |||
|  | @ -33,27 +33,11 @@ | |||
| 
 | ||||
| UISkins g_uiSkins; | ||||
| 
 | ||||
| void UISkins::init() | ||||
| void UISkins::load(const std::string& skinsFile) | ||||
| { | ||||
|     // load default skin
 | ||||
|     g_uiSkins.load("skins/tibiaskin.yml"); | ||||
| 
 | ||||
| } | ||||
| 
 | ||||
| void UISkins::terminate() | ||||
| { | ||||
|     for(auto it = m_elementSkins.begin(); it != m_elementSkins.end(); ++it) | ||||
|         delete (*it); | ||||
|     m_elementSkins.clear(); | ||||
| } | ||||
| 
 | ||||
| bool UISkins::load(const std::string& file) | ||||
| { | ||||
|     std::string fileContents = g_resources.loadTextFile(file); | ||||
|     if(!fileContents.size()) { | ||||
|         logFatal("Could not load skin file \"%s",  file.c_str()); | ||||
|         return false; | ||||
|     } | ||||
|     std::string fileContents = g_resources.loadTextFile(skinsFile); | ||||
|     if(!fileContents.size()) | ||||
|         logFatal("Could not load skin file \"%s",  skinsFile.c_str()); | ||||
| 
 | ||||
|     std::istringstream fin(fileContents); | ||||
| 
 | ||||
|  | @ -128,12 +112,18 @@ bool UISkins::load(const std::string& file) | |||
|             } | ||||
|         } | ||||
|     } catch (YAML::Exception& e) { | ||||
|         logError("Malformed skin file \"%s\":\n  %s", file.c_str(), e.what()); | ||||
|         return false; | ||||
|         logFatal("Malformed skin file \"%s\":\n  %s", skinsFile.c_str(), e.what()); | ||||
|     } | ||||
|     return true; | ||||
| } | ||||
| 
 | ||||
| void UISkins::terminate() | ||||
| { | ||||
|     for(auto it = m_elementSkins.begin(); it != m_elementSkins.end(); ++it) | ||||
|         delete (*it); | ||||
|     m_elementSkins.clear(); | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| UIElementSkin* UISkins::getElementSkin(UI::EElementType elementType, const std::string& name) | ||||
| { | ||||
|     for(auto it = m_elementSkins.begin(); it != m_elementSkins.end(); ++it) { | ||||
|  |  | |||
|  | @ -36,11 +36,9 @@ class UISkins | |||
| public: | ||||
|     UISkins() { } | ||||
| 
 | ||||
|     void init(); | ||||
|     void load(const std::string& skinsFile); | ||||
|     void terminate(); | ||||
| 
 | ||||
|     bool load(const std::string& file); | ||||
| 
 | ||||
|     UIElementSkin *getElementSkin(UI::EElementType elementType, const std::string& name = "default"); | ||||
|     TexturePtr getDefaultTexture() { return m_defaultTexture; } | ||||
| 
 | ||||
|  |  | |||
|  | @ -108,8 +108,7 @@ int main(int argc, const char *argv[]) | |||
| 
 | ||||
|     // init engine
 | ||||
|     g_engine.init(); | ||||
| 
 | ||||
|     g_uiSkins.init(); | ||||
|     g_uiSkins.load("skins/tibiaskin.yml"); | ||||
| 
 | ||||
|     // state scope
 | ||||
|     { | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	 Eduardo Bart
						Eduardo Bart