Skip to content

Commit 49d61c3

Browse files
committed
QOL for encounter edit
1 parent fe9a9c8 commit 49d61c3

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

EncounterEdit.cpp

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ void displayEncounterEdit(void* s)
3939
break; // Break to avoid iterator invalidation
4040
}
4141

42+
ImGui::Text("AC: %d, HP: %d (%s)", creature.get_ac().value(),
43+
creature.get_max_hit_points(),
44+
creature.get_hit_dice().value_or("N/A").c_str());
45+
4246
// Notes
4347
ImGui::Separator();
4448

@@ -55,7 +59,29 @@ void displayEncounterEdit(void* s)
5559
ImVec2(-FLT_MIN, ImGui::GetTextLineHeight() * 4));
5660
creature.set_notes(std::string(notesBuffer));
5761

58-
ImGui::Text("Actions");
62+
ImGui::Separator();
63+
64+
ImGui::Text("Traits:");
65+
66+
ImGui::Separator();
67+
68+
if (creature.get_traits().has_value()) {
69+
// Traits
70+
for (const auto& trait : creature.get_traits().value_or(
71+
std::vector<std::string>())) {
72+
ImGui::TextWrapped("%s", trait.c_str());
73+
ImGui::Separator();
74+
}
75+
if (creature.get_traits()->empty()) {
76+
ImGui::Text("No traits available.");
77+
ImGui::Separator();
78+
}
79+
} else {
80+
ImGui::Text("No traits available.");
81+
ImGui::Separator();
82+
}
83+
84+
ImGui::Text("Actions:");
5985

6086
ImGui::Separator();
6187

@@ -79,6 +105,8 @@ void displayEncounterEdit(void* s)
79105

80106
ImGui::Text("Legendary Actions:");
81107

108+
ImGui::Separator();
109+
82110
if (creature.get_legendary_actions().has_value()) {
83111
// Legendary Actions
84112
for (const auto& la : creature.get_legendary_actions().value_or(
@@ -97,6 +125,8 @@ void displayEncounterEdit(void* s)
97125

98126
ImGui::Text("Reactions:");
99127

128+
ImGui::Separator();
129+
100130
if (creature.get_reactions().has_value()) {
101131
// Reactions
102132
for (const auto& reaction : creature.get_reactions().value_or(

0 commit comments

Comments
 (0)