diff --git a/data/skins/tibiaskin.yml b/data/skins/tibiaskin.yml index 959ab27d..1b2305e7 100644 --- a/data/skins/tibiaskin.yml +++ b/data/skins/tibiaskin.yml @@ -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: diff --git a/src/framework/ui/uibuttonskin.cpp b/src/framework/ui/uibuttonskin.cpp index 570704d1..657645cd 100644 --- a/src/framework/ui/uibuttonskin.cpp +++ b/src/framework/ui/uibuttonskin.cpp @@ -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) diff --git a/src/framework/ui/uiskins.cpp b/src/framework/ui/uiskins.cpp index b5ad5aa0..72e2ce4b 100644 --- a/src/framework/ui/uiskins.cpp +++ b/src/framework/ui/uiskins.cpp @@ -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) { diff --git a/src/framework/ui/uiskins.h b/src/framework/ui/uiskins.h index 1590ae43..f4b9e9c5 100644 --- a/src/framework/ui/uiskins.h +++ b/src/framework/ui/uiskins.h @@ -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; } diff --git a/src/main.cpp b/src/main.cpp index 729e1ae3..acafbcf6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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 {