From 440b918f06f58c4ad4287f4f17165e916851fc09 Mon Sep 17 00:00:00 2001 From: That One Seong Date: Sat, 6 Jul 2024 03:46:22 +0000 Subject: [PATCH] Misc settings layout tweaks - Autofire toggle will be forcefully disabled and untickable if neither Rumble FF or Solenoid are currently enabled. - Small tweak to add the hex identifier 0x to the advanced view's hex ID preview, to make it clear that it's supposed to be seen as hexadecimal. --- guiwindow.cpp | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/guiwindow.cpp b/guiwindow.cpp index 9ba7f41..b24c094 100644 --- a/guiwindow.cpp +++ b/guiwindow.cpp @@ -1674,6 +1674,12 @@ void guiWindow::on_rumbleToggle_stateChanged(int arg1) } else { ui->rumbleFFToggle->setEnabled(true); } + if(!(arg1 && boolSettings[rumbleFF]) && !boolSettings[solenoid]) { + ui->autofireToggle->setChecked(false); + ui->autofireToggle->setEnabled(false); + } else { + ui->autofireToggle->setEnabled(true); + } DiffUpdate(); } @@ -1682,6 +1688,12 @@ void guiWindow::on_solenoidToggle_stateChanged(int arg1) { boolSettings[solenoid] = arg1; if(arg1) { ui->rumbleFFToggle->setChecked(false); } + if(!arg1 && !(boolSettings[rumble] && boolSettings[rumbleFF])) { + ui->autofireToggle->setChecked(false); + ui->autofireToggle->setEnabled(false); + } else { + ui->autofireToggle->setEnabled(true); + } DiffUpdate(); } @@ -1725,6 +1737,12 @@ void guiWindow::on_rumbleFFToggle_stateChanged(int arg1) { boolSettings[rumbleFF] = arg1; if(arg1) { ui->solenoidToggle->setChecked(false); } + if(!(arg1 && boolSettings[rumble]) && !boolSettings[solenoid]) { + ui->autofireToggle->setChecked(false); + ui->autofireToggle->setEnabled(false); + } else { + ui->autofireToggle->setEnabled(true); + } DiffUpdate(); } @@ -1784,13 +1802,13 @@ void guiWindow::on_productIdInput_textChanged(const QString &arg1) QString hex; if(iTest >= INT8_MIN && iTest <= INT8_MAX){ - hex = QString("%1").arg(iTest & 0xFF, 2, 16); + hex = QString("%1").arg(iTest & 0xFF, 2, 16).simplified(); } else if(iTest >= INT16_MIN && iTest <= INT16_MAX){ - hex = QString("%1").arg(iTest & 0xFFFF, 4, 16); + hex = QString("%1").arg(iTest & 0xFFFF, 4, 16).simplified(); } else { - hex = QString("%1").arg(iTest, 8, 16); + hex = QString("%1").arg(iTest, 8, 16).simplified(); } - ui->productIdConverted->setText(hex); + ui->productIdConverted->setText(QString("0x%1").arg(hex)); }