X-Git-Url: https://git.yukkurigames.com/?p=enjoyable.git;a=blobdiff_plain;f=Classes%2FNJInputButton.m;h=caa759b6844888358eda0a95c718fe58f0073d13;hp=0c3b0ce32de0105413d0d1c4e68c86be853e62b7;hb=79b05c3cf1c75bc4f7078acde43aaf4215c6408a;hpb=0064c1fbff36795885a9724081af2a17d83c20a3 diff --git a/Classes/NJInputButton.m b/Classes/NJInputButton.m index 0c3b0ce..caa759b 100644 --- a/Classes/NJInputButton.m +++ b/Classes/NJInputButton.m @@ -12,12 +12,12 @@ } - (id)initWithName:(NSString *)name idx:(int)idx max:(long)max { - if ((self = [super init])) { + NSString *fullname = [NSString stringWithFormat:NSLocalizedString(@"button %d", @"button name"), idx]; + if (name.length) + fullname = [fullname stringByAppendingFormat:@"- %@", name]; + NSString *did = [[NSString alloc] initWithFormat:@"Button %d", idx]; + if ((self = [super initWithName:fullname did:did base:nil])) { _max = max; - if (name.length) - self.name = [NSString stringWithFormat:@"Button %d - %@", idx, name]; - else - self.name = [NSString stringWithFormat:@"Button %d", idx]; } return self; }