Add script config to normal InputSource.

Move script execution into SourceLayout
This commit is contained in:
Zakk 2017-07-02 20:33:14 -04:00
parent d9dee6611e
commit e73e87df0c
8 changed files with 366 additions and 136 deletions

View file

@ -19,6 +19,7 @@
@synthesize inputSource = _inputSource;
-(instancetype) init
{
if (self = [super init])
@ -53,6 +54,10 @@
self.compositionFilterNames = [CIFilter filterNamesInCategory:kCICategoryCompositeOperation];
self.scriptTypes = @[@"After Add", @"Before Delete", @"FrameTick", @"Before Merge", @"After Merge", @"Before Remove", @"Before Replace", @"After Replace"];
self.scriptKeys = @[@"selection.script_afterAdd", @"selection.script_beforeDelete", @"selection.script_frameTick", @"selection.script_beforeMerge", @"selection.script_afterMerge", @"selection.script_beforeRemove", @"selection.script_beforeReplace", @"selection.script_afterReplace"];
}
@ -94,6 +99,12 @@
}
}
- (IBAction)scriptSaveAll:(id)sender
{
[self.inputobjctrl commitEditing];
}
- (IBAction)configureFilter:(NSSegmentedControl *)sender
{
@ -384,6 +395,7 @@
}
-(void)tableViewSelectionDidChange:(NSNotification *)notification
{
NSTableView *tableView = notification.object;
@ -411,6 +423,10 @@
} else {
self.layerTableHasSelection = NO;
}
} else if (tableView == self.scriptTableView) {
NSString *scriptKey = self.scriptKeys[tableView.selectedRow];
[self.scriptTextView bind:@"value" toObject:self.inputobjctrl withKeyPath:scriptKey options:nil];
}
}