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

@@ -147,34 +147,30 @@ MTGCard * CarouselDeckView::Click(int x, int y)
return NULL;
}
bool CarouselDeckView::Button(Buttons button)
void CarouselDeckView::changePosition(int offset)
{
switch(button)
{
case JGE_BTN_LEFT:
mScrollTarget -= 1;
mStage = SCROLL_TO_SELECTED;
last_user_activity = 0;
break;
case JGE_BTN_RIGHT:
if(offset > 0){
mScrollTarget += 1;
mStage = SCROLL_TO_SELECTED;
last_user_activity = 0;
break;
case JGE_BTN_UP:
}else if(offset < 0){
mScrollTarget -= 1;
mStage = SCROLL_TO_SELECTED;
}
last_user_activity = 0;
}
void CarouselDeckView::changeFilter(int offset)
{
if(offset > 0){
mStage = SLIDE_UP;
SwitchFilter(1);
last_user_activity = 0;
break;
case JGE_BTN_DOWN:
} else if(offset < 0){
mStage = SLIDE_DOWN;
SwitchFilter(-1);
last_user_activity = 0;
break;
default:
return false;
}
return true;
last_user_activity = 0;
}
MTGCard *CarouselDeckView::getActiveCard()