--(void) load {
- id jsaction = [joystickController selectedAction];
- currentJsaction = jsaction;
- if(!jsaction) {
- [self setEnabled: NO];
- [title setStringValue: @""];
- return;
- } else {
- [self setEnabled: YES];
- }
- Target* target = [[configsController currentConfig] getTargetForAction: jsaction];
-
- id act = jsaction;
- NSString* actFullName = [act name];
- while([act base]) {
- act = [act base];
- actFullName = [[NSString alloc] initWithFormat: @"%@ > %@", [act name], actFullName];
- }
- [title setStringValue: [[NSString alloc] initWithFormat: @"%@ > %@", [[configsController currentConfig] name], actFullName]];
-
- if(!target) {
- // already reset
- } else if([target isKindOfClass: [TargetKeyboard class]]) {
- [radioButtons setState:1 atRow: 1 column: 0];
- [keyInput setVk: [(TargetKeyboard*)target vk]];
- } else if([target isKindOfClass: [TargetConfig class]]) {
- [radioButtons setState:1 atRow: 2 column: 0];
- [configPopup selectItemAtIndex: [[configsController configs] indexOfObject: [(TargetConfig*)target config]]];
+- (void)load {
+ JSAction *act = joystickController.selectedAction;
+ if (!act) {
+ self.enabled = NO;
+ title.stringValue = @"";
+ return;
+ } else {
+ self.enabled = YES;
+ }
+
+ Target *target = [self currentTarget];
+ NSString *actFullName = act.name;
+ for (JSAction *cur = act.base; cur; cur = cur.base) {
+ actFullName = [[NSString alloc] initWithFormat:@"%@ > %@", cur.name, actFullName];
+ }
+ title.stringValue = [[NSString alloc] initWithFormat:@"%@ > %@", configsController.currentConfig.name, actFullName];
+
+ if ([target isKindOfClass:[TargetKeyboard class]]) {
+ [radioButtons setState:1 atRow:1 column:0];
+ keyInput.vk = [(TargetKeyboard*)target vk];
+ } else if ([target isKindOfClass:[TargetConfig class]]) {
+ [radioButtons setState:1 atRow:2 column:0];
+ [configPopup selectItemAtIndex:[configsController.configs
+ indexOfObject:[(TargetConfig *)target config]]];