mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-09-10 02:03:57 +08:00
Visuals - Quality of Life - Driver Camera On Reverse
Added toggle to show the driver camera when in the reverse gear.
This commit is contained in:
@@ -67,6 +67,10 @@ void HomeWindow::updateState(const UIState &s) {
|
||||
body->setEnabled(true);
|
||||
slayout->setCurrentWidget(body);
|
||||
}
|
||||
|
||||
if (s.scene.started) {
|
||||
showDriverView(s.scene.driver_camera_timer >= 10, true);
|
||||
}
|
||||
}
|
||||
|
||||
void HomeWindow::offroadTransition(bool offroad) {
|
||||
@@ -80,10 +84,11 @@ void HomeWindow::offroadTransition(bool offroad) {
|
||||
}
|
||||
}
|
||||
|
||||
void HomeWindow::showDriverView(bool show) {
|
||||
void HomeWindow::showDriverView(bool show, bool started) {
|
||||
if (show) {
|
||||
emit closeSettings();
|
||||
slayout->setCurrentWidget(driver_view);
|
||||
sidebar->setVisible(show == false);
|
||||
} else {
|
||||
if (started) {
|
||||
slayout->setCurrentWidget(onroad);
|
||||
@@ -93,7 +98,6 @@ void HomeWindow::showDriverView(bool show) {
|
||||
sidebar->setVisible(show == false);
|
||||
}
|
||||
}
|
||||
sidebar->setVisible(show == false);
|
||||
}
|
||||
|
||||
void HomeWindow::mousePressEvent(QMouseEvent* e) {
|
||||
|
||||
@@ -56,7 +56,7 @@ signals:
|
||||
|
||||
public slots:
|
||||
void offroadTransition(bool offroad);
|
||||
void showDriverView(bool show);
|
||||
void showDriverView(bool show, bool started=false);
|
||||
void showSidebar(bool show);
|
||||
void showMapPanel(bool show);
|
||||
|
||||
|
||||
@@ -417,6 +417,7 @@ void ui_update_frogpilot_params(UIState *s) {
|
||||
scene.big_map = quality_of_life_visuals && params.getBool("BigMap");
|
||||
scene.full_map = scene.big_map && params.getBool("FullMap");
|
||||
scene.camera_view = quality_of_life_visuals ? params.getInt("CameraView") : 0;
|
||||
scene.driver_camera = quality_of_life_visuals && params.getBool("DriverCamera");
|
||||
|
||||
scene.speed_limit_controller = scene.longitudinal_control && params.getBool("SpeedLimitController");
|
||||
scene.show_slc_offset = scene.speed_limit_controller && params.getBool("ShowSLCOffset");
|
||||
@@ -510,6 +511,7 @@ void UIState::update() {
|
||||
scene.conditional_status = scene.conditional_experimental && scene.enabled ? paramsMemory.getInt("CEStatus") : 0;
|
||||
scene.current_holiday_theme = scene.holiday_themes ? paramsMemory.getInt("CurrentHolidayTheme") : 0;
|
||||
scene.current_random_event = scene.random_events ? paramsMemory.getInt("CurrentRandomEvent") : 0;
|
||||
scene.driver_camera_timer = scene.driver_camera && scene.reverse ? scene.driver_camera_timer + 1 : 0;
|
||||
}
|
||||
|
||||
void UIState::setPrimeType(PrimeType type) {
|
||||
|
||||
@@ -134,6 +134,7 @@ typedef struct UIScene {
|
||||
bool conditional_experimental;
|
||||
bool disable_smoothing_mtsc;
|
||||
bool disable_smoothing_vtsc;
|
||||
bool driver_camera;
|
||||
bool dynamic_path_width;
|
||||
bool dynamic_pedals_on_ui;
|
||||
bool enabled;
|
||||
@@ -232,6 +233,7 @@ typedef struct UIScene {
|
||||
int custom_icons;
|
||||
int custom_signals;
|
||||
int desired_follow;
|
||||
int driver_camera_timer;
|
||||
int lead_distance;
|
||||
int model_length;
|
||||
int obstacle_distance;
|
||||
|
||||
Reference in New Issue
Block a user