From 060c1e141ad6e3a4ebac2dbc0e0b64b9af1070a1 Mon Sep 17 00:00:00 2001 From: dabreegster Date: Sun, 4 Apr 2021 17:17:18 +0000 Subject: [PATCH] deploy: b8318917a83997a213857417d0e7df44fd16fcb9 --- .../built_info/constant.BUILT_TIME_UTC.html | 2 +- rustdoc/map_gui/tools/command/index.html | 2 +- .../tools/command/struct.RunCommand.html | 9 +++--- rustdoc/search-index.js | 4 +-- rustdoc/src/convert_osm/elevation.rs.html | 6 ++-- .../game-e51c0a1cdd4549fe/out/built.rs.html | 2 +- rustdoc/src/map_gui/tools/command.rs.html | 32 ++++++++++++------- 7 files changed, 34 insertions(+), 23 deletions(-) diff --git a/rustdoc/game/pregame/built_info/constant.BUILT_TIME_UTC.html b/rustdoc/game/pregame/built_info/constant.BUILT_TIME_UTC.html index 4f61e7c893..13d974c0dc 100644 --- a/rustdoc/game/pregame/built_info/constant.BUILT_TIME_UTC.html +++ b/rustdoc/game/pregame/built_info/constant.BUILT_TIME_UTC.html @@ -1,6 +1,6 @@ game::pregame::built_info::BUILT_TIME_UTC - Rust

Constant game::pregame::built_info::BUILT_TIME_UTC[][src]

pub const BUILT_TIME_UTC: &str = "Sat, 03 Apr 2021 18:35:49 +0000";

The built-time in RFC2822, UTC

+ Change settings

Constant game::pregame::built_info::BUILT_TIME_UTC[][src]

pub const BUILT_TIME_UTC: &str = "Sun, 04 Apr 2021 17:14:31 +0000";

The built-time in RFC2822, UTC

\ No newline at end of file diff --git a/rustdoc/map_gui/tools/command/index.html b/rustdoc/map_gui/tools/command/index.html index 11d4ccce18..ff46a8148a 100644 --- a/rustdoc/map_gui/tools/command/index.html +++ b/rustdoc/map_gui/tools/command/index.html @@ -1,7 +1,7 @@ map_gui::tools::command - Rust

Module map_gui::tools::command[][src]

Structs

+ Change settings

Module map_gui::tools::command[][src]

Structs

RunCommand

Executes a command and displays STDOUT and STDERR in a loading screen window. Only works on native, of course.

diff --git a/rustdoc/map_gui/tools/command/struct.RunCommand.html b/rustdoc/map_gui/tools/command/struct.RunCommand.html index b0d7ecfd07..ca19b19a1b 100644 --- a/rustdoc/map_gui/tools/command/struct.RunCommand.html +++ b/rustdoc/map_gui/tools/command/struct.RunCommand.html @@ -1,19 +1,20 @@ map_gui::tools::command::RunCommand - Rust -

Struct map_gui::tools::command::RunCommand[][src]

pub struct RunCommand<A: AppLike> {
+

Struct map_gui::tools::command::RunCommand[][src]

pub struct RunCommand<A: AppLike> {
     p: Popen,
     comm: Option<Communicator>,
     panel: Panel,
     lines: VecDeque<String>,
     max_capacity: usize,
     started: Instant,
+    last_drawn: Instant,
     on_load: Option<Box<dyn FnOnce(&mut EventCtx<'_>, &mut A, bool, Vec<String>) -> Transition<A>>>,
 }

Executes a command and displays STDOUT and STDERR in a loading screen window. Only works on native, of course.

- Fields

p: Popencomm: Option<Communicator>panel: Panellines: VecDeque<String>max_capacity: usizestarted: Instanton_load: Option<Box<dyn FnOnce(&mut EventCtx<'_>, &mut A, bool, Vec<String>) -> Transition<A>>>

Implementations

impl<A: AppLike + 'static> RunCommand<A>[src]

pub fn new(
    ctx: &mut EventCtx<'_>,
    _: &A,
    args: Vec<String>,
    on_load: Box<dyn FnOnce(&mut EventCtx<'_>, &mut A, bool, Vec<String>) -> Transition<A>>
) -> Box<dyn State<A>>
[src]

fn read_output(&mut self)[src]

Trait Implementations

impl<A: AppLike + 'static> State<A> for RunCommand<A>[src]

 use std::collections::VecDeque;
 use std::time::Duration;
@@ -183,6 +188,7 @@
     lines: VecDeque<String>,
     max_capacity: usize,
     started: Instant,
+    last_drawn: Instant,
     // Wrapped in an Option just to make calling from event() work. The bool is success, and the
     // strings are the last lines of output.
     on_load: Option<Box<dyn FnOnce(&mut EventCtx, &mut A, bool, Vec<String>) -> Transition<A>>>,
@@ -219,6 +225,7 @@
                     lines: VecDeque::new(),
                     max_capacity,
                     started: Instant::now(),
+                    last_drawn: Instant::now(),
                     on_load: Some(on_load),
                 })
             }
@@ -275,18 +282,21 @@
 
         self.read_output();
 
-        // Throttle rerendering?
-        let mut txt = Text::from(
-            Line(format!(
-                "Running command... {} so far",
-                geom::Duration::realtime_elapsed(self.started)
-            ))
-            .small_heading(),
-        );
-        for line in &self.lines {
-            txt.add_line(line);
+        // Throttle rerendering
+        if abstutil::elapsed_seconds(self.last_drawn) > 0.1 {
+            let mut txt = Text::from(
+                Line(format!(
+                    "Running command... {} so far",
+                    geom::Duration::realtime_elapsed(self.started)
+                ))
+                .small_heading(),
+            );
+            for line in &self.lines {
+                txt.add_line(line);
+            }
+            self.panel = ctx.make_loading_screen(txt);
+            self.last_drawn = Instant::now();
         }
-        self.panel = ctx.make_loading_screen(txt);
 
         if let Some(status) = self.p.poll() {
             // Make sure to grab all remaining output.