More refactoring and cleanup

This commit is contained in:
2021-11-16 13:14:59 -05:00
parent 077b2fc23b
commit 51a95cc964
8 changed files with 49 additions and 36 deletions

View File

@@ -18,7 +18,6 @@ public:
LuaConsole console_;
PrintChanneler print_channeler_;
Gui gui_;
int64_t gui_place_;
public:
void set_initial_state() {
@@ -104,22 +103,14 @@ public:
}
void do_view_command(const StringVec &cmd) {
for (int64_t id : world_->get_near(actor_id_, 100, true)) {
const Tangible *tan = world_->tangible_get(id);
const AnimStep &aqback = tan->anim_queue_.back();
stdostream() << id << ": " << aqback.graphic() << " " << aqback.plane() << " " << aqback.xyz().debug_string() << std::endl;
}
stdostream() << world_->tangibles_near_debug_string(actor_id_, 100);
}
void do_menu_command(const StringVec &cmd) {
world_to_asynchronous();
gui_place_ = util::strtoint(cmd[1], actor_id_);
world_->update_gui(actor_id_, gui_place_, &gui_);
int index = 0;
for (const GuiElt &elt : gui_.elts()) {
stdostream() << index << " " << elt.label() << std::endl;
index += 1;
}
int64_t place = util::strtoint(cmd[1], actor_id_);
world_->update_gui(actor_id_, place, &gui_);
stdostream() << gui_.menu_debug_string();
}
void do_choose_command(const StringVec &cmd) {
@@ -129,7 +120,7 @@ public:
return;
}
stdostream() << "Invoking plan: " << action << std::endl;
Invocation inv(Invocation::KIND_PLAN, actor_id_, gui_place_, action);
Invocation inv(Invocation::KIND_PLAN, actor_id_, gui_.place(), action);
send_invocation(inv);
}