Commit ada8babd authored by Supernature2k's avatar Supernature2k Committed by Subs

add tag in theme to force transition style

parent 13ae9e1c
......@@ -4,6 +4,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased]
### Added
- Added tag in theme to force transition style
- Added dynamic change of volume and audio output in menu
- Added ubuntu_condensed.ttf as fallback font
- Added clock in main menu
......
......@@ -703,6 +703,9 @@ EmulationStation borrows the concept of "nine patches" from Android (or "9-Slice
* `maxLogoCount` - type: FLOAT.
- Sets the number of logos to display in the carousel.
- Default is 3
* `defaultTransition` - type: STRING.
- Force transition style.
- Accepted values are "instant", "fade" or "slide".
* `zIndex` - type: FLOAT.
- z-index value for component. Components will be rendered in order of z-index value from low to high.
......
......@@ -556,6 +556,9 @@ GuiMenu::GuiMenu(Window *window) : GuiComponent(window), mMenu(window, _("MAIN M
window->pushGui(ViewController::get());
ViewController::get()->goToStart();
MenuThemeData::getInstance();
auto transi = ThemeData::getCurrent()->getTransition();
if (transi != "")
Settings::getInstance()->setString("TransitionStyle", transi);
Settings::getInstance()->setBool("ThemeChanged", false);
};
......
......@@ -133,6 +133,7 @@ std::map< std::string, ElementMapType > ThemeData::sElementMap = boost::assign::
("logoSize", NORMALIZED_PAIR)
("logoAlignment", STRING)
("maxLogoCount", FLOAT)
("defaultTransition", STRING)
("zIndex", FLOAT)))
("menuBackground", makeMap(boost::assign::map_list_of
("color", COLOR)
......@@ -850,6 +851,21 @@ fs::path ThemeData::getThemeFromCurrentSet(const std::string& system)
return set->second.getThemePath(system);
}
std::string ThemeData::getTransition()
{
std::string result = "";
auto elem = getElement("system", "systemcarousel", "carousel");
if (elem->has("defaultTransition")) {
if (!(elem->get<std::string>("defaultTransition").compare("instant")))
result = "instant";
if (!(elem->get<std::string>("defaultTransition").compare("fade")))
result = "fade";
if (!(elem->get<std::string>("defaultTransition").compare("slide")))
result = "slide";
}
return result;
}
bool ThemeData::getHasFavoritesInTheme()
{
return (mVersion >= CURRENT_THEME_FORMAT_VERSION);
......
......@@ -135,6 +135,7 @@ public:
static std::map<std::string, std::string> getThemeSubSets(const std::string& theme);
static std::map<std::string, std::string> sortThemeSubSets(const std::map<std::string, std::string>& subsetmap, const std::string& subset);
static boost::filesystem::path getThemeFromCurrentSet(const std::string& system);
std::string getTransition();
bool getHasFavoritesInTheme();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment