enabled OK button on GuiCombat screen when choosing defenders/attackers. iOS solution only currently. To implement in Android, we need to create a mask/invisible button above the OK button coordinates and add a listener to activate when a user touches the appropriate area. Not ideal, but it works for now.
TODO: translate functionality into core of engine.
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
|
||||
@synthesize bannerIsVisible;
|
||||
@synthesize eaglView;
|
||||
@synthesize okButtonView;
|
||||
@synthesize inputField;
|
||||
|
||||
#pragma mark initialization / deallocation methods
|
||||
@@ -38,6 +39,7 @@
|
||||
[eaglView setDelegate: nil];
|
||||
[eaglView release], eaglView = nil;
|
||||
[inputField release], inputField = nil;
|
||||
[okButtonView release], okButtonView = nil;
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@@ -86,10 +88,32 @@
|
||||
// e.g. self.myOutlet = nil;
|
||||
}
|
||||
|
||||
#pragma mark - UIView Creation
|
||||
- (void)addOkButtonListener: (CGRect) frame
|
||||
{
|
||||
// create an invisible view to handle the pressing of the OK button.
|
||||
if ( okButtonView == nil )
|
||||
{
|
||||
okButtonView = [[UIButton alloc] initWithFrame: frame];
|
||||
[okButtonView setBackgroundColor: [UIColor clearColor]];
|
||||
[okButtonView setEnabled: YES];
|
||||
[okButtonView addTarget: self.view action:@selector(handleOK:) forControlEvents: UIControlEventTouchUpInside];
|
||||
[self.view addSubview: okButtonView];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self.view bringSubviewToFront: okButtonView];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
- (void)removeOkButtonListener
|
||||
{
|
||||
[[self.view.subviews lastObject] removeFromSuperview];
|
||||
[okButtonView release], okButtonView = nil;
|
||||
}
|
||||
|
||||
#pragma mark device orientation handlers
|
||||
|
||||
#pragma mark - device orientation handlers
|
||||
|
||||
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
|
||||
// Overriden to allow any orientation.
|
||||
|
||||
Reference in New Issue
Block a user