mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-11-24 01:15:12 +03:00
deploy: 0320b2be89
This commit is contained in:
parent
ec693d9f2e
commit
a3b6f2e5a3
File diff suppressed because one or more lines are too long
@ -80,9 +80,9 @@ call this to handle all other events. <a href="#method.other_event">Read more</a
|
||||
</div><h4 id="method.draw-60" class="method hidden"><code>fn <a href="#method.draw" class="fnname">draw</a>(&self, g: &mut GfxCtx<'_>, _: &<a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>)</code><a class="srclink" href="../../src/game/edit/traffic_signals/offsets.rs.html#303-305" title="goto source code">[src]</a></h4><h4 id="method.panel_changed-6" class="method hidden"><code>pub fn <a href="#method.panel_changed" class="fnname">panel_changed</a>(<br> &mut self, <br> &mut EventCtx<'_>, <br> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>A, <br> &Panel<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transition<A>></code></h4><div class='docblock hidden'><p>Called when something on the panel has changed. If a transition is returned, stop handling
|
||||
the event and immediately apply the transition. <a href="#method.panel_changed">Read more</a></p>
|
||||
</div><h4 id="method.on_mouseover-5" class="method hidden"><code>pub fn <a href="#method.on_mouseover" class="fnname">on_mouseover</a>(&mut self, &mut EventCtx<'_>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>A)</code></h4><div class='docblock hidden'><p>Called when the mouse has moved.</p>
|
||||
</div><h4 id="method.draw_baselayer-59" class="method hidden"><code>pub fn <a href="#method.draw_baselayer" class="fnname">draw_baselayer</a>(&self) -> DrawBaselayer</code></h4></div><h3 id="impl-SimpleState%3CApp%3E-6" class="impl"><code class="in-band">impl SimpleState<<a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>> for <a class="struct" href="../../game/sandbox/gameplay/actdev/struct.About.html" title="struct game::sandbox::gameplay::actdev::About">About</a></code><a href="#impl-SimpleState%3CApp%3E-6" class="anchor"></a><a class="srclink" href="../../src/game/sandbox/gameplay/actdev.rs.html#181-194" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.on_click-6" class="method hidden"><code>fn <a href="#method.on_click" class="fnname">on_click</a>(<br> &mut self, <br> _: &mut EventCtx<'_>, <br> _: &mut <a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>, <br> x: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, <br> _: &Panel<br>) -> Transition<<a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>></code><a class="srclink" href="../../src/game/sandbox/gameplay/actdev.rs.html#182-189" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Called when something on the panel has been clicked. Since the action is just a string,
|
||||
</div><h4 id="method.draw_baselayer-59" class="method hidden"><code>pub fn <a href="#method.draw_baselayer" class="fnname">draw_baselayer</a>(&self) -> DrawBaselayer</code></h4></div><h3 id="impl-SimpleState%3CApp%3E-6" class="impl"><code class="in-band">impl SimpleState<<a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>> for <a class="struct" href="../../game/sandbox/gameplay/actdev/struct.About.html" title="struct game::sandbox::gameplay::actdev::About">About</a></code><a href="#impl-SimpleState%3CApp%3E-6" class="anchor"></a><a class="srclink" href="../../src/game/sandbox/gameplay/actdev.rs.html#199-212" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.on_click-6" class="method hidden"><code>fn <a href="#method.on_click" class="fnname">on_click</a>(<br> &mut self, <br> _: &mut EventCtx<'_>, <br> _: &mut <a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>, <br> x: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, <br> _: &Panel<br>) -> Transition<<a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>></code><a class="srclink" href="../../src/game/sandbox/gameplay/actdev.rs.html#200-207" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Called when something on the panel has been clicked. Since the action is just a string,
|
||||
the fallback case can just use <code>unreachable!()</code>. <a href="#tymethod.on_click">Read more</a></p>
|
||||
</div><h4 id="method.draw-61" class="method hidden"><code>fn <a href="#method.draw" class="fnname">draw</a>(&self, g: &mut GfxCtx<'_>, app: &<a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>)</code><a class="srclink" href="../../src/game/sandbox/gameplay/actdev.rs.html#191-193" title="goto source code">[src]</a></h4><h4 id="method.panel_changed-7" class="method hidden"><code>pub fn <a href="#method.panel_changed" class="fnname">panel_changed</a>(<br> &mut self, <br> &mut EventCtx<'_>, <br> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>A, <br> &Panel<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transition<A>></code></h4><div class='docblock hidden'><p>Called when something on the panel has changed. If a transition is returned, stop handling
|
||||
</div><h4 id="method.draw-61" class="method hidden"><code>fn <a href="#method.draw" class="fnname">draw</a>(&self, g: &mut GfxCtx<'_>, app: &<a class="struct" href="../../game/app/struct.App.html" title="struct game::app::App">App</a>)</code><a class="srclink" href="../../src/game/sandbox/gameplay/actdev.rs.html#209-211" title="goto source code">[src]</a></h4><h4 id="method.panel_changed-7" class="method hidden"><code>pub fn <a href="#method.panel_changed" class="fnname">panel_changed</a>(<br> &mut self, <br> &mut EventCtx<'_>, <br> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>A, <br> &Panel<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transition<A>></code></h4><div class='docblock hidden'><p>Called when something on the panel has changed. If a transition is returned, stop handling
|
||||
the event and immediately apply the transition. <a href="#method.panel_changed">Read more</a></p>
|
||||
</div><h4 id="method.on_mouseover-6" class="method hidden"><code>pub fn <a href="#method.on_mouseover" class="fnname">on_mouseover</a>(&mut self, &mut EventCtx<'_>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>A)</code></h4><div class='docblock hidden'><p>Called when the mouse has moved.</p>
|
||||
</div><h4 id="method.other_event-6" class="method hidden"><code>pub fn <a href="#method.other_event" class="fnname">other_event</a>(&mut self, &mut EventCtx<'_>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>A) -> Transition<A></code></h4><div class='docblock hidden'><p>If a panel <code>on_click</code> event didn't occur and <code>panel_changed</code> didn't return transition, then
|
||||
|
@ -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="API documentation for the Rust `map` mod in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, map"><title>game::layer::map - Rust</title><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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../game/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><p class="location">Module map</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li></ul></div><p class="location"><a href="../../index.html">game</a>::<wbr><a href="../index.html">layer</a></p><script>window.sidebarCurrent = {name: "map", ty: "mod", relpath: "../"};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../../theme.js"></script><nav class="sub"><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" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" class="help-button">?</button>
|
||||
<a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">−</span>]</a></span><a class="srclink" href="../../../src/game/layer/map.rs.html#1-425" title="goto source code">[src]</a></span><span class="in-band">Module <a href="../../index.html">game</a>::<wbr><a href="../index.html">layer</a>::<wbr><a class="mod" href="">map</a></span></h1><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
|
||||
<table><tr class="module-item"><td><a class="struct" href="struct.BikeNetwork.html" title="game::layer::map::BikeNetwork struct">BikeNetwork</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="struct" href="struct.CongestionCaps.html" title="game::layer::map::CongestionCaps struct">CongestionCaps</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="struct" href="struct.Static.html" title="game::layer::map::Static struct">Static</a></td><td class="docblock-short"></td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "game";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
|
||||
<a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">−</span>]</a></span><a class="srclink" href="../../../src/game/layer/map.rs.html#1-454" title="goto source code">[src]</a></span><span class="in-band">Module <a href="../../index.html">game</a>::<wbr><a href="../index.html">layer</a>::<wbr><a class="mod" href="">map</a></span></h1><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
|
||||
<table><tr class="module-item"><td><a class="struct" href="struct.BikeActivity.html" title="game::layer::map::BikeActivity struct">BikeActivity</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="struct" href="struct.CongestionCaps.html" title="game::layer::map::CongestionCaps struct">CongestionCaps</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="struct" href="struct.Static.html" title="game::layer::map::Static struct">Static</a></td><td class="docblock-short"></td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "game";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
|
@ -1 +1 @@
|
||||
initSidebarItems({"struct":[["BikeNetwork",""],["CongestionCaps",""],["Static",""]]});
|
||||
initSidebarItems({"struct":[["BikeActivity",""],["CongestionCaps",""],["Static",""]]});
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -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="API documentation for the Rust `BUILT_TIME_UTC` constant in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, BUILT_TIME_UTC"><title>game::pregame::built_info::BUILT_TIME_UTC - Rust</title><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="../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../../down-arrow.svg");}</style></head><body class="rustdoc constant"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../game/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="../../index.html">game</a>::<wbr><a href="../index.html">pregame</a>::<wbr><a href="index.html">built_info</a></p><script>window.sidebarCurrent = {name: "BUILT_TIME_UTC", ty: "constant", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../../theme.js"></script><nav class="sub"><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" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" class="help-button">?</button>
|
||||
<a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">−</span>]</a></span><a class="srclink" href="../../../src/game/home/runner/work/abstreet/abstreet/target/debug/build/game-a95c4551e63dceca/out/built.rs.html#53" title="goto source code">[src]</a></span><span class="in-band">Constant <a href="../../index.html">game</a>::<wbr><a href="../index.html">pregame</a>::<wbr><a href="index.html">built_info</a>::<wbr><a class="constant" href="">BUILT_TIME_UTC</a></span></h1><pre class="rust const">pub const BUILT_TIME_UTC: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a> = "Thu, 25 Feb 2021 18:29:16 +0000";</pre><div class="docblock"><p>The built-time in RFC2822, UTC</p>
|
||||
<a id="settings-menu" href="../../../settings.html"><img src="../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">−</span>]</a></span><a class="srclink" href="../../../src/game/home/runner/work/abstreet/abstreet/target/debug/build/game-a95c4551e63dceca/out/built.rs.html#53" title="goto source code">[src]</a></span><span class="in-band">Constant <a href="../../index.html">game</a>::<wbr><a href="../index.html">pregame</a>::<wbr><a href="index.html">built_info</a>::<wbr><a class="constant" href="">BUILT_TIME_UTC</a></span></h1><pre class="rust const">pub const BUILT_TIME_UTC: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a> = "Thu, 25 Feb 2021 19:00:43 +0000";</pre><div class="docblock"><p>The built-time in RFC2822, UTC</p>
|
||||
</div></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "game";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
|
@ -1,4 +1,4 @@
|
||||
<!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="API documentation for the Rust `find_active_trip` fn in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, find_active_trip"><title>game::sandbox::gameplay::actdev::find_active_trip - Rust</title><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="../../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../../../down-arrow.svg");}</style></head><body class="rustdoc fn"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../../game/index.html'><div class='logo-container rust-logo'><img src='../../../../rust-logo.png' alt='logo'></div></a><div class="sidebar-elems"><p class="location"><a href="../../../index.html">game</a>::<wbr><a href="../../index.html">sandbox</a>::<wbr><a href="../index.html">gameplay</a>::<wbr><a href="index.html">actdev</a></p><script>window.sidebarCurrent = {name: "find_active_trip", ty: "fn", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../../../theme.js"></script><nav class="sub"><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" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" class="help-button">?</button>
|
||||
<a id="settings-menu" href="../../../../settings.html"><img src="../../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">−</span>]</a></span><a class="srclink" href="../../../../src/game/sandbox/gameplay/actdev.rs.html#196-205" title="goto source code">[src]</a></span><span class="in-band">Function <a href="../../../index.html">game</a>::<wbr><a href="../../index.html">sandbox</a>::<wbr><a href="../index.html">gameplay</a>::<wbr><a href="index.html">actdev</a>::<wbr><a class="fn" href="">find_active_trip</a></span></h1><pre class="rust fn">fn find_active_trip(app: &<a class="struct" href="../../../../game/app/struct.App.html" title="struct game::app::App">App</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="struct" href="../../../../sim/struct.PersonID.html" title="struct sim::PersonID">PersonID</a>, <a class="struct" href="../../../../sim/struct.TripID.html" title="struct sim::TripID">TripID</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>></pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../../";window.currentCrate = "game";</script><script src="../../../../main.js"></script><script defer src="../../../../search-index.js"></script></body></html>
|
||||
<a id="settings-menu" href="../../../../settings.html"><img src="../../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">−</span>]</a></span><a class="srclink" href="../../../../src/game/sandbox/gameplay/actdev.rs.html#214-223" title="goto source code">[src]</a></span><span class="in-band">Function <a href="../../../index.html">game</a>::<wbr><a href="../../index.html">sandbox</a>::<wbr><a href="../index.html">gameplay</a>::<wbr><a href="index.html">actdev</a>::<wbr><a class="fn" href="">find_active_trip</a></span></h1><pre class="rust fn">fn find_active_trip(app: &<a class="struct" href="../../../../game/app/struct.App.html" title="struct game::app::App">App</a>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="struct" href="../../../../sim/struct.PersonID.html" title="struct sim::PersonID">PersonID</a>, <a class="struct" href="../../../../sim/struct.TripID.html" title="struct sim::TripID">TripID</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>></pre></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../../";window.currentCrate = "game";</script><script src="../../../../main.js"></script><script defer src="../../../../search-index.js"></script></body></html>
|
@ -1,7 +1,7 @@
|
||||
<!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="API documentation for the Rust `actdev` mod in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, actdev"><title>game::sandbox::gameplay::actdev - Rust</title><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="../../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../../game/index.html'><div class='logo-container rust-logo'><img src='../../../../rust-logo.png' alt='logo'></div></a><p class="location">Module actdev</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#functions">Functions</a></li></ul></div><p class="location"><a href="../../../index.html">game</a>::<wbr><a href="../../index.html">sandbox</a>::<wbr><a href="../index.html">gameplay</a></p><script>window.sidebarCurrent = {name: "actdev", ty: "mod", relpath: "../"};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../../../theme.js"></script><nav class="sub"><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" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" class="help-button">?</button>
|
||||
<a id="settings-menu" href="../../../../settings.html"><img src="../../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">−</span>]</a></span><a class="srclink" href="../../../../src/game/sandbox/gameplay/actdev.rs.html#1-205" title="goto source code">[src]</a></span><span class="in-band">Module <a href="../../../index.html">game</a>::<wbr><a href="../../index.html">sandbox</a>::<wbr><a href="../index.html">gameplay</a>::<wbr><a class="mod" href="">actdev</a></span></h1><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
|
||||
<a id="settings-menu" href="../../../../settings.html"><img src="../../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">−</span>]</a></span><a class="srclink" href="../../../../src/game/sandbox/gameplay/actdev.rs.html#1-223" title="goto source code">[src]</a></span><span class="in-band">Module <a href="../../../index.html">game</a>::<wbr><a href="../../index.html">sandbox</a>::<wbr><a href="../index.html">gameplay</a>::<wbr><a class="mod" href="">actdev</a></span></h1><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2>
|
||||
<table><tr class="module-item"><td><a class="struct" href="struct.About.html" title="game::sandbox::gameplay::actdev::About struct">About</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="struct" href="struct.Actdev.html" title="game::sandbox::gameplay::actdev::Actdev struct">Actdev</a></td><td class="docblock-short"><p>A gameplay mode with specific controls for integration with
|
||||
https://cyipt.github.io/acton/articles/the-actdev-project.html.</p>
|
||||
</td></tr></table><h2 id="functions" class="section-header"><a href="#functions">Functions</a></h2>
|
||||
|
@ -1,9 +1,9 @@
|
||||
<!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="API documentation for the Rust `About` struct in crate `game`."><meta name="keywords" content="rust, rustlang, rust-lang, About"><title>game::sandbox::gameplay::actdev::About - Rust</title><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="../../../../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled ><script id="default-settings"></script><script src="../../../../storage.js"></script><noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg">
|
||||
<link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png">
|
||||
<link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><style type="text/css">#crate-search{background-image:url("../../../../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href='../../../../game/index.html'><div class='logo-container rust-logo'><img src='../../../../rust-logo.png' alt='logo'></div></a><p class="location">Struct About</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-SimpleState%3CApp%3E">SimpleState<App></a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><a class="sidebar-title" href="#blanket-implementations">Blanket Implementations</a><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-Downcast">Downcast</a><a href="#impl-DowncastSync">DowncastSync</a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Instrument">Instrument</a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-Same%3CT%3E">Same<T></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a><a href="#impl-VZip%3CV%3E">VZip<V></a></div></div><p class="location"><a href="../../../index.html">game</a>::<wbr><a href="../../index.html">sandbox</a>::<wbr><a href="../index.html">gameplay</a>::<wbr><a href="index.html">actdev</a></p><script>window.sidebarCurrent = {name: "About", ty: "struct", relpath: ""};</script><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu"><img src="../../../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices" role="menu"></div></div><script src="../../../../theme.js"></script><nav class="sub"><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" disabled autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" class="help-button">?</button>
|
||||
<a id="settings-menu" href="../../../../settings.html"><img src="../../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">−</span>]</a></span><a class="srclink" href="../../../../src/game/sandbox/gameplay/actdev.rs.html#179" title="goto source code">[src]</a></span><span class="in-band">Struct <a href="../../../index.html">game</a>::<wbr><a href="../../index.html">sandbox</a>::<wbr><a href="../index.html">gameplay</a>::<wbr><a href="index.html">actdev</a>::<wbr><a class="struct" href="">About</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">struct About;</pre></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><h3 id="impl-SimpleState%3CApp%3E" class="impl"><code class="in-band">impl SimpleState<<a class="struct" href="../../../../game/app/struct.App.html" title="struct game::app::App">App</a>> for <a class="struct" href="../../../../game/sandbox/gameplay/actdev/struct.About.html" title="struct game::sandbox::gameplay::actdev::About">About</a></code><a href="#impl-SimpleState%3CApp%3E" class="anchor"></a><a class="srclink" href="../../../../src/game/sandbox/gameplay/actdev.rs.html#181-194" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.on_click" class="method hidden"><code>fn <a href="#method.on_click" class="fnname">on_click</a>(<br> &mut self, <br> _: &mut EventCtx<'_>, <br> _: &mut <a class="struct" href="../../../../game/app/struct.App.html" title="struct game::app::App">App</a>, <br> x: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, <br> _: &Panel<br>) -> Transition<<a class="struct" href="../../../../game/app/struct.App.html" title="struct game::app::App">App</a>></code><a class="srclink" href="../../../../src/game/sandbox/gameplay/actdev.rs.html#182-189" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Called when something on the panel has been clicked. Since the action is just a string,
|
||||
<a id="settings-menu" href="../../../../settings.html"><img src="../../../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><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">−</span>]</a></span><a class="srclink" href="../../../../src/game/sandbox/gameplay/actdev.rs.html#197" title="goto source code">[src]</a></span><span class="in-band">Struct <a href="../../../index.html">game</a>::<wbr><a href="../../index.html">sandbox</a>::<wbr><a href="../index.html">gameplay</a>::<wbr><a href="index.html">actdev</a>::<wbr><a class="struct" href="">About</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">struct About;</pre></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><h3 id="impl-SimpleState%3CApp%3E" class="impl"><code class="in-band">impl SimpleState<<a class="struct" href="../../../../game/app/struct.App.html" title="struct game::app::App">App</a>> for <a class="struct" href="../../../../game/sandbox/gameplay/actdev/struct.About.html" title="struct game::sandbox::gameplay::actdev::About">About</a></code><a href="#impl-SimpleState%3CApp%3E" class="anchor"></a><a class="srclink" href="../../../../src/game/sandbox/gameplay/actdev.rs.html#199-212" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.on_click" class="method hidden"><code>fn <a href="#method.on_click" class="fnname">on_click</a>(<br> &mut self, <br> _: &mut EventCtx<'_>, <br> _: &mut <a class="struct" href="../../../../game/app/struct.App.html" title="struct game::app::App">App</a>, <br> x: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, <br> _: &Panel<br>) -> Transition<<a class="struct" href="../../../../game/app/struct.App.html" title="struct game::app::App">App</a>></code><a class="srclink" href="../../../../src/game/sandbox/gameplay/actdev.rs.html#200-207" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Called when something on the panel has been clicked. Since the action is just a string,
|
||||
the fallback case can just use <code>unreachable!()</code>. <a href="#tymethod.on_click">Read more</a></p>
|
||||
</div><h4 id="method.draw" class="method hidden"><code>fn <a href="#method.draw" class="fnname">draw</a>(&self, g: &mut GfxCtx<'_>, app: &<a class="struct" href="../../../../game/app/struct.App.html" title="struct game::app::App">App</a>)</code><a class="srclink" href="../../../../src/game/sandbox/gameplay/actdev.rs.html#191-193" title="goto source code">[src]</a></h4><h4 id="method.panel_changed" class="method hidden"><code>pub fn <a href="#method.panel_changed" class="fnname">panel_changed</a>(<br> &mut self, <br> &mut EventCtx<'_>, <br> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>A, <br> &Panel<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transition<A>></code></h4><div class='docblock hidden'><p>Called when something on the panel has changed. If a transition is returned, stop handling
|
||||
</div><h4 id="method.draw" class="method hidden"><code>fn <a href="#method.draw" class="fnname">draw</a>(&self, g: &mut GfxCtx<'_>, app: &<a class="struct" href="../../../../game/app/struct.App.html" title="struct game::app::App">App</a>)</code><a class="srclink" href="../../../../src/game/sandbox/gameplay/actdev.rs.html#209-211" title="goto source code">[src]</a></h4><h4 id="method.panel_changed" class="method hidden"><code>pub fn <a href="#method.panel_changed" class="fnname">panel_changed</a>(<br> &mut self, <br> &mut EventCtx<'_>, <br> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>A, <br> &Panel<br>) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><Transition<A>></code></h4><div class='docblock hidden'><p>Called when something on the panel has changed. If a transition is returned, stop handling
|
||||
the event and immediately apply the transition. <a href="#method.panel_changed">Read more</a></p>
|
||||
</div><h4 id="method.on_mouseover" class="method hidden"><code>pub fn <a href="#method.on_mouseover" class="fnname">on_mouseover</a>(&mut self, &mut EventCtx<'_>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>A)</code></h4><div class='docblock hidden'><p>Called when the mouse has moved.</p>
|
||||
</div><h4 id="method.other_event" class="method hidden"><code>pub fn <a href="#method.other_event" class="fnname">other_event</a>(&mut self, &mut EventCtx<'_>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>A) -> Transition<A></code></h4><div class='docblock hidden'><p>If a panel <code>on_click</code> event didn't occur and <code>panel_changed</code> didn't return transition, then
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -122,7 +122,7 @@
|
||||
<span class="doccomment">/// The output of `rustdoc -V`</span>
|
||||
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">RUSTDOC_VERSION</span>: <span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">"rustdoc 1.50.0 (cb75ad5db 2021-02-10)"</span>;
|
||||
<span class="doccomment">/// The built-time in RFC2822, UTC</span>
|
||||
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">BUILT_TIME_UTC</span>: <span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">"Thu, 25 Feb 2021 18:29:16 +0000"</span>;
|
||||
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">BUILT_TIME_UTC</span>: <span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">"Thu, 25 Feb 2021 19:00:43 +0000"</span>;
|
||||
<span class="doccomment">/// The target architecture, given by `cfg!(target_arch)`.</span>
|
||||
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">CFG_TARGET_ARCH</span>: <span class="kw-2">&</span><span class="ident">str</span> <span class="op">=</span> <span class="string">"x86_64"</span>;
|
||||
<span class="doccomment">/// The endianness, given by `cfg!(target_endian)`.</span>
|
||||
|
@ -426,7 +426,38 @@
|
||||
<span id="423">423</span>
|
||||
<span id="424">424</span>
|
||||
<span id="425">425</span>
|
||||
<span id="426">426</span>
|
||||
<span id="427">427</span>
|
||||
<span id="428">428</span>
|
||||
<span id="429">429</span>
|
||||
<span id="430">430</span>
|
||||
<span id="431">431</span>
|
||||
<span id="432">432</span>
|
||||
<span id="433">433</span>
|
||||
<span id="434">434</span>
|
||||
<span id="435">435</span>
|
||||
<span id="436">436</span>
|
||||
<span id="437">437</span>
|
||||
<span id="438">438</span>
|
||||
<span id="439">439</span>
|
||||
<span id="440">440</span>
|
||||
<span id="441">441</span>
|
||||
<span id="442">442</span>
|
||||
<span id="443">443</span>
|
||||
<span id="444">444</span>
|
||||
<span id="445">445</span>
|
||||
<span id="446">446</span>
|
||||
<span id="447">447</span>
|
||||
<span id="448">448</span>
|
||||
<span id="449">449</span>
|
||||
<span id="450">450</span>
|
||||
<span id="451">451</span>
|
||||
<span id="452">452</span>
|
||||
<span id="453">453</span>
|
||||
<span id="454">454</span>
|
||||
</pre><div class="example-wrap"><pre class="rust ">
|
||||
<span class="kw">use</span> <span class="ident">maplit</span>::<span class="ident">btreeset</span>;
|
||||
|
||||
<span class="kw">use</span> <span class="ident">abstutil</span>::{<span class="ident">prettyprint_usize</span>, <span class="ident">Counter</span>};
|
||||
<span class="kw">use</span> <span class="ident">geom</span>::{<span class="ident">Distance</span>, <span class="ident">Time</span>};
|
||||
<span class="kw">use</span> <span class="ident">map_gui</span>::<span class="ident">tools</span>::{<span class="ident">ColorDiscrete</span>, <span class="ident">ColorLegend</span>, <span class="ident">ColorNetwork</span>};
|
||||
@ -441,16 +472,17 @@
|
||||
<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">app</span>::<span class="ident">App</span>;
|
||||
<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">layer</span>::{<span class="ident">header</span>, <span class="ident">Layer</span>, <span class="ident">LayerOutcome</span>};
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">BikeNetwork</span> {
|
||||
<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">BikeActivity</span> {
|
||||
<span class="ident">panel</span>: <span class="ident">Panel</span>,
|
||||
<span class="ident">time</span>: <span class="ident">Time</span>,
|
||||
<span class="ident">unzoomed</span>: <span class="ident">Drawable</span>,
|
||||
<span class="ident">zoomed</span>: <span class="ident">Drawable</span>,
|
||||
<span class="ident">tooltip</span>: <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Text</span><span class="op">></span>,
|
||||
}
|
||||
|
||||
<span class="kw">impl</span> <span class="ident">Layer</span> <span class="kw">for</span> <span class="ident">BikeNetwork</span> {
|
||||
<span class="kw">impl</span> <span class="ident">Layer</span> <span class="kw">for</span> <span class="ident">BikeActivity</span> {
|
||||
<span class="kw">fn</span> <span class="ident">name</span>(<span class="kw-2">&</span><span class="self">self</span>) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="kw-2">&</span><span class="lifetime">'static</span> <span class="ident">str</span><span class="op">></span> {
|
||||
<span class="prelude-val">Some</span>(<span class="string">"bike network"</span>)
|
||||
<span class="prelude-val">Some</span>(<span class="string">"cycling activity"</span>)
|
||||
}
|
||||
<span class="kw">fn</span> <span class="ident">event</span>(
|
||||
<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>,
|
||||
@ -458,8 +490,30 @@
|
||||
<span class="ident">app</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">App</span>,
|
||||
<span class="ident">minimap</span>: <span class="kw-2">&</span><span class="ident">Panel</span>,
|
||||
) <span class="op">-</span><span class="op">></span> <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">LayerOutcome</span><span class="op">></span> {
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">recalc_tooltip</span> <span class="op">=</span> <span class="bool-val">false</span>;
|
||||
<span class="kw">if</span> <span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">sim</span>.<span class="ident">time</span>() <span class="op">!</span><span class="op">=</span> <span class="self">self</span>.<span class="ident">time</span> {
|
||||
<span class="kw-2">*</span><span class="self">self</span> <span class="op">=</span> <span class="ident">BikeNetwork</span>::<span class="ident">new</span>(<span class="ident">ctx</span>, <span class="ident">app</span>);
|
||||
<span class="kw-2">*</span><span class="self">self</span> <span class="op">=</span> <span class="ident">BikeActivity</span>::<span class="ident">new</span>(<span class="ident">ctx</span>, <span class="ident">app</span>);
|
||||
<span class="ident">recalc_tooltip</span> <span class="op">=</span> <span class="bool-val">true</span>;
|
||||
}
|
||||
|
||||
<span class="comment">// Show a tooltip with count, only when unzoomed</span>
|
||||
<span class="kw">if</span> <span class="ident">ctx</span>.<span class="ident">canvas</span>.<span class="ident">cam_zoom</span> <span class="op"><</span> <span class="ident">app</span>.<span class="ident">opts</span>.<span class="ident">min_zoom_for_detail</span> {
|
||||
<span class="kw">if</span> <span class="ident">ctx</span>.<span class="ident">redo_mouseover</span>() <span class="op">|</span><span class="op">|</span> <span class="ident">recalc_tooltip</span> {
|
||||
<span class="self">self</span>.<span class="ident">tooltip</span> <span class="op">=</span> <span class="prelude-val">None</span>;
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">ID</span>::<span class="ident">Road</span>(<span class="ident">r</span>)) <span class="op">=</span> <span class="ident">app</span>.<span class="ident">mouseover_unzoomed_roads_and_intersections</span>(<span class="ident">ctx</span>) {
|
||||
<span class="kw">let</span> <span class="ident">cnt</span> <span class="op">=</span> <span class="ident">app</span>
|
||||
.<span class="ident">primary</span>
|
||||
.<span class="ident">sim</span>
|
||||
.<span class="ident">get_analytics</span>()
|
||||
.<span class="ident">road_thruput</span>
|
||||
.<span class="ident">total_for_with_agent_types</span>(<span class="ident">r</span>, <span class="macro">btreeset</span><span class="macro">!</span> { <span class="ident">AgentType</span>::<span class="ident">Bike</span> });
|
||||
<span class="kw">if</span> <span class="ident">cnt</span> <span class="op">></span> <span class="number">0</span> {
|
||||
<span class="self">self</span>.<span class="ident">tooltip</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">Text</span>::<span class="ident">from</span>(<span class="ident">Line</span>(<span class="ident">prettyprint_usize</span>(<span class="ident">cnt</span>))));
|
||||
}
|
||||
}
|
||||
}
|
||||
} <span class="kw">else</span> {
|
||||
<span class="self">self</span>.<span class="ident">tooltip</span> <span class="op">=</span> <span class="prelude-val">None</span>;
|
||||
}
|
||||
|
||||
<span class="ident">Layer</span>::<span class="ident">simple_event</span>(<span class="ident">ctx</span>, <span class="ident">minimap</span>, <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="self">self</span>.<span class="ident">panel</span>)
|
||||
@ -471,14 +525,17 @@
|
||||
} <span class="kw">else</span> {
|
||||
<span class="ident">g</span>.<span class="ident">redraw</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">zoomed</span>);
|
||||
}
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="kw-2">ref</span> <span class="ident">txt</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">tooltip</span> {
|
||||
<span class="ident">g</span>.<span class="ident">draw_mouse_tooltip</span>(<span class="ident">txt</span>.<span class="ident">clone</span>());
|
||||
}
|
||||
}
|
||||
<span class="kw">fn</span> <span class="ident">draw_minimap</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">g</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">GfxCtx</span>) {
|
||||
<span class="ident">g</span>.<span class="ident">redraw</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">unzoomed</span>);
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">impl</span> <span class="ident">BikeNetwork</span> {
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new</span>(<span class="ident">ctx</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">EventCtx</span>, <span class="ident">app</span>: <span class="kw-2">&</span><span class="ident">App</span>) <span class="op">-</span><span class="op">></span> <span class="ident">BikeNetwork</span> {
|
||||
<span class="kw">impl</span> <span class="ident">BikeActivity</span> {
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new</span>(<span class="ident">ctx</span>: <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">EventCtx</span>, <span class="ident">app</span>: <span class="kw-2">&</span><span class="ident">App</span>) <span class="op">-</span><span class="op">></span> <span class="ident">BikeActivity</span> {
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">num_lanes</span> <span class="op">=</span> <span class="number">0</span>;
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">total_dist</span> <span class="op">=</span> <span class="ident">Distance</span>::<span class="ident">ZERO</span>;
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">on_bike_lanes</span> <span class="op">=</span> <span class="ident">Counter</span>::<span class="ident">new</span>();
|
||||
@ -535,9 +592,9 @@
|
||||
}
|
||||
|
||||
<span class="kw">let</span> <span class="ident">panel</span> <span class="op">=</span> <span class="ident">Panel</span>::<span class="ident">new</span>(<span class="ident">Widget</span>::<span class="ident">col</span>(<span class="macro">vec</span><span class="macro">!</span>[
|
||||
<span class="ident">header</span>(<span class="ident">ctx</span>, <span class="string">"Bike network"</span>),
|
||||
<span class="ident">header</span>(<span class="ident">ctx</span>, <span class="string">"Cycling activity"</span>),
|
||||
<span class="ident">Text</span>::<span class="ident">from_multiline</span>(<span class="macro">vec</span><span class="macro">!</span>[
|
||||
<span class="ident">Line</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">"{} lanes"</span>, <span class="ident">num_lanes</span>)),
|
||||
<span class="ident">Line</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">"{} bike lanes"</span>, <span class="ident">num_lanes</span>)),
|
||||
<span class="ident">Line</span>(<span class="macro">format</span><span class="macro">!</span>(
|
||||
<span class="string">"total distance of {}"</span>,
|
||||
<span class="ident">total_dist</span>.<span class="ident">to_string</span>(<span class="kw-2">&</span><span class="ident">app</span>.<span class="ident">opts</span>.<span class="ident">units</span>)
|
||||
@ -567,11 +624,12 @@
|
||||
<span class="ident">colorer</span>.<span class="ident">ranked_intersections</span>(<span class="ident">intersections_off</span>, <span class="kw-2">&</span><span class="ident">app</span>.<span class="ident">cs</span>.<span class="ident">good_to_bad_red</span>);
|
||||
<span class="kw">let</span> (<span class="ident">unzoomed</span>, <span class="ident">zoomed</span>) <span class="op">=</span> <span class="ident">colorer</span>.<span class="ident">build</span>(<span class="ident">ctx</span>);
|
||||
|
||||
<span class="ident">BikeNetwork</span> {
|
||||
<span class="ident">BikeActivity</span> {
|
||||
<span class="ident">panel</span>,
|
||||
<span class="ident">time</span>: <span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">sim</span>.<span class="ident">time</span>(),
|
||||
<span class="ident">unzoomed</span>,
|
||||
<span class="ident">zoomed</span>,
|
||||
<span class="ident">tooltip</span>: <span class="prelude-val">None</span>,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -388,12 +388,12 @@
|
||||
<span class="ident">btn</span>(<span class="string">"delay"</span>, <span class="ident">Key</span>::<span class="ident">D</span>),
|
||||
<span class="ident">btn</span>(<span class="string">"throughput"</span>, <span class="ident">Key</span>::<span class="ident">T</span>),
|
||||
<span class="ident">btn</span>(<span class="string">"traffic jams"</span>, <span class="ident">Key</span>::<span class="ident">J</span>),
|
||||
<span class="ident">btn</span>(<span class="string">"cycling activity"</span>, <span class="ident">Key</span>::<span class="ident">B</span>),
|
||||
]),
|
||||
<span class="ident">Widget</span>::<span class="ident">col</span>(<span class="macro">vec</span><span class="macro">!</span>[
|
||||
<span class="string">"Map"</span>.<span class="ident">draw_text</span>(<span class="ident">ctx</span>),
|
||||
<span class="ident">btn</span>(<span class="string">"map edits"</span>, <span class="ident">Key</span>::<span class="ident">E</span>),
|
||||
<span class="ident">btn</span>(<span class="string">"parking occupancy"</span>, <span class="ident">Key</span>::<span class="ident">P</span>),
|
||||
<span class="ident">btn</span>(<span class="string">"bike network"</span>, <span class="ident">Key</span>::<span class="ident">B</span>),
|
||||
<span class="ident">btn</span>(<span class="string">"transit network"</span>, <span class="ident">Key</span>::<span class="ident">U</span>),
|
||||
<span class="ident">btn</span>(<span class="string">"population map"</span>, <span class="ident">Key</span>::<span class="ident">X</span>),
|
||||
<span class="ident">btn</span>(<span class="string">"no sidewalks"</span>, <span class="ident">Key</span>::<span class="ident">S</span>),
|
||||
@ -450,8 +450,8 @@
|
||||
<span class="string">"backpressure"</span> <span class="op">=</span><span class="op">></span> {
|
||||
<span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">layer</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">Box</span>::<span class="ident">new</span>(<span class="ident">traffic</span>::<span class="ident">Backpressure</span>::<span class="ident">new</span>(<span class="ident">ctx</span>, <span class="ident">app</span>)));
|
||||
}
|
||||
<span class="string">"bike network"</span> <span class="op">=</span><span class="op">></span> {
|
||||
<span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">layer</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">Box</span>::<span class="ident">new</span>(<span class="ident">map</span>::<span class="ident">BikeNetwork</span>::<span class="ident">new</span>(<span class="ident">ctx</span>, <span class="ident">app</span>)));
|
||||
<span class="string">"cycling activity"</span> <span class="op">=</span><span class="op">></span> {
|
||||
<span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">layer</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">Box</span>::<span class="ident">new</span>(<span class="ident">map</span>::<span class="ident">BikeActivity</span>::<span class="ident">new</span>(<span class="ident">ctx</span>, <span class="ident">app</span>)));
|
||||
}
|
||||
<span class="string">"delay"</span> <span class="op">=</span><span class="op">></span> {
|
||||
<span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">layer</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">Box</span>::<span class="ident">new</span>(<span class="ident">traffic</span>::<span class="ident">Delay</span>::<span class="ident">new</span>(<span class="ident">ctx</span>, <span class="ident">app</span>)));
|
||||
|
@ -206,10 +206,30 @@
|
||||
<span id="203">203</span>
|
||||
<span id="204">204</span>
|
||||
<span id="205">205</span>
|
||||
<span id="206">206</span>
|
||||
<span id="207">207</span>
|
||||
<span id="208">208</span>
|
||||
<span id="209">209</span>
|
||||
<span id="210">210</span>
|
||||
<span id="211">211</span>
|
||||
<span id="212">212</span>
|
||||
<span id="213">213</span>
|
||||
<span id="214">214</span>
|
||||
<span id="215">215</span>
|
||||
<span id="216">216</span>
|
||||
<span id="217">217</span>
|
||||
<span id="218">218</span>
|
||||
<span id="219">219</span>
|
||||
<span id="220">220</span>
|
||||
<span id="221">221</span>
|
||||
<span id="222">222</span>
|
||||
<span id="223">223</span>
|
||||
</pre><div class="example-wrap"><pre class="rust ">
|
||||
<span class="kw">use</span> <span class="ident">maplit</span>::<span class="ident">btreeset</span>;
|
||||
|
||||
<span class="kw">use</span> <span class="ident">geom</span>::<span class="ident">Duration</span>;
|
||||
<span class="kw">use</span> <span class="ident">map_gui</span>::<span class="ident">tools</span>::{<span class="ident">grey_out_map</span>, <span class="ident">nice_map_name</span>, <span class="ident">open_browser</span>, <span class="ident">PopupMsg</span>};
|
||||
<span class="kw">use</span> <span class="ident">sim</span>::{<span class="ident">PersonID</span>, <span class="ident">TripID</span>};
|
||||
<span class="kw">use</span> <span class="ident">sim</span>::{<span class="ident">AgentType</span>, <span class="ident">PersonID</span>, <span class="ident">TripID</span>};
|
||||
<span class="kw">use</span> <span class="ident">widgetry</span>::{
|
||||
<span class="ident">lctrl</span>, <span class="ident">ControlState</span>, <span class="ident">EventCtx</span>, <span class="ident">GfxCtx</span>, <span class="ident">HorizontalAlignment</span>, <span class="ident">Key</span>, <span class="ident">Line</span>, <span class="ident">Outcome</span>, <span class="ident">Panel</span>,
|
||||
<span class="ident">SimpleState</span>, <span class="ident">StyledButtons</span>, <span class="ident">Text</span>, <span class="ident">TextExt</span>, <span class="ident">VerticalAlignment</span>, <span class="ident">Widget</span>,
|
||||
@ -263,10 +283,13 @@
|
||||
<span class="ident">jump_to_time_upon_startup</span>(<span class="ident">Duration</span>::<span class="ident">hours</span>(<span class="number">8</span>)),
|
||||
)));
|
||||
}
|
||||
<span class="string">"edit map"</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">Some</span>(<span class="ident">Transition</span>::<span class="ident">Push</span>(<span class="ident">EditMode</span>::<span class="ident">new</span>(
|
||||
<span class="string">"Edit map"</span> <span class="op">=</span><span class="op">></span> <span class="prelude-val">Some</span>(<span class="ident">Transition</span>::<span class="ident">Push</span>(<span class="ident">EditMode</span>::<span class="ident">new</span>(
|
||||
<span class="ident">ctx</span>,
|
||||
<span class="ident">app</span>,
|
||||
<span class="ident">GameplayMode</span>::<span class="ident">Freeform</span>(<span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">map</span>.<span class="ident">get_name</span>().<span class="ident">clone</span>()),
|
||||
<span class="ident">GameplayMode</span>::<span class="ident">Actdev</span>(
|
||||
<span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">map</span>.<span class="ident">get_name</span>().<span class="ident">clone</span>(),
|
||||
<span class="self">self</span>.<span class="ident">scenario_name</span>.<span class="ident">clone</span>(),
|
||||
),
|
||||
))),
|
||||
<span class="string">"about A/B Street"</span> <span class="op">=</span><span class="op">></span> {
|
||||
<span class="kw">let</span> <span class="ident">panel</span> <span class="op">=</span> <span class="ident">Panel</span>::<span class="ident">new</span>(<span class="ident">Widget</span>::<span class="ident">col</span>(<span class="macro">vec</span><span class="macro">!</span>[
|
||||
@ -291,8 +314,10 @@
|
||||
.<span class="ident">build</span>(<span class="ident">ctx</span>);
|
||||
<span class="prelude-val">Some</span>(<span class="ident">Transition</span>::<span class="ident">Push</span>(<span class="ident">SimpleState</span>::<span class="ident">new</span>(<span class="ident">panel</span>, <span class="ident">Box</span>::<span class="ident">new</span>(<span class="ident">About</span>))))
|
||||
}
|
||||
<span class="string">"follow someone"</span> <span class="op">=</span><span class="op">></span> {
|
||||
<span class="string">"Follow someone"</span> <span class="op">=</span><span class="op">></span> {
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>((<span class="ident">person</span>, <span class="ident">trip</span>)) <span class="op">=</span> <span class="ident">find_active_trip</span>(<span class="ident">app</span>) {
|
||||
<span class="comment">// The user may not realize they have to close layers; do it for them.</span>
|
||||
<span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">layer</span> <span class="op">=</span> <span class="prelude-val">None</span>;
|
||||
<span class="ident">ctx</span>.<span class="ident">canvas</span>.<span class="ident">cam_zoom</span> <span class="op">=</span> <span class="number">40.0</span>;
|
||||
<span class="ident">controls</span>.<span class="ident">common</span>.<span class="ident">as_mut</span>().<span class="ident">unwrap</span>().<span class="ident">launch_info_panel</span>(
|
||||
<span class="ident">ctx</span>,
|
||||
@ -309,9 +334,17 @@
|
||||
)));
|
||||
}
|
||||
}
|
||||
<span class="string">"bike network"</span> <span class="op">=</span><span class="op">></span> {
|
||||
<span class="string">"Cycling activity"</span> <span class="op">=</span><span class="op">></span> {
|
||||
<span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">layer</span> <span class="op">=</span>
|
||||
<span class="prelude-val">Some</span>(<span class="ident">Box</span>::<span class="ident">new</span>(<span class="kw">crate</span>::<span class="ident">layer</span>::<span class="ident">map</span>::<span class="ident">BikeNetwork</span>::<span class="ident">new</span>(<span class="ident">ctx</span>, <span class="ident">app</span>)));
|
||||
<span class="prelude-val">Some</span>(<span class="ident">Box</span>::<span class="ident">new</span>(<span class="kw">crate</span>::<span class="ident">layer</span>::<span class="ident">map</span>::<span class="ident">BikeActivity</span>::<span class="ident">new</span>(<span class="ident">ctx</span>, <span class="ident">app</span>)));
|
||||
<span class="prelude-val">None</span>
|
||||
}
|
||||
<span class="string">"Walking activity"</span> <span class="op">=</span><span class="op">></span> {
|
||||
<span class="ident">app</span>.<span class="ident">primary</span>.<span class="ident">layer</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">Box</span>::<span class="ident">new</span>(<span class="kw">crate</span>::<span class="ident">layer</span>::<span class="ident">traffic</span>::<span class="ident">Throughput</span>::<span class="ident">new</span>(
|
||||
<span class="ident">ctx</span>,
|
||||
<span class="ident">app</span>,
|
||||
<span class="macro">btreeset</span><span class="macro">!</span> { <span class="ident">AgentType</span>::<span class="ident">Pedestrian</span> },
|
||||
)));
|
||||
<span class="prelude-val">None</span>
|
||||
}
|
||||
<span class="kw">_</span> <span class="op">=</span><span class="op">></span> <span class="macro">unreachable</span><span class="macro">!</span>(),
|
||||
@ -361,16 +394,19 @@
|
||||
<span class="ident">ctx</span>.<span class="ident">style</span>()
|
||||
.<span class="ident">btn_outline_icon_text</span>(<span class="string">"system/assets/tools/pencil.svg"</span>, <span class="string">"Edit map"</span>)
|
||||
.<span class="ident">hotkey</span>(<span class="ident">lctrl</span>(<span class="ident">Key</span>::<span class="ident">E</span>))
|
||||
.<span class="ident">build_widget</span>(<span class="ident">ctx</span>, <span class="string">"edit map"</span>),
|
||||
.<span class="ident">build_def</span>(<span class="ident">ctx</span>),
|
||||
])
|
||||
.<span class="ident">centered</span>(),
|
||||
<span class="ident">Widget</span>::<span class="ident">row</span>(<span class="macro">vec</span><span class="macro">!</span>[
|
||||
<span class="ident">ctx</span>.<span class="ident">style</span>()
|
||||
.<span class="ident">btn_plain_icon_text</span>(<span class="string">"system/assets/tools/location.svg"</span>, <span class="string">"Follow someone"</span>)
|
||||
.<span class="ident">build_widget</span>(<span class="ident">ctx</span>, <span class="string">"follow someone"</span>),
|
||||
.<span class="ident">build_def</span>(<span class="ident">ctx</span>),
|
||||
<span class="ident">ctx</span>.<span class="ident">style</span>()
|
||||
.<span class="ident">btn_plain_icon_text</span>(<span class="string">"system/assets/meters/bike.svg"</span>, <span class="string">"Bike network"</span>)
|
||||
.<span class="ident">build_widget</span>(<span class="ident">ctx</span>, <span class="string">"bike network"</span>),
|
||||
.<span class="ident">btn_plain_icon_text</span>(<span class="string">"system/assets/meters/bike.svg"</span>, <span class="string">"Cycling activity"</span>)
|
||||
.<span class="ident">build_def</span>(<span class="ident">ctx</span>),
|
||||
<span class="ident">ctx</span>.<span class="ident">style</span>()
|
||||
.<span class="ident">btn_plain_icon_text</span>(<span class="string">"system/assets/meters/pedestrian.svg"</span>, <span class="string">"Walking activity"</span>)
|
||||
.<span class="ident">build_def</span>(<span class="ident">ctx</span>),
|
||||
]),
|
||||
]);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user