record and replay display_spells
This commit is contained in:
@@ -113,6 +113,19 @@ static bool display_spells_event_filter(cDialog& me, std::string item_hit, eSkil
|
|||||||
}
|
}
|
||||||
//short force_spell; // if 100, ignore
|
//short force_spell; // if 100, ignore
|
||||||
void display_spells(eSkill mode,short force_spell,cDialog* parent) {
|
void display_spells(eSkill mode,short force_spell,cDialog* parent) {
|
||||||
|
if(recording){
|
||||||
|
std::map<std::string,std::string> info;
|
||||||
|
std::ostringstream sstr;
|
||||||
|
|
||||||
|
sstr << mode;
|
||||||
|
info["mode"] = sstr.str();
|
||||||
|
|
||||||
|
sstr.str("");
|
||||||
|
sstr << force_spell;
|
||||||
|
info["force_spell"] = sstr.str();
|
||||||
|
|
||||||
|
record_action("display_spells", info);
|
||||||
|
}
|
||||||
using namespace std::placeholders;
|
using namespace std::placeholders;
|
||||||
if(force_spell < 100) {
|
if(force_spell < 100) {
|
||||||
if(mode == eSkill::MAGE_SPELLS)
|
if(mode == eSkill::MAGE_SPELLS)
|
||||||
|
@@ -360,6 +360,19 @@ static void replay_next_action() {
|
|||||||
print_party_stats();
|
print_party_stats();
|
||||||
}else if(t == "display_alchemy"){
|
}else if(t == "display_alchemy"){
|
||||||
display_alchemy();
|
display_alchemy();
|
||||||
|
}else if(t == "display_spells"){
|
||||||
|
auto info = info_from_action(next_action);
|
||||||
|
std::istringstream sstr(info["mode"]);
|
||||||
|
int enum_v;
|
||||||
|
sstr >> enum_v;
|
||||||
|
|
||||||
|
eSkill mode = static_cast<eSkill>(enum_v);
|
||||||
|
|
||||||
|
short force_spell;
|
||||||
|
sstr.str(info["force_spell"]);
|
||||||
|
sstr >> force_spell;
|
||||||
|
|
||||||
|
display_spells(mode, force_spell, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO some of these actions shouldn't call advance_time(). They should return
|
// TODO some of these actions shouldn't call advance_time(). They should return
|
||||||
@@ -738,11 +751,9 @@ void handle_menu_choice(eMenu item_hit) {
|
|||||||
dialogToShow = "about-boe";
|
dialogToShow = "about-boe";
|
||||||
break;
|
break;
|
||||||
case eMenu::LIBRARY_MAGE:
|
case eMenu::LIBRARY_MAGE:
|
||||||
// TODO record and replay
|
|
||||||
display_spells(eSkill::MAGE_SPELLS,100,0);
|
display_spells(eSkill::MAGE_SPELLS,100,0);
|
||||||
break;
|
break;
|
||||||
case eMenu::LIBRARY_PRIEST:
|
case eMenu::LIBRARY_PRIEST:
|
||||||
// TODO record and replay
|
|
||||||
display_spells(eSkill::PRIEST_SPELLS,100,0);
|
display_spells(eSkill::PRIEST_SPELLS,100,0);
|
||||||
break;
|
break;
|
||||||
case eMenu::LIBRARY_SKILLS:
|
case eMenu::LIBRARY_SKILLS:
|
||||||
|
Reference in New Issue
Block a user