Add extra options, clean up layout

This commit is contained in:
VoxelTek 2025-07-14 14:12:25 +10:00
parent 26b450a719
commit af280eed1e
5 changed files with 341 additions and 158 deletions

View File

@ -57,8 +57,9 @@ CMainDialog::CMainDialog(QWidget* pParent) : QDialog(pParent)
connect(m_ui->devicesList, &QListWidget::currentRowChanged, this, &CMainDialog::OnList3DevicesSelectionChanged);
connect(m_ui->musicCheckBox, &QCheckBox::toggled, this, &CMainDialog::OnCheckboxMusic);
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->rumbleCheckBox, &QCheckBox::toggled, this, &CMainDialog::OnCheckboxRumble);
connect(m_ui->touchComboBox, &QComboBox::currentIndexChanged, this, &CMainDialog::TouchControlsChanged);
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);
@ -210,9 +211,9 @@ void CMainDialog::UpdateInterface()
else {
m_ui->textureQualityHighRadioButton->setChecked(true);
}
m_ui->joystickCheckBox->setChecked(currentConfigApp->m_use_joystick);
m_ui->musicCheckBox->setChecked(currentConfigApp->m_music);
m_ui->fullscreenCheckBox->setChecked(currentConfigApp->m_full_screen);
m_ui->rumbleCheckBox->setChecked(currentConfigApp->m_haptic);
m_ui->transitionTypeComboBox->setCurrentIndex(currentConfigApp->m_transition_type);
m_ui->dataPath->setText(QString::fromStdString(currentConfigApp->m_cd_path));
m_ui->savePath->setText(QString::fromStdString(currentConfigApp->m_save_path));
@ -275,14 +276,6 @@ void CMainDialog::OnRadiobuttonTextureHighQuality(bool checked)
}
}
// FUNCTION: CONFIG 0x00404790
void CMainDialog::OnCheckboxJoystick(bool checked)
{
currentConfigApp->m_use_joystick = checked;
m_modified = true;
UpdateInterface();
}
// FUNCTION: CONFIG 0x004048c0
void CMainDialog::OnCheckboxMusic(bool checked)
{
@ -298,6 +291,20 @@ void CMainDialog::OnCheckboxFullscreen(bool checked)
UpdateInterface();
}
void CMainDialog::OnCheckboxRumble(bool checked)
{
currentConfigApp->m_haptic = checked;
m_modified = true;
UpdateInterface();
}
void CMainDialog::TouchControlsChanged(int index)
{
currentConfigApp->m_touchScheme = index;
m_modified = true;
UpdateInterface();
}
void CMainDialog::TransitionTypeChanged(int index)
{
currentConfigApp->m_transition_type = index;

View File

@ -40,9 +40,10 @@ private slots:
void OnRadiobuttonModelHighQuality(bool checked);
void OnRadiobuttonTextureLowQuality(bool checked);
void OnRadiobuttonTextureHighQuality(bool checked);
void OnCheckboxJoystick(bool checked);
void OnCheckboxMusic(bool checked);
void OnCheckboxFullscreen(bool checked);
void OnCheckboxRumble(bool checked);
void TouchControlsChanged(int index);
void TransitionTypeChanged(int index);
void accept() override;
void reject() override;

View File

@ -78,6 +78,8 @@ bool CConfigApp::InitInstance()
m_3d_video_ram = FALSE;
m_joystick_index = -1;
m_display_bit_depth = 16;
m_haptic = TRUE;
m_touchScheme = 2;
int totalRamMiB = SDL_GetSystemRAM();
if (totalRamMiB < 12) {
m_3d_sound = FALSE;
@ -155,6 +157,7 @@ bool CConfigApp::ReadRegisterSettings()
m_flip_surfaces = iniparser_getboolean(dict, "isle:Flip Surfaces", m_flip_surfaces);
m_full_screen = iniparser_getboolean(dict, "isle:Full Screen", m_full_screen);
m_transition_type = iniparser_getint(dict, "isle:Transition Type", m_transition_type);
m_touchScheme = iniparser_getint(dict, "isle:Touch Scheme", m_touchScheme);
m_3d_video_ram = iniparser_getboolean(dict, "isle:Back Buffers in Video RAM", m_3d_video_ram);
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);
@ -162,6 +165,7 @@ bool CConfigApp::ReadRegisterSettings()
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);
m_haptic = iniparser_getboolean(dict, "isle:Haptic", m_haptic);
m_music = iniparser_getboolean(dict, "isle:Music", m_music);
m_joystick_index = iniparser_getint(dict, "isle:JoystickIndex", m_joystick_index);
m_max_lod = iniparser_getdouble(dict, "isle:Max LOD", m_max_lod);
@ -230,6 +234,14 @@ bool CConfigApp::ValidateSettings()
m_max_actors = 20;
is_modified = TRUE;
}
if (!m_use_joystick) {
m_use_joystick = true;
is_modified = TRUE;
}
if (m_touchScheme < 0 || m_touchScheme > 2) {
m_touchScheme = 2;
is_modified = TRUE;
}
return is_modified;
}
@ -311,9 +323,11 @@ void CConfigApp::WriteRegisterSettings() const
SetIniBool(dict, "isle:Wide View Angle", m_wide_view_angle);
SetIniInt(dict, "isle:Transition Type", m_transition_type);
SetIniInt(dict, "isle:Touch Scheme", m_touchScheme);
SetIniBool(dict, "isle:3DSound", m_3d_sound);
SetIniBool(dict, "isle:Music", m_music);
SetIniBool(dict, "isle:Haptic", m_haptic);
SetIniBool(dict, "isle:UseJoystick", m_use_joystick);
SetIniInt(dict, "isle:JoystickIndex", m_joystick_index);

View File

@ -71,6 +71,7 @@ class CConfigApp {
bool m_3d_sound;
bool m_draw_cursor;
bool m_use_joystick;
bool m_haptic;
int m_joystick_index;
int m_model_quality;
int m_texture_quality;
@ -81,6 +82,7 @@ class CConfigApp {
std::string m_save_path;
float m_max_lod;
int m_max_actors;
int m_touchScheme;
};
extern CConfigApp g_theApp;

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>550</width>
<height>610</height>
<height>620</height>
</rect>
</property>
<property name="sizePolicy">
@ -23,7 +23,7 @@
<iconset resource="config.qrc">
<normaloff>:/lego1.png</normaloff>:/lego1.png</iconset>
</property>
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,1">
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,0">
<item>
<widget class="QLabel" name="sharkImageLabel">
<property name="sizePolicy">
@ -184,8 +184,8 @@
<property name="rightMargin">
<number>0</number>
</property>
<item row="0" column="3">
<widget class="QGroupBox" name="modelQualityGroup">
<item row="1" column="3">
<widget class="QGroupBox" name="maxActorsGroup">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
@ -193,36 +193,65 @@
</sizepolicy>
</property>
<property name="toolTip">
<string>Set 3D model detail level.</string>
<string>Maximum number of LEGO actors to exist in the world at a time. The game will gradually increase the number of actors until this maximum is reached and while performance is acceptable.</string>
</property>
<property name="title">
<string>Island Model Quality</string>
<string>Maximum Actors (5..40)</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_6">
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
<widget class="QRadioButton" name="modelQualityLowRadioButton">
<property name="toolTip">
<string>Broken, not recommended.</string>
<widget class="QSlider" name="maxActorsSlider">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 0, 0);</string>
<property name="minimum">
<number>5</number>
</property>
<property name="text">
<string>Low - BROKEN!</string>
<property name="maximum">
<number>40</number>
</property>
<property name="singleStep">
<number>5</number>
</property>
<property name="value">
<number>20</number>
</property>
<property name="sliderPosition">
<number>20</number>
</property>
<property name="tracking">
<bool>false</bool>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::NoTicks</enum>
</property>
<property name="tickInterval">
<number>5</number>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="modelQualityMediumRadioButton">
<property name="text">
<string>Medium</string>
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>15</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="modelQualityHighRadioButton">
<property name="text">
<string>High</string>
<string>20</string>
</property>
</widget>
</item>
@ -284,11 +313,78 @@
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="LoDNum">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>15</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>35</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="3">
<widget class="QGroupBox" name="modelQualityGroup">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Set 3D model detail level.</string>
</property>
<property name="title">
<string>Island Model Quality</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<widget class="QRadioButton" name="modelQualityLowRadioButton">
<property name="toolTip">
<string>Broken, not recommended.</string>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 0, 0);</string>
</property>
<property name="text">
<string>Low - BROKEN!</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="modelQualityMediumRadioButton">
<property name="text">
<string>Medium</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="modelQualityHighRadioButton">
<property name="text">
<string>High</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="2">
<widget class="QGroupBox" name="textureQualityGroup">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
@ -301,6 +397,9 @@
<property name="title">
<string>Island Texture Quality</string>
</property>
<property name="flat">
<bool>false</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
<property name="topMargin">
<number>0</number>
@ -325,61 +424,6 @@
</layout>
</widget>
</item>
<item row="1" column="3">
<widget class="QGroupBox" name="maxActorsGroup">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Maximum number of LEGO actors to exist in the world at a time. The game will gradually increase the number of actors until this maximum is reached and while performance is acceptable.</string>
</property>
<property name="title">
<string>Maximum Actors (5..40)</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
<widget class="QSlider" name="maxActorsSlider">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimum">
<number>5</number>
</property>
<property name="maximum">
<number>40</number>
</property>
<property name="singleStep">
<number>5</number>
</property>
<property name="value">
<number>20</number>
</property>
<property name="sliderPosition">
<number>20</number>
</property>
<property name="tracking">
<bool>false</bool>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::NoTicks</enum>
</property>
<property name="tickInterval">
<number>5</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
@ -392,9 +436,6 @@
</sizepolicy>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>10</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
@ -421,16 +462,6 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="joystickCheckBox">
<property name="toolTip">
<string>Enable joystick and gamepad support for LEGO Island.</string>
</property>
<property name="text">
<string>Use Joystick</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="fullscreenCheckBox">
<property name="toolTip">
@ -441,67 +472,132 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="rumbleCheckBox">
<property name="enabled">
<bool>true</bool>
</property>
<property name="toolTip">
<string>Enable controller rumble.</string>
</property>
<property name="text">
<string>Rumble</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="transitionBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Sets the transition effect to be used in game.</string>
</property>
<property name="title">
<string>Transition Type</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<widget class="QWidget" name="widget" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="leftMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QComboBox" name="transitionTypeComboBox">
<property name="currentText">
<string>Mosaic</string>
<widget class="QGroupBox" name="transitionBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="currentIndex">
<number>3</number>
<property name="toolTip">
<string>Sets the transition effect to be used in game.</string>
</property>
<item>
<property name="text">
<string>Idle - Broken</string>
</property>
</item>
<item>
<property name="text">
<string>No Animation</string>
</property>
</item>
<item>
<property name="text">
<string>Dissolve</string>
</property>
</item>
<item>
<property name="text">
<string>Mosaic</string>
</property>
</item>
<item>
<property name="text">
<string>Wipe Down</string>
</property>
</item>
<item>
<property name="text">
<string>Windows</string>
</property>
</item>
<item>
<property name="text">
<string>Unknown - Broken</string>
</property>
</item>
<property name="title">
<string>Transition Type</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QComboBox" name="transitionTypeComboBox">
<property name="currentText">
<string>Mosaic</string>
</property>
<property name="currentIndex">
<number>3</number>
</property>
<item>
<property name="text">
<string>Idle - Broken</string>
</property>
</item>
<item>
<property name="text">
<string>No Animation</string>
</property>
</item>
<item>
<property name="text">
<string>Dissolve</string>
</property>
</item>
<item>
<property name="text">
<string>Mosaic</string>
</property>
</item>
<item>
<property name="text">
<string>Wipe Down</string>
</property>
</item>
<item>
<property name="text">
<string>Windows</string>
</property>
</item>
<item>
<property name="text">
<string>Unknown - Broken</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="touchControl">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Virtual Gamepad (Recommended):&lt;/span&gt; Slide your finger to move and turn.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Virtual Arrow Keys:&lt;/span&gt; Tap screen areas to move. The top moves forward, the bottom turns or moves back.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Virtual Mouse:&lt;/span&gt; Emulates classic mouse controls with touch.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="title">
<string>Touch Control Scheme</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QComboBox" name="touchComboBox">
<property name="currentIndex">
<number>2</number>
</property>
<item>
<property name="text">
<string>Virtual Mouse</string>
</property>
</item>
<item>
<property name="text">
<string>Virtual Arrow Keys</string>
</property>
</item>
<item>
<property name="text">
<string>Virtual Gamepad</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
@ -647,8 +743,6 @@
<tabstop>maxActorsSlider</tabstop>
<tabstop>sound3DCheckBox</tabstop>
<tabstop>musicCheckBox</tabstop>
<tabstop>joystickCheckBox</tabstop>
<tabstop>fullscreenCheckBox</tabstop>
<tabstop>devicesList</tabstop>
<tabstop>okButton</tabstop>
<tabstop>launchButton</tabstop>
@ -657,5 +751,70 @@
<resources>
<include location="config.qrc"/>
</resources>
<connections/>
<connections>
<connection>
<sender>maxActorsSlider</sender>
<signal>sliderMoved(int)</signal>
<receiver>label</receiver>
<slot>setNum(int)</slot>
<hints>
<hint type="sourcelabel">
<x>436</x>
<y>269</y>
</hint>
<hint type="destinationlabel">
<x>525</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>maxActorsSlider</sender>
<signal>valueChanged(int)</signal>
<receiver>label</receiver>
<slot>setNum(int)</slot>
<hints>
<hint type="sourcelabel">
<x>387</x>
<y>274</y>
</hint>
<hint type="destinationlabel">
<x>518</x>
<y>276</y>
</hint>
</hints>
</connection>
<connection>
<sender>maxLoDSlider</sender>
<signal>valueChanged(int)</signal>
<receiver>LoDNum</receiver>
<slot>setNum(int)</slot>
<hints>
<hint type="sourcelabel">
<x>269</x>
<y>270</y>
</hint>
<hint type="destinationlabel">
<x>327</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>maxLoDSlider</sender>
<signal>sliderMoved(int)</signal>
<receiver>LoDNum</receiver>
<slot>setNum(int)</slot>
<hints>
<hint type="sourcelabel">
<x>260</x>
<y>277</y>
</hint>
<hint type="destinationlabel">
<x>328</x>
<y>262</y>
</hint>
</hints>
</connection>
</connections>
</ui>