use text for bool representations

This commit is contained in:
2024-09-02 15:34:01 -05:00
committed by Celtic Minstrel
parent d772263394
commit e7a56f08a2
5 changed files with 22 additions and 12 deletions

View File

@@ -253,7 +253,7 @@ void handle_spellcast(eSkill which_type, bool& did_something, bool& need_redraw,
if(record && recording){
std::map<std::string,std::string> info;
info["which_type"] = boost::lexical_cast<std::string>(which_type);
info["spell_forced"] = boost::lexical_cast<std::string>(spell_forced);
info["spell_forced"] = bool_to_str(spell_forced);
record_action("handle_spellcast", info);
}
short store_sp[6];
@@ -313,7 +313,7 @@ void handle_spellcast(eSkill which_type, bool& did_something, bool& need_redraw,
void handle_begin_look(bool right_button, bool& need_redraw) {
if(recording){
record_action("handle_begin_look", boost::lexical_cast<std::string>(right_button));
record_action("handle_begin_look", bool_to_str(right_button));
}
if(overall_mode == MODE_OUTDOORS) overall_mode = MODE_LOOK_OUTDOORS;
if(overall_mode == MODE_TOWN) overall_mode = MODE_LOOK_TOWN;
@@ -486,7 +486,7 @@ void handle_look(location destination, bool right_button, eKeyMod mods, bool& ne
if(recording){
std::map<std::string,std::string> info;
info["destination"] = boost::lexical_cast<std::string>(destination);
info["right_button"] = boost::lexical_cast<std::string>(right_button);
info["right_button"] = bool_to_str(right_button);
info["mods"] = boost::lexical_cast<std::string>(mods);
record_action("handle_look", info);
}

View File

@@ -390,12 +390,12 @@ static void replay_next_action() {
short help1 = short_from_action(next_action);
menu_give_help(help1);
}else if(t == "handle_begin_look"){
bool right_button = boost::lexical_cast<bool>(next_action.GetText());
bool right_button = str_to_bool(next_action.GetText());
handle_begin_look(right_button, need_redraw);
}else if(t == "handle_look"){
auto info = info_from_action(next_action);
location destination = boost::lexical_cast<location>(info["destination"]);
bool right_button = boost::lexical_cast<bool>(info["right_button"]);
bool right_button = str_to_bool(info["right_button"]);
eKeyMod mods = static_cast<eKeyMod>(std::stoi(info["mods"]));
handle_look(destination, right_button, mods, need_redraw, need_reprint);
@@ -413,7 +413,7 @@ static void replay_next_action() {
}else if(t == "handle_spellcast"){
auto info = info_from_action(next_action);
eSkill which_type = boost::lexical_cast<eSkill>(info["which_type"]);
spell_forced = boost::lexical_cast<bool>(info["spell_forced"]);
spell_forced = str_to_bool(info["spell_forced"]);
handle_spellcast(which_type, did_something, need_redraw, need_reprint);
}else if(t == "handle_target_space"){