(iOS) You can now remove keyboard or joystick button assignments.

This commit is contained in:
meancoot 2013-03-29 20:06:25 -04:00
parent 2e4846cb43
commit 0c2261aa01
2 changed files with 9 additions and 4 deletions

View File

@ -94,7 +94,7 @@ static const struct
message:_value.label
delegate:self
cancelButtonTitle:@"Cancel"
otherButtonTitles:nil];
otherButtonTitles:@"Clear Keyboard", @"Clear Joystick", nil];
[_alert show];
_btTimer = [NSTimer scheduledTimerWithTimeInterval:.05f target:self selector:@selector(checkInput) userInfo:nil repeats:YES];
@ -109,7 +109,7 @@ static const struct
[_btTimer invalidate];
[_alert dismissWithClickedButtonIndex:0 animated:YES];
[_alert dismissWithClickedButtonIndex:_alert.cancelButtonIndex animated:YES];
[_view reloadData];
_me = nil;
@ -118,6 +118,11 @@ static const struct
- (void)alertView:(UIAlertView*)alertView willDismissWithButtonIndex:(NSInteger)buttonIndex
{
if (buttonIndex == _alert.firstOtherButtonIndex)
_value.msubValues[0] = @"";
else if(buttonIndex == _alert.firstOtherButtonIndex + 1)
_value.msubValues[1] = @"";
[self finish];
}

View File

@ -66,9 +66,9 @@ static const char* const SETTINGID = "SETTING";
break;
case ButtonSetting:
if (setting.msubValues[0] && [setting.msubValues[0] length])
if (setting.msubValues[0])
config_set_string(config, [setting.name UTF8String], [setting.msubValues[0] UTF8String]);
if (setting.msubValues[1] && [setting.msubValues[1] length])
if (setting.msubValues[1])
config_set_string(config, [[setting.name stringByAppendingString:@"_btn"] UTF8String], [setting.msubValues[1] UTF8String]);
break;