Fixed trophy card selection and scrolling with mouse and touch.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user