From 6172c49ce119612e7ec80e635393585f34543ade Mon Sep 17 00:00:00 2001 From: VoxelTek <53562267+VoxelTek@users.noreply.github.com> Date: Wed, 18 Jun 2025 19:39:14 +1000 Subject: [PATCH] Finish config tool rewrite --- CONFIG/MainDlg.cpp | 46 ++++++++++++++++++++++++++-------------- CONFIG/MainDlg.h | 8 +++---- CONFIG/config.cpp | 2 +- CONFIG/res/maindialog.ui | 39 +++++++++++++++++++++++++++------- 4 files changed, 66 insertions(+), 29 deletions(-) diff --git a/CONFIG/MainDlg.cpp b/CONFIG/MainDlg.cpp index 2e046341..bf60ac00 100644 --- a/CONFIG/MainDlg.cpp +++ b/CONFIG/MainDlg.cpp @@ -130,6 +130,9 @@ bool CMainDialog::OnInitDialog() driver_i += 1; } m_ui->devicesList->setCurrentRow(selected); + + m_ui->maxLoDSlider->setValue((int)currentConfigApp->m_max_lod * 10); + m_ui->maxActorsSlider->setValue(currentConfigApp->m_max_actors); UpdateInterface(); return true; } @@ -353,9 +356,12 @@ void CMainDialog::SelectDiskPathDialog() disk_path, QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); - currentConfigApp->m_base_path = disk_path.toStdString(); - m_modified = true; - UpdateInterface(); + + if (disk_path.toStdString() != "") { + currentConfigApp->m_base_path = disk_path.toStdString(); + m_modified = true; + UpdateInterface(); + } } void CMainDialog::SelectCDPathDialog() @@ -365,9 +371,12 @@ void CMainDialog::SelectCDPathDialog() cd_path, QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); - currentConfigApp->m_cd_path = cd_path.toStdString(); - m_modified = true; - UpdateInterface(); + + if (cd_path.toStdString() != "") { + currentConfigApp->m_cd_path = cd_path.toStdString(); + m_modified = true; + UpdateInterface(); + } } void CMainDialog::SelectMediaPathDialog() @@ -377,9 +386,11 @@ void CMainDialog::SelectMediaPathDialog() media_path, QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); - currentConfigApp->m_media_path = media_path.toStdString(); - m_modified = true; - UpdateInterface(); + if (media_path.toStdString() != "") { + currentConfigApp->m_media_path = media_path.toStdString(); + m_modified = true; + UpdateInterface(); + } } void CMainDialog::SelectSavePathDialog() @@ -389,34 +400,37 @@ void CMainDialog::SelectSavePathDialog() save_path, QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); - currentConfigApp->m_save_path = save_path.toStdString(); - m_modified = true; - UpdateInterface(); + + if (save_path.toStdString() != "") { + currentConfigApp->m_save_path = save_path.toStdString(); + m_modified = true; + UpdateInterface(); + } } -void CMainDialog::DiskPathEdited(QString &text) +void CMainDialog::DiskPathEdited(const QString &text) { currentConfigApp->m_base_path = text.toStdString(); m_modified = true; UpdateInterface(); } -void CMainDialog::CDPathEdited(QString &text) +void CMainDialog::CDPathEdited(const QString &text) { currentConfigApp->m_cd_path = text.toStdString(); m_modified = true; UpdateInterface(); } -void CMainDialog::MediaPathEdited(QString &text) +void CMainDialog::MediaPathEdited(const QString &text) { currentConfigApp->m_media_path = text.toStdString(); m_modified = true; UpdateInterface(); } -void CMainDialog::SavePathEdited(QString &text) +void CMainDialog::SavePathEdited(const QString &text) { currentConfigApp->m_save_path = text.toStdString(); m_modified = true; diff --git a/CONFIG/MainDlg.h b/CONFIG/MainDlg.h index c0ea9739..b4eb84ad 100644 --- a/CONFIG/MainDlg.h +++ b/CONFIG/MainDlg.h @@ -51,10 +51,10 @@ private slots: void SelectCDPathDialog(); void SelectMediaPathDialog(); void SelectSavePathDialog(); - void DiskPathEdited(QString &text); - void CDPathEdited(QString &text); - void MediaPathEdited(QString &text); - void SavePathEdited(QString &text); + void DiskPathEdited(const QString &text); + void CDPathEdited(const QString &text); + void MediaPathEdited(const QString &text); + void SavePathEdited(const QString &text); void MaxLoDChanged(int value); void MaxActorsChanged(int value); }; diff --git a/CONFIG/config.cpp b/CONFIG/config.cpp index 81c9e965..335bf477 100644 --- a/CONFIG/config.cpp +++ b/CONFIG/config.cpp @@ -321,7 +321,7 @@ void CConfigApp::WriteRegisterSettings() const SetIniInt(dict, "isle:Island Quality", m_model_quality); SetIniInt(dict, "isle:Island Texture", m_texture_quality); - iniparser_set(dict, "isle:Max LOD", (const char)m_max_lod); + iniparser_set(dict, "isle:Max LOD", std::to_string(m_max_lod).c_str()); SetIniInt(dict, "isle:Max Allowed Extras", m_max_actors); #undef SetIniBool diff --git a/CONFIG/res/maindialog.ui b/CONFIG/res/maindialog.ui index aae18e52..1c497ad7 100644 --- a/CONFIG/res/maindialog.ui +++ b/CONFIG/res/maindialog.ui @@ -318,7 +318,7 @@ 35 - true + false Qt::Horizontal @@ -392,6 +392,9 @@ 20 + + false + Qt::Horizontal @@ -614,13 +617,6 @@ - - - - PushButton - - - @@ -636,6 +632,33 @@ + + diskPath + diskPathOpen + cdPath + cdPathOpen + mediaPath + mediaPathOpen + savePath + savePathOpen + textureQualityFastRadioButton + textureQualityHighRadioButton + modelQualityLowRadioButton + modelQualityMediumRadioButton + modelQualityHighRadioButton + maxLoDSlider + maxActorsSlider + colorPalette256RadioButton + colorPalette16bitRadioButton + sound3DCheckBox + musicCheckBox + joystickCheckBox + devicesList + flipVideoMemoryPagesCheckBox + videomemoryCheckBox + okButton + cancelButton +