This commit is contained in:
dabreegster 2022-03-04 13:53:40 +00:00
parent 8c77b8cd90
commit 12c7028d02
4 changed files with 74 additions and 74 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="The build time in RFC2822, UTC."><meta name="keywords" content="rust, rustlang, rust-lang, BUILT_TIME_UTC"><title>BUILT_TIME_UTC in map_gui::tools::title_screen::built_info - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../../storage.js"></script><script src="../../../../crates.js"></script><script defer src="../../../../main.js"></script>
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a class="sidebar-logo" href="../../../../map_gui/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.png" alt="logo"></div>
</a><div class="sidebar-elems"><h2 class="location">Other items in<br><a href="../../../index.html">map_gui</a>::<wbr><a href="../../index.html">tools</a>::<wbr><a href="../index.html">title_screen</a>::<wbr><a href="index.html">built_info</a></h2><div id="sidebar-vars" data-name="BUILT_TIME_UTC" data-ty="constant" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../map_gui/index.html"><img class="rust-logo" src="../../../../rust-logo.png" alt="logo"></a><nav class="sub"><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><h1 class="fqn"><span class="in-band">Constant <a href="../../../index.html">map_gui</a>::<wbr><a href="../../index.html">tools</a>::<wbr><a href="../index.html">title_screen</a>::<wbr><a href="index.html">built_info</a>::<wbr><a class="constant" href="#">BUILT_TIME_UTC</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../../../src/map_gui/home/runner/work/abstreet/abstreet/target/debug/build/map_gui-49fc0ec202264eb2/out/built.rs.html#78" title="goto source code">[src]</a></span></h1><div class="docblock item-decl"><pre class="rust const"><code>pub const BUILT_TIME_UTC: &amp;<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.str.html">str</a> = r&quot;Fri, 04 Mar 2022 09:49:57 +0000&quot;;</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The build time in RFC2822, UTC.</p>
</a><div class="sidebar-elems"><h2 class="location">Other items in<br><a href="../../../index.html">map_gui</a>::<wbr><a href="../../index.html">tools</a>::<wbr><a href="../index.html">title_screen</a>::<wbr><a href="index.html">built_info</a></h2><div id="sidebar-vars" data-name="BUILT_TIME_UTC" data-ty="constant" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../map_gui/index.html"><img class="rust-logo" src="../../../../rust-logo.png" alt="logo"></a><nav class="sub"><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><h1 class="fqn"><span class="in-band">Constant <a href="../../../index.html">map_gui</a>::<wbr><a href="../../index.html">tools</a>::<wbr><a href="../index.html">title_screen</a>::<wbr><a href="index.html">built_info</a>::<wbr><a class="constant" href="#">BUILT_TIME_UTC</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../../../../src/map_gui/home/runner/work/abstreet/abstreet/target/debug/build/map_gui-49fc0ec202264eb2/out/built.rs.html#78" title="goto source code">[src]</a></span></h1><div class="docblock item-decl"><pre class="rust const"><code>pub const BUILT_TIME_UTC: &amp;<a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.str.html">str</a> = r&quot;Fri, 04 Mar 2022 13:52:24 +0000&quot;;</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The build time in RFC2822, UTC.</p>
</div></details></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="map_gui" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.59.0 (9d1b2106e 2022-02-23)" ></div>
</body></html>

View File

@ -275,8 +275,7 @@
<span id="273">273</span>
<span id="274">274</span>
<span id="275">275</span>
</pre><pre class="rust"><code><span class="kw">use</span> <span class="ident">geom::ArrowCap</span>;
<span class="kw">use</span> <span class="ident">map_gui::tools</span>::{<span class="ident">percentage_bar</span>, <span class="ident">ColorNetwork</span>};
</pre><pre class="rust"><code><span class="kw">use</span> <span class="ident">map_gui::tools</span>::{<span class="ident">percentage_bar</span>, <span class="ident">ColorNetwork</span>};
<span class="kw">use</span> <span class="ident">map_model</span>::{<span class="ident">PathRequest</span>, <span class="ident">NORMAL_LANE_THICKNESS</span>};
<span class="kw">use</span> <span class="ident">widgetry::mapspace</span>::{<span class="ident">ToggleZoomed</span>, <span class="ident">World</span>};
<span class="kw">use</span> <span class="ident">widgetry</span>::{
@ -290,7 +289,8 @@
<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">BrowseRatRuns</span> {
<span class="ident">panel</span>: <span class="ident">Panel</span>,
<span class="ident">rat_runs</span>: <span class="ident">RatRuns</span>,
<span class="ident">current_idx</span>: <span class="ident">usize</span>,
<span class="comment">// When None, show the heatmap of all rat runs</span>
<span class="ident">current_idx</span>: <span class="prelude-ty">Option</span><span class="op">&lt;</span><span class="ident">usize</span><span class="op">&gt;</span>,
<span class="ident">draw_path</span>: <span class="ident">ToggleZoomed</span>,
<span class="ident">draw_heatmap</span>: <span class="ident">ToggleZoomed</span>,
@ -322,13 +322,12 @@
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">state</span> <span class="op">=</span> <span class="ident">BrowseRatRuns</span> {
<span class="ident">panel</span>: <span class="ident">Panel::empty</span>(<span class="ident">ctx</span>),
<span class="ident">rat_runs</span>,
<span class="ident">current_idx</span>: <span class="number">0</span>,
<span class="ident">current_idx</span>: <span class="prelude-val">None</span>,
<span class="ident">draw_path</span>: <span class="ident">ToggleZoomed::empty</span>(<span class="ident">ctx</span>),
<span class="ident">draw_heatmap</span>: <span class="ident">colorer</span>.<span class="ident">build</span>(<span class="ident">ctx</span>),
<span class="ident">neighborhood</span>,
<span class="ident">world</span>,
};
<span class="ident">state</span>.<span class="ident">recalculate</span>(<span class="ident">ctx</span>, <span class="ident">app</span>);
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">req</span>) <span class="op">=</span> <span class="ident">start_with_request</span> {
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">idx</span>) <span class="op">=</span> <span class="ident">state</span>
@ -337,15 +336,12 @@
.<span class="ident">iter</span>()
.<span class="ident">position</span>(<span class="op">|</span><span class="ident">path</span><span class="op">|</span> <span class="ident">path</span>.<span class="ident">get_req</span>() <span class="op">==</span> <span class="kw-2">&amp;</span><span class="ident">req</span>)
{
<span class="ident">state</span>.<span class="ident">current_idx</span> <span class="op">=</span> <span class="ident">idx</span>;
<span class="ident">state</span>
.<span class="ident">panel</span>
.<span class="ident">set_checked</span>(<span class="string">&quot;show heatmap of all rat-runs&quot;</span>, <span class="bool-val">false</span>);
<span class="comment">// We need to call recalculate twice -- we can&#39;t set the checkbox otherwise.</span>
<span class="ident">state</span>.<span class="ident">recalculate</span>(<span class="ident">ctx</span>, <span class="ident">app</span>);
<span class="ident">state</span>.<span class="ident">current_idx</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">idx</span>);
}
}
<span class="ident">state</span>.<span class="ident">recalculate</span>(<span class="ident">ctx</span>, <span class="ident">app</span>);
<span class="ident">Box::new</span>(<span class="ident">state</span>)
}
@ -376,39 +372,6 @@
<span class="ident">ctx</span>,
<span class="ident">app</span>,
<span class="ident">Widget::col</span>(<span class="macro">vec!</span>[
<span class="ident">Widget::row</span>(<span class="macro">vec!</span>[
<span class="string">&quot;Rat runs:&quot;</span>.<span class="ident">text_widget</span>(<span class="ident">ctx</span>).<span class="ident">centered_vert</span>(),
<span class="ident">ctx</span>.<span class="ident">style</span>()
.<span class="ident">btn_prev</span>()
.<span class="ident">disabled</span>(<span class="self">self</span>.<span class="ident">current_idx</span> <span class="op">==</span> <span class="number">0</span>)
.<span class="ident">hotkey</span>(<span class="ident">Key::LeftArrow</span>)
.<span class="ident">build_widget</span>(<span class="ident">ctx</span>, <span class="string">&quot;previous rat run&quot;</span>),
<span class="ident">Text::from</span>(
<span class="ident">Line</span>(<span class="macro">format!</span>(
<span class="string">&quot;{}/{}&quot;</span>,
<span class="self">self</span>.<span class="ident">current_idx</span> <span class="op">+</span> <span class="number">1</span>,
<span class="self">self</span>.<span class="ident">rat_runs</span>.<span class="ident">paths</span>.<span class="ident">len</span>()
))
.<span class="ident">secondary</span>(),
)
.<span class="ident">into_widget</span>(<span class="ident">ctx</span>)
.<span class="ident">centered_vert</span>(),
<span class="ident">ctx</span>.<span class="ident">style</span>()
.<span class="ident">btn_next</span>()
.<span class="ident">disabled</span>(<span class="self">self</span>.<span class="ident">current_idx</span> <span class="op">==</span> <span class="self">self</span>.<span class="ident">rat_runs</span>.<span class="ident">paths</span>.<span class="ident">len</span>() <span class="op">-</span> <span class="number">1</span>)
.<span class="ident">hotkey</span>(<span class="ident">Key::RightArrow</span>)
.<span class="ident">build_widget</span>(<span class="ident">ctx</span>, <span class="string">&quot;next rat run&quot;</span>),
]),
<span class="comment">// TODO This should disable the individual path controls, or maybe even be a different</span>
<span class="comment">// state entirely...</span>
<span class="ident">Toggle::checkbox</span>(
<span class="ident">ctx</span>,
<span class="string">&quot;show heatmap of all rat-runs&quot;</span>,
<span class="ident">Key::R</span>,
<span class="self">self</span>.<span class="ident">panel</span>
.<span class="ident">maybe_is_checked</span>(<span class="string">&quot;show heatmap of all rat-runs&quot;</span>)
.<span class="ident">unwrap_or</span>(<span class="bool-val">true</span>),
),
<span class="ident">percentage_bar</span>(
<span class="ident">ctx</span>,
<span class="ident">Text::from</span>(<span class="ident">Line</span>(<span class="macro">format!</span>(
@ -417,14 +380,49 @@
))),
(<span class="ident">quiet_streets</span> <span class="kw">as</span> <span class="ident">f64</span>) <span class="op">/</span> (<span class="ident">total_streets</span> <span class="kw">as</span> <span class="ident">f64</span>),
),
<span class="ident">Widget::row</span>(<span class="macro">vec!</span>[
<span class="string">&quot;Show rat-runs&quot;</span>.<span class="ident">text_widget</span>(<span class="ident">ctx</span>).<span class="ident">centered_vert</span>(),
<span class="ident">Toggle::choice</span>(
<span class="ident">ctx</span>,
<span class="string">&quot;show rat-runs&quot;</span>,
<span class="string">&quot;all (heatmap)&quot;</span>,
<span class="string">&quot;individually&quot;</span>,
<span class="ident">Key::R</span>,
<span class="self">self</span>.<span class="ident">current_idx</span>.<span class="ident">is_none</span>(),
),
]),
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">idx</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">current_idx</span> {
<span class="ident">Widget::row</span>(<span class="macro">vec!</span>[
<span class="ident">ctx</span>.<span class="ident">style</span>()
.<span class="ident">btn_prev</span>()
.<span class="ident">disabled</span>(<span class="ident">idx</span> <span class="op">==</span> <span class="number">0</span>)
.<span class="ident">hotkey</span>(<span class="ident">Key::LeftArrow</span>)
.<span class="ident">build_widget</span>(<span class="ident">ctx</span>, <span class="string">&quot;previous rat run&quot;</span>),
<span class="ident">Text::from</span>(
<span class="ident">Line</span>(<span class="macro">format!</span>(<span class="string">&quot;{}/{}&quot;</span>, <span class="ident">idx</span> <span class="op">+</span> <span class="number">1</span>, <span class="self">self</span>.<span class="ident">rat_runs</span>.<span class="ident">paths</span>.<span class="ident">len</span>()))
.<span class="ident">secondary</span>(),
)
.<span class="ident">into_widget</span>(<span class="ident">ctx</span>)
.<span class="ident">centered_vert</span>(),
<span class="ident">ctx</span>.<span class="ident">style</span>()
.<span class="ident">btn_next</span>()
.<span class="ident">disabled</span>(<span class="ident">idx</span> <span class="op">==</span> <span class="self">self</span>.<span class="ident">rat_runs</span>.<span class="ident">paths</span>.<span class="ident">len</span>() <span class="op">-</span> <span class="number">1</span>)
.<span class="ident">hotkey</span>(<span class="ident">Key::RightArrow</span>)
.<span class="ident">build_widget</span>(<span class="ident">ctx</span>, <span class="string">&quot;next rat run&quot;</span>),
])
} <span class="kw">else</span> {
<span class="ident">Widget::nothing</span>()
},
]),
)
.<span class="ident">build</span>(<span class="ident">ctx</span>);
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">draw_path</span> <span class="op">=</span> <span class="ident">ToggleZoomed::builder</span>();
<span class="kw">let</span> <span class="ident">color</span> <span class="op">=</span> <span class="ident">Color::RED</span>;
<span class="kw">let</span> <span class="ident">path</span> <span class="op">=</span> <span class="kw-2">&amp;</span><span class="self">self</span>.<span class="ident">rat_runs</span>.<span class="ident">paths</span>[<span class="self">self</span>.<span class="ident">current_idx</span>];
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">pl</span>) <span class="op">=</span> <span class="ident">path</span>.<span class="ident">trace</span>(<span class="kw-2">&amp;</span><span class="ident">app</span>.<span class="ident">map</span>) {
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">pl</span>) <span class="op">=</span> <span class="self">self</span>
.<span class="ident">current_idx</span>
.<span class="ident">and_then</span>(<span class="op">|</span><span class="ident">idx</span><span class="op">|</span> <span class="self">self</span>.<span class="ident">rat_runs</span>.<span class="ident">paths</span>[<span class="ident">idx</span>].<span class="ident">trace</span>(<span class="kw-2">&amp;</span><span class="ident">app</span>.<span class="ident">map</span>))
{
<span class="kw">let</span> <span class="ident">color</span> <span class="op">=</span> <span class="ident">Color::RED</span>;
<span class="kw">let</span> <span class="ident">shape</span> <span class="op">=</span> <span class="ident">pl</span>.<span class="ident">make_polygons</span>(<span class="number">3.0</span> <span class="op">*</span> <span class="ident">NORMAL_LANE_THICKNESS</span>);
<span class="ident">draw_path</span>.<span class="ident">unzoomed</span>.<span class="ident">push</span>(<span class="ident">color</span>.<span class="ident">alpha</span>(<span class="number">0.8</span>), <span class="ident">shape</span>.<span class="ident">clone</span>());
<span class="ident">draw_path</span>.<span class="ident">zoomed</span>.<span class="ident">push</span>(<span class="ident">color</span>.<span class="ident">alpha</span>(<span class="number">0.5</span>), <span class="ident">shape</span>);
@ -449,18 +447,18 @@
<span class="kw">impl</span> <span class="ident">State</span><span class="op">&lt;</span><span class="ident">App</span><span class="op">&gt;</span> <span class="kw">for</span> <span class="ident">BrowseRatRuns</span> {
<span class="kw">fn</span> <span class="ident">event</span>(<span class="kw-2">&amp;mut</span> <span class="self">self</span>, <span class="ident">ctx</span>: <span class="kw-2">&amp;mut</span> <span class="ident">EventCtx</span>, <span class="ident">app</span>: <span class="kw-2">&amp;mut</span> <span class="ident">App</span>) -&gt; <span class="ident">Transition</span> {
<span class="kw">if</span> <span class="kw">let</span> <span class="ident">Outcome::Clicked</span>(<span class="ident">x</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">panel</span>.<span class="ident">event</span>(<span class="ident">ctx</span>) {
<span class="kw">match</span> <span class="ident">x</span>.<span class="ident">as_ref</span>() {
<span class="kw">match</span> <span class="self">self</span>.<span class="ident">panel</span>.<span class="ident">event</span>(<span class="ident">ctx</span>) {
<span class="ident">Outcome::Clicked</span>(<span class="ident">x</span>) =&gt; <span class="kw">match</span> <span class="ident">x</span>.<span class="ident">as_ref</span>() {
<span class="string">&quot;previous rat run&quot;</span> =&gt; {
<span class="self">self</span>.<span class="ident">current_idx</span> <span class="op">-</span><span class="op">=</span> <span class="number">1</span>;
<span class="self">self</span>.<span class="ident">panel</span>
.<span class="ident">set_checked</span>(<span class="string">&quot;show heatmap of all rat-runs&quot;</span>, <span class="bool-val">false</span>);
<span class="kw">for</span> <span class="ident">idx</span> <span class="kw">in</span> <span class="kw-2">&amp;mut</span> <span class="self">self</span>.<span class="ident">current_idx</span> {
<span class="kw-2">*</span><span class="ident">idx</span> <span class="op">-</span><span class="op">=</span> <span class="number">1</span>;
}
<span class="self">self</span>.<span class="ident">recalculate</span>(<span class="ident">ctx</span>, <span class="ident">app</span>);
}
<span class="string">&quot;next rat run&quot;</span> =&gt; {
<span class="self">self</span>.<span class="ident">current_idx</span> <span class="op">+</span><span class="op">=</span> <span class="number">1</span>;
<span class="self">self</span>.<span class="ident">panel</span>
.<span class="ident">set_checked</span>(<span class="string">&quot;show heatmap of all rat-runs&quot;</span>, <span class="bool-val">false</span>);
<span class="kw">for</span> <span class="ident">idx</span> <span class="kw">in</span> <span class="kw-2">&amp;mut</span> <span class="self">self</span>.<span class="ident">current_idx</span> {
<span class="kw-2">*</span><span class="ident">idx</span> <span class="op">+</span><span class="op">=</span> <span class="number">1</span>;
}
<span class="self">self</span>.<span class="ident">recalculate</span>(<span class="ident">ctx</span>, <span class="ident">app</span>);
}
<span class="ident">x</span> =&gt; {
@ -468,7 +466,16 @@
.<span class="ident">handle_action</span>(<span class="ident">ctx</span>, <span class="ident">app</span>, <span class="ident">x</span>, <span class="self">self</span>.<span class="ident">neighborhood</span>.<span class="ident">id</span>)
.<span class="ident">unwrap</span>();
}
},
<span class="ident">Outcome::Changed</span>(<span class="kw">_</span>) =&gt; {
<span class="kw">if</span> <span class="self">self</span>.<span class="ident">panel</span>.<span class="ident">is_checked</span>(<span class="string">&quot;show rat-runs&quot;</span>) {
<span class="self">self</span>.<span class="ident">current_idx</span> <span class="op">=</span> <span class="prelude-val">None</span>;
} <span class="kw">else</span> {
<span class="self">self</span>.<span class="ident">current_idx</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="number">0</span>);
}
<span class="self">self</span>.<span class="ident">recalculate</span>(<span class="ident">ctx</span>, <span class="ident">app</span>);
}
<span class="kw">_</span> =&gt; {}
}
<span class="comment">// TODO Bit weird to allow this while showing individual paths, since we don&#39;t draw the</span>
@ -476,12 +483,9 @@
<span class="kw">let</span> <span class="ident">world_outcome</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">world</span>.<span class="ident">event</span>(<span class="ident">ctx</span>);
<span class="kw">if</span> <span class="ident"><span class="kw">crate</span>::per_neighborhood::handle_world_outcome</span>(<span class="ident">ctx</span>, <span class="ident">app</span>, <span class="ident">world_outcome</span>) {
<span class="comment">// Reset state, but if possible, preserve the current individual rat run.</span>
<span class="kw">let</span> <span class="ident">current_request</span> <span class="op">=</span> <span class="kw">if</span> <span class="self">self</span>.<span class="ident">current_idx</span> <span class="op">==</span> <span class="number">0</span> {
<span class="prelude-val">None</span>
} <span class="kw">else</span> {
<span class="comment">// TODO Off-by-one? Or we just have no way to show the 0th path?</span>
<span class="prelude-val">Some</span>(<span class="self">self</span>.<span class="ident">rat_runs</span>.<span class="ident">paths</span>[<span class="self">self</span>.<span class="ident">current_idx</span>].<span class="ident">get_req</span>().<span class="ident">clone</span>())
};
<span class="kw">let</span> <span class="ident">current_request</span> <span class="op">=</span> <span class="self">self</span>
.<span class="ident">current_idx</span>
.<span class="ident">map</span>(<span class="op">|</span><span class="ident">idx</span><span class="op">|</span> <span class="self">self</span>.<span class="ident">rat_runs</span>.<span class="ident">paths</span>[<span class="ident">idx</span>].<span class="ident">get_req</span>().<span class="ident">clone</span>());
<span class="kw">return</span> <span class="ident">Transition::Replace</span>(<span class="ident">BrowseRatRuns::new_state</span>(
<span class="ident">ctx</span>,
<span class="ident">app</span>,
@ -496,15 +500,11 @@
<span class="kw">fn</span> <span class="ident">draw</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">g</span>: <span class="kw-2">&amp;mut</span> <span class="ident">GfxCtx</span>, <span class="ident">app</span>: <span class="kw-2">&amp;</span><span class="ident">App</span>) {
<span class="self">self</span>.<span class="ident">panel</span>.<span class="ident">draw</span>(<span class="ident">g</span>);
<span class="kw">if</span> <span class="self">self</span>
.<span class="ident">panel</span>
.<span class="ident">maybe_is_checked</span>(<span class="string">&quot;show heatmap of all rat-runs&quot;</span>)
.<span class="ident">unwrap_or</span>(<span class="bool-val">false</span>)
{
<span class="kw">if</span> <span class="self">self</span>.<span class="ident">current_idx</span>.<span class="ident">is_some</span>() {
<span class="self">self</span>.<span class="ident">draw_path</span>.<span class="ident">draw</span>(<span class="ident">g</span>);
} <span class="kw">else</span> {
<span class="self">self</span>.<span class="ident">draw_heatmap</span>.<span class="ident">draw</span>(<span class="ident">g</span>);
<span class="self">self</span>.<span class="ident">world</span>.<span class="ident">draw</span>(<span class="ident">g</span>);
} <span class="kw">else</span> {
<span class="self">self</span>.<span class="ident">draw_path</span>.<span class="ident">draw</span>(<span class="ident">g</span>);
}
<span class="ident">g</span>.<span class="ident">redraw</span>(<span class="kw-2">&amp;</span><span class="self">self</span>.<span class="ident">neighborhood</span>.<span class="ident">fade_irrelevant</span>);

View File

@ -176,7 +176,7 @@
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">RUSTDOC_VERSION</span>: <span class="kw-2">&amp;</span><span class="ident">str</span> <span class="op">=</span> <span class="string">r&quot;rustdoc 1.59.0 (9d1b2106e 2022-02-23)&quot;</span>;
<span class="attribute">#[<span class="ident">doc</span><span class="op">=</span><span class="string">r#&quot;The build time in RFC2822, UTC.&quot;#</span>]</span>
<span class="attribute">#[<span class="ident">allow</span>(<span class="ident">dead_code</span>)]</span>
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">BUILT_TIME_UTC</span>: <span class="kw-2">&amp;</span><span class="ident">str</span> <span class="op">=</span> <span class="string">r&quot;Fri, 04 Mar 2022 09:49:57 +0000&quot;</span>;
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">BUILT_TIME_UTC</span>: <span class="kw-2">&amp;</span><span class="ident">str</span> <span class="op">=</span> <span class="string">r&quot;Fri, 04 Mar 2022 13:52:24 +0000&quot;</span>;
<span class="attribute">#[<span class="ident">doc</span><span class="op">=</span><span class="string">r#&quot;The target architecture, given by `CARGO_CFG_TARGET_ARCH`.&quot;#</span>]</span>
<span class="attribute">#[<span class="ident">allow</span>(<span class="ident">dead_code</span>)]</span>
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">CFG_TARGET_ARCH</span>: <span class="kw-2">&amp;</span><span class="ident">str</span> <span class="op">=</span> <span class="string">r&quot;x86_64&quot;</span>;