fixed a memory leaks in app delegate
* adjusted the touch sensitivity of the iOS port for deck menu selection. Decks were being selected even though the selection was touched. It was highlighted but as soon as you let go it would instantly select (OK button) select the selected deck. This isn't a problem on Android as the SDL already handles this as far as I can tell. I limited this to only iOS so I don't accidentally mess up the other ports.
This commit is contained in:
@@ -115,6 +115,8 @@
|
||||
NSString *resPath = [NSString stringWithFormat: @"%@/Res", docsPath];
|
||||
NSError *error = nil;
|
||||
|
||||
[compoundPredicate release], compoundPredicate = nil;
|
||||
|
||||
if ( ([resourceZipFiles count] > 0 ) && ![fileManager fileExistsAtPath: userPath] )
|
||||
[fileManager createDirectoryAtPath: userPath withIntermediateDirectories: YES attributes:nil error:nil ];
|
||||
|
||||
@@ -206,6 +208,8 @@
|
||||
[fm moveItemAtPath: fromPath toPath: toPath error: nil];
|
||||
}
|
||||
|
||||
[playerDataPredicate release], playerDataPredicate = nil;
|
||||
|
||||
[self createManifest: docsPath];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName: @"readyToStartGame" object: nil];
|
||||
@@ -243,6 +247,8 @@
|
||||
|
||||
- (void) setupNetworkListeners
|
||||
{
|
||||
NSLog(@"App checking network connections");
|
||||
|
||||
hostReach = [[Reachability reachabilityForGoogleDNS] retain];
|
||||
internetReach = [[Reachability reachabilityForInternetConnection] retain];
|
||||
wifiReach = [[Reachability reachabilityForLocalWiFi] retain];
|
||||
|
||||
@@ -14,13 +14,16 @@ private:
|
||||
bool mHasFocus;
|
||||
bool mScrollEnabled;
|
||||
bool mDisplayInitialized;
|
||||
|
||||
bool mIsValidSelection;
|
||||
|
||||
DeckMenu* parent;
|
||||
int fontId;
|
||||
string mText;
|
||||
float mTitleResetWidth;
|
||||
static float mYOffset;
|
||||
|
||||
void checkUserClick();
|
||||
|
||||
public:
|
||||
string imageFilename;
|
||||
string desc;
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
#include <algorithm>
|
||||
|
||||
#define ITEM_PX_WIDTH 190.0f
|
||||
#define kItemXOffset 22
|
||||
#define kItemYHeight 20
|
||||
|
||||
const int kHorizontalScrollSpeed = 30; // higher numbers mean faster scrolling
|
||||
|
||||
@@ -17,6 +19,8 @@ DeckMenuItem::DeckMenuItem(DeckMenu* _parent, int id, int fontId, string text, f
|
||||
WFont * mFont = WResourceManager::Instance()->GetWFont(fontId);
|
||||
meta = deckMetaData;
|
||||
mText = trim(text);
|
||||
mIsValidSelection = false;
|
||||
|
||||
if (autoTranslate)
|
||||
mText = _(mText);
|
||||
|
||||
@@ -113,25 +117,46 @@ void DeckMenuItem::Render()
|
||||
RenderWithOffset(0);
|
||||
}
|
||||
|
||||
void DeckMenuItem::checkUserClick()
|
||||
{
|
||||
#ifdef IOS
|
||||
int x1 = 0, y1 = 0;
|
||||
if ( mEngine->GetLeftClickCoordinates(x1, y1))
|
||||
{
|
||||
mIsValidSelection = false;
|
||||
int x2 = kItemXOffset, y2 = static_cast<int>(mY + mYOffset);
|
||||
if ( (x1 >= x2) && (x1 <= (x2 + ITEM_PX_WIDTH)) && (y1 >= y2) && (y1 < (y2 + kItemYHeight)))
|
||||
mIsValidSelection = true;
|
||||
}
|
||||
else
|
||||
mIsValidSelection = true;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void DeckMenuItem::Entering()
|
||||
{
|
||||
checkUserClick();
|
||||
mHasFocus = true;
|
||||
parent->mSelectionTargetY = mY;
|
||||
}
|
||||
|
||||
bool DeckMenuItem::Leaving(JButton key)
|
||||
{
|
||||
// check to see if the user clicked on the object, if so return true.
|
||||
checkUserClick();
|
||||
mHasFocus = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool DeckMenuItem::ButtonPressed()
|
||||
{
|
||||
return true;
|
||||
return mIsValidSelection;
|
||||
}
|
||||
|
||||
void DeckMenuItem::Relocate(float x, float y)
|
||||
{
|
||||
checkUserClick();
|
||||
mX = x;
|
||||
mY = y;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user