mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-29 17:45:38 +00:00
Fixed the screensaver controls.
It's now possible to start a game directly from the slideshow screensaver. Also fixed toggling of the video screensaver which was not working as expected.
This commit is contained in:
parent
41c3c66eb7
commit
c906881957
|
@ -2,7 +2,7 @@
|
||||||
// SystemScreenSaver.cpp
|
// SystemScreenSaver.cpp
|
||||||
//
|
//
|
||||||
// Screensaver, supporting the following modes:
|
// Screensaver, supporting the following modes:
|
||||||
// Dim, black, video, slideshow.
|
// Dim, black, slideshow, video.
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "SystemScreenSaver.h"
|
#include "SystemScreenSaver.h"
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
// SystemScreenSaver.h
|
// SystemScreenSaver.h
|
||||||
//
|
//
|
||||||
// Screensaver, supporting the following modes:
|
// Screensaver, supporting the following modes:
|
||||||
// Dim, black, video, slideshow.
|
// Dim, black, slideshow, video.
|
||||||
//
|
//
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
|
@ -54,10 +54,8 @@ GuiGeneralScreensaverOptions::GuiGeneralScreensaverOptions(Window* window, const
|
||||||
"random video" && screensaver_behavior->getSelected() == "random video") {
|
"random video" && screensaver_behavior->getSelected() == "random video") {
|
||||||
// If before it wasn't risky but now there's a risk of problems, show warning.
|
// If before it wasn't risky but now there's a risk of problems, show warning.
|
||||||
mWindow->pushGui(new GuiMsgBox(mWindow, getHelpStyle(),
|
mWindow->pushGui(new GuiMsgBox(mWindow, getHelpStyle(),
|
||||||
"THE \"RANDOM VIDEO\" SCREENSAVER SHOWS\nVIDEOS FROM YOUR GAMELISTS.\n\nIF YOU DO NOT "
|
"THE \"RANDOM VIDEO\" SCREENSAVER\nSHOWS VIDEOS FROM YOUR GAMELISTS.\n\nIF YOU DO NOT "
|
||||||
"HAVE ANY VIDEOS, THE SCREENSAVER\nWILL DEFAULT TO \"BLACK\".\n\nSEE MORE "
|
"HAVE ANY VIDEOS, THE\nSCREENSAVER WILL DEFAULT TO \"BLACK\"",
|
||||||
"OPTIONS IN THE MENU \"UI SETTINGS\" >\n\"SCREENSAVER SETTINGS\" > "
|
|
||||||
"\"VIDEO SCREENSAVER SETTINGS\".",
|
|
||||||
"OK", [] { return; }));
|
"OK", [] { return; }));
|
||||||
}
|
}
|
||||||
Settings::getInstance()->setString("ScreenSaverBehavior",
|
Settings::getInstance()->setString("ScreenSaverBehavior",
|
||||||
|
|
|
@ -17,7 +17,7 @@ GuiVideoScreensaverOptions::GuiVideoScreensaverOptions(Window* window, const cha
|
||||||
: GuiScreensaverOptions(window, title)
|
: GuiScreensaverOptions(window, title)
|
||||||
{
|
{
|
||||||
// Timer for swapping videos.
|
// Timer for swapping videos.
|
||||||
auto swap = std::make_shared<SliderComponent>(mWindow, 10.f, 1000.f, 1.f, "s");
|
auto swap = std::make_shared<SliderComponent>(mWindow, 10.f, 300.f, 5.f, "s");
|
||||||
swap->setValue((float)(Settings::getInstance()->
|
swap->setValue((float)(Settings::getInstance()->
|
||||||
getInt("ScreenSaverSwapVideoTimeout") / (1000)));
|
getInt("ScreenSaverSwapVideoTimeout") / (1000)));
|
||||||
addWithLabel("SWAP VIDEO AFTER (SECS)", swap);
|
addWithLabel("SWAP VIDEO AFTER (SECS)", swap);
|
||||||
|
|
|
@ -131,18 +131,20 @@ void Window::input(InputConfig* config, Input input)
|
||||||
if (mScreenSaver) {
|
if (mScreenSaver) {
|
||||||
if (mScreenSaver->isScreenSaverActive() &&
|
if (mScreenSaver->isScreenSaverActive() &&
|
||||||
Settings::getInstance()->getBool("ScreenSaverControls") &&
|
Settings::getInstance()->getBool("ScreenSaverControls") &&
|
||||||
(Settings::getInstance()->getString("ScreenSaverBehavior") == "random video")) {
|
((Settings::getInstance()->getString("ScreenSaverBehavior") == "random video") ||
|
||||||
|
(Settings::getInstance()->getString("ScreenSaverBehavior") == "slideshow"))) {
|
||||||
if (mScreenSaver->getCurrentGame() != nullptr &&
|
if (mScreenSaver->getCurrentGame() != nullptr &&
|
||||||
(config->isMappedLike("right", input) ||
|
(config->isMappedTo("a", input) ||
|
||||||
config->isMappedTo("start", input) || config->isMappedTo("select", input))) {
|
config->isMappedLike("left", input) || config->isMappedLike("right", input))) {
|
||||||
if (config->isMappedLike("right", input) || config->isMappedTo("select", input)) {
|
// Left or right browses to the next video or image.
|
||||||
|
if (config->isMappedLike("left", input) || config->isMappedLike("right", input)) {
|
||||||
if (input.value != 0) {
|
if (input.value != 0) {
|
||||||
// Handle screensaver control.
|
// Handle screensaver control.
|
||||||
mScreenSaver->nextVideo();
|
mScreenSaver->nextVideo();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (config->isMappedTo("start", input) && input.value != 0) {
|
else if (config->isMappedTo("a", input) && input.value != 0) {
|
||||||
// Launch game.
|
// Launch game.
|
||||||
cancelScreenSaver();
|
cancelScreenSaver();
|
||||||
mScreenSaver->launchGame();
|
mScreenSaver->launchGame();
|
||||||
|
|
Loading…
Reference in a new issue