mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-25 07:25:47 +03:00
timewarp restores last picked halt_limit (#305)
This commit is contained in:
parent
a36ef99c06
commit
f58b60d7f1
@ -22,6 +22,7 @@ pub struct Options {
|
||||
pub time_increment: Duration,
|
||||
pub resume_after_edit: bool,
|
||||
pub dont_draw_time_warp: bool,
|
||||
pub time_warp_halt_limit: Duration,
|
||||
|
||||
pub language: Option<String>,
|
||||
}
|
||||
@ -41,6 +42,7 @@ impl Options {
|
||||
time_increment: Duration::minutes(10),
|
||||
resume_after_edit: true,
|
||||
dont_draw_time_warp: false,
|
||||
time_warp_halt_limit: Duration::minutes(5),
|
||||
|
||||
language: None,
|
||||
}
|
||||
|
@ -359,7 +359,7 @@ impl JumpToTime {
|
||||
fn new(ctx: &mut EventCtx, app: &App, maybe_mode: Option<GameplayMode>) -> JumpToTime {
|
||||
let target = app.primary.sim.time();
|
||||
let end_of_day = app.primary.sim.get_end_of_day();
|
||||
let halt_limit = Duration::minutes(5);
|
||||
let halt_limit = app.opts.time_warp_halt_limit;
|
||||
JumpToTime {
|
||||
target,
|
||||
halt_limit,
|
||||
@ -444,11 +444,13 @@ impl State for JumpToTime {
|
||||
}
|
||||
"choose delay" => return Transition::Keep,
|
||||
"jump to delay" => {
|
||||
let halt_limit = self.panel.persistent_split_value("choose delay");
|
||||
app.opts.time_warp_halt_limit = halt_limit;
|
||||
return Transition::Replace(TimeWarpScreen::new(
|
||||
ctx,
|
||||
app,
|
||||
app.primary.sim.get_end_of_day(),
|
||||
Some(self.panel.persistent_split_value("choose delay")),
|
||||
Some(halt_limit),
|
||||
));
|
||||
}
|
||||
_ => unreachable!(),
|
||||
|
Loading…
Reference in New Issue
Block a user