wip
This commit is contained in:
@@ -29,6 +29,8 @@
|
|||||||
// p.restore();
|
// p.restore();
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
bool alert_is_visible = false;
|
||||||
|
|
||||||
OnroadWindow::OnroadWindow(QWidget *parent) : QWidget(parent), scene(uiState()->scene) {
|
OnroadWindow::OnroadWindow(QWidget *parent) : QWidget(parent), scene(uiState()->scene) {
|
||||||
QVBoxLayout *main_layout = new QVBoxLayout(this);
|
QVBoxLayout *main_layout = new QVBoxLayout(this);
|
||||||
main_layout->setMargin(UI_BORDER_SIZE);
|
main_layout->setMargin(UI_BORDER_SIZE);
|
||||||
@@ -232,6 +234,8 @@ void OnroadAlerts::updateAlert(const Alert &a) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void OnroadAlerts::paintEvent(QPaintEvent *event) {
|
void OnroadAlerts::paintEvent(QPaintEvent *event) {
|
||||||
|
alert_is_visible = false;
|
||||||
|
|
||||||
if (alert.size == cereal::ControlsState::AlertSize::NONE) {
|
if (alert.size == cereal::ControlsState::AlertSize::NONE) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -240,6 +244,8 @@ void OnroadAlerts::paintEvent(QPaintEvent *event) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
alert_is_visible = true;
|
||||||
|
|
||||||
static std::map<cereal::ControlsState::AlertSize, const int> alert_heights = {
|
static std::map<cereal::ControlsState::AlertSize, const int> alert_heights = {
|
||||||
{cereal::ControlsState::AlertSize::SMALL, 271},
|
{cereal::ControlsState::AlertSize::SMALL, 271},
|
||||||
{cereal::ControlsState::AlertSize::MID, 420},
|
{cereal::ControlsState::AlertSize::MID, 420},
|
||||||
@@ -386,7 +392,7 @@ void AnnotatedCameraWidget::drawHud(QPainter &p) {
|
|||||||
p.save();
|
p.save();
|
||||||
|
|
||||||
int screenDisaplayMode = paramsMemory.getInt("ScreenDisaplayMode");
|
int screenDisaplayMode = paramsMemory.getInt("ScreenDisaplayMode");
|
||||||
if (screenDisaplayMode == 1 && !alert->isVisible()) {
|
if (screenDisaplayMode == 1 && !alert_is_visible) {
|
||||||
// Draw black, filled, full-size rectangle to blank the screen
|
// Draw black, filled, full-size rectangle to blank the screen
|
||||||
// p.fillRect(0, 0, width(), height(), Qt::black);
|
// p.fillRect(0, 0, width(), height(), Qt::black);
|
||||||
// p.restore();
|
// p.restore();
|
||||||
|
|||||||
Reference in New Issue
Block a user