fixed some click issues found with iOS port.
This commit is contained in:
@@ -150,7 +150,7 @@ bool JGuiController::CheckUserInput(JButton key)
|
||||
}
|
||||
else
|
||||
{ // a dude may have clicked somewhere, we're gonna select the closest object from where he clicked
|
||||
int x, y;
|
||||
int x = -1, y = -1;
|
||||
unsigned int distance2;
|
||||
unsigned int minDistance2 = -1;
|
||||
int n = mCurr;
|
||||
@@ -175,6 +175,11 @@ bool JGuiController::CheckUserInput(JButton key)
|
||||
mCurr = n;
|
||||
mObjects[mCurr]->Entering();
|
||||
}
|
||||
// if the same object was selected process click
|
||||
else if (n == mCurr && mObjects[mCurr] != NULL && mObjects[mCurr]->Leaving(JGE_BTN_OK))
|
||||
{
|
||||
mObjects[mCurr]->Entering();
|
||||
}
|
||||
mEngine->LeftClickedProcessed();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -405,6 +405,7 @@ static NSString *_MY_AD_WHIRL_APPLICATION_KEY_IPAD = @"2e70e3f3da40408588b9a3170
|
||||
// we want to differentiate between a pan motion vs a flick gesture.
|
||||
if (!(( ((int)abs( (int) velocity.x)) > 300) || ((int) (abs( (int) velocity.y)) > 300)))
|
||||
{
|
||||
g_engine->LeftClicked(newLocation.x, newLocation.y);
|
||||
g_engine->HoldKey_NoRepeat( JGE_BTN_OK );
|
||||
}
|
||||
else
|
||||
@@ -433,7 +434,6 @@ static NSString *_MY_AD_WHIRL_APPLICATION_KEY_IPAD = @"2e70e3f3da40408588b9a3170
|
||||
int actualWidth = (int) JRenderer::GetInstance()->GetActualWidth();
|
||||
|
||||
CGPoint newCoordinates = [self normalizeClickCoordinatesWithPoint: currentLocation];
|
||||
|
||||
g_engine->LeftClicked( newCoordinates.x, newCoordinates.y);
|
||||
g_engine->HoldKey_NoRepeat(JGE_BTN_NONE);
|
||||
|
||||
@@ -444,7 +444,8 @@ static NSString *_MY_AD_WHIRL_APPLICATION_KEY_IPAD = @"2e70e3f3da40408588b9a3170
|
||||
if (clickedWithinGameArea)
|
||||
{
|
||||
// we want some delay for the left click to take place before clicking on OK.
|
||||
[self performSelector: @selector(handleOK:) withObject: nil afterDelay: 0.25];
|
||||
g_engine->LeftClicked( newCoordinates.x, newCoordinates.y);
|
||||
[self performSelector: @selector(handleOK:) withObject: recognizer afterDelay: 0.25];
|
||||
}
|
||||
|
||||
else if(currentLocation.y < es2renderer.viewPort.top) {
|
||||
|
||||
Reference in New Issue
Block a user