tweaks to tutorial UI

This commit is contained in:
Dustin Carlino 2020-02-26 15:18:05 -08:00
parent 4af217c140
commit 59ec571aae
4 changed files with 39 additions and 33 deletions

View File

@ -163,9 +163,9 @@ e348fda658d0fcb6bb8abdcec23d1dab data/system/assets/speed/speed_up.svg
d15fe87c4174463e84b9a440162129ed data/system/assets/tools/undo.svg
841a6304950389f8ede9581d04c1021f data/system/assets/tools/visibility.svg
512477d8556de48901712165e905782f data/system/assets/tools/locate.svg
9fe22b344e21eb92b2eb824c5753fc33 data/system/assets/tools/next.svg
5f3912d972b47419295ded39c52e647d data/system/assets/tools/next.svg
e469148085a2046afd447d31a54d15ab data/system/assets/tools/search.svg
fe6ccbe746735c32d7b52257aeb5c4b9 data/system/assets/tools/prev.svg
4a5d6456d7c3d9ad94fc1a9e456d6f06 data/system/assets/tools/prev.svg
fe358c0fdf48b65117f7c4970fa35d91 data/system/assets/tools/settings.svg
1e0135f13d0aea11650460d6a61b5463 data/system/assets/tools/edit.svg
cddd0aa7a98d4d511138befe8f56a6b7 data/system/assets/tools/delete.svg

View File

@ -1,4 +1,4 @@
<svg width="58" height="58" viewBox="0 0 58 58" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="29" cy="29" r="29" fill="white"/>
<path d="M24 40L35 30.25L24 20.5" stroke="black" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="18" cy="18" r="18" fill="white"/>
<path d="M15 25L22 19L15 13" stroke="black" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

Before

Width:  |  Height:  |  Size: 264 B

After

Width:  |  Height:  |  Size: 259 B

View File

@ -1,4 +1,4 @@
<svg width="58" height="58" viewBox="0 0 58 58" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="29" cy="29" r="29" fill="white"/>
<path d="M32 20.5L21 30.25L32 40" stroke="black" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="18" cy="18" r="18" fill="white"/>
<path d="M20 13L13 19L20 25" stroke="black" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

Before

Width:  |  Height:  |  Size: 264 B

After

Width:  |  Height:  |  Size: 259 B

View File

@ -593,32 +593,32 @@ impl Task {
Task::Nil => unreachable!(),
Task::Camera => "Put out the fire at the Montlake Market",
Task::InspectObjects => {
let mut txt = Text::from(Line("Click and inspect one of each:").fg(Color::CYAN));
let mut txt = Text::from(Line("Click and inspect one of each:"));
if state.inspected_lane {
txt.add(Line("☑ lane").fg(Color::GREEN));
} else {
txt.add(Line("☐ lane").fg(Color::CYAN));
txt.add(Line("☐ lane"));
}
if state.inspected_building {
txt.add(Line("☑ building").fg(Color::GREEN));
} else {
txt.add(Line("☐ building").fg(Color::CYAN));
txt.add(Line("☐ building"));
}
if state.inspected_stop_sign {
txt.add(Line("☑ intersection with stop sign").fg(Color::GREEN));
} else {
txt.add(Line("☐ intersection with stop sign").fg(Color::CYAN));
txt.add(Line("☐ intersection with stop sign"));
}
if state.inspected_border {
txt.add(Line("☑ intersection on the map border").fg(Color::GREEN));
} else {
txt.add(Line("☐ intersection on the map border").fg(Color::CYAN));
txt.add(Line("☐ intersection on the map border"));
}
return txt;
}
Task::TimeControls => "Simulate until after 5pm",
Task::PauseResume => {
let mut txt = Text::from(Line("☐ Pause/resume ").fg(Color::CYAN));
let mut txt = Text::from(Line("☐ Pause/resume "));
txt.append(Line(format!("{} times", 3 - state.num_pauses)).fg(Color::GREEN));
return txt;
}
@ -628,17 +628,17 @@ impl Task {
if state.following_car {
txt.add(Line("☑ follow the target car").fg(Color::GREEN));
} else {
txt.add(Line("☐ follow the target car").fg(Color::CYAN));
txt.add(Line("☐ follow the target car"));
}
if state.car_parked {
txt.add(Line("☑ wait for them to park").fg(Color::GREEN));
} else {
txt.add(Line("☐ wait for them to park").fg(Color::CYAN));
txt.add(Line("☐ wait for them to park"));
}
if state.inspected_building {
txt.add(Line("☑ draw WASH ME on the window").fg(Color::GREEN));
} else {
txt.add(Line("☐ draw WASH ME on the window").fg(Color::CYAN));
txt.add(Line("☐ draw WASH ME on the window"));
}
return txt;
}
@ -652,7 +652,7 @@ impl Task {
let mut txt = Text::new();
txt.add_wrapped(format!("{}", simple), 0.6 * ctx.canvas.window_width);
txt.change_fg(Color::CYAN)
txt
}
fn label(self) -> &'static str {
@ -911,27 +911,33 @@ impl TutorialState {
)
}
.margin(5),
if self.interaction() != Task::Nil {
WrappedComposite::svg_button(
ctx,
"../data/system/assets/tools/info.svg",
"help",
None,
)
} else {
ManagedWidget::draw_svg_transform(
ctx,
"../data/system/assets/tools/info.svg",
RewriteColor::ChangeAll(Color::WHITE.alpha(0.5)),
)
}
.margin(5),
WrappedComposite::text_button(ctx, "Quit", None).margin(5),
])
.centered()];
{
let task = self.interaction();
if task != Task::Nil {
col.push(ManagedWidget::row(vec![
ManagedWidget::draw_text(
ctx,
Text::from(
Line(format!(
"Task {}: {}",
self.current.stage + 1,
self.stage().task.label()
))
.roboto_bold(),
),
),
WrappedComposite::svg_button(
ctx,
"../data/system/assets/tools/info.svg",
"help",
None,
)
.centered_vert()
.align_right(),
]));
col.push(ManagedWidget::draw_text(ctx, task.top_txt(ctx, self)).margin(5));
}
}