record and replay screen shifting while looking
This commit is contained in:
@@ -1155,6 +1155,19 @@ static void handle_party_death() {
|
||||
}
|
||||
|
||||
void screen_shift(int dx, int dy, bool& need_redraw) {
|
||||
if(recording){
|
||||
std::map<std::string,std::string> info;
|
||||
std::ostringstream sstr;
|
||||
sstr << dx;
|
||||
info["dx"] = sstr.str();
|
||||
|
||||
sstr.str("");
|
||||
sstr << dy;
|
||||
info["dy"] = sstr.str();
|
||||
|
||||
record_action("screen_shift", info);
|
||||
}
|
||||
|
||||
center.x += dx;
|
||||
center.y += dy;
|
||||
|
||||
|
@@ -412,6 +412,17 @@ static void replay_next_action() {
|
||||
eKeyMod mods = static_cast<eKeyMod>(std::stoi(info["mods"]));
|
||||
|
||||
handle_look(destination, right_button, mods, need_redraw, need_reprint);
|
||||
}else if(t == "screen_shift"){
|
||||
auto info = info_from_action(next_action);
|
||||
std::istringstream sstr(info["dx"]);
|
||||
int dx = 0;
|
||||
sstr >> dx;
|
||||
|
||||
sstr.str(info["dy"]);
|
||||
int dy = 0;
|
||||
sstr >> dy;
|
||||
|
||||
screen_shift(dx, dy, need_redraw);
|
||||
}
|
||||
|
||||
// TODO some of these actions shouldn't call advance_time(). They should return
|
||||
|
Reference in New Issue
Block a user