Adds legendary actions.

This commit is contained in:
2021-03-25 16:55:03 -07:00
parent b5dc107766
commit 0a335b372a
4 changed files with 26 additions and 1 deletions

View File

@@ -80,6 +80,10 @@ struct EditMonster: View {
NavigationLink(
"Actions",
destination: EditTraits(viewModel: monsterViewModel, path: \.actions, title: "Actions"))
NavigationLink(
"Legendary Actions",
destination: EditTraits(viewModel: monsterViewModel, path: \.legendaryActions, title: "Legendary Actions"))
}
}

View File

@@ -213,6 +213,7 @@ struct MonsterDetail: View {
let monsterChallengeRatingDescription = monster.challengeRatingDescription
let monsterAbilities: [AbilityViewModel] = monster.abilities ?? []
let monsterActions: [AbilityViewModel] = monster.actions ?? []
let monsterLegendaryActions: [AbilityViewModel] = monster.legendaryActions ?? []
BasicInfoView(monster: monster)
@@ -270,6 +271,18 @@ struct MonsterDetail: View {
}
// Legendary Actions
if (monsterLegendaryActions.count > 0) {
VStack(alignment: .leading) {
Text("Legendary Actions")
.fontWeight(.bold)
ForEach(monsterLegendaryActions) { action in
VStack {
Markdown(Document(action.renderedText(monster)))
Divider()
}
}
}
}
}
.padding(.horizontal)