Adds HP to monster card.

This commit is contained in:
2020-09-25 03:52:44 -07:00
parent 82e5545904
commit b2eed1ffc7
4 changed files with 19 additions and 1 deletions

View File

@@ -16,6 +16,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (weak, nonatomic) IBOutlet UILabel *monsterName;
@property (weak, nonatomic) IBOutlet UILabel *monsterMeta;
@property (weak, nonatomic) IBOutlet UILabel *monsterArmorClass;
@property (weak, nonatomic) IBOutlet UILabel *monsterHitPoints;
@property Monster* monster;

View File

@@ -52,6 +52,14 @@
self.monsterArmorClass.attributedText = [HTMLHelper attributedStringFromHTML:[NSString stringWithFormat:@"<span style=\"font-family: helvetica; font-size: 12pt; color: #9B2818;\"><b>Armor Class</b> %@</span>", armorClassDescription]];
}
}
if (self.monsterHitPoints != nil) {
NSString *hitPointsDescription = self.monster.hitPointsDescription;
if (hitPointsDescription == nil) {
self.monsterHitPoints.text = @"";
} else {
self.monsterHitPoints.attributedText = [HTMLHelper attributedStringFromHTML:[NSString stringWithFormat:@"<span style=\"font-family: helvetica; font-size: 12pt; color: #9B2818;\"><b>Hit Points</b> %@</span>", hitPointsDescription]];
}
}
}
- (IBAction)unwindWithSegue:(UIStoryboardSegue *)unwindSegue {