diff --git a/RetroFE/Source/Graphics/Page.cpp b/RetroFE/Source/Graphics/Page.cpp index ec5dabb..c5ec03d 100644 --- a/RetroFE/Source/Graphics/Page.cpp +++ b/RetroFE/Source/Graphics/Page.cpp @@ -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++) diff --git a/RetroFE/Source/Graphics/Page.h b/RetroFE/Source/Graphics/Page.h index 86282bc..1c1123c 100644 --- a/RetroFE/Source/Graphics/Page.h +++ b/RetroFE/Source/Graphics/Page.h @@ -100,8 +100,6 @@ private: Sound *UnloadSoundChunk; Sound *HighlightSoundChunk; Sound *SelectSoundChunk; - bool HasSoundedWhenActive; - bool FirstSoundPlayed; float MinShowTime; float ElapsedTime;