Fixed trophy card selection and scrolling with mouse and touch.

This commit is contained in:
Xawotihs
2011-09-06 21:08:25 +00:00
parent 98709e661e
commit c3d2b60a67
4 changed files with 61 additions and 4 deletions

View File

@@ -177,7 +177,7 @@ void GameStateAwards::Update(float dt)
{
JButton key = JGE_BTN_NONE;
int x, y;
while ((key = JGE::GetInstance()->ReadButton()) || JGE::GetInstance()->GetLeftClickCoordinates(x,y))
while ((key = JGE::GetInstance()->ReadButton()))
{
switch (key)
{
@@ -388,3 +388,17 @@ void GameStateAwards::ButtonPressed(int controllerId, int controlId)
}
}
}
void GameStateAwards::OnScroll(int inXVelocity, int inYVelocity)
{
if (abs(inYVelocity) > 300)
{
bool flickUpwards = (inYVelocity < 0);
int velocity = (inYVelocity < 0) ? (-1 * inYVelocity) : inYVelocity;
while(velocity > 0)
{
mEngine->HoldKey_NoRepeat(flickUpwards ? JGE_BTN_DOWN : JGE_BTN_UP);
velocity -= 100;
}
}
}