mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-22 05:41:31 +03:00
refactoring some UI-related colors
This commit is contained in:
parent
8a2d73ae23
commit
59f2f03acb
@ -1,3 +1,4 @@
|
||||
use crate::colors;
|
||||
use crate::edit::apply_map_edits;
|
||||
use crate::game::{State, Transition, WizardState};
|
||||
use crate::managed::{ManagedGUIState, WrappedComposite};
|
||||
@ -139,7 +140,7 @@ pub fn challenges_picker(ctx: &mut EventCtx, ui: &UI) -> Box<dyn State> {
|
||||
flex_row.push(ManagedWidget::btn(Button::text_bg(
|
||||
Text::from(Line(&name).size(40).fg(Color::BLACK)),
|
||||
Color::WHITE,
|
||||
Color::ORANGE,
|
||||
colors::HOVERING,
|
||||
hotkey(Key::NUM_KEYS[idx]),
|
||||
&name,
|
||||
ctx,
|
||||
|
9
game/src/colors.rs
Normal file
9
game/src/colors.rs
Normal file
@ -0,0 +1,9 @@
|
||||
// TODO Still can't decide how to arrange colorschemes. Trying this out.
|
||||
|
||||
//before: 256
|
||||
|
||||
use ezgui::Color;
|
||||
|
||||
pub const HOVERING: Color = Color::ORANGE;
|
||||
pub const PANEL_BG: Color = Color::grey(0.4);
|
||||
pub const SECTION_BG: Color = Color::grey(0.5);
|
@ -1,3 +1,4 @@
|
||||
use crate::colors;
|
||||
use crate::managed::WrappedComposite;
|
||||
use crate::render::MIN_ZOOM_FOR_DETAIL;
|
||||
use crate::ui::UI;
|
||||
@ -144,7 +145,7 @@ impl ColorerBuilder {
|
||||
for (label, color) in self.prioritized_colors {
|
||||
col.push(ColorLegend::row(ctx, color, label));
|
||||
}
|
||||
let legend = Composite::new(ManagedWidget::col(col).bg(Color::grey(0.4)))
|
||||
let legend = Composite::new(ManagedWidget::col(col).bg(colors::PANEL_BG))
|
||||
.aligned(HorizontalAlignment::Right, VerticalAlignment::Center)
|
||||
.build(ctx);
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
use crate::colors;
|
||||
use crate::common::{ColorLegend, CommonState, Warping};
|
||||
use crate::game::{msg, Transition};
|
||||
use crate::helpers::{rotating_color, rotating_color_map, ID};
|
||||
@ -55,7 +56,7 @@ impl InfoPanel {
|
||||
"assets/tools/locate.svg",
|
||||
"jump to object",
|
||||
hotkey(Key::J),
|
||||
RewriteColor::Change(Color::hex("#CC4121"), Color::ORANGE),
|
||||
RewriteColor::Change(Color::hex("#CC4121"), colors::HOVERING),
|
||||
ctx,
|
||||
)),
|
||||
WrappedComposite::text_button(ctx, "X", hotkey(Key::Escape)).align_right(),
|
||||
@ -67,8 +68,8 @@ impl InfoPanel {
|
||||
txt.append(Line(format!(" - {}", label)));
|
||||
col.push(ManagedWidget::btn(Button::text_bg(
|
||||
txt,
|
||||
Color::grey(0.5),
|
||||
Color::ORANGE,
|
||||
colors::SECTION_BG,
|
||||
colors::HOVERING,
|
||||
hotkey(*key),
|
||||
label,
|
||||
ctx,
|
||||
@ -146,7 +147,7 @@ impl InfoPanel {
|
||||
actions,
|
||||
trip_details,
|
||||
time: ui.primary.sim.time(),
|
||||
composite: Composite::new(ManagedWidget::col(col).bg(Color::grey(0.3)))
|
||||
composite: Composite::new(ManagedWidget::col(col).bg(colors::PANEL_BG))
|
||||
.aligned(
|
||||
HorizontalAlignment::Percent(0.02),
|
||||
VerticalAlignment::Percent(0.2),
|
||||
@ -298,7 +299,7 @@ fn info_for(id: ID, ctx: &EventCtx, ui: &UI) -> Vec<ManagedWidget> {
|
||||
ctx,
|
||||
Text::from(Line("throughput in 20 minute buckets (entire road)")),
|
||||
)
|
||||
.bg(Color::grey(0.5)),
|
||||
.bg(colors::SECTION_BG),
|
||||
);
|
||||
rows.push(
|
||||
road_throughput(
|
||||
@ -307,7 +308,7 @@ fn info_for(id: ID, ctx: &EventCtx, ui: &UI) -> Vec<ManagedWidget> {
|
||||
ctx,
|
||||
ui,
|
||||
)
|
||||
.bg(Color::grey(0.5))
|
||||
.bg(colors::SECTION_BG)
|
||||
.margin(10),
|
||||
);
|
||||
}
|
||||
@ -345,21 +346,21 @@ fn info_for(id: ID, ctx: &EventCtx, ui: &UI) -> Vec<ManagedWidget> {
|
||||
if ui.primary.map.get_i(id).is_traffic_signal() {
|
||||
rows.push(
|
||||
ManagedWidget::draw_text(ctx, Text::from(Line("delay in 20 minute buckets")))
|
||||
.bg(Color::grey(0.5)),
|
||||
.bg(colors::SECTION_BG),
|
||||
);
|
||||
rows.push(
|
||||
intersection_delay(id, Duration::minutes(20), ctx, ui)
|
||||
.bg(Color::grey(0.5))
|
||||
.bg(colors::SECTION_BG)
|
||||
.margin(10),
|
||||
);
|
||||
}
|
||||
rows.push(
|
||||
ManagedWidget::draw_text(ctx, Text::from(Line("throughput in 20 minute buckets")))
|
||||
.bg(Color::grey(0.5)),
|
||||
.bg(colors::SECTION_BG),
|
||||
);
|
||||
rows.push(
|
||||
intersection_throughput(id, Duration::minutes(20), ctx, ui)
|
||||
.bg(Color::grey(0.5))
|
||||
.bg(colors::SECTION_BG)
|
||||
.margin(10),
|
||||
);
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
use crate::colors;
|
||||
use crate::common::{navigate, shortcuts, Overlays, Warping};
|
||||
use crate::game::{Transition, WizardState};
|
||||
use crate::managed::WrappedComposite;
|
||||
@ -277,7 +278,7 @@ fn make_minimap_panel(ctx: &mut EventCtx, acs: &AgentColorScheme, zoom_lvl: usiz
|
||||
"assets/speed/speed_up.svg",
|
||||
"zoom in",
|
||||
None,
|
||||
RewriteColor::ChangeAll(Color::ORANGE),
|
||||
RewriteColor::ChangeAll(colors::HOVERING),
|
||||
ctx,
|
||||
))];
|
||||
for i in (0..=3).rev() {
|
||||
@ -295,7 +296,7 @@ fn make_minimap_panel(ctx: &mut EventCtx, acs: &AgentColorScheme, zoom_lvl: usiz
|
||||
),
|
||||
DrawBoth::new(
|
||||
ctx,
|
||||
GeomBatch::from(vec![(Color::ORANGE, rect.clone())]),
|
||||
GeomBatch::from(vec![(colors::HOVERING, rect.clone())]),
|
||||
Vec::new(),
|
||||
),
|
||||
None,
|
||||
@ -307,7 +308,7 @@ fn make_minimap_panel(ctx: &mut EventCtx, acs: &AgentColorScheme, zoom_lvl: usiz
|
||||
"assets/speed/slow_down.svg",
|
||||
"zoom out",
|
||||
None,
|
||||
RewriteColor::ChangeAll(Color::ORANGE),
|
||||
RewriteColor::ChangeAll(colors::HOVERING),
|
||||
ctx,
|
||||
)));
|
||||
|
||||
@ -339,7 +340,7 @@ fn make_minimap_panel(ctx: &mut EventCtx, acs: &AgentColorScheme, zoom_lvl: usiz
|
||||
])
|
||||
.centered(),
|
||||
])
|
||||
.bg(Color::grey(0.5)),
|
||||
.bg(colors::PANEL_BG),
|
||||
)
|
||||
.aligned(
|
||||
HorizontalAlignment::Right,
|
||||
@ -411,7 +412,7 @@ fn make_viz_panel(ctx: &mut EventCtx, acs: &AgentColorScheme) -> ManagedWidget {
|
||||
} else {
|
||||
RewriteColor::ChangeAll(Color::WHITE.alpha(0.5))
|
||||
},
|
||||
RewriteColor::ChangeAll(Color::ORANGE),
|
||||
RewriteColor::ChangeAll(colors::HOVERING),
|
||||
ctx,
|
||||
))
|
||||
.margin(3),
|
||||
@ -441,5 +442,5 @@ fn make_viz_panel(ctx: &mut EventCtx, acs: &AgentColorScheme) -> ManagedWidget {
|
||||
.centered_cross(),
|
||||
);
|
||||
}
|
||||
ManagedWidget::col(col).bg(Color::grey(0.4))
|
||||
ManagedWidget::col(col).bg(colors::PANEL_BG)
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
use crate::colors;
|
||||
use crate::common::{ColorLegend, Colorer, ShowBusRoute, Warping};
|
||||
use crate::game::Transition;
|
||||
use crate::helpers::rotating_color_total;
|
||||
@ -224,35 +225,35 @@ impl Overlays {
|
||||
"assets/layers/parking_avail.svg",
|
||||
"parking availability",
|
||||
hotkey(Key::P),
|
||||
RewriteColor::Change(Color::hex("#F2F2F2"), Color::ORANGE),
|
||||
RewriteColor::Change(Color::hex("#F2F2F2"), colors::HOVERING),
|
||||
ctx,
|
||||
)),
|
||||
ManagedWidget::btn(Button::rectangle_svg(
|
||||
"assets/layers/intersection_delay.svg",
|
||||
"intersection delay",
|
||||
hotkey(Key::I),
|
||||
RewriteColor::Change(Color::hex("#F2F2F2"), Color::ORANGE),
|
||||
RewriteColor::Change(Color::hex("#F2F2F2"), colors::HOVERING),
|
||||
ctx,
|
||||
)),
|
||||
ManagedWidget::btn(Button::rectangle_svg(
|
||||
"assets/layers/throughput.svg",
|
||||
"throughput",
|
||||
hotkey(Key::T),
|
||||
RewriteColor::Change(Color::hex("#F2F2F2"), Color::ORANGE),
|
||||
RewriteColor::Change(Color::hex("#F2F2F2"), colors::HOVERING),
|
||||
ctx,
|
||||
)),
|
||||
ManagedWidget::btn(Button::rectangle_svg(
|
||||
"assets/layers/bike_network.svg",
|
||||
"bike network",
|
||||
hotkey(Key::B),
|
||||
RewriteColor::Change(Color::hex("#F2F2F2"), Color::ORANGE),
|
||||
RewriteColor::Change(Color::hex("#F2F2F2"), colors::HOVERING),
|
||||
ctx,
|
||||
)),
|
||||
ManagedWidget::btn(Button::rectangle_svg(
|
||||
"assets/layers/bus_network.svg",
|
||||
"bus network",
|
||||
hotkey(Key::U),
|
||||
RewriteColor::Change(Color::hex("#F2F2F2"), Color::ORANGE),
|
||||
RewriteColor::Change(Color::hex("#F2F2F2"), colors::HOVERING),
|
||||
ctx,
|
||||
)),
|
||||
];
|
||||
@ -306,7 +307,7 @@ impl Overlays {
|
||||
]),
|
||||
ManagedWidget::row(choices).flex_wrap(ctx, 20),
|
||||
])
|
||||
.bg(Color::hex("#5B5B5B")),
|
||||
.bg(colors::PANEL_BG),
|
||||
)
|
||||
.max_size_percent(30, 50)
|
||||
.build(ctx),
|
||||
@ -595,7 +596,7 @@ impl Overlays {
|
||||
ctx,
|
||||
),
|
||||
])
|
||||
.bg(Color::grey(0.4)),
|
||||
.bg(colors::PANEL_BG),
|
||||
)
|
||||
.aligned(HorizontalAlignment::Right, VerticalAlignment::Center)
|
||||
.build(ctx),
|
||||
@ -637,7 +638,7 @@ impl Overlays {
|
||||
"assets/tools/locate.svg",
|
||||
"intersection demand",
|
||||
None,
|
||||
RewriteColor::Change(Color::hex("#CC4121"), Color::ORANGE),
|
||||
RewriteColor::Change(Color::hex("#CC4121"), colors::HOVERING),
|
||||
ctx,
|
||||
)),
|
||||
WrappedComposite::text_button(ctx, "X", None).align_right(),
|
||||
@ -648,7 +649,7 @@ impl Overlays {
|
||||
ui.primary.sim.time(),
|
||||
i,
|
||||
batch.upload(ctx),
|
||||
Composite::new(ManagedWidget::col(col).bg(Color::grey(0.4)))
|
||||
Composite::new(ManagedWidget::col(col).bg(colors::PANEL_BG))
|
||||
.aligned(HorizontalAlignment::Right, VerticalAlignment::Center)
|
||||
.build(ctx),
|
||||
)
|
||||
@ -678,7 +679,7 @@ impl Overlays {
|
||||
"assets/tools/locate.svg",
|
||||
&format!("Stop {}", idx + 1),
|
||||
None,
|
||||
RewriteColor::Change(Color::hex("#CC4121"), Color::ORANGE),
|
||||
RewriteColor::Change(Color::hex("#CC4121"), colors::HOVERING),
|
||||
ctx,
|
||||
)),
|
||||
];
|
||||
@ -729,7 +730,7 @@ impl Overlays {
|
||||
]));
|
||||
|
||||
let mut c = WrappedComposite::new(
|
||||
Composite::new(ManagedWidget::col(master_col).bg(Color::grey(0.4)))
|
||||
Composite::new(ManagedWidget::col(master_col).bg(colors::PANEL_BG))
|
||||
.aligned(HorizontalAlignment::Right, VerticalAlignment::Center)
|
||||
.build(ctx),
|
||||
);
|
||||
@ -788,7 +789,7 @@ impl Overlays {
|
||||
]),
|
||||
Plot::new_duration(series, ctx).margin(10),
|
||||
])
|
||||
.bg(Color::grey(0.3)),
|
||||
.bg(colors::PANEL_BG),
|
||||
)
|
||||
// TODO Doesn't fit
|
||||
.aligned(HorizontalAlignment::Right, VerticalAlignment::Center)
|
||||
|
@ -1,9 +1,10 @@
|
||||
use crate::colors;
|
||||
use crate::game::Transition;
|
||||
use crate::managed::WrappedComposite;
|
||||
use crate::options;
|
||||
use ezgui::{
|
||||
hotkey, Button, Color, Composite, EventCtx, HorizontalAlignment, Key, ManagedWidget,
|
||||
RewriteColor, VerticalAlignment,
|
||||
hotkey, Button, Composite, EventCtx, HorizontalAlignment, Key, ManagedWidget, RewriteColor,
|
||||
VerticalAlignment,
|
||||
};
|
||||
|
||||
pub fn tool_panel(ctx: &mut EventCtx) -> WrappedComposite {
|
||||
@ -14,7 +15,7 @@ pub fn tool_panel(ctx: &mut EventCtx) -> WrappedComposite {
|
||||
"assets/tools/home.svg",
|
||||
"back",
|
||||
hotkey(Key::Escape),
|
||||
RewriteColor::ChangeAll(Color::ORANGE),
|
||||
RewriteColor::ChangeAll(colors::HOVERING),
|
||||
ctx,
|
||||
))
|
||||
.margin(10),
|
||||
@ -22,13 +23,13 @@ pub fn tool_panel(ctx: &mut EventCtx) -> WrappedComposite {
|
||||
"assets/tools/settings.svg",
|
||||
"settings",
|
||||
None,
|
||||
RewriteColor::ChangeAll(Color::ORANGE),
|
||||
RewriteColor::ChangeAll(colors::HOVERING),
|
||||
ctx,
|
||||
))
|
||||
.margin(10),
|
||||
];
|
||||
WrappedComposite::new(
|
||||
Composite::new(ManagedWidget::row(row).bg(Color::grey(0.4)))
|
||||
Composite::new(ManagedWidget::row(row).bg(colors::PANEL_BG))
|
||||
.aligned(HorizontalAlignment::Left, VerticalAlignment::BottomAboveOSD)
|
||||
.build(ctx),
|
||||
)
|
||||
|
@ -1,3 +1,4 @@
|
||||
use crate::colors;
|
||||
use crate::game::{State, Transition};
|
||||
use crate::helpers::plain_list_names;
|
||||
use crate::helpers::ID;
|
||||
@ -334,7 +335,7 @@ fn make_diagram(i: IntersectionID, selected: usize, ui: &UI, ctx: &mut EventCtx)
|
||||
);
|
||||
}
|
||||
|
||||
Composite::new(ManagedWidget::col(col).bg(Color::hex("#545454")))
|
||||
Composite::new(ManagedWidget::col(col).bg(colors::PANEL_BG))
|
||||
.aligned(HorizontalAlignment::Left, VerticalAlignment::Top)
|
||||
.max_size_percent(30, 90)
|
||||
.build(ctx)
|
||||
|
@ -1,3 +1,4 @@
|
||||
use crate::colors;
|
||||
use crate::common::Colorer;
|
||||
use crate::edit::apply_map_edits;
|
||||
use crate::game::{msg, State, Transition, WizardState};
|
||||
@ -220,7 +221,7 @@ fn make_brush_panel(ctx: &mut EventCtx, brush: Brush) -> Composite {
|
||||
} else {
|
||||
RewriteColor::NoOp
|
||||
},
|
||||
RewriteColor::ChangeAll(Color::ORANGE),
|
||||
RewriteColor::ChangeAll(colors::HOVERING),
|
||||
ctx,
|
||||
))])
|
||||
.padding(5),
|
||||
@ -231,7 +232,7 @@ fn make_brush_panel(ctx: &mut EventCtx, brush: Brush) -> Composite {
|
||||
ManagedWidget::draw_text(ctx, Text::from(Line("Modify lanes"))).centered_horiz(),
|
||||
ManagedWidget::row(row).centered(),
|
||||
])
|
||||
.bg(Color::hex("#4C4C4C"))
|
||||
.bg(colors::PANEL_BG)
|
||||
.padding(10),
|
||||
)
|
||||
.aligned(HorizontalAlignment::Center, VerticalAlignment::Top)
|
||||
|
@ -1,3 +1,4 @@
|
||||
use crate::colors;
|
||||
use crate::common::CommonState;
|
||||
use crate::edit::apply_map_edits;
|
||||
use crate::game::{msg, State, Transition, WizardState};
|
||||
@ -389,7 +390,7 @@ fn make_top_panel(can_undo: bool, can_redo: bool, ctx: &mut EventCtx) -> Composi
|
||||
})
|
||||
.margin(15),
|
||||
];
|
||||
Composite::new(ManagedWidget::row(row).bg(Color::hex("#545454")))
|
||||
Composite::new(ManagedWidget::row(row).bg(colors::PANEL_BG))
|
||||
.aligned(HorizontalAlignment::Center, VerticalAlignment::Top)
|
||||
.build(ctx)
|
||||
}
|
||||
@ -565,7 +566,7 @@ fn make_diagram(i: IntersectionID, selected: usize, ui: &UI, ctx: &mut EventCtx)
|
||||
);
|
||||
}
|
||||
|
||||
Composite::new(ManagedWidget::col(col).bg(Color::hex("#545454")))
|
||||
Composite::new(ManagedWidget::col(col).bg(colors::PANEL_BG))
|
||||
.aligned(HorizontalAlignment::Left, VerticalAlignment::Top)
|
||||
.max_size_percent(30, 90)
|
||||
.build(ctx)
|
||||
|
@ -1,5 +1,6 @@
|
||||
mod abtest;
|
||||
mod challenges;
|
||||
mod colors;
|
||||
mod common;
|
||||
mod debug;
|
||||
mod edit;
|
||||
|
@ -1,3 +1,4 @@
|
||||
use crate::colors;
|
||||
use crate::common::CommonState;
|
||||
use crate::game::{State, Transition};
|
||||
use crate::ui::UI;
|
||||
@ -68,7 +69,7 @@ impl WrappedComposite {
|
||||
filename,
|
||||
tooltip,
|
||||
hotkey,
|
||||
RewriteColor::Change(Color::WHITE, Color::ORANGE),
|
||||
RewriteColor::Change(Color::WHITE, colors::HOVERING),
|
||||
ctx,
|
||||
))
|
||||
}
|
||||
@ -81,7 +82,7 @@ impl WrappedComposite {
|
||||
) -> ManagedWidget {
|
||||
ManagedWidget::btn(Button::text_no_bg(
|
||||
txt.clone(),
|
||||
txt.change_fg(Color::ORANGE),
|
||||
txt.change_fg(colors::HOVERING),
|
||||
hotkey,
|
||||
label,
|
||||
true,
|
||||
@ -98,7 +99,7 @@ impl WrappedComposite {
|
||||
ManagedWidget::btn(Button::text_bg(
|
||||
Text::from(Line(label).fg(Color::BLACK)),
|
||||
Color::WHITE,
|
||||
Color::ORANGE,
|
||||
colors::HOVERING,
|
||||
hotkey,
|
||||
label,
|
||||
ctx,
|
||||
|
@ -1,5 +1,6 @@
|
||||
use crate::abtest::setup::PickABTest;
|
||||
use crate::challenges::challenges_picker;
|
||||
use crate::colors;
|
||||
use crate::game::{State, Transition};
|
||||
use crate::managed::{ManagedGUIState, WrappedComposite, WrappedOutcome};
|
||||
use crate::mission::MissionEditMode;
|
||||
@ -35,7 +36,7 @@ impl TitleScreen {
|
||||
ManagedWidget::btn(Button::text_bg(
|
||||
Text::from(Line("PLAY")),
|
||||
Color::BLUE,
|
||||
Color::ORANGE,
|
||||
colors::HOVERING,
|
||||
hotkey(Key::Space),
|
||||
"start game",
|
||||
ctx,
|
||||
|
@ -1,3 +1,4 @@
|
||||
use crate::colors;
|
||||
use crate::common::ShowBusRoute;
|
||||
use crate::game::{State, Transition};
|
||||
use crate::helpers::ID;
|
||||
@ -59,7 +60,7 @@ pub fn make(ctx: &mut EventCtx, ui: &UI, tab: Tab) -> Box<dyn State> {
|
||||
Composite::new(ManagedWidget::col(vec![
|
||||
ManagedWidget::row(tabs)
|
||||
.evenly_spaced()
|
||||
.bg(Color::grey(0.6))
|
||||
.bg(colors::PANEL_BG)
|
||||
.padding(10),
|
||||
content,
|
||||
]))
|
||||
@ -151,7 +152,7 @@ fn finished_trips_summary_prebaked(ctx: &EventCtx, ui: &UI) -> ManagedWidget {
|
||||
// TODO The x-axes for the plot and histogram get stretched to the full screen. Don't do that!
|
||||
ManagedWidget::col(vec![
|
||||
ManagedWidget::draw_text(ctx, txt),
|
||||
finished_trips_plot(ctx, ui).bg(Color::grey(0.3)),
|
||||
finished_trips_plot(ctx, ui).bg(colors::SECTION_BG),
|
||||
ManagedWidget::draw_text(
|
||||
ctx,
|
||||
Text::from(Line(
|
||||
@ -165,7 +166,7 @@ fn finished_trips_summary_prebaked(ctx: &EventCtx, ui: &UI) -> ManagedWidget {
|
||||
.finished_trip_deltas(ui.primary.sim.time(), ui.prebaked()),
|
||||
ctx,
|
||||
)
|
||||
.bg(Color::grey(0.3)),
|
||||
.bg(colors::SECTION_BG),
|
||||
])
|
||||
}
|
||||
|
||||
@ -213,7 +214,7 @@ fn finished_trips_summary_not_prebaked(ctx: &EventCtx, ui: &UI) -> ManagedWidget
|
||||
// TODO The x-axes for the plot and histogram get stretched to the full screen. Don't do that!
|
||||
ManagedWidget::col(vec![
|
||||
ManagedWidget::draw_text(ctx, txt),
|
||||
finished_trips_plot(ctx, ui).bg(Color::grey(0.3)),
|
||||
finished_trips_plot(ctx, ui).bg(colors::SECTION_BG),
|
||||
])
|
||||
}
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
use crate::colors;
|
||||
use crate::edit::EditMode;
|
||||
use crate::game::{State, Transition, WizardState};
|
||||
use crate::helpers::{nice_map_name, ID};
|
||||
@ -114,7 +115,7 @@ pub fn freeform_controller(
|
||||
.margin(5),
|
||||
])
|
||||
.centered()
|
||||
.bg(Color::grey(0.4)),
|
||||
.bg(colors::PANEL_BG),
|
||||
)
|
||||
.aligned(HorizontalAlignment::Center, VerticalAlignment::Top)
|
||||
.build(ctx),
|
||||
|
@ -10,6 +10,7 @@ mod tutorial;
|
||||
pub use self::tutorial::{Tutorial, TutorialState};
|
||||
use crate::challenges;
|
||||
use crate::challenges::challenges_picker;
|
||||
use crate::colors;
|
||||
use crate::common::{CommonState, Overlays};
|
||||
use crate::edit::EditMode;
|
||||
use crate::game::{msg, State, Transition};
|
||||
@ -312,7 +313,7 @@ fn challenge_controller(
|
||||
rows.extend(extra_rows);
|
||||
|
||||
WrappedComposite::new(
|
||||
Composite::new(ManagedWidget::col(rows).bg(Color::grey(0.4)))
|
||||
Composite::new(ManagedWidget::col(rows).bg(colors::PANEL_BG))
|
||||
.aligned(HorizontalAlignment::Center, VerticalAlignment::Top)
|
||||
.build(ctx),
|
||||
)
|
||||
@ -352,7 +353,7 @@ impl FinalScore {
|
||||
])
|
||||
.centered(),
|
||||
])
|
||||
.bg(Color::grey(0.4))
|
||||
.bg(colors::PANEL_BG)
|
||||
.outline(10.0, Color::WHITE)
|
||||
.padding(10),
|
||||
)
|
||||
|
@ -1,3 +1,4 @@
|
||||
use crate::colors;
|
||||
use crate::common::{tool_panel, Minimap, Overlays, Warping};
|
||||
use crate::edit::EditMode;
|
||||
use crate::game::{msg, Transition};
|
||||
@ -690,7 +691,7 @@ impl TutorialState {
|
||||
);
|
||||
}
|
||||
|
||||
Composite::new(ManagedWidget::col(col).bg(Color::grey(0.4)))
|
||||
Composite::new(ManagedWidget::col(col).bg(colors::PANEL_BG))
|
||||
.aligned(HorizontalAlignment::Center, VerticalAlignment::Top)
|
||||
.build(ctx)
|
||||
}
|
||||
@ -742,7 +743,7 @@ impl TutorialState {
|
||||
WrappedComposite::text_button(ctx, "OK", hotkey(Key::Enter))
|
||||
.centered_horiz(),
|
||||
])
|
||||
.bg(Color::grey(0.4))
|
||||
.bg(colors::PANEL_BG)
|
||||
.outline(5.0, Color::WHITE)
|
||||
.padding(5),
|
||||
)
|
||||
|
@ -2,6 +2,7 @@ mod dashboards;
|
||||
mod gameplay;
|
||||
mod speed;
|
||||
|
||||
use crate::colors;
|
||||
use crate::common::{tool_panel, CommonState, Minimap, Overlays, ShowBusRoute};
|
||||
use crate::debug::DebugMode;
|
||||
use crate::edit::{apply_map_edits, save_edits, EditMode, StopSignEditor, TrafficSignalEditor};
|
||||
@ -14,8 +15,8 @@ use crate::sandbox::gameplay::Tutorial;
|
||||
pub use crate::sandbox::gameplay::TutorialState;
|
||||
use crate::ui::{ShowEverything, UI};
|
||||
use ezgui::{
|
||||
hotkey, lctrl, Choice, Color, Composite, EventCtx, EventLoopMode, GfxCtx, HorizontalAlignment,
|
||||
Key, Line, ManagedWidget, Outcome, Text, VerticalAlignment, Wizard,
|
||||
hotkey, lctrl, Choice, Composite, EventCtx, EventLoopMode, GfxCtx, HorizontalAlignment, Key,
|
||||
Line, ManagedWidget, Outcome, Text, VerticalAlignment, Wizard,
|
||||
};
|
||||
pub use gameplay::spawner::spawn_agents_around;
|
||||
pub use gameplay::GameplayMode;
|
||||
@ -368,7 +369,7 @@ impl AgentMeter {
|
||||
// TODO The SVG button uses clip and doesn't seem to work
|
||||
WrappedComposite::text_button(ctx, "view finished trip data", hotkey(Key::Q)),
|
||||
])
|
||||
.bg(Color::grey(0.4))
|
||||
.bg(colors::PANEL_BG)
|
||||
.padding(20),
|
||||
)
|
||||
.aligned(HorizontalAlignment::Right, VerticalAlignment::Top)
|
||||
|
@ -1,3 +1,4 @@
|
||||
use crate::colors;
|
||||
use crate::game::{State, Transition, WizardState};
|
||||
use crate::managed::{WrappedComposite, WrappedOutcome};
|
||||
use crate::ui::UI;
|
||||
@ -29,8 +30,6 @@ enum SpeedSetting {
|
||||
|
||||
impl SpeedControls {
|
||||
fn make_panel(ctx: &mut EventCtx, paused: bool, setting: SpeedSetting) -> WrappedComposite {
|
||||
let bg = Color::hex("#7C7C7C");
|
||||
|
||||
let mut row = Vec::new();
|
||||
row.push(
|
||||
ManagedWidget::btn(if paused {
|
||||
@ -38,7 +37,7 @@ impl SpeedControls {
|
||||
"assets/speed/triangle.svg",
|
||||
"play",
|
||||
hotkey(Key::Space),
|
||||
RewriteColor::ChangeAll(Color::ORANGE),
|
||||
RewriteColor::ChangeAll(colors::HOVERING),
|
||||
ctx,
|
||||
)
|
||||
} else {
|
||||
@ -46,13 +45,13 @@ impl SpeedControls {
|
||||
"assets/speed/pause.svg",
|
||||
"pause",
|
||||
hotkey(Key::Space),
|
||||
RewriteColor::ChangeAll(Color::ORANGE),
|
||||
RewriteColor::ChangeAll(colors::HOVERING),
|
||||
ctx,
|
||||
)
|
||||
})
|
||||
.margin(5)
|
||||
.centered_vert()
|
||||
.bg(bg),
|
||||
.bg(colors::SECTION_BG),
|
||||
);
|
||||
|
||||
row.push(
|
||||
@ -74,14 +73,14 @@ impl SpeedControls {
|
||||
} else {
|
||||
RewriteColor::ChangeAll(Color::WHITE.alpha(0.2))
|
||||
},
|
||||
RewriteColor::ChangeAll(Color::ORANGE),
|
||||
RewriteColor::ChangeAll(colors::HOVERING),
|
||||
ctx,
|
||||
))
|
||||
.margin(5)
|
||||
})
|
||||
.collect(),
|
||||
)
|
||||
.bg(bg)
|
||||
.bg(colors::SECTION_BG)
|
||||
.centered(),
|
||||
);
|
||||
|
||||
@ -90,7 +89,7 @@ impl SpeedControls {
|
||||
vec![
|
||||
ManagedWidget::btn(Button::text_no_bg(
|
||||
Text::from(Line("+0.1s").fg(Color::WHITE).size(21).roboto()),
|
||||
Text::from(Line("+0.1s").fg(Color::ORANGE).size(21).roboto()),
|
||||
Text::from(Line("+0.1s").fg(colors::HOVERING).size(21).roboto()),
|
||||
hotkey(Key::M),
|
||||
"step forwards 0.1 seconds",
|
||||
false,
|
||||
@ -98,7 +97,7 @@ impl SpeedControls {
|
||||
)),
|
||||
ManagedWidget::btn(Button::text_no_bg(
|
||||
Text::from(Line("+1h").fg(Color::WHITE).size(21).roboto()),
|
||||
Text::from(Line("+1h").fg(Color::ORANGE).size(21).roboto()),
|
||||
Text::from(Line("+1h").fg(colors::HOVERING).size(21).roboto()),
|
||||
hotkey(Key::N),
|
||||
"step forwards 1 hour",
|
||||
false,
|
||||
@ -108,14 +107,14 @@ impl SpeedControls {
|
||||
"assets/speed/jump_to_time.svg",
|
||||
"jump to specific time",
|
||||
hotkey(Key::B),
|
||||
RewriteColor::ChangeAll(Color::ORANGE),
|
||||
RewriteColor::ChangeAll(colors::HOVERING),
|
||||
ctx,
|
||||
)),
|
||||
ManagedWidget::btn(Button::rectangle_svg(
|
||||
"assets/speed/reset.svg",
|
||||
"reset to midnight",
|
||||
hotkey(Key::X),
|
||||
RewriteColor::ChangeAll(Color::ORANGE),
|
||||
RewriteColor::ChangeAll(colors::HOVERING),
|
||||
ctx,
|
||||
)),
|
||||
]
|
||||
@ -123,14 +122,14 @@ impl SpeedControls {
|
||||
.map(|x| x.margin(5))
|
||||
.collect(),
|
||||
)
|
||||
.bg(bg)
|
||||
.bg(colors::SECTION_BG)
|
||||
.centered(),
|
||||
);
|
||||
|
||||
WrappedComposite::new(
|
||||
Composite::new(
|
||||
ManagedWidget::row(row.into_iter().map(|x| x.margin(5)).collect())
|
||||
.bg(Color::hex("#4C4C4C")),
|
||||
.bg(colors::PANEL_BG),
|
||||
)
|
||||
.aligned(
|
||||
HorizontalAlignment::Center,
|
||||
@ -395,7 +394,7 @@ impl TimePanel {
|
||||
batch.push(Color::WHITE, Polygon::rectangle(width, height));
|
||||
if percent != 0.0 {
|
||||
batch.push(
|
||||
Color::grey(0.5),
|
||||
colors::SECTION_BG,
|
||||
Polygon::rectangle(percent * width, height),
|
||||
);
|
||||
}
|
||||
@ -412,7 +411,7 @@ impl TimePanel {
|
||||
.evenly_spaced(),
|
||||
])
|
||||
.padding(10)
|
||||
.bg(Color::hex("#4C4C4C")),
|
||||
.bg(colors::PANEL_BG),
|
||||
)
|
||||
.aligned(HorizontalAlignment::Left, VerticalAlignment::Top)
|
||||
.build(ctx),
|
||||
|
Loading…
Reference in New Issue
Block a user