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 time_increment: Duration,
|
||||||
pub resume_after_edit: bool,
|
pub resume_after_edit: bool,
|
||||||
pub dont_draw_time_warp: bool,
|
pub dont_draw_time_warp: bool,
|
||||||
|
pub time_warp_halt_limit: Duration,
|
||||||
|
|
||||||
pub language: Option<String>,
|
pub language: Option<String>,
|
||||||
}
|
}
|
||||||
@ -41,6 +42,7 @@ impl Options {
|
|||||||
time_increment: Duration::minutes(10),
|
time_increment: Duration::minutes(10),
|
||||||
resume_after_edit: true,
|
resume_after_edit: true,
|
||||||
dont_draw_time_warp: false,
|
dont_draw_time_warp: false,
|
||||||
|
time_warp_halt_limit: Duration::minutes(5),
|
||||||
|
|
||||||
language: None,
|
language: None,
|
||||||
}
|
}
|
||||||
|
@ -359,7 +359,7 @@ impl JumpToTime {
|
|||||||
fn new(ctx: &mut EventCtx, app: &App, maybe_mode: Option<GameplayMode>) -> JumpToTime {
|
fn new(ctx: &mut EventCtx, app: &App, maybe_mode: Option<GameplayMode>) -> JumpToTime {
|
||||||
let target = app.primary.sim.time();
|
let target = app.primary.sim.time();
|
||||||
let end_of_day = app.primary.sim.get_end_of_day();
|
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 {
|
JumpToTime {
|
||||||
target,
|
target,
|
||||||
halt_limit,
|
halt_limit,
|
||||||
@ -444,11 +444,13 @@ impl State for JumpToTime {
|
|||||||
}
|
}
|
||||||
"choose delay" => return Transition::Keep,
|
"choose delay" => return Transition::Keep,
|
||||||
"jump to delay" => {
|
"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(
|
return Transition::Replace(TimeWarpScreen::new(
|
||||||
ctx,
|
ctx,
|
||||||
app,
|
app,
|
||||||
app.primary.sim.get_end_of_day(),
|
app.primary.sim.get_end_of_day(),
|
||||||
Some(self.panel.persistent_split_value("choose delay")),
|
Some(halt_limit),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
_ => unreachable!(),
|
_ => unreachable!(),
|
||||||
|
Loading…
Reference in New Issue
Block a user