mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-23 22:55:39 +00:00
29 lines
827 B
C++
29 lines
827 B
C++
|
#include "HelpStyle.h"
|
||
|
#include "ThemeData.h"
|
||
|
#include "Renderer.h"
|
||
|
#include "resources/Font.h"
|
||
|
|
||
|
HelpStyle::HelpStyle()
|
||
|
{
|
||
|
position = Eigen::Vector2f(12.0f, Renderer::getScreenHeight() * 0.955f);
|
||
|
iconColor = 0x777777FF;
|
||
|
textColor = 0x777777FF;
|
||
|
font = Font::get(FONT_SIZE_SMALL);
|
||
|
}
|
||
|
|
||
|
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");
|
||
|
|
||
|
if(elem->has("fontPath") || elem->has("fontSize"))
|
||
|
font = Font::getFromTheme(elem, ThemeFlags::ALL, font);
|
||
|
}
|