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:
2020-09-12 17:39:07 -07:00
parent 7643b98c01
commit 2aaca29741
4 changed files with 115 additions and 12 deletions

View File

@@ -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;
}
}
}