mirror of
https://github.com/FunKey-Project/RetroFE.git
synced 2025-12-12 17:58:53 +01:00
Having "highlight" sound effect play as soon as you press the button instead of when the item is highlighed.
This commit is contained in:
parent
e07b00f707
commit
692c098bf0
@ -38,8 +38,6 @@ Page::Page(Configuration &config)
|
||||
, UnloadSoundChunk(NULL)
|
||||
, HighlightSoundChunk(NULL)
|
||||
, SelectSoundChunk(NULL)
|
||||
, HasSoundedWhenActive(false)
|
||||
, FirstSoundPlayed(false)
|
||||
, MinShowTime(0)
|
||||
{
|
||||
}
|
||||
@ -324,6 +322,7 @@ void Page::Highlight()
|
||||
void Page::SetScrolling(ScrollDirection direction)
|
||||
{
|
||||
ScrollingList::ScrollDirection menuDirection;
|
||||
bool prevScrollActive = ScrollActive;
|
||||
|
||||
switch(direction)
|
||||
{
|
||||
@ -342,6 +341,12 @@ void Page::SetScrolling(ScrollDirection direction)
|
||||
break;
|
||||
}
|
||||
|
||||
if(!prevScrollActive && ScrollActive && HighlightSoundChunk)
|
||||
{
|
||||
HighlightSoundChunk->Play();
|
||||
}
|
||||
|
||||
|
||||
ActiveMenu->SetScrollDirection(menuDirection);
|
||||
}
|
||||
|
||||
@ -486,22 +491,10 @@ void Page::Update(float dt)
|
||||
menu->Update(dt);
|
||||
}
|
||||
|
||||
if(SelectedItemChanged && !HasSoundedWhenActive && HighlightSoundChunk)
|
||||
{
|
||||
// skip the first sound being played (as it is part of the on-enter)
|
||||
if(FirstSoundPlayed)
|
||||
{
|
||||
HighlightSoundChunk->Play();
|
||||
HasSoundedWhenActive = true;
|
||||
}
|
||||
FirstSoundPlayed = true;
|
||||
}
|
||||
|
||||
if(SelectedItemChanged && !ScrollActive)
|
||||
{
|
||||
Highlight();
|
||||
SelectedItemChanged = false;
|
||||
HasSoundedWhenActive = false;
|
||||
}
|
||||
|
||||
if(TextStatusComponent)
|
||||
@ -572,7 +565,6 @@ void Page::FreeGraphicsMemory()
|
||||
|
||||
void Page::AllocateGraphicsMemory()
|
||||
{
|
||||
FirstSoundPlayed = false;
|
||||
Logger::Write(Logger::ZONE_DEBUG, "Page", "Allocating graphics memory");
|
||||
|
||||
for(MenuVector_T::iterator it = Menus.begin(); it != Menus.end(); it++)
|
||||
|
||||
@ -100,8 +100,6 @@ private:
|
||||
Sound *UnloadSoundChunk;
|
||||
Sound *HighlightSoundChunk;
|
||||
Sound *SelectSoundChunk;
|
||||
bool HasSoundedWhenActive;
|
||||
bool FirstSoundPlayed;
|
||||
float MinShowTime;
|
||||
float ElapsedTime;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user