Indices are for display niceness only, so index them from 1 rather than keep offsetti...
[enjoyable.git] / JSAction.m
index 8576b2f..f96c10d 100644 (file)
 @synthesize name;
 @synthesize active;
 
+- (id)initWithName:(NSString *)newName base:(JSAction *)newBase {
+    if ((self = [super init])) {
+        self.name = newName;
+        self.base = newBase;
+    }
+    return self;
+}
+
 - (id)findSubActionForValue:(IOHIDValueRef)value {
     return NULL;
 }
 
 - (NSString *)stringify {
-    return [NSString stringWithFormat: @"%@~%p", [base stringify], cookie];
+    if (cookie)
+        return [NSString stringWithFormat: @"%@~%p", [base stringify], cookie];
+    else
+        return [NSString stringWithFormat: @"%@~%@", [base stringify], name];
 }
 
 - (void)notifyEvent:(IOHIDValueRef)value {