summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2023-01-12 21:43:23 +0100
committerAki <please@ignore.pl>2023-01-12 21:43:23 +0100
commit71c845e53bcbe1e5019735e154ea5bbb0b3c83d7 (patch)
tree7cafe8fbe06f2f4498c96545443c8806abd38a36
parentc632d5e6824603eb420a874095e8b30b9713e918 (diff)
downloadkurator-71c845e53bcbe1e5019735e154ea5bbb0b3c83d7.zip
kurator-71c845e53bcbe1e5019735e154ea5bbb0b3c83d7.tar.gz
kurator-71c845e53bcbe1e5019735e154ea5bbb0b3c83d7.tar.bz2
Team sliders are now created in a loop
-rw-r--r--kurator/src/ScenarioEditor.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/kurator/src/ScenarioEditor.cpp b/kurator/src/ScenarioEditor.cpp
index ab4832b..b79dc14 100644
--- a/kurator/src/ScenarioEditor.cpp
+++ b/kurator/src/ScenarioEditor.cpp
@@ -99,12 +99,8 @@ groups_editor(std::shared_ptr<universe::Repository> repo, std::vector<Group>& gr
ImGui::SameLine();
changed |= loadout_editor(repo, it->loadout);
changed |= removed;
- changed |= ImGui::SliderInt("Team 1", &it->counts[0], 0, 10); // yeah no
- changed |= ImGui::SliderInt("Team 2", &it->counts[1], 0, 10);
- changed |= ImGui::SliderInt("Team 3", &it->counts[2], 0, 10);
- changed |= ImGui::SliderInt("Team 4", &it->counts[3], 0, 10);
- changed |= ImGui::SliderInt("Team 5", &it->counts[4], 0, 10);
- changed |= ImGui::SliderInt("Team 6", &it->counts[5], 0, 10);
+ for (auto jt = it->counts.begin(); jt != it->counts.end(); ++jt)
+ changed |= ImGui::SliderInt(TextFormat("Team %d", jt - it->counts.begin() + 1), &(*jt), 0, 10);
it = removed ? groups.erase(it) : std::next(it);
ImGui::PopID();
}