App 2.27.2: Terminal in the accent colour; Original as a colour choice
Retro and Terminal are one entry each; the accent colour drop-down offers "Original" first for them, remembered per style. The old "Retro (accent colour)" entry is folded in and its stored value migrated. Emulator only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LhzAVaUyqcw5PkGjz4mWW6
This commit is contained in:
@@ -2,43 +2,65 @@ package com.evsuite.abrp;
|
||||
|
||||
/**
|
||||
* The Overview styles in the order of the Settings drop-down, the value each is stored as, and
|
||||
* whether it is drawn in the chosen accent colour. Styles with their own fixed palette (Retro's
|
||||
* display, the starship console, the cartoon, the blueprint, the terminal, the flight display,
|
||||
* the nixie tubes) ignore it, so Settings only offers the accent colour for the others. Pure
|
||||
* Java, unit-tested.
|
||||
* how it takes colour:
|
||||
*
|
||||
* - {@link #usesAccent}: drawn in the chosen accent colour, so Settings offers the accent
|
||||
* colour for it. Styles with only their own fixed palette (the starship console, the cartoon,
|
||||
* the blueprint, the flight display, the nixie tubes) ignore it and Settings greys it out.
|
||||
* - {@link #hasOriginal}: has an original palette of its own as well (Retro's turquoise
|
||||
* display, the terminal's green phosphor); Settings then offers "Original colours" above the
|
||||
* accent colours, remembered per style under {@link #originalKey()}.
|
||||
*
|
||||
* Pure Java, unit-tested.
|
||||
*/
|
||||
enum OverviewStyle {
|
||||
TILES(true),
|
||||
GAUGES(true),
|
||||
COCKPIT(true),
|
||||
RETRO(false),
|
||||
RETRO_ACCENT(true),
|
||||
FUTURISTIC(true),
|
||||
SCIFI(false),
|
||||
CARTOON(false),
|
||||
BLUEPRINT(false),
|
||||
MG(true),
|
||||
MINIMAL(true),
|
||||
TERMINAL(false),
|
||||
AVIATION(false),
|
||||
NIXIE(false),
|
||||
CHRONOGRAPH(true);
|
||||
TILES(true, false),
|
||||
GAUGES(true, false),
|
||||
COCKPIT(true, false),
|
||||
RETRO(true, true),
|
||||
FUTURISTIC(true, false),
|
||||
SCIFI(false, false),
|
||||
CARTOON(false, false),
|
||||
BLUEPRINT(false, false),
|
||||
MG(true, false),
|
||||
MINIMAL(true, false),
|
||||
TERMINAL(true, true),
|
||||
AVIATION(false, false),
|
||||
NIXIE(false, false),
|
||||
CHRONOGRAPH(true, false);
|
||||
|
||||
static final String PREF_KEY = "overview_style";
|
||||
|
||||
/** Drawn in the accent colour, so the accent choice changes how it looks. */
|
||||
final boolean usesAccent;
|
||||
final boolean hasOriginal;
|
||||
|
||||
OverviewStyle(boolean usesAccent) {
|
||||
OverviewStyle(boolean usesAccent, boolean hasOriginal) {
|
||||
this.usesAccent = usesAccent;
|
||||
this.hasOriginal = hasOriginal;
|
||||
}
|
||||
|
||||
/** The stored style; "DASHBOARD" (Gauges before 2.22.3) and anything unknown handled. */
|
||||
/** Where the choice between the original palette and the accent colour is kept. */
|
||||
String originalKey() {
|
||||
return "original_colours_" + name();
|
||||
}
|
||||
|
||||
/**
|
||||
* The stored style. Older values: "DASHBOARD" (Gauges before 2.22.3), and "RETRO_ACCENT" /
|
||||
* "TERMINAL_ACCENT" (separate entries before 2.27.2, now the style in the accent colour —
|
||||
* see {@link #wasAccentEntry}). Anything unknown is Tiles.
|
||||
*/
|
||||
static OverviewStyle fromPref(String stored) {
|
||||
if ("DASHBOARD".equals(stored)) return GAUGES;
|
||||
if ("RETRO_ACCENT".equals(stored)) return RETRO;
|
||||
if ("TERMINAL_ACCENT".equals(stored)) return TERMINAL;
|
||||
for (OverviewStyle style : values()) {
|
||||
if (style.name().equals(stored)) return style;
|
||||
}
|
||||
return TILES;
|
||||
}
|
||||
|
||||
/** A stored value from when the accent-coloured variant was its own entry. */
|
||||
static boolean wasAccentEntry(String stored) {
|
||||
return "RETRO_ACCENT".equals(stored) || "TERMINAL_ACCENT".equals(stored);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user