mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-25 23:55:38 +00:00
Fixed game list continuing to scroll after you open a menu or start a game.
This commit is contained in:
parent
03995a66bb
commit
c2b970f2cf
|
@ -1,3 +1,6 @@
|
|||
October 14
|
||||
-Fixed game list continuing to scroll when a menu is opened or a game is started.
|
||||
|
||||
October 13
|
||||
-Added sound support through SDL_mixer.
|
||||
-Added new theme tags for defining menu sounds. See THEMES.md for details.
|
||||
|
|
|
@ -123,6 +123,8 @@ void GuiGameList::onInput(InputManager::InputButton button, bool keyDown)
|
|||
mFolder = (FolderData*)file;
|
||||
updateList();
|
||||
}else{
|
||||
mList->stopScrolling();
|
||||
|
||||
//wait for the sound to finish or we'll never hear it...
|
||||
while(mTheme->getMenuSelectSound()->isPlaying());
|
||||
|
||||
|
@ -248,6 +250,7 @@ void GuiGameList::updateDetailData()
|
|||
//these are called when the menu opens/closes
|
||||
void GuiGameList::onPause()
|
||||
{
|
||||
mList->stopScrolling();
|
||||
mTheme->getMenuOpenSound()->play();
|
||||
InputManager::unregisterComponent(this);
|
||||
}
|
||||
|
|
|
@ -103,14 +103,20 @@ void GuiList<listType>::onInput(InputManager::InputButton button, bool keyDown)
|
|||
}else{
|
||||
if((button == InputManager::DOWN && mScrollDir > 0) || (button == InputManager::UP && mScrollDir < 0))
|
||||
{
|
||||
mScrollAccumulator = 0;
|
||||
mScrolling = false;
|
||||
mScrollDir = 0;
|
||||
stopScrolling();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template <typename listType>
|
||||
void GuiList<listType>::stopScrolling()
|
||||
{
|
||||
mScrollAccumulator = 0;
|
||||
mScrolling = false;
|
||||
mScrollDir = 0;
|
||||
}
|
||||
|
||||
template <typename listType>
|
||||
void GuiList<listType>::onTick(int deltaTime)
|
||||
{
|
||||
|
|
|
@ -30,6 +30,7 @@ public:
|
|||
std::string getSelectedName();
|
||||
listType getSelectedObject();
|
||||
int getSelection();
|
||||
void stopScrolling();
|
||||
bool isScrolling();
|
||||
|
||||
void setSelectorColor(int selectorColor);
|
||||
|
|
Loading…
Reference in a new issue