From 7bb49068b16a7db774539791241b49aaf4228b17 Mon Sep 17 00:00:00 2001 From: Xawotihs Date: Sun, 26 Jun 2011 20:51:45 +0000 Subject: [PATCH] Use Will's scrolling support to add next phase (scroll up) and interrupt (scroll down) in the duel state. --- projects/mtg/include/GameStateDuel.h | 2 ++ projects/mtg/src/GameStateDuel.cpp | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/projects/mtg/include/GameStateDuel.h b/projects/mtg/include/GameStateDuel.h index e712151b1..e30ca1ff3 100644 --- a/projects/mtg/include/GameStateDuel.h +++ b/projects/mtg/include/GameStateDuel.h @@ -59,6 +59,8 @@ public: virtual void Render(); void initRand(unsigned seed = 0); + void OnScroll(int inXVelocity, int inYVelocity); + enum ENUM_DUEL_STATE_MENU_ITEM { MENUITEM_CANCEL = kCancelMenuID, diff --git a/projects/mtg/src/GameStateDuel.cpp b/projects/mtg/src/GameStateDuel.cpp index 5591404c9..ad919abff 100644 --- a/projects/mtg/src/GameStateDuel.cpp +++ b/projects/mtg/src/GameStateDuel.cpp @@ -855,3 +855,13 @@ void GameStateDuel::ButtonPressed(int controllerId, int controlId) } } + +void GameStateDuel::OnScroll(int inXVelocity, int inYVelocity) +{ + if (abs(inYVelocity) > 300) + { + bool flickUpwards = (inYVelocity < 0); + mEngine->HoldKey_NoRepeat(flickUpwards ? JGE_BTN_PREV : JGE_BTN_SEC); + } +} +