X-Git-Url: https://git.yukkurigames.com/?p=enjoyable.git;a=blobdiff_plain;f=Target.m;h=052f01a852e407d132cbfd59963ed27064846d4c;hp=35ebfc2dfef16c8bb0189c518987657c6a045c15;hb=323ddd0bcbc6b80f9f708fb71f3043eab378a840;hpb=530009447c5bbd360ac5023979cffc6d32a28df3 diff --git a/Target.m b/Target.m index 35ebfc2..052f01a 100644 --- a/Target.m +++ b/Target.m @@ -10,7 +10,7 @@ +(Target*) unstringify: (NSString*) str withConfigList: (NSArray*) configs { NSArray* components = [str componentsSeparatedByString:@"~"]; NSParameterAssert([components count]); - NSString* typeTag = [components objectAtIndex:0]; + NSString* typeTag = components[0]; if([typeTag isEqualToString:@"key"]) return [TargetKeyboard unstringifyImpl:components]; if([typeTag isEqualToString:@"cfg"]) @@ -19,6 +19,10 @@ return [TargetMouseMove unstringifyImpl:components]; if([typeTag isEqualToString:@"mbtn"]) return [TargetMouseBtn unstringifyImpl:components]; + if([typeTag isEqualToString:@"mscroll"]) + return [TargetMouseScroll unstringifyImpl:components]; + if([typeTag isEqualToString:@"mtoggle"]) + return [TargetToggleMouseScope unstringifyImpl:components]; NSParameterAssert(NO); return NULL; @@ -29,27 +33,22 @@ return NULL; } --(void) trigger { +-(void) trigger: (JoystickController *)jc { [self doesNotRecognizeSelector:_cmd]; } --(void) untrigger { +-(void) untrigger: (JoystickController *)jc { // no-op by default } --(BOOL) running { - return running; +-(void) update: (JoystickController *) jc { + [self doesNotRecognizeSelector:_cmd]; } --(void) setRunning: (BOOL) newRunning { - if(newRunning == running) - return; - if(newRunning) - [self trigger]; - else - [self untrigger]; - running = newRunning; + +-(BOOL) isContinuous { + return false; } -@synthesize inputValue; +@synthesize inputValue, running; @end