Skip to content

Commit 5fb3a7b

Browse files
committed
Add skills into encounter screen
1 parent 1ab3712 commit 5fb3a7b

1 file changed

Lines changed: 17 additions & 8 deletions

File tree

EncounterEdit.cpp

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,24 @@ void displayEncounterEdit(void* s)
6161

6262
ImGui::Separator();
6363

64-
ImGui::Text("Traits:");
64+
ImGui::Text("Skills:");
6565

66-
ImGui::Separator();
66+
if (creature.get_skills().has_value()) {
67+
// Skills
68+
for (const auto& skill : creature.get_skills().value_or(std::map<std::string, int>())) {
69+
ImGui::TextWrapped("%s: %d", skill.first.c_str(), skill.second);
70+
ImGui::Separator();
71+
}
72+
if (creature.get_skills()->empty()) {
73+
ImGui::Text("No skills available.");
74+
ImGui::Separator();
75+
}
76+
} else {
77+
ImGui::Text("No skills available.");
78+
ImGui::Separator();
79+
}
80+
81+
ImGui::Text("Traits:");
6782

6883
if (creature.get_traits().has_value()) {
6984
// Traits
@@ -83,8 +98,6 @@ void displayEncounterEdit(void* s)
8398

8499
ImGui::Text("Actions:");
85100

86-
ImGui::Separator();
87-
88101
if (creature.get_actions().has_value()) {
89102
// Actions
90103

@@ -105,8 +118,6 @@ void displayEncounterEdit(void* s)
105118

106119
ImGui::Text("Legendary Actions:");
107120

108-
ImGui::Separator();
109-
110121
if (creature.get_legendary_actions().has_value()) {
111122
// Legendary Actions
112123
for (const auto& la : creature.get_legendary_actions().value_or(
@@ -125,8 +136,6 @@ void displayEncounterEdit(void* s)
125136

126137
ImGui::Text("Reactions:");
127138

128-
ImGui::Separator();
129-
130139
if (creature.get_reactions().has_value()) {
131140
// Reactions
132141
for (const auto& reaction : creature.get_reactions().value_or(

0 commit comments

Comments
 (0)