Skip to content

Commit

Permalink
Misc settings layout tweaks
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
SeongGino authored Jul 6, 2024
1 parent 97712c6 commit 440b918
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions guiwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand All @@ -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();
}

Expand Down Expand Up @@ -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();
}

Expand Down Expand Up @@ -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));
}


Expand Down

0 comments on commit 440b918

Please sign in to comment.