mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-11-28 12:12:00 +03:00
temporary workarounds for the hackathon, will revert later
This commit is contained in:
parent
10c291f7ed
commit
640fcae07e
@ -59,8 +59,8 @@ impl<'a> EventCtx<'a> {
|
||||
.insert(filename.to_string(), fallback);
|
||||
}
|
||||
|
||||
if textures.len() > 20 {
|
||||
panic!("Due to lovely hacks, only 20 textures supported");
|
||||
if textures.len() > 15 {
|
||||
panic!("Due to lovely hacks, only 15 textures supported");
|
||||
}
|
||||
timer.start_iter("upload textures", textures.len());
|
||||
for (idx, (filename, tex_type)) in textures.into_iter().enumerate() {
|
||||
|
@ -28,21 +28,16 @@ impl LaneEditor {
|
||||
pub fn setup(ctx: &EventCtx) -> LaneEditor {
|
||||
// TODO This won't handle resizing well
|
||||
let mut x1 = 0.5 * ctx.canvas.window_width;
|
||||
let mut make_brush =
|
||||
|icon: &str,
|
||||
let mut make_brush = |icon: &str,
|
||||
label: &str,
|
||||
key: Key,
|
||||
apply: Box<dyn Fn(&Map, LaneID) -> Result<Option<EditCmd>, String>>| {
|
||||
let btn = Button::icon_btn(
|
||||
&format!("assets/ui/edit_{}.png", icon),
|
||||
32.0,
|
||||
label,
|
||||
hotkey(key),
|
||||
ctx,
|
||||
)
|
||||
apply: Box<
|
||||
dyn Fn(&Map, LaneID) -> Result<Option<EditCmd>, String>,
|
||||
>| {
|
||||
let btn = Button::icon_btn("assets/ui/hamburger.png", 32.0, label, hotkey(key), ctx)
|
||||
.at(ScreenPt::new(x1, 0.0));
|
||||
let enabled_btn = Button::icon_btn_bg(
|
||||
&format!("assets/ui/edit_{}.png", icon),
|
||||
"assets/ui/hamburger.png",
|
||||
32.0,
|
||||
label,
|
||||
hotkey(key),
|
||||
|
@ -25,12 +25,12 @@ impl UI {
|
||||
let (primary, prebaked) = ctx.loading_screen("load map", |ctx, mut timer| {
|
||||
// Always load some small icons.
|
||||
let mut textures = vec![
|
||||
("assets/ui/edit_bike.png", TextureType::Stretch),
|
||||
/*("assets/ui/edit_bike.png", TextureType::Stretch),
|
||||
("assets/ui/edit_bus.png", TextureType::Stretch),
|
||||
("assets/ui/edit_construction.png", TextureType::Stretch),
|
||||
("assets/ui/edit_contraflow.png", TextureType::Stretch),
|
||||
("assets/ui/edit_driving.png", TextureType::Stretch),
|
||||
("assets/ui/edit_parking.png", TextureType::Stretch),
|
||||
("assets/ui/edit_parking.png", TextureType::Stretch),*/
|
||||
("assets/ui/hamburger.png", TextureType::Stretch),
|
||||
("assets/ui/hide.png", TextureType::Stretch),
|
||||
("assets/ui/info.png", TextureType::Stretch),
|
||||
|
@ -156,7 +156,8 @@ impl IntersectionSimState {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
unreachable!()
|
||||
return;
|
||||
//unreachable!()
|
||||
};
|
||||
|
||||
for req in protected {
|
||||
|
Loading…
Reference in New Issue
Block a user