Implemented directional controls on Filters so that you can now navigate the Filters menu on Touch interfaces for the Deck Editor and Shop screens. It's not the best implementation but it at least works across all platforms. swipe will now move the highlighted cursor to the correct direction.

in release builds, test suite will now be disabled
This commit is contained in:
techdragon.nguyen@gmail.com
2012-01-03 17:53:51 +00:00
parent 51d1873872
commit b03449cbf6
4 changed files with 38 additions and 8 deletions

View File

@@ -411,6 +411,7 @@ static NSString *_MY_AD_WHIRL_APPLICATION_KEY_IPAD = @"2e70e3f3da40408588b9a3170
{
CGPoint v2 = [panGesture velocityInView: self];
g_engine->Scroll( static_cast<int>(v2.x), static_cast<int>(v2.y));
[self performSelector: @selector(resetInput) withObject: nil afterDelay: 0.1];
}
}
}

View File

@@ -1690,13 +1690,22 @@ void GameStateDeckViewer::ButtonPressed(int controllerId, int controlId)
void GameStateDeckViewer::OnScroll(int inXVelocity, int inYVelocity)
{
if (abs(inYVelocity) > 300)
{
bool flickUpwards = (inYVelocity < 0);
mEngine->HoldKey_NoRepeat(flickUpwards ? JGE_BTN_DOWN : JGE_BTN_UP);
bool flickHorizontal = (abs(inXVelocity) > abs(inYVelocity));
bool flickUp = inYVelocity < 0 ? true : false;
bool flickRight = inXVelocity > 0 ? true : false;
} else if (abs(inXVelocity) > 300)
if (mStage == STAGE_FILTERS)
{
mEngine->HoldKey_NoRepeat(JGE_BTN_PRI);
if (flickHorizontal)
mEngine->HoldKey_NoRepeat( flickRight ? JGE_BTN_RIGHT : JGE_BTN_LEFT);
else
mEngine->HoldKey_NoRepeat(flickUp ? JGE_BTN_UP : JGE_BTN_DOWN);
}
else
{
if (flickHorizontal && (abs(inXVelocity) > 300))
mEngine->HoldKey_NoRepeat(JGE_BTN_PRI);
else if (!flickHorizontal && (abs(inYVelocity) > 300))
mEngine->HoldKey_NoRepeat(flickUp ? JGE_BTN_UP : JGE_BTN_DOWN);
}
}

View File

@@ -810,7 +810,28 @@ void GameStateShop::ButtonPressed(int controllerId, int controlId)
void GameStateShop::OnScroll(int inXVelocity, int inYVelocity)
{
if (abs(inXVelocity) > 200)
if (mStage == STAGE_ASK_ABOUT)
{
bool flickHorizontal = (abs(inXVelocity) > abs(inYVelocity));
if (flickHorizontal)
{
bool flickRight = inXVelocity > 0 ? true : false;
if (flickRight)
mEngine->HoldKey_NoRepeat(JGE_BTN_RIGHT);
else
mEngine->HoldKey_NoRepeat(JGE_BTN_LEFT);
}
else
{
bool flickUp = inYVelocity < 0 ? true : false;
if (flickUp)
mEngine->HoldKey_NoRepeat(JGE_BTN_UP);
else
mEngine->HoldKey_NoRepeat(JGE_BTN_DOWN);
}
}
else if (abs(inXVelocity) > 200)
{
bool flickRight = (inXVelocity >= 0);
if (flickRight)

View File

@@ -2568,7 +2568,6 @@
GCC_PREPROCESSOR_DEFINITIONS = (
FT2_BUILD_LIBRARY,
IOS,
TESTSUITE,
);
"GCC_THUMB_SUPPORT[arch=armv6]" = "";
GCC_VERSION = com.apple.compilers.llvmgcc42;