2014-05-29 20:41:47 +00:00
|
|
|
#include "HelpStyle.h"
|
|
|
|
#include "ThemeData.h"
|
|
|
|
#include "Renderer.h"
|
|
|
|
#include "resources/Font.h"
|
|
|
|
|
|
|
|
HelpStyle::HelpStyle()
|
|
|
|
{
|
2014-05-29 21:27:18 +00:00
|
|
|
position = Eigen::Vector2f(12.0f, Renderer::getScreenHeight() * 0.9515f);
|
2014-05-29 20:41:47 +00:00
|
|
|
iconColor = 0x777777FF;
|
|
|
|
textColor = 0x777777FF;
|
2014-05-31 23:00:42 +00:00
|
|
|
|
|
|
|
if(FONT_SIZE_SMALL != 0)
|
|
|
|
font = Font::get(FONT_SIZE_SMALL);
|
|
|
|
else
|
|
|
|
font = nullptr;
|
2014-05-29 20:41:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void HelpStyle::applyTheme(const std::shared_ptr<ThemeData>& theme, const std::string& view)
|
|
|
|
{
|
|
|
|
auto elem = theme->getElement(view, "help", "helpsystem");
|
|
|
|
if(!elem)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if(elem->has("pos"))
|
|
|
|
position = elem->get<Eigen::Vector2f>("pos").cwiseProduct(Eigen::Vector2f((float)Renderer::getScreenWidth(), (float)Renderer::getScreenHeight()));
|
|
|
|
|
|
|
|
if(elem->has("textColor"))
|
|
|
|
textColor = elem->get<unsigned int>("textColor");
|
|
|
|
|
2014-05-29 21:27:18 +00:00
|
|
|
if(elem->has("iconColor"))
|
|
|
|
iconColor = elem->get<unsigned int>("iconColor");
|
|
|
|
|
2014-05-29 20:41:47 +00:00
|
|
|
if(elem->has("fontPath") || elem->has("fontSize"))
|
|
|
|
font = Font::getFromTheme(elem, ThemeFlags::ALL, font);
|
|
|
|
}
|