X-Git-Url: https://git.yukkurigames.com/?p=enjoyable.git;a=blobdiff_plain;f=JSActionHat.m;h=174d2df484b406eaa19ee9dd99ef54f2e856673c;hp=6ed0ad13443b3c19737d6c6367f646c341c7b63d;hb=2fb801b58b29997f54443d9879d2e20ae8b169ad;hpb=cc2c6ed12ca38c56a4263d95af75692d6cf716a5 diff --git a/JSActionHat.m b/JSActionHat.m index 6ed0ad1..174d2df 100644 --- a/JSActionHat.m +++ b/JSActionHat.m @@ -29,14 +29,13 @@ static BOOL active_fourway[20] = { @implementation JSActionHat -- (id)init { +- (id)initWithIndex:(int)index { if ((self = [super init])) { - self.children = @[[[JSAction alloc] initWithName:@"Up" base: self], - [[JSAction alloc] initWithName:@"Down" base: self], - [[JSAction alloc] initWithName:@"Left" base: self], - [[JSAction alloc] initWithName:@"Right" base: self]]; - // TODO(jfw): Should have an indexed name, like everything else. - self.name = @"Hat switch"; + self.children = @[[[JSAction alloc] initWithName:@"Up" base:self], + [[JSAction alloc] initWithName:@"Down" base:self], + [[JSAction alloc] initWithName:@"Left" base:self], + [[JSAction alloc] initWithName:@"Right" base:self]]; + self.name = [NSString stringWithFormat:@"Hat Switch %d", index]; } return self; }