Visuals - Screen Management - Hide UI Elements - Alerts

Hide non-critical alerts on the onroad screen.
This commit is contained in:
FrogAi 2024-05-11 15:38:15 -07:00
parent efb2be1900
commit 89ab6b591a
4 changed files with 12 additions and 0 deletions

View File

@ -15,6 +15,7 @@ void OnroadAlerts::updateState(const UIState &s) {
// FrogPilot variables
const UIScene &scene = s.scene;
hideAlerts = scene.hide_alerts;
roadNameUI = scene.road_name_ui;
showAOLStatusBar = scene.show_aol_status_bar;
showCEMStatusBar = scene.show_cem_status_bar;
@ -65,6 +66,11 @@ void OnroadAlerts::paintEvent(QPaintEvent *event) {
if (alert.size == cereal::ControlsState::AlertSize::NONE) {
return;
}
if (hideAlerts && alert.status == cereal::ControlsState::AlertStatus::NORMAL) {
return;
}
static std::map<cereal::ControlsState::AlertSize, const int> alert_heights = {
{cereal::ControlsState::AlertSize::SMALL, 271},
{cereal::ControlsState::AlertSize::MID, 420},

View File

@ -41,6 +41,7 @@ protected:
Alert alert = {};
// FrogPilot variables
bool hideAlerts;
bool roadNameUI;
bool showAOLStatusBar;
bool showCEMStatusBar;

View File

@ -428,6 +428,10 @@ void ui_update_frogpilot_params(UIState *s, Params &params) {
scene.stopped_timer = quality_of_life_visuals && params.getBool("StoppedTimer");
scene.wheel_speed = quality_of_life_visuals && params.getBool("WheelSpeed");
bool screen_management = params.getBool("ScreenManagement");
bool hide_ui_elements = screen_management && params.getBool("HideUIElements");
scene.hide_alerts = hide_ui_elements && params.getBool("HideAlerts");
scene.speed_limit_controller = scene.longitudinal_control && params.getBool("SpeedLimitController");
scene.show_slc_offset = scene.speed_limit_controller && params.getBool("ShowSLCOffset");
scene.show_slc_offset_ui = scene.speed_limit_controller && params.getBool("ShowSLCOffsetUI");

View File

@ -145,6 +145,7 @@ typedef struct UIScene {
bool full_map;
bool has_auto_tune;
bool has_lead;
bool hide_alerts;
bool hide_lead_marker;
bool hide_speed;
bool hide_speed_ui;