Adds alignment to monsters.
Adds tests for editing alignment on monsters. Adds tests for monster meta text when alignment is set.
This commit is contained in:
@@ -75,6 +75,7 @@
|
||||
self.size = [jsonRoot objectForKey:@"size"] ?: @"";
|
||||
self.type = [jsonRoot objectForKey:@"type"] ?: @"";
|
||||
self.subtype = [jsonRoot objectForKey:@"tag"] ?: @"";
|
||||
self.alignment = [jsonRoot objectForKey:@"alignment"] ?: @"";
|
||||
|
||||
return self;
|
||||
}
|
||||
@@ -338,6 +339,7 @@
|
||||
self.size = monster.size;
|
||||
self.type = monster.type;
|
||||
self.subtype = monster.subtype;
|
||||
self.alignment = monster.alignment;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
// * Subtype
|
||||
// * Alignment
|
||||
|
||||
return 4;
|
||||
return 5;
|
||||
}
|
||||
|
||||
- (EditableShortStringTableViewCell*) makeShortStringCellFromCell:(UITableViewCell*)cell {
|
||||
@@ -109,6 +109,13 @@
|
||||
shortStringCell.textField.text = self.editingMonster.subtype;
|
||||
shortStringCell.textField.placeholder = NSLocalizedString(@"Subtype", @"Placeholder text for the subtype of a monster or NPC.");
|
||||
return shortStringCell;
|
||||
case 4:
|
||||
shortStringCell = [self makeShortStringCellFromCell: [self.monsterTableView dequeueReusableCellWithIdentifier:@"EditableShortString"]];
|
||||
shortStringCell.delegate = self;
|
||||
shortStringCell.identifier = @"monster.alignment";
|
||||
shortStringCell.textField.text = self.editingMonster.alignment;
|
||||
shortStringCell.textField.placeholder = NSLocalizedString(@"Alignment", @"Placeholder text for the alignment of a monster or NPC.");
|
||||
return shortStringCell;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -128,6 +135,8 @@
|
||||
self.editingMonster.type = (NSString*)value;
|
||||
} else if ([@"monster.subtype" isEqualToString:identifier]) {
|
||||
self.editingMonster.subtype = (NSString*)value;
|
||||
} else if ([@"monster.alignment" isEqualToString:identifier]) {
|
||||
self.editingMonster.alignment = (NSString*)value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user