mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-11-28 03:35:51 +03:00
deploy: fa9565e22b
This commit is contained in:
parent
5e633a0b0d
commit
fe9a43b3bd
@ -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><span class="help-button">?</span>
|
||||
<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-b5501e76eef510ad/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> = "Sat, 09 Jan 2021 21:17:43 +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-b5501e76eef510ad/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> = "Sat, 09 Jan 2021 21:29:40 +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,6 +1,6 @@
|
||||
<!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 `city_picker` mod in crate `map_gui`."><meta name="keywords" content="rust, rustlang, rust-lang, city_picker"><title>map_gui::tools::city_picker - 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='../../../map_gui/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><p class="location">Module city_picker</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">map_gui</a>::<wbr><a href="../index.html">tools</a></p><script>window.sidebarCurrent = {name: "city_picker", 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><span class="help-button">?</span>
|
||||
<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/map_gui/tools/city_picker.rs.html#1-332" title="goto source code">[src]</a></span><span class="in-band">Module <a href="../../index.html">map_gui</a>::<wbr><a href="../index.html">tools</a>::<wbr><a class="mod" href="">city_picker</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/map_gui/tools/city_picker.rs.html#1-333" title="goto source code">[src]</a></span><span class="in-band">Module <a href="../../index.html">map_gui</a>::<wbr><a href="../index.html">tools</a>::<wbr><a class="mod" href="">city_picker</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.AllCityPicker.html" title="map_gui::tools::city_picker::AllCityPicker struct">AllCityPicker</a></td><td class="docblock-short"></td></tr><tr class="module-item"><td><a class="struct" href="struct.CityPicker.html" title="map_gui::tools::city_picker::CityPicker struct">CityPicker</a></td><td class="docblock-short"><p>Lets the player switch maps.</p>
|
||||
</td></tr></table></section><section id="search" class="content hidden"></section><section class="footer"></section><script>window.rootPath = "../../../";window.currentCrate = "map_gui";</script><script src="../../../main.js"></script><script defer src="../../../search-index.js"></script></body></html>
|
@ -1,13 +1,13 @@
|
||||
<!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 `AllCityPicker` struct in crate `map_gui`."><meta name="keywords" content="rust, rustlang, rust-lang, AllCityPicker"><title>map_gui::tools::city_picker::AllCityPicker - 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='../../../map_gui/index.html'><div class='logo-container rust-logo'><img src='../../../rust-logo.png' alt='logo'></div></a><p class="location">Struct AllCityPicker</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.on_load">on_load</a><a href="#structfield.panel">panel</a></div><a class="sidebar-title" href="#implementations">Methods</a><div class="sidebar-links"><a href="#method.new">new</a></div><a class="sidebar-title" href="#trait-implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-State%3CA%3E">State<A></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-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">map_gui</a>::<wbr><a href="../index.html">tools</a>::<wbr><a href="index.html">city_picker</a></p><script>window.sidebarCurrent = {name: "AllCityPicker", 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><span class="help-button">?</span>
|
||||
<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/map_gui/tools/city_picker.rs.html#248-252" title="goto source code">[src]</a></span><span class="in-band">Struct <a href="../../index.html">map_gui</a>::<wbr><a href="../index.html">tools</a>::<wbr><a href="index.html">city_picker</a>::<wbr><a class="struct" href="">AllCityPicker</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">struct AllCityPicker<A: <a class="trait" href="../../../map_gui/trait.AppLike.html" title="trait map_gui::AppLike">AppLike</a>> {
|
||||
<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/map_gui/tools/city_picker.rs.html#249-253" title="goto source code">[src]</a></span><span class="in-band">Struct <a href="../../index.html">map_gui</a>::<wbr><a href="../index.html">tools</a>::<wbr><a href="index.html">city_picker</a>::<wbr><a class="struct" href="">AllCityPicker</a></span></h1><div class="docblock type-decl hidden-by-usual-hider"><pre class="rust struct">struct AllCityPicker<A: <a class="trait" href="../../../map_gui/trait.AppLike.html" title="trait map_gui::AppLike">AppLike</a>> {
|
||||
panel: Panel,
|
||||
on_load: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&mut EventCtx<'_>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>A) -> Transition<A>>>,
|
||||
}</pre></div><h2 id="fields" class="fields small-section-header">
|
||||
Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.panel" class="structfield small-section-header"><a href="#structfield.panel" class="anchor field"></a><code>panel: Panel</code></span><span id="structfield.on_load" class="structfield small-section-header"><a href="#structfield.on_load" class="anchor field"></a><code>on_load: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&mut EventCtx<'_>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>A) -> Transition<A>>></code></span><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><h3 id="impl" class="impl"><code class="in-band">impl<A: <a class="trait" href="../../../map_gui/trait.AppLike.html" title="trait map_gui::AppLike">AppLike</a> + 'static> <a class="struct" href="../../../map_gui/tools/city_picker/struct.AllCityPicker.html" title="struct map_gui::tools::city_picker::AllCityPicker">AllCityPicker</a><A></code><a href="#impl" class="anchor"></a><a class="srclink" href="../../../src/map_gui/tools/city_picker.rs.html#254-290" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.new" class="method"><code>fn <a href="#method.new" class="fnname">new</a>(<br> ctx: &mut EventCtx<'_>, <br> on_load: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&mut EventCtx<'_>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>A) -> Transition<A>><br>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn State<A>></code><a class="srclink" href="../../../src/map_gui/tools/city_picker.rs.html#255-289" title="goto source code">[src]</a></h4></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-State%3CA%3E" class="impl"><code class="in-band">impl<A: <a class="trait" href="../../../map_gui/trait.AppLike.html" title="trait map_gui::AppLike">AppLike</a> + 'static> State<A> for <a class="struct" href="../../../map_gui/tools/city_picker/struct.AllCityPicker.html" title="struct map_gui::tools::city_picker::AllCityPicker">AllCityPicker</a><A></code><a href="#impl-State%3CA%3E" class="anchor"></a><a class="srclink" href="../../../src/map_gui/tools/city_picker.rs.html#292-332" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.event" class="method hidden"><code>fn <a href="#method.event" class="fnname">event</a>(&mut self, ctx: &mut EventCtx<'_>, app: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>A) -> Transition<A></code><a class="srclink" href="../../../src/map_gui/tools/city_picker.rs.html#293-322" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Respond to a UI event, such as input or time passing.</p>
|
||||
</div><h4 id="method.draw_baselayer" class="method hidden"><code>fn <a href="#method.draw_baselayer" class="fnname">draw_baselayer</a>(&self) -> DrawBaselayer</code><a class="srclink" href="../../../src/map_gui/tools/city_picker.rs.html#324-326" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Specifies what to draw before draw()</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="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>A)</code><a class="srclink" href="../../../src/map_gui/tools/city_picker.rs.html#328-331" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Draw</p>
|
||||
Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.panel" class="structfield small-section-header"><a href="#structfield.panel" class="anchor field"></a><code>panel: Panel</code></span><span id="structfield.on_load" class="structfield small-section-header"><a href="#structfield.on_load" class="anchor field"></a><code>on_load: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&mut EventCtx<'_>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>A) -> Transition<A>>></code></span><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><h3 id="impl" class="impl"><code class="in-band">impl<A: <a class="trait" href="../../../map_gui/trait.AppLike.html" title="trait map_gui::AppLike">AppLike</a> + 'static> <a class="struct" href="../../../map_gui/tools/city_picker/struct.AllCityPicker.html" title="struct map_gui::tools::city_picker::AllCityPicker">AllCityPicker</a><A></code><a href="#impl" class="anchor"></a><a class="srclink" href="../../../src/map_gui/tools/city_picker.rs.html#255-291" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.new" class="method"><code>fn <a href="#method.new" class="fnname">new</a>(<br> ctx: &mut EventCtx<'_>, <br> on_load: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&mut EventCtx<'_>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>A) -> Transition<A>><br>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html" title="struct alloc::boxed::Box">Box</a><dyn State<A>></code><a class="srclink" href="../../../src/map_gui/tools/city_picker.rs.html#256-290" title="goto source code">[src]</a></h4></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-State%3CA%3E" class="impl"><code class="in-band">impl<A: <a class="trait" href="../../../map_gui/trait.AppLike.html" title="trait map_gui::AppLike">AppLike</a> + 'static> State<A> for <a class="struct" href="../../../map_gui/tools/city_picker/struct.AllCityPicker.html" title="struct map_gui::tools::city_picker::AllCityPicker">AllCityPicker</a><A></code><a href="#impl-State%3CA%3E" class="anchor"></a><a class="srclink" href="../../../src/map_gui/tools/city_picker.rs.html#293-333" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.event" class="method hidden"><code>fn <a href="#method.event" class="fnname">event</a>(&mut self, ctx: &mut EventCtx<'_>, app: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&mut </a>A) -> Transition<A></code><a class="srclink" href="../../../src/map_gui/tools/city_picker.rs.html#294-323" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Respond to a UI event, such as input or time passing.</p>
|
||||
</div><h4 id="method.draw_baselayer" class="method hidden"><code>fn <a href="#method.draw_baselayer" class="fnname">draw_baselayer</a>(&self) -> DrawBaselayer</code><a class="srclink" href="../../../src/map_gui/tools/city_picker.rs.html#325-327" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Specifies what to draw before draw()</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="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>A)</code><a class="srclink" href="../../../src/map_gui/tools/city_picker.rs.html#329-332" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Draw</p>
|
||||
</div><h4 id="method.on_destroy" class="method hidden"><code>fn <a href="#method.on_destroy" class="fnname">on_destroy</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>Before this state is popped or replaced, call this.</p>
|
||||
</div></div></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><h3 id="impl-RefUnwindSafe" class="impl"><code class="in-band">impl<A> !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.RefUnwindSafe.html" title="trait std::panic::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="../../../map_gui/tools/city_picker/struct.AllCityPicker.html" title="struct map_gui::tools::city_picker::AllCityPicker">AllCityPicker</a><A></code><a href="#impl-RefUnwindSafe" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Send" class="impl"><code class="in-band">impl<A> !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../../../map_gui/tools/city_picker/struct.AllCityPicker.html" title="struct map_gui::tools::city_picker::AllCityPicker">AllCityPicker</a><A></code><a href="#impl-Send" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Sync" class="impl"><code class="in-band">impl<A> !<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../../../map_gui/tools/city_picker/struct.AllCityPicker.html" title="struct map_gui::tools::city_picker::AllCityPicker">AllCityPicker</a><A></code><a href="#impl-Sync" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-Unpin" class="impl"><code class="in-band">impl<A> <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="../../../map_gui/tools/city_picker/struct.AllCityPicker.html" title="struct map_gui::tools::city_picker::AllCityPicker">AllCityPicker</a><A></code><a href="#impl-Unpin" class="anchor"></a></h3><div class="impl-items"></div><h3 id="impl-UnwindSafe" class="impl"><code class="in-band">impl<A> !<a class="trait" href="https://doc.rust-lang.org/nightly/std/panic/trait.UnwindSafe.html" title="trait std::panic::UnwindSafe">UnwindSafe</a> for <a class="struct" href="../../../map_gui/tools/city_picker/struct.AllCityPicker.html" title="struct map_gui::tools::city_picker::AllCityPicker">AllCityPicker</a><A></code><a href="#impl-UnwindSafe" class="anchor"></a></h3><div class="impl-items"></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><h3 id="impl-Any" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href="#impl-Any" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#108-112" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.type_id" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#109-111" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||
</div></div><h3 id="impl-Borrow%3CT%3E" class="impl"><code class="in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></code><a href="#impl-Borrow%3CT%3E" class="anchor"></a><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#210-214" title="goto source code">[src]</a></h3><div class="impl-items"><h4 id="method.borrow" class="method hidden"><code>pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&</a>T</code><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211-213" title="goto source code">[src]</a></h4><div class='docblock hidden'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
|
||||
|
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.49.0 (e1884a8e3 2020-12-29)"</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">"Sat, 09 Jan 2021 21:17:43 +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">"Sat, 09 Jan 2021 21:29:40 +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>
|
||||
|
@ -333,9 +333,9 @@
|
||||
<span id="330">330</span>
|
||||
<span id="331">331</span>
|
||||
<span id="332">332</span>
|
||||
<span id="333">333</span>
|
||||
</pre><div class="example-wrap"><pre class="rust ">
|
||||
<span class="kw">use</span> <span class="ident">abstio</span>::<span class="ident">MapName</span>;
|
||||
<span class="kw">use</span> <span class="ident">abstutil</span>::<span class="ident">Timer</span>;
|
||||
<span class="kw">use</span> <span class="ident">geom</span>::{<span class="ident">Distance</span>, <span class="ident">Percent</span>, <span class="ident">Polygon</span>, <span class="ident">Pt2D</span>};
|
||||
<span class="kw">use</span> <span class="ident">map_model</span>::<span class="ident">City</span>;
|
||||
<span class="kw">use</span> <span class="ident">widgetry</span>::{
|
||||
@ -343,7 +343,7 @@
|
||||
<span class="ident">Panel</span>, <span class="ident">ScreenPt</span>, <span class="ident">State</span>, <span class="ident">Text</span>, <span class="ident">TextExt</span>, <span class="ident">Transition</span>, <span class="ident">Widget</span>,
|
||||
};
|
||||
|
||||
<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">load</span>::<span class="ident">MapLoader</span>;
|
||||
<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">load</span>::{<span class="ident">FileLoader</span>, <span class="ident">MapLoader</span>};
|
||||
<span class="kw">use</span> <span class="kw">crate</span>::<span class="ident">render</span>::<span class="ident">DrawArea</span>;
|
||||
<span class="kw">use</span> <span class="kw">crate</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="kw">use</span> <span class="kw">crate</span>::<span class="ident">AppLike</span>;
|
||||
@ -365,108 +365,111 @@
|
||||
<span class="ident">on_load</span>: <span class="ident">Box</span><span class="op"><</span><span class="ident">dyn</span> <span class="ident">FnOnce</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">EventCtx</span>, <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">A</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Transition</span><span class="op"><</span><span class="ident">A</span><span class="op">></span><span class="op">></span>,
|
||||
) <span class="op">-</span><span class="op">></span> <span class="ident">Box</span><span class="op"><</span><span class="ident">dyn</span> <span class="ident">State</span><span class="op"><</span><span class="ident">A</span><span class="op">></span><span class="op">></span> {
|
||||
<span class="kw">let</span> <span class="ident">city</span> <span class="op">=</span> <span class="ident">app</span>.<span class="ident">map</span>().<span class="ident">get_city_name</span>().<span class="ident">clone</span>();
|
||||
<span class="ident">CityPicker</span>::<span class="ident">new_in_city</span>(<span class="ident">ctx</span>, <span class="ident">app</span>, <span class="ident">on_load</span>, <span class="ident">city</span>)
|
||||
<span class="ident">CityPicker</span>::<span class="ident">new_in_city</span>(<span class="ident">ctx</span>, <span class="ident">on_load</span>, <span class="ident">city</span>)
|
||||
}
|
||||
|
||||
<span class="kw">fn</span> <span class="ident">new_in_city</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="kw-2">mut</span> <span class="ident">A</span>,
|
||||
<span class="ident">on_load</span>: <span class="ident">Box</span><span class="op"><</span><span class="ident">dyn</span> <span class="ident">FnOnce</span>(<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">EventCtx</span>, <span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">A</span>) <span class="op">-</span><span class="op">></span> <span class="ident">Transition</span><span class="op"><</span><span class="ident">A</span><span class="op">></span><span class="op">></span>,
|
||||
<span class="ident">city_name</span>: <span class="ident">String</span>,
|
||||
) <span class="op">-</span><span class="op">></span> <span class="ident">Box</span><span class="op"><</span><span class="ident">dyn</span> <span class="ident">State</span><span class="op"><</span><span class="ident">A</span><span class="op">></span><span class="op">></span> {
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">batch</span> <span class="op">=</span> <span class="ident">GeomBatch</span>::<span class="ident">new</span>();
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">regions</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">new</span>();
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">this_city</span> <span class="op">=</span> <span class="macro">vec</span><span class="macro">!</span>[];
|
||||
|
||||
<span class="comment">// If this city overview doesn't exist, we assume this map is the only one in the city.</span>
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Ok</span>(<span class="ident">city</span>) <span class="op">=</span> <span class="ident">abstio</span>::<span class="ident">maybe_read_binary</span>::<span class="op"><</span><span class="ident">City</span><span class="op">></span>(
|
||||
<span class="ident">FileLoader</span>::<span class="op"><</span><span class="ident">A</span>, <span class="ident">City</span><span class="op">></span>::<span class="ident">new</span>(
|
||||
<span class="ident">ctx</span>,
|
||||
<span class="ident">abstio</span>::<span class="ident">path</span>(<span class="macro">format</span><span class="macro">!</span>(<span class="string">"system/{}/city.bin"</span>, <span class="ident">city_name</span>)),
|
||||
<span class="kw-2">&</span><span class="kw-2">mut</span> <span class="ident">Timer</span>::<span class="ident">throwaway</span>(),
|
||||
) {
|
||||
<span class="kw">let</span> <span class="ident">bounds</span> <span class="op">=</span> <span class="ident">city</span>.<span class="ident">boundary</span>.<span class="ident">get_bounds</span>();
|
||||
<span class="ident">Box</span>::<span class="ident">new</span>(<span class="kw">move</span> <span class="op">|</span><span class="ident">ctx</span>, <span class="ident">app</span>, <span class="kw">_</span>, <span class="ident">maybe_city</span><span class="op">|</span> {
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">batch</span> <span class="op">=</span> <span class="ident">GeomBatch</span>::<span class="ident">new</span>();
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">regions</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">new</span>();
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">this_city</span> <span class="op">=</span> <span class="macro">vec</span><span class="macro">!</span>[];
|
||||
|
||||
<span class="kw">let</span> <span class="ident">zoom</span> <span class="op">=</span> (<span class="number">0.8</span> <span class="op">*</span> <span class="ident">ctx</span>.<span class="ident">canvas</span>.<span class="ident">window_width</span> <span class="op">/</span> <span class="ident">bounds</span>.<span class="ident">width</span>())
|
||||
.<span class="ident">min</span>(<span class="number">0.8</span> <span class="op">*</span> <span class="ident">ctx</span>.<span class="ident">canvas</span>.<span class="ident">window_height</span> <span class="op">/</span> <span class="ident">bounds</span>.<span class="ident">height</span>());
|
||||
<span class="comment">// If this city overview doesn't exist, we assume this map is the only one in the</span>
|
||||
<span class="comment">// city.</span>
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Ok</span>(<span class="ident">city</span>) <span class="op">=</span> <span class="ident">maybe_city</span> {
|
||||
<span class="kw">let</span> <span class="ident">bounds</span> <span class="op">=</span> <span class="ident">city</span>.<span class="ident">boundary</span>.<span class="ident">get_bounds</span>();
|
||||
|
||||
<span class="ident">batch</span>.<span class="ident">push</span>(<span class="ident">app</span>.<span class="ident">cs</span>().<span class="ident">map_background</span>.<span class="ident">clone</span>(), <span class="ident">city</span>.<span class="ident">boundary</span>);
|
||||
<span class="kw">for</span> (<span class="ident">area_type</span>, <span class="ident">polygon</span>) <span class="kw">in</span> <span class="ident">city</span>.<span class="ident">areas</span> {
|
||||
<span class="ident">batch</span>.<span class="ident">push</span>(<span class="ident">DrawArea</span>::<span class="ident">fill</span>(<span class="ident">area_type</span>, <span class="ident">app</span>.<span class="ident">cs</span>()), <span class="ident">polygon</span>);
|
||||
}
|
||||
<span class="kw">let</span> <span class="ident">zoom</span> <span class="op">=</span> (<span class="number">0.8</span> <span class="op">*</span> <span class="ident">ctx</span>.<span class="ident">canvas</span>.<span class="ident">window_width</span> <span class="op">/</span> <span class="ident">bounds</span>.<span class="ident">width</span>())
|
||||
.<span class="ident">min</span>(<span class="number">0.8</span> <span class="op">*</span> <span class="ident">ctx</span>.<span class="ident">canvas</span>.<span class="ident">window_height</span> <span class="op">/</span> <span class="ident">bounds</span>.<span class="ident">height</span>());
|
||||
|
||||
<span class="kw">for</span> (<span class="ident">name</span>, <span class="ident">polygon</span>) <span class="kw">in</span> <span class="ident">city</span>.<span class="ident">regions</span> {
|
||||
<span class="kw">let</span> <span class="ident">color</span> <span class="op">=</span> <span class="ident">app</span>.<span class="ident">cs</span>().<span class="ident">rotating_color_agents</span>(<span class="ident">regions</span>.<span class="ident">len</span>());
|
||||
<span class="ident">batch</span>.<span class="ident">push</span>(<span class="ident">app</span>.<span class="ident">cs</span>().<span class="ident">map_background</span>.<span class="ident">clone</span>(), <span class="ident">city</span>.<span class="ident">boundary</span>);
|
||||
<span class="kw">for</span> (<span class="ident">area_type</span>, <span class="ident">polygon</span>) <span class="kw">in</span> <span class="ident">city</span>.<span class="ident">areas</span> {
|
||||
<span class="ident">batch</span>.<span class="ident">push</span>(<span class="ident">DrawArea</span>::<span class="ident">fill</span>(<span class="ident">area_type</span>, <span class="ident">app</span>.<span class="ident">cs</span>()), <span class="ident">polygon</span>);
|
||||
}
|
||||
|
||||
<span class="kw">let</span> <span class="ident">btn</span> <span class="op">=</span> <span class="ident">Btn</span>::<span class="ident">txt</span>(
|
||||
<span class="ident">name</span>.<span class="ident">path</span>(),
|
||||
<span class="ident">Text</span>::<span class="ident">from</span>(<span class="ident">Line</span>(<span class="ident">nice_map_name</span>(<span class="kw-2">&</span><span class="ident">name</span>)).<span class="ident">fg</span>(<span class="ident">color</span>)),
|
||||
)
|
||||
.<span class="ident">no_tooltip</span>();
|
||||
<span class="kw">for</span> (<span class="ident">name</span>, <span class="ident">polygon</span>) <span class="kw">in</span> <span class="ident">city</span>.<span class="ident">regions</span> {
|
||||
<span class="kw">let</span> <span class="ident">color</span> <span class="op">=</span> <span class="ident">app</span>.<span class="ident">cs</span>().<span class="ident">rotating_color_agents</span>(<span class="ident">regions</span>.<span class="ident">len</span>());
|
||||
|
||||
<span class="kw">if</span> <span class="kw-2">&</span><span class="ident">name</span> <span class="op">=</span><span class="op">=</span> <span class="ident">app</span>.<span class="ident">map</span>().<span class="ident">get_name</span>() {
|
||||
<span class="ident">this_city</span>.<span class="ident">push</span>(<span class="ident">btn</span>.<span class="ident">inactive</span>(<span class="ident">ctx</span>));
|
||||
<span class="ident">batch</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">polygon</span>.<span class="ident">clone</span>());
|
||||
} <span class="kw">else</span> {
|
||||
<span class="ident">this_city</span>.<span class="ident">push</span>(<span class="ident">btn</span>.<span class="ident">build_def</span>(<span class="ident">ctx</span>, <span class="prelude-val">None</span>));
|
||||
<span class="ident">batch</span>.<span class="ident">push</span>(<span class="ident">color</span>, <span class="ident">polygon</span>.<span class="ident">to_outline</span>(<span class="ident">Distance</span>::<span class="ident">meters</span>(<span class="number">200.0</span>)).<span class="ident">unwrap</span>());
|
||||
<span class="ident">regions</span>.<span class="ident">push</span>((<span class="ident">name</span>, <span class="ident">color</span>, <span class="ident">polygon</span>.<span class="ident">scale</span>(<span class="ident">zoom</span>)));
|
||||
<span class="kw">let</span> <span class="ident">btn</span> <span class="op">=</span> <span class="ident">Btn</span>::<span class="ident">txt</span>(
|
||||
<span class="ident">name</span>.<span class="ident">path</span>(),
|
||||
<span class="ident">Text</span>::<span class="ident">from</span>(<span class="ident">Line</span>(<span class="ident">nice_map_name</span>(<span class="kw-2">&</span><span class="ident">name</span>)).<span class="ident">fg</span>(<span class="ident">color</span>)),
|
||||
)
|
||||
.<span class="ident">no_tooltip</span>();
|
||||
|
||||
<span class="kw">if</span> <span class="kw-2">&</span><span class="ident">name</span> <span class="op">=</span><span class="op">=</span> <span class="ident">app</span>.<span class="ident">map</span>().<span class="ident">get_name</span>() {
|
||||
<span class="ident">this_city</span>.<span class="ident">push</span>(<span class="ident">btn</span>.<span class="ident">inactive</span>(<span class="ident">ctx</span>));
|
||||
<span class="ident">batch</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">polygon</span>.<span class="ident">clone</span>());
|
||||
} <span class="kw">else</span> {
|
||||
<span class="ident">this_city</span>.<span class="ident">push</span>(<span class="ident">btn</span>.<span class="ident">build_def</span>(<span class="ident">ctx</span>, <span class="prelude-val">None</span>));
|
||||
<span class="ident">batch</span>.<span class="ident">push</span>(<span class="ident">color</span>, <span class="ident">polygon</span>.<span class="ident">to_outline</span>(<span class="ident">Distance</span>::<span class="ident">meters</span>(<span class="number">200.0</span>)).<span class="ident">unwrap</span>());
|
||||
<span class="ident">regions</span>.<span class="ident">push</span>((<span class="ident">name</span>, <span class="ident">color</span>, <span class="ident">polygon</span>.<span class="ident">scale</span>(<span class="ident">zoom</span>)));
|
||||
}
|
||||
}
|
||||
<span class="ident">batch</span> <span class="op">=</span> <span class="ident">batch</span>.<span class="ident">scale</span>(<span class="ident">zoom</span>);
|
||||
|
||||
<span class="ident">this_city</span>.<span class="ident">insert</span>(<span class="number">0</span>, <span class="macro">format</span><span class="macro">!</span>(<span class="string">"More regions in {}"</span>, <span class="ident">city_name</span>).<span class="ident">draw_text</span>(<span class="ident">ctx</span>));
|
||||
}
|
||||
}
|
||||
<span class="ident">batch</span> <span class="op">=</span> <span class="ident">batch</span>.<span class="ident">scale</span>(<span class="ident">zoom</span>);
|
||||
|
||||
<span class="ident">this_city</span>.<span class="ident">insert</span>(<span class="number">0</span>, <span class="macro">format</span><span class="macro">!</span>(<span class="string">"More regions in {}"</span>, <span class="ident">city_name</span>).<span class="ident">draw_text</span>(<span class="ident">ctx</span>));
|
||||
}
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">other_cities</span> <span class="op">=</span> <span class="macro">vec</span><span class="macro">!</span>[<span class="ident">Line</span>(<span class="string">"Other cities"</span>).<span class="ident">draw</span>(<span class="ident">ctx</span>)];
|
||||
<span class="kw">for</span> <span class="ident">city</span> <span class="kw">in</span> <span class="ident">MapName</span>::<span class="ident">list_all_cities</span>() {
|
||||
<span class="kw">if</span> <span class="ident">city</span> <span class="op">=</span><span class="op">=</span> <span class="ident">city_name</span> {
|
||||
<span class="kw">continue</span>;
|
||||
}
|
||||
<span class="comment">// If there's only one map in the city, make the button directly load it.</span>
|
||||
<span class="kw">let</span> <span class="ident">maps</span> <span class="op">=</span> <span class="ident">MapName</span>::<span class="ident">list_all_maps_in_city</span>(<span class="kw-2">&</span><span class="ident">city</span>);
|
||||
<span class="kw">if</span> <span class="ident">maps</span>.<span class="ident">len</span>() <span class="op">=</span><span class="op">=</span> <span class="number">1</span> {
|
||||
<span class="ident">other_cities</span>.<span class="ident">push</span>(<span class="ident">Btn</span>::<span class="ident">text_fg</span>(<span class="ident">city</span>).<span class="ident">build</span>(<span class="ident">ctx</span>, <span class="ident">maps</span>[<span class="number">0</span>].<span class="ident">path</span>(), <span class="prelude-val">None</span>));
|
||||
} <span class="kw">else</span> {
|
||||
<span class="ident">other_cities</span>.<span class="ident">push</span>(<span class="ident">Btn</span>::<span class="ident">text_fg</span>(<span class="ident">city</span>).<span class="ident">no_tooltip</span>().<span class="ident">build_def</span>(<span class="ident">ctx</span>, <span class="prelude-val">None</span>));
|
||||
}
|
||||
}
|
||||
<span class="ident">other_cities</span>.<span class="ident">push</span>(<span class="ident">Btn</span>::<span class="ident">text_bg2</span>(<span class="string">"Search all maps"</span>).<span class="ident">build_def</span>(<span class="ident">ctx</span>, <span class="ident">Key</span>::<span class="ident">Tab</span>));
|
||||
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">other_cities</span> <span class="op">=</span> <span class="macro">vec</span><span class="macro">!</span>[<span class="ident">Line</span>(<span class="string">"Other cities"</span>).<span class="ident">draw</span>(<span class="ident">ctx</span>)];
|
||||
<span class="kw">for</span> <span class="ident">city</span> <span class="kw">in</span> <span class="ident">MapName</span>::<span class="ident">list_all_cities</span>() {
|
||||
<span class="kw">if</span> <span class="ident">city</span> <span class="op">=</span><span class="op">=</span> <span class="ident">city_name</span> {
|
||||
<span class="kw">continue</span>;
|
||||
}
|
||||
<span class="comment">// If there's only one map in the city, make the button directly load it.</span>
|
||||
<span class="kw">let</span> <span class="ident">maps</span> <span class="op">=</span> <span class="ident">MapName</span>::<span class="ident">list_all_maps_in_city</span>(<span class="kw-2">&</span><span class="ident">city</span>);
|
||||
<span class="kw">if</span> <span class="ident">maps</span>.<span class="ident">len</span>() <span class="op">=</span><span class="op">=</span> <span class="number">1</span> {
|
||||
<span class="ident">other_cities</span>.<span class="ident">push</span>(<span class="ident">Btn</span>::<span class="ident">text_fg</span>(<span class="ident">city</span>).<span class="ident">build</span>(<span class="ident">ctx</span>, <span class="ident">maps</span>[<span class="number">0</span>].<span class="ident">path</span>(), <span class="prelude-val">None</span>));
|
||||
} <span class="kw">else</span> {
|
||||
<span class="ident">other_cities</span>.<span class="ident">push</span>(<span class="ident">Btn</span>::<span class="ident">text_fg</span>(<span class="ident">city</span>).<span class="ident">no_tooltip</span>().<span class="ident">build_def</span>(<span class="ident">ctx</span>, <span class="prelude-val">None</span>));
|
||||
}
|
||||
}
|
||||
<span class="ident">other_cities</span>.<span class="ident">push</span>(<span class="ident">Btn</span>::<span class="ident">text_bg2</span>(<span class="string">"Search all maps"</span>).<span class="ident">build_def</span>(<span class="ident">ctx</span>, <span class="ident">Key</span>::<span class="ident">Tab</span>));
|
||||
|
||||
<span class="ident">Box</span>::<span class="ident">new</span>(<span class="ident">CityPicker</span> {
|
||||
<span class="ident">regions</span>,
|
||||
<span class="ident">selected</span>: <span class="prelude-val">None</span>,
|
||||
<span class="ident">on_load</span>: <span class="prelude-val">Some</span>(<span class="ident">on_load</span>),
|
||||
<span class="ident">panel</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">Widget</span>::<span class="ident">row</span>(<span class="macro">vec</span><span class="macro">!</span>[
|
||||
<span class="ident">Line</span>(<span class="string">"Select a region"</span>).<span class="ident">small_heading</span>().<span class="ident">draw</span>(<span class="ident">ctx</span>),
|
||||
<span class="ident">Btn</span>::<span class="ident">close</span>(<span class="ident">ctx</span>),
|
||||
]),
|
||||
<span class="ident">Widget</span>::<span class="ident">row</span>(<span class="macro">vec</span><span class="macro">!</span>[
|
||||
<span class="ident">Widget</span>::<span class="ident">col</span>(<span class="ident">other_cities</span>).<span class="ident">centered_vert</span>(),
|
||||
<span class="ident">Widget</span>::<span class="ident">draw_batch</span>(<span class="ident">ctx</span>, <span class="ident">batch</span>).<span class="ident">named</span>(<span class="string">"picker"</span>),
|
||||
<span class="ident">Widget</span>::<span class="ident">col</span>(<span class="ident">this_city</span>).<span class="ident">centered_vert</span>(),
|
||||
]),
|
||||
<span class="ident">Widget</span>::<span class="ident">custom_row</span>(<span class="macro">vec</span><span class="macro">!</span>[
|
||||
<span class="string">"Don't see the city you want?"</span>
|
||||
.<span class="ident">draw_text</span>(<span class="ident">ctx</span>)
|
||||
.<span class="ident">centered_vert</span>(),
|
||||
<span class="ident">Btn</span>::<span class="ident">plaintext_custom</span>(
|
||||
<span class="string">"import new city"</span>,
|
||||
<span class="ident">Text</span>::<span class="ident">from</span>(
|
||||
<span class="ident">Line</span>(<span class="string">"Import a new city into A/B Street"</span>)
|
||||
.<span class="ident">fg</span>(<span class="ident">Color</span>::<span class="ident">hex</span>(<span class="string">"#4CA4E5"</span>))
|
||||
.<span class="ident">underlined</span>(),
|
||||
),
|
||||
)
|
||||
.<span class="ident">build_def</span>(<span class="ident">ctx</span>, <span class="prelude-val">None</span>),
|
||||
]),
|
||||
<span class="kw">if</span> <span class="macro">cfg</span><span class="macro">!</span>(<span class="ident">not</span>(<span class="ident">target_arch</span> <span class="op">=</span> <span class="string">"wasm32"</span>)) {
|
||||
<span class="ident">Btn</span>::<span class="ident">text_fg</span>(<span class="string">"Download more cities"</span>).<span class="ident">build_def</span>(<span class="ident">ctx</span>, <span class="prelude-val">None</span>)
|
||||
} <span class="kw">else</span> {
|
||||
<span class="ident">Widget</span>::<span class="ident">nothing</span>()
|
||||
},
|
||||
]))
|
||||
.<span class="ident">build</span>(<span class="ident">ctx</span>),
|
||||
})
|
||||
<span class="ident">Transition</span>::<span class="ident">Replace</span>(<span class="ident">Box</span>::<span class="ident">new</span>(<span class="ident">CityPicker</span> {
|
||||
<span class="ident">regions</span>,
|
||||
<span class="ident">selected</span>: <span class="prelude-val">None</span>,
|
||||
<span class="ident">on_load</span>: <span class="prelude-val">Some</span>(<span class="ident">on_load</span>),
|
||||
<span class="ident">panel</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">Widget</span>::<span class="ident">row</span>(<span class="macro">vec</span><span class="macro">!</span>[
|
||||
<span class="ident">Line</span>(<span class="string">"Select a region"</span>).<span class="ident">small_heading</span>().<span class="ident">draw</span>(<span class="ident">ctx</span>),
|
||||
<span class="ident">Btn</span>::<span class="ident">close</span>(<span class="ident">ctx</span>),
|
||||
]),
|
||||
<span class="ident">Widget</span>::<span class="ident">row</span>(<span class="macro">vec</span><span class="macro">!</span>[
|
||||
<span class="ident">Widget</span>::<span class="ident">col</span>(<span class="ident">other_cities</span>).<span class="ident">centered_vert</span>(),
|
||||
<span class="ident">Widget</span>::<span class="ident">draw_batch</span>(<span class="ident">ctx</span>, <span class="ident">batch</span>).<span class="ident">named</span>(<span class="string">"picker"</span>),
|
||||
<span class="ident">Widget</span>::<span class="ident">col</span>(<span class="ident">this_city</span>).<span class="ident">centered_vert</span>(),
|
||||
]),
|
||||
<span class="ident">Widget</span>::<span class="ident">custom_row</span>(<span class="macro">vec</span><span class="macro">!</span>[
|
||||
<span class="string">"Don't see the city you want?"</span>
|
||||
.<span class="ident">draw_text</span>(<span class="ident">ctx</span>)
|
||||
.<span class="ident">centered_vert</span>(),
|
||||
<span class="ident">Btn</span>::<span class="ident">plaintext_custom</span>(
|
||||
<span class="string">"import new city"</span>,
|
||||
<span class="ident">Text</span>::<span class="ident">from</span>(
|
||||
<span class="ident">Line</span>(<span class="string">"Import a new city into A/B Street"</span>)
|
||||
.<span class="ident">fg</span>(<span class="ident">Color</span>::<span class="ident">hex</span>(<span class="string">"#4CA4E5"</span>))
|
||||
.<span class="ident">underlined</span>(),
|
||||
),
|
||||
)
|
||||
.<span class="ident">build_def</span>(<span class="ident">ctx</span>, <span class="prelude-val">None</span>),
|
||||
]),
|
||||
<span class="kw">if</span> <span class="macro">cfg</span><span class="macro">!</span>(<span class="ident">not</span>(<span class="ident">target_arch</span> <span class="op">=</span> <span class="string">"wasm32"</span>)) {
|
||||
<span class="ident">Btn</span>::<span class="ident">text_fg</span>(<span class="string">"Download more cities"</span>).<span class="ident">build_def</span>(<span class="ident">ctx</span>, <span class="prelude-val">None</span>)
|
||||
} <span class="kw">else</span> {
|
||||
<span class="ident">Widget</span>::<span class="ident">nothing</span>()
|
||||
},
|
||||
]))
|
||||
.<span class="ident">build</span>(<span class="ident">ctx</span>),
|
||||
}))
|
||||
}),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@ -510,7 +513,6 @@
|
||||
<span class="comment">// Browse maps for another city without loading any map there</span>
|
||||
<span class="kw">return</span> <span class="ident">Transition</span>::<span class="ident">Replace</span>(<span class="ident">CityPicker</span>::<span class="ident">new_in_city</span>(
|
||||
<span class="ident">ctx</span>,
|
||||
<span class="ident">app</span>,
|
||||
<span class="self">self</span>.<span class="ident">on_load</span>.<span class="ident">take</span>().<span class="ident">unwrap</span>(),
|
||||
<span class="ident">x</span>.<span class="ident">to_string</span>(),
|
||||
));
|
||||
|
Loading…
Reference in New Issue
Block a user