Skip to content

Commit

Permalink
Split gamestate inspector AI config up by component type
Browse files Browse the repository at this point in the history
  • Loading branch information
CelticMinstrel authored and mattsc committed Mar 22, 2016
1 parent a5d131c commit 852a255
Showing 1 changed file with 33 additions and 7 deletions.
40 changes: 33 additions & 7 deletions src/gui/dialogs/gamestate_inspector.cpp
Expand Up @@ -55,6 +55,15 @@ inline std::string config_to_string(const config& cfg)
return s.str();
}

inline std::string config_to_string(const config& cfg, std::string only_children)
{
config filtered;
BOOST_FOREACH(const config& child, cfg.child_range(only_children)) {
filtered.add_child(only_children, child);
}
return config_to_string(filtered);
}

}

namespace gui2
Expand Down Expand Up @@ -522,7 +531,10 @@ class team_mode_controller : public single_mode_controller
// note: needs sync with handle_stuff_list_selection()
model_.add_row_to_stuff_list("overview", "overview");
model_.add_row_to_stuff_list("ai overview", "ai overview");
model_.add_row_to_stuff_list("ai config full", "ai config full");
model_.add_row_to_stuff_list("ai engines", "ai engines");
model_.add_row_to_stuff_list("ai stages", "ai stages");
model_.add_row_to_stuff_list("ai aspects", "ai aspects");
model_.add_row_to_stuff_list("ai goals", "ai goals");
model_.add_row_to_stuff_list("recall list overview",
"recall list overview");
model_.add_row_to_stuff_list("recall list full", "recall list full");
Expand Down Expand Up @@ -559,11 +571,25 @@ class team_mode_controller : public single_mode_controller

if(selected == 2) {
model_.set_inspect_window_text(
config_to_string(ai::manager::to_config(side_)));
return;
config_to_string(ai::manager::to_config(side_), "engine"));
}

if(selected == 3) {
model_.set_inspect_window_text(
config_to_string(ai::manager::to_config(side_), "stage"));
}

if(selected == 4) {
model_.set_inspect_window_text(
config_to_string(ai::manager::to_config(side_), "aspect"));
}

if(selected == 5) {
model_.set_inspect_window_text(
config_to_string(ai::manager::to_config(side_), "goal"));
}

if(selected == 6) {
std::stringstream s;
if (resources::teams) {
FOREACH(const AUTO & u, resources::teams->at(side_ - 1).recall_list())
Expand All @@ -583,7 +609,7 @@ class team_mode_controller : public single_mode_controller
return;
}

if(selected == 4) {
if(selected == 7) {
config c;
if (resources::teams) {
FOREACH(const AUTO & u, resources::teams->at(side_ - 1).recall_list())
Expand All @@ -597,14 +623,14 @@ class team_mode_controller : public single_mode_controller
return;
}

if(selected == 5) {
if(selected == 8) {
model_.set_inspect_window_text(
ai::manager::get_active_ai_structure_for_side(side_));
return;
}


if(selected == 6) {
if(selected == 9) {
std::stringstream s;
if(resources::units) {
for(unit_map::iterator i = resources::units->begin();
Expand Down

0 comments on commit 852a255

Please sign in to comment.