Let the deck view base class handle buttons

This commit is contained in:
Tobias Loose
2013-12-05 22:10:33 +01:00
parent 8de50532f2
commit 1194463349
7 changed files with 72 additions and 62 deletions

View File

@@ -42,6 +42,32 @@ void DeckView::Update(float dt)
}
}
bool DeckView::Button(Buttons button)
{
switch(button)
{
case JGE_BTN_LEFT:
changePosition(-1);
last_user_activity = 0;
break;
case JGE_BTN_RIGHT:
changePosition(1);
last_user_activity = 0;
break;
case JGE_BTN_UP:
changeFilter(1);
last_user_activity = 0;
break;
case JGE_BTN_DOWN:
changeFilter(-1);
last_user_activity = 0;
break;
default:
return false;
}
return true;
}
void DeckView::SetDeck(DeckDataWrapper *toShow)
{
mCurrentDeck = toShow;