Commit 977d5dbc authored by Supernature2k's avatar Supernature2k

add missing fav icons for new systems

parent 2a95a111
......@@ -4,6 +4,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased]
### Added
- Added clock in main menu
- Added missing fav icons for Amigas 3DO and X68k
### Fixed
- Fixed HelpMessages not translated
......
This diff is collapsed.
......@@ -469,6 +469,15 @@ GuiMenu::GuiMenu(Window *window) : GuiComponent(window), mMenu(window, _("MAIN M
screensaver_behavior->getSelected());
});
// display clock
auto show_time = std::make_shared<SwitchComponent>(mWindow);
show_time->setState(Settings::getInstance()->getBool("ShowClock"));
s->addWithLabel(show_time, _("CLOCK IN MENU"), MenuMessages::UI_CLOCK_HELP_MSG);
s->addSaveFunc(
[show_time] {
Settings::getInstance()->setBool("ShowClock", show_time->getState());
});
// show help
auto show_help = std::make_shared<SwitchComponent>(mWindow);
show_help->setState(Settings::getInstance()->getBool("ShowHelpPrompts"));
......
......@@ -36,6 +36,7 @@ const char* MenuMessages::UI_HELP_MSG = "Configure your EmulationStation experie
const char* MenuMessages::UI_SCREENSAVER_AFTER_HELP_MSG = "Start the screensaver after N minutes.";
const char* MenuMessages::UI_SCREENSAVER_BEHAVIOR_HELP_MSG = "Set the screensaver behavior. DIM will reduce the screen light, and BLACK will turn the screen black.";
const char* MenuMessages::UI_ONSCREENHELP_HELP_MSG = "Shows a help at the bottom of the screen which displays commands you can use.";
const char* MenuMessages::UI_CLOCK_HELP_MSG = "Add a clock in the main menu.";
const char* MenuMessages::UI_QUICK_HELP_MSG = "When enabled, you can switch between systems while browsing a gamelist by pressing LEFT or RIGHT.";
const char* MenuMessages::UI_KEYBOARD_HELP_MSG = "The onscreen keyboard is necessary to type text if you only have controllers plugged into your recalbox. You can disable it if you have a real keyboard connected.";
const char* MenuMessages::UI_CAROUSEL_HELP_MSG = "Choose if carousel will be animated or not during transitions";
......
......@@ -44,6 +44,7 @@ public:
static const char* UI_SCREENSAVER_AFTER_HELP_MSG;
static const char* UI_SCREENSAVER_BEHAVIOR_HELP_MSG;
static const char* UI_ONSCREENHELP_HELP_MSG;
static const char* UI_CLOCK_HELP_MSG;
static const char* UI_QUICK_HELP_MSG;
static const char* UI_KEYBOARD_HELP_MSG;
static const char* UI_CAROUSEL_HELP_MSG;
......@@ -107,6 +108,7 @@ public:
static const char* GAMELISTOPTION_FAVORITES_ONLY_MSG;
static const char* GAMELISTOPTION_SHOW_HIDDEN_MSG;
static const char* GAMELISTOPTION_EDIT_METADATA_MSG;
};
#endif //EMULATIONSTATION_ALL_MENUMESSAGES_H
......@@ -43,6 +43,11 @@ void BasicGameListView::onFileChanged(FileData* file, FileChangeType change)
static const std::map<std::string, const char*> favorites_icons_map = boost::assign::map_list_of
("snes", "\uF25e ")
("3do", "\uF28a")
("x68000", "\uF28b")
("amiga600", "\uF244")
("amiga1200", "\uF245")
("nds", "\uF267")
("c64", "\uF24c ")
("nes", "\uF25c ")
("n64", "\uF260 ")
......
......@@ -51,6 +51,7 @@ void Settings::setDefaults() {
mBoolMap["ShowExit"] = true;
mBoolMap["Windowed"] = false;
mBoolMap["UseOSK"] = true;
mBoolMap["ShowClock"] = false;
#ifdef _RPI_
// don't enable VSync by default on the Pi, since it already
......
......@@ -13,6 +13,7 @@ DateTimeComponent::DateTimeComponent(Window* window, DisplayMode dispMode) : Gui
auto menuTheme = MenuThemeData::getInstance()->getCurrentTheme();
setFont(menuTheme->menuTextSmall.font);
setColor(menuTheme->menuText.color);
mFlag = true;
updateTextCache();
}
......@@ -126,7 +127,7 @@ bool DateTimeComponent::input(InputConfig* config, Input input)
void DateTimeComponent::update(int deltaTime)
{
if(mDisplayMode == DISP_RELATIVE_TO_NOW)
if(mDisplayMode == DISP_RELATIVE_TO_NOW || mDisplayMode == DISP_TIME)
{
mRelativeUpdateAccumulator += deltaTime;
if(mRelativeUpdateAccumulator > 1000)
......@@ -207,6 +208,22 @@ std::string DateTimeComponent::getDisplayString(DisplayMode mode) const
case DISP_DATE_TIME:
fmt = "%m/%d/%Y %H:%M:%S";
break;
//only used for timer in main menu
case DISP_TIME: {
if (mFlag)
fmt = "%H:%M:%S";
else
fmt = "%H:%M:%S";
using namespace boost::posix_time;
boost::posix_time::time_facet* facet = new boost::posix_time::time_facet();
facet->format(fmt.c_str());
std::locale loc(std::locale::classic(), facet);
std::stringstream ss;
ss.imbue(loc);
ss << "" << second_clock::universal_time();
return ss.str();
}
case DISP_RELATIVE_TO_NOW:
{
//relative time
......@@ -266,6 +283,7 @@ std::shared_ptr<Font> DateTimeComponent::getFont() const
void DateTimeComponent::updateTextCache()
{
mFlag = !mFlag;
DisplayMode mode = getCurrentDisplayMode();
const std::string dispString = mUppercase ? strToUpper(getDisplayString(mode)) : getDisplayString(mode);
std::shared_ptr<Font> font = getFont();
......
......@@ -12,6 +12,7 @@ public:
{
DISP_DATE,
DISP_DATE_TIME,
DISP_TIME,
DISP_RELATIVE_TO_NOW
};
......@@ -63,4 +64,6 @@ private:
bool mUppercase;
bool mAutoSize;
bool mFlag;
};
#include <Settings.h>
#include "components/MenuComponent.h"
#include "components/ButtonComponent.h"
#include "Locale.h"
......@@ -28,8 +29,23 @@ MenuComponent::MenuComponent(Window* window, const char* title, const std::share
setTitle(title, menuTheme->menuTitle.font);
mTitle->setColor(menuTheme->menuTitle.color);
mGrid.setEntry(mTitle, Vector2i(0, 0), false);
if (title == _("MAIN MENU") && Settings::getInstance()->getBool("ShowClock")) {
mDateTime = std::make_shared<DateTimeComponent>(mWindow);
mDateTime->setDisplayMode(DateTimeComponent::DISP_TIME);
mDateTime->setFont(menuTheme->menuText.font);
mDateTime->setColor(menuTheme->menuText.color);
auto headerGrid = std::make_shared<ComponentGrid>(mWindow, Vector2i(7, 1));
headerGrid->setEntry(mDateTime, Vector2i(6, 0), false);
mGrid.setEntry(headerGrid, Vector2i(0, 0), false);
}
// set up list which will never change (externally, anyway)
mList = std::make_shared<ComponentList>(mWindow);
......
......@@ -9,6 +9,7 @@
#include "MenuThemeData.h"
#include "Locale.h"
#include "guis/GuiMsgBoxScroll.h"
#include "DateTimeComponent.h"
class ButtonComponent;
class ImageComponent;
......@@ -85,6 +86,7 @@ private:
ComponentGrid mGrid;
std::shared_ptr<TextComponent> mTitle;
std::shared_ptr<DateTimeComponent> mDateTime;
std::shared_ptr<ComponentList> mList;
std::shared_ptr<ComponentGrid> mButtonGrid;
std::vector< std::shared_ptr<ButtonComponent> > mButtons;
......
......@@ -381,6 +381,10 @@ msgstr ""
msgid "SHOW FRAMERATE"
msgstr ""
#:
msgid "CLOCK IN MENU"
msgstr ""
#:
msgid "ON-SCREEN HELP"
msgstr ""
......
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