Commit 46cd1553 authored by Saket Dandawate's avatar Saket Dandawate Committed by Subs

Move Carousel transition to separate switch

- Removed Simple Slide
- Added Switch to control Carousel transition
parent ef79c054
......@@ -494,6 +494,12 @@ GuiMenu::GuiMenu(Window *window) : GuiComponent(window), mMenu(window, _("MAIN M
Settings::getInstance()->setBool("UseOSK", osk_enable->getState());
});
// carousel transition option
auto move_carousel = std::make_shared<SwitchComponent>(mWindow);
move_carousel->setState(Settings::getInstance()->getBool("MoveCarousel"));
s->addWithLabel(move_carousel, _("CAROUSEL ANIMATION"), MenuMessages::UI_CAROUSEL_HELP_MSG);
s->addSaveFunc([move_carousel] { Settings::getInstance()->setBool("MoveCarousel", move_carousel->getState()); });
// transition style
auto transition_style = std::make_shared<OptionListComponent<std::string> >(mWindow,
_("TRANSITION STYLE"),
......
......@@ -38,7 +38,8 @@ const std::string MenuMessages::UI_SCREENSAVER_BEHAVIOR_HELP_MSG = _("Set the sc
const std::string MenuMessages::UI_ONSCREENHELP_HELP_MSG = _("Shows a help at the bottom of the screen which displays commands you can use.");
const std::string MenuMessages::UI_QUICK_HELP_MSG = _("When enabled, you can switch between systems while browsing a gamelist by pressing LEFT or RIGHT.");
const std::string 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 std::string MenuMessages::UI_TRANSITION_HELP_MSG = _("Select the type of transition that occurs when you start a game. FADE will fade to dark, and SLIDE will zoom on the game cover (or name if there is no scrape information)");
const std::string MenuMessages::UI_CAROUSEL_HELP_MSG = _("Choose if carousel will be animated or not during transitions");
const std::string MenuMessages::UI_TRANSITION_HELP_MSG = _("Select the type of transition that occurs when you start a game. INSTANT will do nothing, FADE will fade to dark, and SLIDE will zoom on the game cover (or name if there is no scrape information)");
const std::string MenuMessages::UI_THEME_HELP_MSG = _("Select a theme for your recalbox.");
const std::string MenuMessages::UI_THEME_COLORSET_MSG = _("Select exisiting colorset options for this theme.");
const std::string MenuMessages::UI_THEME_ICONSET_MSG = _("Select exisiting iconset options for this theme.");
......
......@@ -46,6 +46,7 @@ public:
static const std::string UI_ONSCREENHELP_HELP_MSG;
static const std::string UI_QUICK_HELP_MSG;
static const std::string UI_KEYBOARD_HELP_MSG;
static const std::string UI_CAROUSEL_HELP_MSG;
static const std::string UI_TRANSITION_HELP_MSG;
static const std::string UI_THEME_HELP_MSG;
static const std::string UI_THEME_COLORSET_MSG;
......
......@@ -331,12 +331,13 @@ void SystemView::onCursorChanged(const CursorState& state)
return;
Animation* anim;
bool move_carousel = Settings::getInstance()->getBool("MoveCarousel");
std::string transition_style = Settings::getInstance()->getString("TransitionStyle");
if(transition_style == "fade")
{
float startExtrasFade = mExtrasFadeOpacity;
anim = new LambdaAnimation(
[startExtrasFade, startPos, endPos, posMax, this](float t)
[startExtrasFade, startPos, endPos, posMax, this, move_carousel](float t)
{
t -= 1;
float f = lerp<float>(startPos, endPos, t*t*t + 1);
......@@ -345,7 +346,7 @@ void SystemView::onCursorChanged(const CursorState& state)
if(f >= posMax)
f -= posMax;
this->mCamOffset = f;
this->mCamOffset = move_carousel ? f : endPos;
t += 1;
if(t < 0.3f)
......@@ -362,7 +363,7 @@ void SystemView::onCursorChanged(const CursorState& state)
}
else if (transition_style == "slide"){ // slide
anim = new LambdaAnimation(
[startPos, endPos, posMax, this](float t)
[startPos, endPos, posMax, this, move_carousel](float t)
{
t -= 1;
float f = lerp<float>(startPos, endPos, t*t*t + 1);
......@@ -371,18 +372,24 @@ void SystemView::onCursorChanged(const CursorState& state)
if(f >= posMax)
f -= posMax;
this->mCamOffset = f;
this->mCamOffset = move_carousel ? f : endPos;
this->mExtrasCamOffset = f;
}, 500);
} else {
// instant
anim = new LambdaAnimation(
[this, endPos](float t)
[this, startPos, endPos, posMax, move_carousel](float t)
{
this->mCamOffset = endPos;
this->mExtrasCamOffset = endPos;
}, 1);
t -= 1;
float f = lerp<float>(startPos, endPos, t*t*t + 1);
if(f < 0)
f += posMax;
if(f >= posMax)
f -= posMax;
this->mCamOffset = move_carousel ? f : endPos;
this->mExtrasCamOffset = endPos;
}, move_carousel ? 500 : 1);
}
setAnimation(anim, 0, nullptr, false, 0);
......
......@@ -72,7 +72,7 @@ void Settings::setDefaults() {
mBoolMap["Debug"] = false;
mBoolMap["DebugGrid"] = false;
mBoolMap["DebugText"] = false;
mBoolMap["MoveCarousel"] = true;
mBoolMap["Overscan"] = false;
mIntMap["ScreenSaverTime"] = 5 * 60 * 1000; // 5 minutes
......
......@@ -365,6 +365,10 @@ msgstr ""
msgid "SCREENSAVER AFTER"
msgstr ""
#:
msgid "CAROUSEL ANIMATION"
msgstr ""
#:
msgid "TRANSITION STYLE"
msgstr ""
......@@ -1288,8 +1292,12 @@ msgstr ""
msgid "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."
msgstr ""
#:
msgid "Choose if carousel will be animated or not during transitions"
msgstr ""
#:
msgid "Select the type of transition that occurs when you start a game. FADE will fade to dark, and SLIDE will zoom on the game cover (or name if there is no scrape information)"
msgid "Select the type of transition that occurs when you start a game. INSTANT will do nothing, FADE will fade to dark, and SLIDE will zoom on the game cover (or name if there is no scrape information)"
msgstr ""
#:
......
......@@ -357,6 +357,10 @@ msgstr "OVERSCAN"
msgid "SCREENSAVER AFTER"
msgstr "ÉCRAN DE VEILLE APRÈS"
#:
msgid "CAROUSEL ANIMATION"
msgstr "ANIMATION DU CAROUSEL"
#:
msgid "TRANSITION STYLE"
msgstr "STYLE DE LA TRANSITION"
......@@ -1273,8 +1277,12 @@ msgstr "Si activé, vous pouvez changer de système tout en parcourant les liste
msgid "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."
msgstr "Le clavier virtuel est nécessaire pour taper du texte si vous n'avez que des manettes branchées sur votre Recalbox. Vous pouvez désactiver cette option si vous avez un clavier branché."
#:
msgid "Choose if carousel will be animated or not during transitions"
msgstr "Choisissez si le carousel est animé ou non pendant les transitions"
#:
msgid "Select the type of transition that occurs when you start a game. FADE will fade to dark, and SLIDE will zoom on the game cover (or name if there is no scrape information)"
msgid "Select the type of transition that occurs when you start a game. INSTANT will do nothing, FADE will fade to dark, and SLIDE will zoom on the game cover (or name if there is no scrape information)"
msgstr "Sélectionnez le type de transition qui se produit lorsque vous lancez un jeu. FADE fera un fondu au noir et SLIDE zoomera sur l'image du jeu (ou le nom si il n'y a pas de metadatas)."
#:
......
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