From f258b2c1a8d633b1df1e5f09f58414f51b260045 Mon Sep 17 00:00:00 2001 From: BagelSketches Date: Fri, 4 Jul 2025 17:40:54 +1000 Subject: [PATCH] added modern controls checkbox to ui --- CONFIG/MainDlg.cpp | 11 ++++ CONFIG/MainDlg.h | 1 + CONFIG/config.cpp | 2 + CONFIG/config.h | 1 + CONFIG/res/maindialog.ui | 131 ++++++++++++++++++++++----------------- 5 files changed, 88 insertions(+), 58 deletions(-) diff --git a/CONFIG/MainDlg.cpp b/CONFIG/MainDlg.cpp index 828395bd..2f66e371 100644 --- a/CONFIG/MainDlg.cpp +++ b/CONFIG/MainDlg.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -59,6 +60,7 @@ CMainDialog::CMainDialog(QWidget* pParent) : QDialog(pParent) connect(m_ui->sound3DCheckBox, &QCheckBox::toggled, this, &CMainDialog::OnCheckbox3DSound); connect(m_ui->joystickCheckBox, &QCheckBox::toggled, this, &CMainDialog::OnCheckboxJoystick); connect(m_ui->fullscreenCheckBox, &QCheckBox::toggled, this, &CMainDialog::OnCheckboxFullscreen); + connect(m_ui->modernControlsCheckBox, &QCheckBox::toggled, this, &CMainDialog::OnCheckboxModernControls); connect(m_ui->transitionTypeComboBox, &QComboBox::currentIndexChanged, this, &CMainDialog::TransitionTypeChanged); connect(m_ui->okButton, &QPushButton::clicked, this, &CMainDialog::accept); connect(m_ui->cancelButton, &QPushButton::clicked, this, &CMainDialog::reject); @@ -214,6 +216,7 @@ void CMainDialog::UpdateInterface() m_ui->musicCheckBox->setChecked(currentConfigApp->m_music); m_ui->fullscreenCheckBox->setChecked(currentConfigApp->m_full_screen); m_ui->transitionTypeComboBox->setCurrentIndex(currentConfigApp->m_transition_type); + m_ui->modernControlsCheckBox->setChecked(currentConfigApp->m_modern_controls_enabled); m_ui->dataPath->setText(QString::fromStdString(currentConfigApp->m_cd_path)); m_ui->savePath->setText(QString::fromStdString(currentConfigApp->m_save_path)); } @@ -226,6 +229,7 @@ void CMainDialog::OnCheckbox3DSound(bool checked) UpdateInterface(); } + // FUNCTION: CONFIG 0x004046d0 void CMainDialog::OnRadiobuttonModelLowQuality(bool checked) { @@ -298,6 +302,13 @@ void CMainDialog::OnCheckboxFullscreen(bool checked) UpdateInterface(); } +void CMainDialog::OnCheckboxModernControls(bool checked) +{ + currentConfigApp->m_modern_controls_enabled = checked; + m_modified = true; + UpdateInterface(); +} + void CMainDialog::TransitionTypeChanged(int index) { currentConfigApp->m_transition_type = index; diff --git a/CONFIG/MainDlg.h b/CONFIG/MainDlg.h index 72062486..823c509a 100644 --- a/CONFIG/MainDlg.h +++ b/CONFIG/MainDlg.h @@ -43,6 +43,7 @@ private slots: void OnCheckboxJoystick(bool checked); void OnCheckboxMusic(bool checked); void OnCheckboxFullscreen(bool checked); + void OnCheckboxModernControls(bool checked); void TransitionTypeChanged(int index); void accept() override; void reject() override; diff --git a/CONFIG/config.cpp b/CONFIG/config.cpp index b4435298..661f9b82 100644 --- a/CONFIG/config.cpp +++ b/CONFIG/config.cpp @@ -159,6 +159,7 @@ bool CConfigApp::ReadRegisterSettings() m_wide_view_angle = iniparser_getboolean(dict, "isle:Wide View Angle", m_wide_view_angle); m_3d_sound = iniparser_getboolean(dict, "isle:3DSound", m_3d_sound); m_draw_cursor = iniparser_getboolean(dict, "isle:Draw Cursor", m_draw_cursor); + m_modern_controls_enabled = iniparser_getboolean(dict, "isle:ModernControls", m_modern_controls_enabled); m_model_quality = iniparser_getint(dict, "isle:Island Quality", m_model_quality); m_texture_quality = iniparser_getint(dict, "isle:Island Texture", m_texture_quality); m_use_joystick = iniparser_getboolean(dict, "isle:UseJoystick", m_use_joystick); @@ -309,6 +310,7 @@ void CConfigApp::WriteRegisterSettings() const SetIniBool(dict, "isle:Flip Surfaces", m_flip_surfaces); SetIniBool(dict, "isle:Full Screen", m_full_screen); SetIniBool(dict, "isle:Wide View Angle", m_wide_view_angle); + SetIniBool(dict, "isle:isle:ModernControls", m_modern_controls_enabled); SetIniInt(dict, "isle:Transition Type", m_transition_type); diff --git a/CONFIG/config.h b/CONFIG/config.h index dffc2b6c..d38393ec 100644 --- a/CONFIG/config.h +++ b/CONFIG/config.h @@ -65,6 +65,7 @@ class CConfigApp { int m_display_bit_depth; bool m_flip_surfaces; bool m_full_screen; + bool m_modern_controls_enabled; int m_transition_type; bool m_3d_video_ram; bool m_wide_view_angle; diff --git a/CONFIG/res/maindialog.ui b/CONFIG/res/maindialog.ui index 66e2b52e..bdf0e488 100644 --- a/CONFIG/res/maindialog.ui +++ b/CONFIG/res/maindialog.ui @@ -7,7 +7,7 @@ 0 0 575 - 600 + 618 @@ -23,7 +23,7 @@ :/lego1.png:/lego1.png - + @@ -187,6 +187,38 @@ 0 + + + + Set texture detail level. + + + Island Texture Quality + + + + 0 + + + 0 + + + + + Fast + + + + + + + High + + + + + + @@ -275,38 +307,6 @@ - - - - Set texture detail level. - - - Island Texture Quality - - - - 0 - - - 0 - - - - - Fast - - - - - - - High - - - - - - @@ -358,28 +358,17 @@ - - - - - Enable 3D positional audio effects. - - - 3D Sound - - - - - - - Enable in-game background music. - - - Music - - - - + + + 0 + 0 + + + + Qt::LayoutDirection::LeftToRight + + + Enable joystick and gamepad support for LEGO Island. @@ -389,7 +378,7 @@ - + Toggle fullscreen display mode. @@ -399,6 +388,33 @@ + + + + Enable 3D positional audio effects. + + + 3D Sound + + + + + + + Enable in-game background music. + + + Music + + + + + + + Enable Modern Controls + + + @@ -612,7 +628,6 @@ modelQualityLowRadioButton modelQualityMediumRadioButton modelQualityHighRadioButton - maxLoDSlider maxActorsSlider sound3DCheckBox musicCheckBox