diff --git a/Classes/iNethackAppDelegate.m b/Classes/iNethackAppDelegate.m index 68cf7ca2..d22c4f68 100644 --- a/Classes/iNethackAppDelegate.m +++ b/Classes/iNethackAppDelegate.m @@ -39,6 +39,10 @@ - (void)applicationDidFinishLaunching:(UIApplication *)application { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; BOOL startAsBlind = [defaults boolForKey:@"blind"]; BOOL startAsNudist = [defaults boolForKey:@"nudist"]; + NSString *petType = [defaults stringForKey:@"pettype"]; + NSString *dogName = [defaults stringForKey:@"dogname"]; + NSString *catName = [defaults stringForKey:@"catname"]; + NSString *horseName = [defaults stringForKey:@"horsename"]; NSMutableArray *activeOptions = [NSMutableArray array]; if (startAsBlind) { @@ -47,6 +51,22 @@ - (void)applicationDidFinishLaunching:(UIApplication *)application { if (startAsNudist) { [activeOptions addObject:@"nudist"]; } + if (petType && [petType length] > 0 && ![petType isEqualToString:@"random"]) { + NSString *petOption = [NSString stringWithFormat:@"pettype:%@", petType]; + [activeOptions addObject:petOption]; + } + if (dogName && [dogName length] > 0) { + NSString *dogOption = [NSString stringWithFormat:@"dogname:%@", dogName]; + [activeOptions addObject:dogOption]; + } + if (catName && [catName length] > 0) { + NSString *catOption = [NSString stringWithFormat:@"catname:%@", catName]; + [activeOptions addObject:catOption]; + } + if (horseName && [horseName length] > 0) { + NSString *horseOption = [NSString stringWithFormat:@"horsename:%@", horseName]; + [activeOptions addObject:horseOption]; + } if ([activeOptions count] > 0) { NSString *optionsString = [activeOptions componentsJoinedByString:@","]; setenv("NETHACKOPTIONS", [optionsString UTF8String], 1); diff --git a/Settings.bundle/Root.plist b/Settings.bundle/Root.plist index bf0abbb7..3a651f0e 100644 --- a/Settings.bundle/Root.plist +++ b/Settings.bundle/Root.plist @@ -180,6 +180,60 @@ asciimono + + DefaultValue + random + Type + PSMultiValueSpecifier + Title + Pet Type + Key + pettype + Titles + + Random + Cat + Dog + None + + Values + + random + cat + dog + none + + + + Type + PSTextFieldSpecifier + Title + Cat Name + Key + catname + DefaultValue + + + + Type + PSTextFieldSpecifier + Title + Dog Name + Key + dogname + DefaultValue + + + + Type + PSTextFieldSpecifier + Title + Horse Name + Key + horsename + DefaultValue + + Type PSTextFieldSpecifier