X-Git-Url: https://git.yukkurigames.com/?p=enjoyable.git;a=blobdiff_plain;f=TargetController.m;h=2e539179dbe3ac5149f9955984959017967dc941;hp=48119c20e45e28dea3b812590fdeb1b2d37c5bdb;hb=f864d363128de19fc6591b77ae9226b34166d715;hpb=f563321aec9e13b8479ab3b890a9179f095a8b17 diff --git a/TargetController.m b/TargetController.m index 48119c2..2e53917 100644 --- a/TargetController.m +++ b/TargetController.m @@ -9,8 +9,8 @@ #import "ConfigsController.h" #import "Config.h" -#import "JSAction.h" -#import "JoystickController.h" +#import "NJInput.h" +#import "NJInputController.h" #import "NJKeyInputField.h" #import "TargetConfig.h" #import "TargetController.h" @@ -98,7 +98,7 @@ } - (Target *)currentTarget { - return configsController.currentConfig[joystickController.selectedAction]; + return configsController.currentConfig[joystickController.selectedInput]; } - (Target *)makeTarget { @@ -145,7 +145,7 @@ - (void)commit { [self cleanUpInterface]; - configsController.currentConfig[joystickController.selectedAction] = [self makeTarget]; + configsController.currentConfig[joystickController.selectedInput] = [self makeTarget]; [configsController save]; } @@ -162,17 +162,17 @@ [scrollDirSelect setEnabled:enabled]; } -- (void)loadTarget:(Target *)target forAction:(JSAction *)action { - if (!action) { +- (void)loadTarget:(Target *)target forInput:(NJInput *)input { + if (!input) { self.enabled = NO; title.stringValue = @""; } else { self.enabled = YES; - NSString *actFullName = action.name; - for (id cur = action.base; cur; cur = cur.base) { - actFullName = [[NSString alloc] initWithFormat:@"%@ > %@", cur.name, actFullName]; + NSString *inpFullName = input.name; + for (id cur = input.base; cur; cur = cur.base) { + inpFullName = [[NSString alloc] initWithFormat:@"%@ > %@", cur.name, inpFullName]; } - title.stringValue = [[NSString alloc] initWithFormat:@"%@ > %@", configsController.currentConfig.name, actFullName]; + title.stringValue = [[NSString alloc] initWithFormat:@"%@ > %@", configsController.currentConfig.name, inpFullName]; } if ([target isKindOfClass:TargetKeyboard.class]) { @@ -209,7 +209,7 @@ } - (void)loadCurrent { - [self loadTarget:self.currentTarget forAction:joystickController.selectedAction]; + [self loadTarget:self.currentTarget forInput:joystickController.selectedInput]; } - (void)focusKey {