Custom themes

Added toggles for the "Custom Themes" configuration. Colors, icons, sounds, and turn signal animations are all individually toggleable.
This commit is contained in:
FrogAi
2024-01-12 22:39:30 -07:00
parent 142e5e0975
commit 7e0e9f2643
67 changed files with 281 additions and 28 deletions

View File

@@ -214,10 +214,14 @@ static void update_state(UIState *s) {
}
if (sm.updated("carState")) {
auto carState = sm["carState"].getCarState();
if (scene.blind_spot_path) {
if (scene.blind_spot_path || scene.custom_signals) {
scene.blind_spot_left = carState.getLeftBlindspot();
scene.blind_spot_right = carState.getRightBlindspot();
}
if (scene.custom_signals) {
scene.turn_signal_left = carState.getLeftBlinker();
scene.turn_signal_right = carState.getRightBlinker();
}
}
if (sm.updated("controlsState")) {
auto controlsState = sm["controlsState"].getControlsState();
@@ -285,6 +289,10 @@ void ui_update_params(UIState *s) {
scene.show_fps = scene.custom_onroad_ui && params.getBool("ShowFPS");
scene.use_si = scene.custom_onroad_ui && params.getBool("UseSI");
scene.custom_theme = params.getBool("CustomTheme");
scene.custom_colors = scene.custom_theme ? params.getInt("CustomColors") : 0;
scene.custom_signals = scene.custom_theme ? params.getInt("CustomSignals") : 0;
scene.model_ui = params.getBool("ModelUI");
scene.acceleration_path = scene.model_ui && params.getBool("AccelerationPath");
scene.lane_line_width = params.getInt("LaneLinesWidth") * (scene.is_metric ? 1 : INCH_TO_CM) / 200;