moving game assets to data/system, to more easily bundle in wasm

[rebuild]
This commit is contained in:
Dustin Carlino 2020-02-15 16:19:23 -08:00
parent bdb0844512
commit 9a9619ec32
79 changed files with 148 additions and 84 deletions

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 223 B

After

Width:  |  Height:  |  Size: 223 B

View File

Before

Width:  |  Height:  |  Size: 589 B

After

Width:  |  Height:  |  Size: 589 B

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 355 B

After

Width:  |  Height:  |  Size: 355 B

View File

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

View File

Before

Width:  |  Height:  |  Size: 8.0 KiB

After

Width:  |  Height:  |  Size: 8.0 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

View File

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 736 B

After

Width:  |  Height:  |  Size: 736 B

View File

Before

Width:  |  Height:  |  Size: 813 B

After

Width:  |  Height:  |  Size: 813 B

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 1000 B

After

Width:  |  Height:  |  Size: 1000 B

View File

Before

Width:  |  Height:  |  Size: 739 B

After

Width:  |  Height:  |  Size: 739 B

View File

Before

Width:  |  Height:  |  Size: 248 B

After

Width:  |  Height:  |  Size: 248 B

View File

Before

Width:  |  Height:  |  Size: 250 B

After

Width:  |  Height:  |  Size: 250 B

View File

Before

Width:  |  Height:  |  Size: 248 B

After

Width:  |  Height:  |  Size: 248 B

View File

Before

Width:  |  Height:  |  Size: 250 B

After

Width:  |  Height:  |  Size: 250 B

View File

Before

Width:  |  Height:  |  Size: 334 B

After

Width:  |  Height:  |  Size: 334 B

View File

Before

Width:  |  Height:  |  Size: 333 B

After

Width:  |  Height:  |  Size: 333 B

View File

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

Before

Width:  |  Height:  |  Size: 167 B

After

Width:  |  Height:  |  Size: 167 B

View File

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

Before

Width:  |  Height:  |  Size: 176 B

After

Width:  |  Height:  |  Size: 176 B

View File

Before

Width:  |  Height:  |  Size: 232 B

After

Width:  |  Height:  |  Size: 232 B

View File

Before

Width:  |  Height:  |  Size: 581 B

After

Width:  |  Height:  |  Size: 581 B

View File

Before

Width:  |  Height:  |  Size: 590 B

After

Width:  |  Height:  |  Size: 590 B

View File

Before

Width:  |  Height:  |  Size: 157 B

After

Width:  |  Height:  |  Size: 157 B

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 374 B

After

Width:  |  Height:  |  Size: 374 B

View File

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

Before

Width:  |  Height:  |  Size: 174 B

After

Width:  |  Height:  |  Size: 174 B

View File

Before

Width:  |  Height:  |  Size: 282 B

After

Width:  |  Height:  |  Size: 282 B

View File

Before

Width:  |  Height:  |  Size: 256 B

After

Width:  |  Height:  |  Size: 256 B

View File

Before

Width:  |  Height:  |  Size: 873 B

After

Width:  |  Height:  |  Size: 873 B

View File

Before

Width:  |  Height:  |  Size: 303 B

After

Width:  |  Height:  |  Size: 303 B

View File

Before

Width:  |  Height:  |  Size: 510 B

After

Width:  |  Height:  |  Size: 510 B

View File

Before

Width:  |  Height:  |  Size: 443 B

After

Width:  |  Height:  |  Size: 443 B

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 263 B

After

Width:  |  Height:  |  Size: 263 B

View File

Before

Width:  |  Height:  |  Size: 281 B

After

Width:  |  Height:  |  Size: 281 B

View File

Before

Width:  |  Height:  |  Size: 652 B

After

Width:  |  Height:  |  Size: 652 B

View File

@ -0,0 +1,8 @@
- instant
- filesystem stuff => include_dir
- logging? panics? stacktraces?
- glow / winit differences (window size)
- random
- std::process::exit
- cargo magic
- conditional compilation backend pattern, not traits with one impl at a time

View File

@ -135,7 +135,7 @@ impl Tab {
col.push(
WrappedComposite::svg_button(
ctx,
"assets/pregame/back.svg",
"../data/system/assets/pregame/back.svg",
"back",
hotkey(Key::Escape),
)

View File

@ -266,7 +266,7 @@ fn info_for(id: ID, ctx: &EventCtx, ui: &UI) -> Vec<ManagedWidget> {
let name_color = ui.cs.get("OSD name color");
let header_btns = ManagedWidget::row(vec![
ManagedWidget::btn(Button::rectangle_svg(
"assets/tools/locate.svg",
"../data/system/assets/tools/locate.svg",
"jump to object",
hotkey(Key::J),
RewriteColor::Change(Color::hex("#CC4121"), colors::HOVERING),

View File

@ -282,7 +282,7 @@ fn make_minimap_panel(ctx: &mut EventCtx, acs: &AgentColorScheme, zoom_lvl: usiz
let square_len = 0.15 * ctx.canvas.window_width;
let mut zoom_col = vec![ManagedWidget::btn(Button::rectangle_svg(
"assets/speed/speed_up.svg",
"../data/system/assets/speed/speed_up.svg",
"zoom in",
None,
RewriteColor::ChangeAll(colors::HOVERING),
@ -305,7 +305,7 @@ fn make_minimap_panel(ctx: &mut EventCtx, acs: &AgentColorScheme, zoom_lvl: usiz
)));
}
zoom_col.push(ManagedWidget::btn(Button::rectangle_svg(
"assets/speed/slow_down.svg",
"../data/system/assets/speed/slow_down.svg",
"zoom out",
None,
RewriteColor::ChangeAll(colors::HOVERING),
@ -317,26 +317,41 @@ fn make_minimap_panel(ctx: &mut EventCtx, acs: &AgentColorScheme, zoom_lvl: usiz
make_viz_panel(ctx, acs),
ManagedWidget::col(zoom_col).margin(5).centered(),
ManagedWidget::col(vec![
WrappedComposite::svg_button(ctx, "assets/minimap/up.svg", "pan up", None)
.margin(5)
.centered_horiz(),
WrappedComposite::svg_button(
ctx,
"../data/system/assets/minimap/up.svg",
"pan up",
None,
)
.margin(5)
.centered_horiz(),
ManagedWidget::row(vec![
WrappedComposite::svg_button(ctx, "assets/minimap/left.svg", "pan left", None)
.margin(5)
.centered_vert(),
WrappedComposite::svg_button(
ctx,
"../data/system/assets/minimap/left.svg",
"pan left",
None,
)
.margin(5)
.centered_vert(),
ManagedWidget::filler("minimap"),
WrappedComposite::svg_button(
ctx,
"assets/minimap/right.svg",
"../data/system/assets/minimap/right.svg",
"pan right",
None,
)
.margin(5)
.centered_vert(),
]),
WrappedComposite::svg_button(ctx, "assets/minimap/down.svg", "pan down", None)
.margin(5)
.centered_horiz(),
WrappedComposite::svg_button(
ctx,
"../data/system/assets/minimap/down.svg",
"pan down",
None,
)
.margin(5)
.centered_horiz(),
])
.centered(),
])
@ -357,11 +372,16 @@ fn make_viz_panel(ctx: &mut EventCtx, acs: &AgentColorScheme) -> ManagedWidget {
let radius = 10.0;
let mut col = vec![
ManagedWidget::row(vec![
WrappedComposite::svg_button(ctx, "assets/tools/search.svg", "search", hotkey(Key::K))
.margin(10),
WrappedComposite::svg_button(
ctx,
"assets/tools/shortcuts.svg",
"../data/system/assets/tools/search.svg",
"search",
hotkey(Key::K),
)
.margin(10),
WrappedComposite::svg_button(
ctx,
"../data/system/assets/tools/shortcuts.svg",
"shortcuts",
hotkey(Key::SingleQuote),
)
@ -369,7 +389,7 @@ fn make_viz_panel(ctx: &mut EventCtx, acs: &AgentColorScheme) -> ManagedWidget {
if ctx.canvas.cam_zoom >= MIN_ZOOM_FOR_DETAIL {
WrappedComposite::svg_button(
ctx,
"assets/minimap/zoom_out_fully.svg",
"../data/system/assets/minimap/zoom_out_fully.svg",
"zoom out fully",
None,
)
@ -377,7 +397,7 @@ fn make_viz_panel(ctx: &mut EventCtx, acs: &AgentColorScheme) -> ManagedWidget {
} else {
WrappedComposite::svg_button(
ctx,
"assets/minimap/zoom_in_fully.svg",
"../data/system/assets/minimap/zoom_in_fully.svg",
"zoom in fully",
None,
)
@ -385,7 +405,7 @@ fn make_viz_panel(ctx: &mut EventCtx, acs: &AgentColorScheme) -> ManagedWidget {
},
WrappedComposite::svg_button(
ctx,
"assets/tools/layers.svg",
"../data/system/assets/tools/layers.svg",
"change overlay",
hotkey(Key::L),
)
@ -404,7 +424,7 @@ fn make_viz_panel(ctx: &mut EventCtx, acs: &AgentColorScheme) -> ManagedWidget {
col.push(
ManagedWidget::row(vec![
ManagedWidget::btn(Button::rectangle_svg_rewrite(
"assets/tools/visibility.svg",
"../data/system/assets/tools/visibility.svg",
&format!("show/hide {}", label),
None,
if *enabled {

View File

@ -222,35 +222,35 @@ impl Overlays {
WrappedComposite::text_button(ctx, "finished trips histogram", hotkey(Key::F)),
WrappedComposite::text_button(ctx, "map edits", hotkey(Key::E)),
ManagedWidget::btn(Button::rectangle_svg(
"assets/layers/parking_avail.svg",
"../data/system/assets/layers/parking_avail.svg",
"parking availability",
hotkey(Key::P),
RewriteColor::Change(Color::hex("#F2F2F2"), colors::HOVERING),
ctx,
)),
ManagedWidget::btn(Button::rectangle_svg(
"assets/layers/intersection_delay.svg",
"../data/system/assets/layers/intersection_delay.svg",
"intersection delay",
hotkey(Key::I),
RewriteColor::Change(Color::hex("#F2F2F2"), colors::HOVERING),
ctx,
)),
ManagedWidget::btn(Button::rectangle_svg(
"assets/layers/throughput.svg",
"../data/system/assets/layers/throughput.svg",
"throughput",
hotkey(Key::T),
RewriteColor::Change(Color::hex("#F2F2F2"), colors::HOVERING),
ctx,
)),
ManagedWidget::btn(Button::rectangle_svg(
"assets/layers/bike_network.svg",
"../data/system/assets/layers/bike_network.svg",
"bike network",
hotkey(Key::B),
RewriteColor::Change(Color::hex("#F2F2F2"), colors::HOVERING),
ctx,
)),
ManagedWidget::btn(Button::rectangle_svg(
"assets/layers/bus_network.svg",
"../data/system/assets/layers/bus_network.svg",
"bus network",
hotkey(Key::U),
RewriteColor::Change(Color::hex("#F2F2F2"), colors::HOVERING),
@ -265,23 +265,23 @@ impl Overlays {
Overlays::Inactive => Some(("None", Button::inactive_button(ctx, "None"))),
Overlays::ParkingAvailability(_, _) => Some((
"parking availability",
ManagedWidget::draw_svg(ctx, "assets/layers/parking_avail.svg"),
ManagedWidget::draw_svg(ctx, "../data/system/assets/layers/parking_avail.svg"),
)),
Overlays::IntersectionDelay(_, _) => Some((
"intersection delay",
ManagedWidget::draw_svg(ctx, "assets/layers/intersection_delay.svg"),
ManagedWidget::draw_svg(ctx, "../data/system/assets/layers/intersection_delay.svg"),
)),
Overlays::CumulativeThroughput(_, _) => Some((
"throughput",
ManagedWidget::draw_svg(ctx, "assets/layers/throughput.svg"),
ManagedWidget::draw_svg(ctx, "../data/system/assets/layers/throughput.svg"),
)),
Overlays::BikeNetwork(_) => Some((
"bike network",
ManagedWidget::draw_svg(ctx, "assets/layers/bike_network.svg"),
ManagedWidget::draw_svg(ctx, "../data/system/assets/layers/bike_network.svg"),
)),
Overlays::BusNetwork(_) => Some((
"bus network",
ManagedWidget::draw_svg(ctx, "assets/layers/bus_network.svg"),
ManagedWidget::draw_svg(ctx, "../data/system/assets/layers/bus_network.svg"),
)),
Overlays::Edits(_) => Some(("map edits", Button::inactive_button(ctx, "map edits"))),
Overlays::FinishedTripsHistogram(_, _) => Some((
@ -638,7 +638,7 @@ impl Overlays {
let mut col = vec![ManagedWidget::row(vec![
ManagedWidget::draw_text(ctx, Text::from(Line("intersection demand"))),
ManagedWidget::btn(Button::rectangle_svg(
"assets/tools/locate.svg",
"../data/system/assets/tools/locate.svg",
"intersection demand",
None,
RewriteColor::Change(Color::hex("#CC4121"), colors::HOVERING),
@ -682,7 +682,7 @@ impl Overlays {
let mut row = vec![
ManagedWidget::draw_text(ctx, Text::from(Line(format!("Stop {}", idx + 1)))),
ManagedWidget::btn(Button::rectangle_svg(
"assets/tools/locate.svg",
"../data/system/assets/tools/locate.svg",
&format!("Stop {}", idx + 1),
None,
RewriteColor::Change(Color::hex("#CC4121"), colors::HOVERING),

View File

@ -12,7 +12,7 @@ pub fn tool_panel(ctx: &mut EventCtx) -> WrappedComposite {
// TODO Maybe this is confusing -- it doesn't jump to the title screen necessarily.
// Caller has to handle this one
ManagedWidget::btn(Button::rectangle_svg(
"assets/tools/home.svg",
"../data/system/assets/tools/home.svg",
"back",
hotkey(Key::Escape),
RewriteColor::ChangeAll(colors::HOVERING),
@ -20,7 +20,7 @@ pub fn tool_panel(ctx: &mut EventCtx) -> WrappedComposite {
))
.margin(10),
ManagedWidget::btn(Button::rectangle_svg(
"assets/tools/settings.svg",
"../data/system/assets/tools/settings.svg",
"settings",
None,
RewriteColor::ChangeAll(colors::HOVERING),

View File

@ -56,7 +56,7 @@ impl LaneEditor {
row.push(
if active {
ManagedWidget::btn(Button::rectangle_svg(
&format!("assets/edit/{}.svg", icon),
&format!("../data/system/assets/edit/{}.svg", icon),
label,
hotkey(key),
RewriteColor::ChangeAll(colors::HOVERING),
@ -65,7 +65,7 @@ impl LaneEditor {
} else {
ManagedWidget::draw_svg_transform(
ctx,
&format!("assets/edit/{}.svg", icon),
&format!("../data/system/assets/edit/{}.svg", icon),
RewriteColor::ChangeAll(Color::WHITE.alpha(0.5)),
)
}

View File

@ -324,7 +324,7 @@ fn make_topcenter(ctx: &mut EventCtx, ui: &UI) -> Composite {
.margin(5),
WrappedComposite::svg_button(
ctx,
"assets/tools/save.svg",
"../data/system/assets/tools/save.svg",
"save edits as",
lctrl(Key::S),
)
@ -332,14 +332,14 @@ fn make_topcenter(ctx: &mut EventCtx, ui: &UI) -> Composite {
(if !ui.primary.map.get_edits().commands.is_empty() {
WrappedComposite::svg_button(
ctx,
"assets/tools/undo.svg",
"../data/system/assets/tools/undo.svg",
"undo",
lctrl(Key::Z),
)
} else {
ManagedWidget::draw_svg_transform(
ctx,
"assets/tools/undo.svg",
"../data/system/assets/tools/undo.svg",
RewriteColor::ChangeAll(Color::WHITE.alpha(0.5)),
)
})

View File

@ -366,11 +366,16 @@ fn make_top_panel(can_undo: bool, can_redo: bool, ctx: &mut EventCtx) -> Composi
WrappedComposite::text_button(ctx, "Finish", hotkey(Key::Escape)),
WrappedComposite::text_button(ctx, "Preview", lctrl(Key::P)),
(if can_undo {
WrappedComposite::svg_button(ctx, "assets/tools/undo.svg", "undo", lctrl(Key::Z))
WrappedComposite::svg_button(
ctx,
"../data/system/assets/tools/undo.svg",
"undo",
lctrl(Key::Z),
)
} else {
ManagedWidget::draw_svg_transform(
ctx,
"assets/tools/undo.svg",
"../data/system/assets/tools/undo.svg",
RewriteColor::ChangeAll(Color::WHITE.alpha(0.5)),
)
})
@ -378,7 +383,7 @@ fn make_top_panel(can_undo: bool, can_redo: bool, ctx: &mut EventCtx) -> Composi
(if can_redo {
WrappedComposite::svg_button(
ctx,
"assets/tools/redo.svg",
"../data/system/assets/tools/redo.svg",
"redo",
// TODO ctrl+shift+Z!
lctrl(Key::Y),
@ -386,7 +391,7 @@ fn make_top_panel(can_undo: bool, can_redo: bool, ctx: &mut EventCtx) -> Composi
} else {
ManagedWidget::draw_svg_transform(
ctx,
"assets/tools/redo.svg",
"../data/system/assets/tools/redo.svg",
RewriteColor::ChangeAll(Color::WHITE.alpha(0.5)),
)
})
@ -470,7 +475,7 @@ fn make_diagram(i: IntersectionID, selected: usize, ui: &UI, ctx: &mut EventCtx)
),
WrappedComposite::svg_button(
ctx,
"assets/tools/edit.svg",
"../data/system/assets/tools/edit.svg",
&format!("change duration of #{}", idx + 1),
if selected == idx {
hotkey(Key::D)
@ -484,7 +489,7 @@ fn make_diagram(i: IntersectionID, selected: usize, ui: &UI, ctx: &mut EventCtx)
row.push(
WrappedComposite::svg_button(
ctx,
"assets/tools/delete.svg",
"../data/system/assets/tools/delete.svg",
&format!("delete phase #{}", idx + 1),
if selected == idx {
hotkey(Key::Backspace)

View File

@ -24,8 +24,14 @@ impl Game {
&& mode == GameplayMode::Freeform;
ctx.set_textures(
vec![
("assets/pregame/challenges.png", TextureType::Stretch),
("assets/pregame/logo.png", TextureType::Stretch),
(
"../data/system/assets/pregame/challenges.png",
TextureType::Stretch,
),
(
"../data/system/assets/pregame/logo.png",
TextureType::Stretch,
),
],
&mut Timer::new("load textures"),
);

View File

@ -29,7 +29,8 @@ impl TitleScreen {
composite: WrappedComposite::new(
Composite::new(
ManagedWidget::col(vec![
JustDraw::image(ctx, "assets/pregame/logo.png").bg(Color::GREEN.alpha(0.2)),
JustDraw::image(ctx, "../data/system/assets/pregame/logo.png")
.bg(Color::GREEN.alpha(0.2)),
// TODO that nicer font
// TODO Any key
ManagedWidget::btn(Button::text_bg(
@ -74,8 +75,13 @@ impl State for TitleScreen {
pub fn main_menu(ctx: &mut EventCtx, ui: &UI) -> Box<dyn State> {
let mut col = vec![
WrappedComposite::svg_button(ctx, "assets/pregame/quit.svg", "quit", hotkey(Key::Escape))
.align_left(),
WrappedComposite::svg_button(
ctx,
"../data/system/assets/pregame/quit.svg",
"quit",
hotkey(Key::Escape),
)
.align_left(),
{
let mut txt = Text::from(Line("A/B STREET").size(100));
txt.add(Line("Created by Dustin Carlino"));
@ -84,18 +90,18 @@ pub fn main_menu(ctx: &mut EventCtx, ui: &UI) -> Box<dyn State> {
ManagedWidget::row(vec![
WrappedComposite::svg_button(
ctx,
"assets/pregame/tutorial.svg",
"../data/system/assets/pregame/tutorial.svg",
"Tutorial",
hotkey(Key::T),
),
WrappedComposite::svg_button(
ctx,
"assets/pregame/sandbox.svg",
"../data/system/assets/pregame/sandbox.svg",
"Sandbox mode",
hotkey(Key::S),
),
ManagedWidget::btn(Button::rectangle_img(
"assets/pregame/challenges.png",
"../data/system/assets/pregame/challenges.png",
hotkey(Key::C),
ctx,
"Challenges",
@ -200,8 +206,13 @@ fn about(ctx: &mut EventCtx) -> Box<dyn State> {
let mut col = Vec::new();
col.push(
WrappedComposite::svg_button(ctx, "assets/pregame/back.svg", "back", hotkey(Key::Escape))
.align_left(),
WrappedComposite::svg_button(
ctx,
"../data/system/assets/pregame/back.svg",
"back",
hotkey(Key::Escape),
)
.align_left(),
);
let mut txt = Text::new();
@ -294,7 +305,7 @@ fn proposals_picker(ctx: &mut EventCtx) -> Box<dyn State> {
ManagedWidget::col(vec![
WrappedComposite::svg_button(
ctx,
"assets/pregame/back.svg",
"../data/system/assets/pregame/back.svg",
"back",
hotkey(Key::Escape),
)

View File

@ -48,7 +48,7 @@ impl DrawBuilding {
// Might need to scale down more for some buildings, but so far, this works everywhere.
batch.add_svg(
prerender,
"assets/map/parking.svg",
"../data/system/assets/map/parking.svg",
bldg.label_center,
0.1,
Angle::ZERO,

View File

@ -43,7 +43,7 @@ impl DrawCar {
if input.status == CarStatus::Parked {
draw_default.add_svg(
prerender,
"assets/map/parked_car.svg",
"../data/system/assets/map/parked_car.svg",
body_polygon.center(),
0.01,
Angle::ZERO,

View File

@ -28,7 +28,7 @@ impl AlmostDrawLane {
let (pt, angle) = lane.lane_center_pts.dist_along(dist);
self.draw_default.add_svg(
prerender,
"assets/map/bus_only.svg",
"../data/system/assets/map/bus_only.svg",
pt,
0.06,
angle
@ -47,7 +47,7 @@ impl AlmostDrawLane {
let (pt, angle) = lane.lane_center_pts.dist_along(dist);
self.draw_default.add_svg(
prerender,
"assets/meters/bike.svg",
"../data/system/assets/meters/bike.svg",
pt,
0.06,
angle

View File

@ -64,13 +64,25 @@ pub fn draw_signal_phase(
);
} else {
let (center, angle) = crosswalk_icon(&signal.turn_groups[g].geom);
batch.add_svg(prerender, "assets/map/walk.svg", center, 0.07, angle);
batch.add_svg(
prerender,
"../data/system/assets/map/walk.svg",
center,
0.07,
angle,
);
dont_walk.remove(g);
}
}
for g in dont_walk {
let (center, angle) = crosswalk_icon(&signal.turn_groups[g].geom);
batch.add_svg(prerender, "assets/map/dont_walk.svg", center, 0.07, angle);
batch.add_svg(
prerender,
"../data/system/assets/map/dont_walk.svg",
center,
0.07,
angle,
);
}
}
TrafficSignalStyle::Sidewalks => {

View File

@ -61,7 +61,7 @@ pub fn make(ctx: &mut EventCtx, ui: &UI, tab: Tab) -> Box<dyn State> {
Composite::new(ManagedWidget::col(vec![
WrappedComposite::svg_button(
ctx,
"assets/pregame/back.svg",
"../data/system/assets/pregame/back.svg",
"back",
hotkey(Key::Escape),
)

View File

@ -107,7 +107,7 @@ pub fn freeform_controller(
.margin(5),
WrappedComposite::svg_button(
ctx,
"assets/tools/edit_map.svg",
"../data/system/assets/tools/edit_map.svg",
"edit map",
lctrl(Key::E),
)

View File

@ -281,14 +281,20 @@ fn challenge_controller(
let mut rows = vec![ManagedWidget::row(vec![
ManagedWidget::draw_text(ctx, Text::from(Line(title).size(26))).margin(5),
WrappedComposite::svg_button(ctx, "assets/tools/info.svg", "info", None).margin(5),
WrappedComposite::svg_button(ctx, "../data/system/assets/tools/info.svg", "info", None)
.margin(5),
ManagedWidget::draw_batch(
ctx,
GeomBatch::from(vec![(Color::WHITE, Polygon::rectangle(2.0, 50.0))]),
)
.margin(5),
WrappedComposite::svg_button(ctx, "assets/tools/edit_map.svg", "edit map", lctrl(Key::E))
.margin(5),
WrappedComposite::svg_button(
ctx,
"../data/system/assets/tools/edit_map.svg",
"edit map",
lctrl(Key::E),
)
.margin(5),
])
.centered()];
rows.extend(extra_rows);

View File

@ -823,7 +823,7 @@ impl TutorialState {
col.push(
WrappedComposite::svg_button(
ctx,
"assets/tools/edit_map.svg",
"../data/system/assets/tools/edit_map.svg",
"edit map",
lctrl(Key::E),
)

View File

@ -367,13 +367,13 @@ impl AgentMeter {
let composite = Composite::new(
ManagedWidget::col(vec![
ManagedWidget::row(vec![
ManagedWidget::draw_svg(ctx, "assets/meters/pedestrian.svg"),
ManagedWidget::draw_svg(ctx, "../data/system/assets/meters/pedestrian.svg"),
ManagedWidget::draw_text(ctx, Text::from(Line(&by_mode[&TripMode::Walk]))),
ManagedWidget::draw_svg(ctx, "assets/meters/bike.svg"),
ManagedWidget::draw_svg(ctx, "../data/system/assets/meters/bike.svg"),
ManagedWidget::draw_text(ctx, Text::from(Line(&by_mode[&TripMode::Bike]))),
ManagedWidget::draw_svg(ctx, "assets/meters/car.svg"),
ManagedWidget::draw_svg(ctx, "../data/system/assets/meters/car.svg"),
ManagedWidget::draw_text(ctx, Text::from(Line(&by_mode[&TripMode::Drive]))),
ManagedWidget::draw_svg(ctx, "assets/meters/bus.svg"),
ManagedWidget::draw_svg(ctx, "../data/system/assets/meters/bus.svg"),
ManagedWidget::draw_text(ctx, Text::from(Line(&by_mode[&TripMode::Transit]))),
])
.centered(),

View File

@ -34,7 +34,7 @@ impl SpeedControls {
row.push(
ManagedWidget::btn(if paused {
Button::rectangle_svg(
"assets/speed/triangle.svg",
"../data/system/assets/speed/triangle.svg",
"play",
hotkey(Key::Space),
RewriteColor::ChangeAll(colors::HOVERING),
@ -42,7 +42,7 @@ impl SpeedControls {
)
} else {
Button::rectangle_svg(
"assets/speed/pause.svg",
"../data/system/assets/speed/pause.svg",
"pause",
hotkey(Key::Space),
RewriteColor::ChangeAll(colors::HOVERING),
@ -65,7 +65,7 @@ impl SpeedControls {
.into_iter()
.map(|(s, label)| {
ManagedWidget::btn(Button::rectangle_svg_rewrite(
"assets/speed/triangle.svg",
"../data/system/assets/speed/triangle.svg",
label,
None,
if setting >= s {
@ -104,14 +104,14 @@ impl SpeedControls {
ctx,
)),
ManagedWidget::btn(Button::rectangle_svg(
"assets/speed/jump_to_time.svg",
"../data/system/assets/speed/jump_to_time.svg",
"jump to specific time",
hotkey(Key::B),
RewriteColor::ChangeAll(colors::HOVERING),
ctx,
)),
ManagedWidget::btn(Button::rectangle_svg(
"assets/speed/reset.svg",
"../data/system/assets/speed/reset.svg",
"reset to midnight",
hotkey(Key::X),
RewriteColor::ChangeAll(colors::HOVERING),
@ -416,9 +416,9 @@ impl TimePanel {
},
ManagedWidget::row(vec![
ManagedWidget::draw_text(ctx, Text::from(Line("00:00").size(12).roboto())),
ManagedWidget::draw_svg(ctx, "assets/speed/sunrise.svg"),
ManagedWidget::draw_svg(ctx, "../data/system/assets/speed/sunrise.svg"),
ManagedWidget::draw_text(ctx, Text::from(Line("12:00").size(12).roboto())),
ManagedWidget::draw_svg(ctx, "assets/speed/sunset.svg"),
ManagedWidget::draw_svg(ctx, "../data/system/assets/speed/sunset.svg"),
ManagedWidget::draw_text(ctx, Text::from(Line("24:00").size(12).roboto())),
])
.padding(10)

View File

@ -15,7 +15,6 @@ cp docs/INSTRUCTIONS.md $output
cp release/$runner $output
mkdir $output/game
cp $binary $output/game
cp -Rv game/assets $output/game
cp -Rv data $output/data
# TODO Github will double-zip this, but if we just pass the directory, then the

View File

@ -14,6 +14,3 @@ rand = "0.7.0"
rand_xorshift = "0.2.0"
serde = "1.0.98"
serde_derive = "1.0.98"
[lib]
crate-type = ["cdylib", "rlib"]