X-Git-Url: https://git.yukkurigames.com/?p=enjoyable.git;a=blobdiff_plain;f=Classes%2FNJInputHat.m;h=46ea94f2a61eab7715ad342261d11913b4745899;hp=e0e127fec646b6d4b15e51b144cede49ede7c0b2;hb=79b05c3cf1c75bc4f7078acde43aaf4215c6408a;hpb=0064c1fbff36795885a9724081af2a17d83c20a3 diff --git a/Classes/NJInputHat.m b/Classes/NJInputHat.m index e0e127f..46ea94f 100644 --- a/Classes/NJInputHat.m +++ b/Classes/NJInputHat.m @@ -30,12 +30,21 @@ static BOOL active_fourway[20] = { @implementation NJInputHat - (id)initWithIndex:(int)index { - if ((self = [super init])) { - self.children = @[[[NJInput alloc] initWithName:@"Up" base:self], - [[NJInput alloc] initWithName:@"Down" base:self], - [[NJInput alloc] initWithName:@"Left" base:self], - [[NJInput alloc] initWithName:@"Right" base:self]]; - self.name = [NSString stringWithFormat:@"Hat Switch %d", index]; + NSString *name = [NSString stringWithFormat:NSLocalizedString(@"hat switch %d", @"hat switch name"), index]; + NSString *did = [NSString stringWithFormat:@"Hat Switch %d", index]; + if ((self = [super initWithName:name did:did base:nil])) { + self.children = @[[[NJInput alloc] initWithName:NSLocalizedString(@"hat up", @"hat switch up state") + did:@"Up" + base:self], + [[NJInput alloc] initWithName:NSLocalizedString(@"hat down", @"hat switch down state") + did:@"Down" + base:self], + [[NJInput alloc] initWithName:NSLocalizedString(@"hat left", @"hat switch left state") + did:@"Left" + base:self], + [[NJInput alloc] initWithName:NSLocalizedString(@"hat right", @"hat switch right state") + did:@"Right" + base:self]]; } return self; }