mirror of
https://github.com/FunKey-Project/RetroFE.git
synced 2025-12-28 09:38:52 +01:00
Reset playlist attract mode timer when attract mode is first entered.
This commit is contained in:
parent
2f5bfed9e9
commit
fdd1a10d6e
@ -29,13 +29,13 @@ AttractMode::AttractMode()
|
||||
{
|
||||
}
|
||||
|
||||
void AttractMode::reset( bool set, bool resetElapsedPlaylistTime )
|
||||
void AttractMode::reset( bool set )
|
||||
{
|
||||
elapsedTime_ = 0;
|
||||
isActive_ = false;
|
||||
isSet_ = set;
|
||||
activeTime_ = 0;
|
||||
if (resetElapsedPlaylistTime)
|
||||
if (!set)
|
||||
elapsedPlaylistTime_ = 0;
|
||||
}
|
||||
|
||||
@ -47,12 +47,17 @@ bool AttractMode::update(float dt, Page &page)
|
||||
|
||||
// Check if it's time to switch playlists
|
||||
if (!isActive_ && elapsedPlaylistTime_ > idlePlaylistTime && idlePlaylistTime > 0)
|
||||
{
|
||||
elapsedPlaylistTime_ = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// enable attract mode when idling for the expected time. Disable if idle time is set to 0.
|
||||
if(!isActive_ && ((elapsedTime_ > idleTime && idleTime > 0) || (isSet_ && elapsedTime_ > idleNextTime && idleNextTime > 0)))
|
||||
{
|
||||
if (!isSet_)
|
||||
elapsedPlaylistTime_ = 0; // Reset playlist timer if we are entering attract mode
|
||||
isActive_ = true;
|
||||
isSet_ = true;
|
||||
elapsedTime_ = 0;
|
||||
|
||||
@ -21,7 +21,7 @@ class AttractMode
|
||||
{
|
||||
public:
|
||||
AttractMode();
|
||||
void reset( bool set = false, bool resetElapsedPlaylistTime = true );
|
||||
void reset( bool set = false );
|
||||
bool update(float dt, Page &page);
|
||||
float idleTime;
|
||||
float idleNextTime;
|
||||
|
||||
@ -893,7 +893,7 @@ void RetroFE::run( )
|
||||
{
|
||||
if (attract_.update( deltaTime, *currentPage_ ))
|
||||
{
|
||||
attract_.reset( attract_.isSet( ), true );
|
||||
attract_.reset( attract_.isSet( ) );
|
||||
currentPage_->nextPlaylist( );
|
||||
std::string attractModeSkipPlaylist = "";
|
||||
config_.getProperty( "attractModeSkipPlaylist", attractModeSkipPlaylist );
|
||||
@ -1153,7 +1153,7 @@ RetroFE::RETROFE_STATE RetroFE::processUserInput( Page *page )
|
||||
page->resetScrollPeriod( );
|
||||
if (page->isMenuScrolling( ))
|
||||
{
|
||||
attract_.reset( attract_.isSet( ), false );
|
||||
attract_.reset( attract_.isSet( ) );
|
||||
state = RETROFE_HIGHLIGHT_REQUEST;
|
||||
}
|
||||
}
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
|
||||
std::string retrofe_version_major = "0";
|
||||
std::string retrofe_version_minor = "8";
|
||||
std::string retrofe_version_build = "29";
|
||||
std::string retrofe_version_build = "31";
|
||||
|
||||
|
||||
std::string Version::getString( )
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user