replay movement actions
This commit is contained in:
@@ -119,8 +119,6 @@ enum_map(eShopArea, rectangle) shopping_rects[8];
|
||||
std::queue<pending_special_type> special_queue;
|
||||
bool end_scenario = false;
|
||||
|
||||
static void advance_time(bool did_something, bool need_redraw, bool need_reprint);
|
||||
|
||||
// This is defined in pc.editors.cpp since the PC editor also uses it
|
||||
extern void edit_stuff_done();
|
||||
|
||||
@@ -501,7 +499,7 @@ static void handle_look(location destination, bool& need_redraw, bool& need_repr
|
||||
}
|
||||
}
|
||||
|
||||
static void handle_move(location destination, bool& did_something, bool& need_redraw, bool& need_reprint) {
|
||||
void handle_move(location destination, bool& did_something, bool& need_redraw, bool& need_reprint) {
|
||||
if(recording) {
|
||||
// record the action
|
||||
std::stringstream out;
|
||||
@@ -1421,7 +1419,7 @@ bool handle_action(const sf::Event& event) {
|
||||
return are_done;
|
||||
}
|
||||
|
||||
static void advance_time(bool did_something, bool need_redraw, bool need_reprint) {
|
||||
void advance_time(bool did_something, bool need_redraw, bool need_reprint) {
|
||||
// MARK: At this point, see if any specials have been queued up, and deal with them
|
||||
// Note: We just check once here instead of looping because run_special also pulls from the queue.
|
||||
if(!special_queue.empty()) {
|
||||
|
@@ -8,6 +8,8 @@
|
||||
void init_screen_locs();
|
||||
bool prime_time();
|
||||
bool handle_action(const sf::Event& event);
|
||||
void advance_time(bool did_something, bool need_redraw, bool need_reprint);
|
||||
void handle_move(location destination, bool& did_something, bool& need_redraw, bool& need_reprint);
|
||||
void handle_monster_actions(bool& need_redraw, bool& need_reprint);
|
||||
bool someone_awake();
|
||||
void handle_menu_spell(short spell_picked,short spell_type) ;
|
||||
|
@@ -19,6 +19,7 @@
|
||||
#include "boe.party.hpp"
|
||||
#include "boe.items.hpp"
|
||||
#include "boe.locutils.hpp"
|
||||
#include "boe.actions.hpp"
|
||||
#include "boe.town.hpp"
|
||||
#include "boe.dlgutil.hpp"
|
||||
#include "boe.infodlg.hpp"
|
||||
@@ -252,13 +253,22 @@ void process_args(int argc, char* argv[]) {
|
||||
}
|
||||
|
||||
void replay_next_action() {
|
||||
bool did_something = false, need_redraw = false, need_reprint = false;
|
||||
|
||||
auto next_action = pop_next_action();
|
||||
std::string t = next_action->Value();
|
||||
if (t == "load_party") {
|
||||
if(t == "load_party") {
|
||||
decode_file(next_action->GetText(), tempDir / "temp.exg");
|
||||
load_party(tempDir / "temp.exg", univ);
|
||||
finish_load_party();
|
||||
} else if(t == "move") {
|
||||
location l;
|
||||
std::stringstream sstr(next_action->GetText());
|
||||
sstr >> l;
|
||||
handle_move(l, did_something, need_redraw, need_reprint);
|
||||
}
|
||||
|
||||
advance_time(did_something, need_redraw, need_reprint);
|
||||
}
|
||||
|
||||
void init_boe(int argc, char* argv[]) {
|
||||
|
Reference in New Issue
Block a user