diff --git a/print.html b/print.html index 97e4e8868c..0ad053f96e 100644 --- a/print.html +++ b/print.html @@ -3113,6 +3113,17 @@ changes here.

  • fixed last bugs for left-handed driving, should work just as well now
  • lots of graphics experiments from the hackathon, not merged yet
  • +

    0.2.12

    +

    References

    Example use cases

    +

    0.2.12

    + diff --git a/rustdoc/game/all.html b/rustdoc/game/all.html index 1b2605a3cf..8a755a7d8c 100644 --- a/rustdoc/game/all.html +++ b/rustdoc/game/all.html @@ -1,3 +1,3 @@ List of all items in this crate

    [] - List of all items

    Structs

    Enums

    Traits

    Functions

    Typedefs

    Constants

    \ No newline at end of file + List of all items

    Structs

    Enums

    Traits

    Functions

    Typedefs

    Constants

    \ No newline at end of file diff --git a/rustdoc/game/colors/enum.ColorSchemeChoice.html b/rustdoc/game/colors/enum.ColorSchemeChoice.html index de5ed928ff..1baadca4c6 100644 --- a/rustdoc/game/colors/enum.ColorSchemeChoice.html +++ b/rustdoc/game/colors/enum.ColorSchemeChoice.html @@ -1,4 +1,4 @@ -game::colors::ColorSchemeChoice - Rust

    [][src]Enum game::colors::ColorSchemeChoice

    pub enum ColorSchemeChoice {
    +game::colors::ColorSchemeChoice - Rust

    [][src]Enum game::colors::ColorSchemeChoice

    pub enum ColorSchemeChoice {
         Standard,
         NightMode,
         SAMGreenDay,
    @@ -9,12 +9,12 @@
         Textured,
     }

    Variants

    -
    Standard
    NightMode
    SAMGreenDay
    SAMDesertDay
    BAP
    OSM
    Starcat
    Textured

    Implementations

    impl ColorSchemeChoice[src]

    pub fn choices() -> Vec<Choice<ColorSchemeChoice>>[src]

    Trait Implementations

    impl Clone for ColorSchemeChoice[src]

     mod app;
     mod challenges;
    @@ -276,6 +277,7 @@
         if let Some(s) = args.optional_parse("--scale_factor", |s| s.parse::<f64>()) {
             settings.scale_factor(s);
         }
    +    settings.loading_tips(helpers::loading_tips());
     
         let mut mode = None;
         if let Some(x) = args.optional("--challenge") {
    diff --git a/rustdoc/src/widgetry/event_ctx.rs.html b/rustdoc/src/widgetry/event_ctx.rs.html
    index 8294baef14..2c73b9f82e 100644
    --- a/rustdoc/src/widgetry/event_ctx.rs.html
    +++ b/rustdoc/src/widgetry/event_ctx.rs.html
    @@ -204,13 +204,61 @@
     204
     205
     206
    +207
    +208
    +209
    +210
    +211
    +212
    +213
    +214
    +215
    +216
    +217
    +218
    +219
    +220
    +221
    +222
    +223
    +224
    +225
    +226
    +227
    +228
    +229
    +230
    +231
    +232
    +233
    +234
    +235
    +236
    +237
    +238
    +239
    +240
    +241
    +242
    +243
    +244
    +245
    +246
    +247
    +248
    +249
    +250
    +251
    +252
    +253
    +254
     
     use crate::{
    -    svg, text, Canvas, Color, Drawable, Event, GeomBatch, GfxCtx, Line, Prerender, ScreenDims,
    -    ScreenPt, Style, Text, UserInput,
    +    svg, text, Canvas, Color, Drawable, Event, GeomBatch, GfxCtx, HorizontalAlignment, Line, Panel,
    +    Prerender, ScreenDims, Style, Text, UserInput, VerticalAlignment, Widget,
     };
     use abstutil::{elapsed_seconds, Timer, TimerSink};
    -use geom::Polygon;
    +use geom::{Percent, Polygon};
     use instant::Instant;
     use std::collections::VecDeque;
     
    @@ -248,6 +296,7 @@
                 &timer_name,
                 Box::new(LoadingScreen::new(
                     self.prerender,
    +                self.style.clone(),
                     self.canvas.get_window_dims(),
                     timer_name.clone(),
                 )),
    @@ -347,6 +396,7 @@
     impl<'a> LoadingScreen<'a> {
         pub fn new(
             prerender: &'a Prerender,
    +        style: Style,
             initial_size: ScreenDims,
             title: String,
         ) -> LoadingScreen<'a> {
    @@ -361,7 +411,7 @@
                 last_drawn: Instant::now(),
                 title,
                 canvas,
    -            style: Style::standard(),
    +            style,
             }
         }
     
    @@ -371,26 +421,72 @@
                 return;
             }
             self.last_drawn = Instant::now();
    +        let mut ctx = EventCtx {
    +            fake_mouseover: true,
    +            input: UserInput::new(Event::NoOp, &self.canvas),
    +            canvas: &mut self.canvas,
    +            prerender: self.prerender,
    +            style: &mut self.style,
    +            updates_requested: vec![],
    +        };
     
             let mut txt = Text::from(Line(&self.title).small_heading());
             for l in &self.lines {
                 txt.add(Line(l));
             }
    +        let border = Color::hex("#F4DA22");
    +        let panel = Panel::new(Widget::row(vec![
    +            Widget::custom_col(vec![
    +                Widget::draw_batch(
    +                    &ctx,
    +                    GeomBatch::load_svg(ctx.prerender, "system/assets/map/dont_walk.svg")
    +                        .scale(5.0),
    +                )
    +                .container()
    +                .bg(Color::BLACK)
    +                .padding(15)
    +                .outline(5.0, border)
    +                .centered_horiz()
    +                .margin_below(5),
    +                Widget::draw_batch(
    +                    &ctx,
    +                    GeomBatch::from(vec![(Color::grey(0.5), Polygon::rectangle(10.0, 30.0))]),
    +                )
    +                .centered_horiz(),
    +                ctx.style
    +                    .loading_tips
    +                    .clone()
    +                    .wrap_to_pct(&ctx, 25)
    +                    .draw(&ctx)
    +                    .container()
    +                    .bg(Color::BLACK)
    +                    .padding(15)
    +                    .outline(5.0, Color::YELLOW)
    +                    .force_width_pct(&ctx, Percent::int(30))
    +                    .margin_below(5),
    +                Widget::draw_batch(
    +                    &ctx,
    +                    GeomBatch::from(vec![(Color::grey(0.5), Polygon::rectangle(10.0, 100.0))]),
    +                )
    +                .centered_horiz(),
    +            ])
    +            .centered_vert(),
    +            Widget::draw_batch(
    +                &ctx,
    +                txt.inner_render(&ctx.prerender.assets, svg::LOW_QUALITY),
    +            )
    +            .container()
    +            .fill_width()
    +            .padding(16)
    +            .bg(text::BG_COLOR),
    +        ]))
    +        .exact_size_percent(80, 80)
    +        .aligned(HorizontalAlignment::Center, VerticalAlignment::Center)
    +        .build_custom(&mut ctx);
     
             let mut g = GfxCtx::new(self.prerender, &self.canvas, &self.style, false);
             g.clear(Color::BLACK);
    -
    -        let mut batch = GeomBatch::from(vec![(
    -            text::BG_COLOR,
    -            Polygon::rectangle(0.8 * g.canvas.window_width, 0.8 * g.canvas.window_height),
    -        )]);
    -        batch.append(txt.inner_render(&g.prerender.assets, svg::LOW_QUALITY));
    -        let draw = g.upload(batch);
    -        g.redraw_at(
    -            ScreenPt::new(0.1 * g.canvas.window_width, 0.1 * g.canvas.window_height),
    -            &draw,
    -        );
    -
    +        panel.draw(&mut g);
             g.prerender.inner.draw_finished(g.inner);
         }
     }
    diff --git a/rustdoc/src/widgetry/runner.rs.html b/rustdoc/src/widgetry/runner.rs.html
    index c421d494a8..a794b1aafe 100644
    --- a/rustdoc/src/widgetry/runner.rs.html
    +++ b/rustdoc/src/widgetry/runner.rs.html
    @@ -333,10 +333,17 @@
     333
     334
     335
    +336
    +337
    +338
    +339
    +340
    +341
    +342
     
     use crate::assets::Assets;
     use crate::tools::screenshot::screenshot_everything;
    -use crate::{Canvas, Event, EventCtx, GfxCtx, Key, Prerender, Style, UpdateType, UserInput};
    +use crate::{Canvas, Event, EventCtx, GfxCtx, Key, Prerender, Style, Text, UpdateType, UserInput};
     use geom::Duration;
     use image::{GenericImageView, Pixel};
     use instant::Instant;
    @@ -496,6 +503,7 @@
         dump_raw_events: bool,
         scale_factor: Option<f64>,
         window_icon: Option<String>,
    +    loading_tips: Option<Text>,
     }
     
     impl Settings {
    @@ -506,6 +514,7 @@
                 dump_raw_events: false,
                 scale_factor: None,
                 window_icon: None,
    +            loading_tips: None,
             }
         }
     
    @@ -526,6 +535,10 @@
         pub fn window_icon(&mut self, path: String) {
             self.window_icon = Some(path);
         }
    +
    +    pub fn loading_tips(&mut self, txt: Text) {
    +        self.loading_tips = Some(txt);
    +    }
     }
     
     pub fn run<G: 'static + GUI, F: FnOnce(&mut EventCtx) -> G>(settings: Settings, make_gui: F) -> ! {
    @@ -552,6 +565,7 @@
             scale_factor: RefCell::new(settings.scale_factor.unwrap_or(monitor_scale_factor)),
         };
         let mut style = Style::standard();
    +    style.loading_tips = settings.loading_tips.unwrap_or_else(Text::new);
     
         let initial_size = prerender.window_size();
         let mut canvas = Canvas::new(initial_size);
    diff --git a/rustdoc/src/widgetry/style.rs.html b/rustdoc/src/widgetry/style.rs.html
    index 6e333759c0..a892e6b31f 100644
    --- a/rustdoc/src/widgetry/style.rs.html
    +++ b/rustdoc/src/widgetry/style.rs.html
    @@ -20,8 +20,10 @@
     20
     21
     22
    +23
    +24
     
    -use crate::Color;
    +use crate::{Color, Text};
     
     #[derive(Clone)]
     pub struct Style {
    @@ -30,6 +32,7 @@
         pub panel_bg: Color,
         pub hotkey_color: Color,
         pub hovering_color: Color,
    +    pub loading_tips: Text,
     }
     
     impl Style {
    @@ -40,6 +43,7 @@
                 panel_bg: Color::grey(0.4),
                 hotkey_color: Color::GREEN,
                 hovering_color: Color::ORANGE,
    +            loading_tips: Text::new(),
             }
         }
     }
    diff --git a/rustdoc/src/widgetry/widgets/mod.rs.html b/rustdoc/src/widgetry/widgets/mod.rs.html
    index 0a026ae4ff..f10d51e1cd 100644
    --- a/rustdoc/src/widgetry/widgets/mod.rs.html
    +++ b/rustdoc/src/widgetry/widgets/mod.rs.html
    @@ -675,6 +675,10 @@
     675
     676
     677
    +678
    +679
    +680
    +681
     
     pub mod autocomplete;
     pub mod button;
    @@ -813,6 +817,10 @@
             self
         }
     
    +    pub fn fill_width(mut self) -> Widget {
    +        self.layout.style.size.width = Dimension::Percent(1.0);
    +        self
    +    }
         pub fn fill_height(mut self) -> Widget {
             self.layout.style.size.height = Dimension::Percent(1.0);
             self
    diff --git a/rustdoc/widgetry/event_ctx/index.html b/rustdoc/widgetry/event_ctx/index.html
    index 9a5122b9e8..141963250e 100644
    --- a/rustdoc/widgetry/event_ctx/index.html
    +++ b/rustdoc/widgetry/event_ctx/index.html
    @@ -1,3 +1,3 @@
    -widgetry::event_ctx - Rust

    [][src]Module widgetry::event_ctx

    Structs

    +widgetry::event_ctx - Rust

    [][src]Module widgetry::event_ctx

    Structs

    EventCtx
    LoadingScreen

    Enums

    UpdateType
    \ No newline at end of file diff --git a/rustdoc/widgetry/event_ctx/struct.EventCtx.html b/rustdoc/widgetry/event_ctx/struct.EventCtx.html index 48dcfb5578..5d5c6a5479 100644 --- a/rustdoc/widgetry/event_ctx/struct.EventCtx.html +++ b/rustdoc/widgetry/event_ctx/struct.EventCtx.html @@ -6,7 +6,7 @@ pub(crate) style: &'a mut Style, pub(crate) updates_requested: Vec<UpdateType>, }

    - Fields

    fake_mouseover: boolinput: UserInputcanvas: &'a mut Canvasprerender: &'a Prerenderstyle: &'a mut Styleupdates_requested: Vec<UpdateType>

    Implementations

    impl<'a> EventCtx<'a>[src]

    pub fn loading_screen<O, S: Into<String>, F: FnOnce(&mut EventCtx, &mut Timer) -> O>(
        &mut self,
        raw_timer_name: S,
        f: F
    ) -> O
    [src]

    pub fn request_update(&mut self, update_type: UpdateType)[src]

    pub fn canvas_movement(&mut self)[src]

    pub fn no_op_event<O, F: FnMut(&mut EventCtx) -> O>(
        &mut self,
        fake_mouseover: bool,
        cb: F
    ) -> O
    [src]

    pub fn redo_mouseover(&self) -> bool[src]

    pub fn normal_left_click(&mut self) -> bool[src]

    fn is_dragging(&self) -> bool[src]

    pub fn default_line_height(&self) -> f64[src]

    pub fn upload(&self, batch: GeomBatch) -> Drawable[src]

    pub(crate) fn cursor_clickable(&mut self)[src]

    pub fn style(&self) -> &Style[src]

    pub fn set_style(&mut self, style: Style)[src]

    Auto Trait Implementations

    impl<'a> !RefUnwindSafe for EventCtx<'a>

    impl<'a> !Send for EventCtx<'a>

    impl<'a> !Sync for EventCtx<'a>

    impl<'a> Unpin for EventCtx<'a>

    impl<'a> !UnwindSafe for EventCtx<'a>

    Blanket Implementations

    impl<T> Any for T where
        T: 'static + ?Sized
    [src]