Split and rename the ColorScheme experiment flag, to be more clear with ongoing new experiments

This commit is contained in:
Dustin Carlino 2022-07-11 15:59:34 +01:00
parent 46df90a238
commit 89184a3306
5 changed files with 17 additions and 15 deletions

View File

@ -63,10 +63,9 @@ impl ColorSchemeChoice {
pub struct ColorScheme {
scheme: ColorSchemeChoice,
/// Enable new stuff if true. This is temporary, to iterate quickly on
/// https://github.com/a-b-street/abstreet/pull/715. Once the dust settles there, the ideas
/// there will be baked in as defaults and this flag goes away.
pub experiment: bool,
pub road_outlines: bool,
pub road_class_colors: bool,
pub show_buildings_in_minimap: bool,
// UI
pub panel_bg: Color,
@ -187,7 +186,9 @@ impl ColorScheme {
ColorScheme {
scheme: ColorSchemeChoice::DayMode,
experiment: false,
road_outlines: false,
road_class_colors: false,
show_buildings_in_minimap: true,
// UI
panel_bg: gui_style.panel_bg,
@ -340,7 +341,9 @@ impl ColorScheme {
fn day_mode() -> ColorScheme {
let mut cs = Self::light_background(Style::light_bg());
cs.scheme = ColorSchemeChoice::DayMode;
cs.experiment = true;
cs.road_outlines = true;
cs.road_class_colors = true;
cs.show_buildings_in_minimap = false;
cs.map_background = hex("#EEE5C8").into();
cs.grass = hex("#BED4A3").into();
@ -360,7 +363,6 @@ impl ColorScheme {
fn ltn() -> ColorScheme {
let mut cs = ColorScheme::day_mode();
cs.scheme = ColorSchemeChoice::LTN;
cs.experiment = true;
cs.private_road = None;
cs.fade_map_dark = Color::BLACK.alpha(0.3);
@ -408,7 +410,7 @@ impl ColorScheme {
}
pub fn zoomed_road_surface(&self, lane: LaneType, rank: RoadRank) -> Color {
let main_asphalt = if self.experiment {
let main_asphalt = if self.road_class_colors {
match rank {
RoadRank::Highway => Color::grey(0.3),
RoadRank::Arterial => Color::grey(0.4),
@ -417,7 +419,7 @@ impl ColorScheme {
} else {
self.driving_lane
};
let parking_asphalt = if self.experiment {
let parking_asphalt = if self.road_class_colors {
main_asphalt
} else {
self.parking_lane
@ -436,7 +438,7 @@ impl ColorScheme {
}
}
pub fn zoomed_intersection_surface(&self, rank: RoadRank) -> Color {
if self.experiment {
if self.road_class_colors {
self.zoomed_road_surface(LaneType::Driving, rank)
} else {
self.normal_intersection

View File

@ -50,7 +50,7 @@ impl DrawIntersection {
app.cs().zoomed_road_surface(LaneType::Sidewalk, rank),
calculate_corners(i, map),
);
if app.cs().experiment {
if app.cs().road_outlines {
default_geom.extend(app.cs().curb(rank), calculate_corner_curbs(i, map));
}

View File

@ -49,7 +49,7 @@ impl DrawLane {
if lane.is_sidewalk() {
batch.extend(app.cs().sidewalk_lines, calculate_sidewalk_lines(lane));
}
if app.cs().experiment && !road.is_footway() {
if app.cs().road_outlines && !road.is_footway() {
// Create a sense of depth at the curb
let width = Distance::meters(0.2);
let mut shift = (lane.width - width) / 2.0;

View File

@ -220,7 +220,7 @@ impl DrawMap {
r.center_pts.make_polygons(width),
));
if cs.experiment {
if cs.road_outlines {
// Draw a thick outline on the left and right
if let Ok(pl) = r.center_pts.shift_left(width / 2.0) {
unzoomed_pieces.push((
@ -264,7 +264,7 @@ impl DrawMap {
};
unzoomed_pieces.push((zorder, intersection_color.into(), i.polygon.clone()));
if cs.experiment {
if cs.road_outlines {
for pl in DrawIntersection::get_unzoomed_outline(i, map) {
unzoomed_pieces.push((
zorder + outline_z_offset,

View File

@ -438,7 +438,7 @@ impl<A: AppLike + 'static, T: MinimapControls<A>> Minimap<A, T> {
g.redraw(&draw_map.draw_all_areas);
g.redraw(&draw_map.draw_all_unzoomed_parking_lots);
g.redraw(&draw_map.draw_all_unzoomed_roads_and_intersections);
if !app.cs().experiment {
if app.cs().show_buildings_in_minimap {
g.redraw(&draw_map.draw_all_buildings);
}
for draw in extra {