mirror of
https://github.com/isledecomp/isle-portable.git
synced 2025-08-03 15:47:34 -04:00
Revamp config tool, add tooltips and consolidate options. (#427)
* Add tooltips, remove obsolete directory stuff In the config tool, the "Media Path" entry was removed, as it doesn't do anything in isle-portable as far as I know. The "Disk Path" and "CD Path" options were merged into one directory editing thing, where CD Path is specified and Disk Path is then derived from that. A checkbox to enable or disable full-screen was added. Tooltips were added to the config app, so now users can more easily tell what a setting in the config tool does. * Make clang-format happy * oops that's an extra semicolon I don't need * Remove obsolete full screen forcing Co-authored-by: Anders Jenbo <anders@jenbo.dk> * Update CONFIG/config.cpp Co-authored-by: Anders Jenbo <anders@jenbo.dk> --------- Co-authored-by: Anders Jenbo <anders@jenbo.dk>
This commit is contained in:
parent
dcacdcc711
commit
7a92f53212
@ -56,18 +56,15 @@ CMainDialog::CMainDialog(QWidget* pParent) : QDialog(pParent)
|
||||
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->okButton, &QPushButton::clicked, this, &CMainDialog::accept);
|
||||
connect(m_ui->cancelButton, &QPushButton::clicked, this, &CMainDialog::reject);
|
||||
|
||||
connect(m_ui->diskPathOpen, &QPushButton::clicked, this, &CMainDialog::SelectDiskPathDialog);
|
||||
connect(m_ui->cdPathOpen, &QPushButton::clicked, this, &CMainDialog::SelectCDPathDialog);
|
||||
connect(m_ui->mediaPathOpen, &QPushButton::clicked, this, &CMainDialog::SelectMediaPathDialog);
|
||||
connect(m_ui->dataPathOpen, &QPushButton::clicked, this, &CMainDialog::SelectDataPathDialog);
|
||||
connect(m_ui->savePathOpen, &QPushButton::clicked, this, &CMainDialog::SelectSavePathDialog);
|
||||
|
||||
connect(m_ui->diskPath, &QLineEdit::textEdited, this, &CMainDialog::DiskPathEdited);
|
||||
connect(m_ui->cdPath, &QLineEdit::textEdited, this, &CMainDialog::CDPathEdited);
|
||||
connect(m_ui->mediaPath, &QLineEdit::textEdited, this, &CMainDialog::MediaPathEdited);
|
||||
connect(m_ui->savePath, &QLineEdit::textEdited, this, &CMainDialog::SavePathEdited);
|
||||
connect(m_ui->dataPath, &QLineEdit::editingFinished, this, &CMainDialog::DataPathEdited);
|
||||
connect(m_ui->savePath, &QLineEdit::editingFinished, this, &CMainDialog::SavePathEdited);
|
||||
|
||||
connect(m_ui->maxLoDSlider, &QSlider::valueChanged, this, &CMainDialog::MaxLoDChanged);
|
||||
connect(m_ui->maxActorsSlider, &QSlider::valueChanged, this, &CMainDialog::MaxActorsChanged);
|
||||
@ -187,9 +184,8 @@ void CMainDialog::UpdateInterface()
|
||||
}
|
||||
m_ui->joystickCheckBox->setChecked(currentConfigApp->m_use_joystick);
|
||||
m_ui->musicCheckBox->setChecked(currentConfigApp->m_music);
|
||||
m_ui->diskPath->setText(QString::fromStdString(currentConfigApp->m_base_path));
|
||||
m_ui->cdPath->setText(QString::fromStdString(currentConfigApp->m_cd_path));
|
||||
m_ui->mediaPath->setText(QString::fromStdString(currentConfigApp->m_media_path));
|
||||
m_ui->fullscreenCheckBox->setChecked(currentConfigApp->m_full_screen);
|
||||
m_ui->dataPath->setText(QString::fromStdString(currentConfigApp->m_cd_path));
|
||||
m_ui->savePath->setText(QString::fromStdString(currentConfigApp->m_save_path));
|
||||
}
|
||||
|
||||
@ -266,54 +262,33 @@ void CMainDialog::OnCheckboxMusic(bool checked)
|
||||
UpdateInterface();
|
||||
}
|
||||
|
||||
void CMainDialog::SelectDiskPathDialog()
|
||||
void CMainDialog::OnCheckboxFullscreen(bool checked)
|
||||
{
|
||||
QString disk_path = QString::fromStdString(currentConfigApp->m_base_path);
|
||||
disk_path = QFileDialog::getExistingDirectory(
|
||||
this,
|
||||
tr("Open Directory"),
|
||||
disk_path,
|
||||
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks
|
||||
);
|
||||
|
||||
if (disk_path.toStdString() != "") {
|
||||
currentConfigApp->m_base_path = disk_path.toStdString();
|
||||
m_modified = true;
|
||||
UpdateInterface();
|
||||
}
|
||||
currentConfigApp->m_full_screen = checked;
|
||||
m_modified = true;
|
||||
UpdateInterface();
|
||||
}
|
||||
|
||||
void CMainDialog::SelectCDPathDialog()
|
||||
void CMainDialog::SelectDataPathDialog()
|
||||
{
|
||||
QString cd_path = QString::fromStdString(currentConfigApp->m_cd_path);
|
||||
cd_path = QFileDialog::getExistingDirectory(
|
||||
QString data_path = QString::fromStdString(currentConfigApp->m_cd_path);
|
||||
data_path = QFileDialog::getExistingDirectory(
|
||||
this,
|
||||
tr("Open Directory"),
|
||||
cd_path,
|
||||
data_path,
|
||||
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks
|
||||
);
|
||||
|
||||
if (cd_path.toStdString() != "") {
|
||||
currentConfigApp->m_cd_path = cd_path.toStdString();
|
||||
m_modified = true;
|
||||
UpdateInterface();
|
||||
}
|
||||
}
|
||||
QDir data_dir = QDir(data_path);
|
||||
|
||||
void CMainDialog::SelectMediaPathDialog()
|
||||
{
|
||||
QString media_path = QString::fromStdString(currentConfigApp->m_media_path);
|
||||
media_path = QFileDialog::getExistingDirectory(
|
||||
this,
|
||||
tr("Open Directory"),
|
||||
media_path,
|
||||
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks
|
||||
);
|
||||
if (media_path.toStdString() != "") {
|
||||
currentConfigApp->m_media_path = media_path.toStdString();
|
||||
if (data_dir.exists()) {
|
||||
currentConfigApp->m_cd_path = data_dir.absolutePath().toStdString();
|
||||
data_dir.cd(QString("DATA"));
|
||||
data_dir.cd(QString("disk"));
|
||||
currentConfigApp->m_base_path = data_dir.absolutePath().toStdString();
|
||||
m_modified = true;
|
||||
UpdateInterface();
|
||||
}
|
||||
UpdateInterface();
|
||||
}
|
||||
|
||||
void CMainDialog::SelectSavePathDialog()
|
||||
@ -326,38 +301,39 @@ void CMainDialog::SelectSavePathDialog()
|
||||
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks
|
||||
);
|
||||
|
||||
if (save_path.toStdString() != "") {
|
||||
currentConfigApp->m_save_path = save_path.toStdString();
|
||||
QDir save_dir = QDir(save_path);
|
||||
|
||||
if (save_dir.exists()) {
|
||||
currentConfigApp->m_save_path = save_dir.absolutePath().toStdString();
|
||||
m_modified = true;
|
||||
UpdateInterface();
|
||||
}
|
||||
}
|
||||
|
||||
void CMainDialog::DiskPathEdited(const QString& text)
|
||||
{
|
||||
currentConfigApp->m_base_path = text.toStdString();
|
||||
m_modified = true;
|
||||
UpdateInterface();
|
||||
}
|
||||
|
||||
void CMainDialog::CDPathEdited(const QString& text)
|
||||
void CMainDialog::DataPathEdited()
|
||||
{
|
||||
currentConfigApp->m_cd_path = text.toStdString();
|
||||
m_modified = true;
|
||||
QDir data_dir = QDir(m_ui->dataPath->text());
|
||||
|
||||
if (data_dir.exists()) {
|
||||
currentConfigApp->m_cd_path = data_dir.absolutePath().toStdString();
|
||||
data_dir.cd(QString("DATA"));
|
||||
data_dir.cd(QString("disk"));
|
||||
currentConfigApp->m_base_path = data_dir.absolutePath().toStdString();
|
||||
m_modified = true;
|
||||
}
|
||||
|
||||
UpdateInterface();
|
||||
}
|
||||
|
||||
void CMainDialog::MediaPathEdited(const QString& text)
|
||||
void CMainDialog::SavePathEdited()
|
||||
{
|
||||
currentConfigApp->m_media_path = text.toStdString();
|
||||
m_modified = true;
|
||||
UpdateInterface();
|
||||
}
|
||||
|
||||
void CMainDialog::SavePathEdited(const QString& text)
|
||||
{
|
||||
currentConfigApp->m_save_path = text.toStdString();
|
||||
m_modified = true;
|
||||
QDir save_dir = QDir(m_ui->savePath->text());
|
||||
|
||||
if (save_dir.exists()) {
|
||||
currentConfigApp->m_save_path = save_dir.absolutePath().toStdString();
|
||||
m_modified = true;
|
||||
}
|
||||
UpdateInterface();
|
||||
}
|
||||
|
||||
|
@ -42,16 +42,13 @@ private slots:
|
||||
void OnRadiobuttonTextureHighQuality(bool checked);
|
||||
void OnCheckboxJoystick(bool checked);
|
||||
void OnCheckboxMusic(bool checked);
|
||||
void OnCheckboxFullscreen(bool checked);
|
||||
void accept() override;
|
||||
void reject() override;
|
||||
void SelectDiskPathDialog();
|
||||
void SelectCDPathDialog();
|
||||
void SelectMediaPathDialog();
|
||||
void SelectDataPathDialog();
|
||||
void SelectSavePathDialog();
|
||||
void DiskPathEdited(const QString& text);
|
||||
void CDPathEdited(const QString& text);
|
||||
void MediaPathEdited(const QString& text);
|
||||
void SavePathEdited(const QString& text);
|
||||
void DataPathEdited();
|
||||
void SavePathEdited();
|
||||
void MaxLoDChanged(int value);
|
||||
void MaxActorsChanged(int value);
|
||||
};
|
||||
|
@ -141,7 +141,6 @@ bool CConfigApp::ReadRegisterSettings()
|
||||
}
|
||||
m_base_path = iniparser_getstring(dict, "isle:diskpath", m_base_path.c_str());
|
||||
m_cd_path = iniparser_getstring(dict, "isle:cdpath", m_cd_path.c_str());
|
||||
m_media_path = iniparser_getstring(dict, "isle:mediapath", m_media_path.c_str());
|
||||
m_save_path = iniparser_getstring(dict, "isle:savepath", m_save_path.c_str());
|
||||
m_display_bit_depth = iniparser_getint(dict, "isle:Display Bit Depth", -1);
|
||||
m_flip_surfaces = iniparser_getboolean(dict, "isle:Flip Surfaces", m_flip_surfaces);
|
||||
@ -166,10 +165,6 @@ bool CConfigApp::ValidateSettings()
|
||||
{
|
||||
BOOL is_modified = FALSE;
|
||||
|
||||
if (!IsPrimaryDriver() && !m_full_screen) {
|
||||
m_full_screen = TRUE;
|
||||
is_modified = TRUE;
|
||||
}
|
||||
if (IsDeviceInBasicRGBMode()) {
|
||||
if (m_3d_video_ram) {
|
||||
m_3d_video_ram = FALSE;
|
||||
@ -203,10 +198,6 @@ bool CConfigApp::ValidateSettings()
|
||||
m_3d_video_ram = TRUE;
|
||||
is_modified = TRUE;
|
||||
}
|
||||
if (!m_full_screen) {
|
||||
m_full_screen = TRUE;
|
||||
is_modified = TRUE;
|
||||
}
|
||||
}
|
||||
if ((m_display_bit_depth != 8 && m_display_bit_depth != 16) && (m_display_bit_depth != 0 || m_full_screen)) {
|
||||
m_display_bit_depth = 16;
|
||||
@ -302,7 +293,6 @@ void CConfigApp::WriteRegisterSettings() const
|
||||
}
|
||||
iniparser_set(dict, "isle:diskpath", m_base_path.c_str());
|
||||
iniparser_set(dict, "isle:cdpath", m_cd_path.c_str());
|
||||
iniparser_set(dict, "isle:mediapath", m_media_path.c_str());
|
||||
iniparser_set(dict, "isle:savepath", m_save_path.c_str());
|
||||
|
||||
SetIniInt(dict, "isle:Display Bit Depth", m_display_bit_depth);
|
||||
|
@ -77,7 +77,6 @@ public:
|
||||
std::string m_iniPath;
|
||||
std::string m_base_path;
|
||||
std::string m_cd_path;
|
||||
std::string m_media_path;
|
||||
std::string m_save_path;
|
||||
float m_max_lod;
|
||||
int m_max_actors;
|
||||
|
@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>575</width>
|
||||
<height>650</height>
|
||||
<height>600</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@ -44,6 +44,9 @@
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Jaws.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
@ -76,13 +79,7 @@
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="cdPath"/>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLineEdit" name="mediaPath"/>
|
||||
</item>
|
||||
<item row="7" column="2">
|
||||
<item row="5" column="2">
|
||||
<widget class="QPushButton" name="savePathOpen">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
@ -101,68 +98,8 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QPushButton" name="mediaPathOpen">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>55</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Open</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QPushButton" name="cdPathOpen">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>55</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Open</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="cdPathLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CD Path:</string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::PlainText</enum>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="diskPath"/>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QPushButton" name="diskPathOpen">
|
||||
<widget class="QPushButton" name="dataPathOpen">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
@ -180,26 +117,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="diskPathLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Disk Path:</string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::PlainText</enum>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="savePathLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
@ -218,8 +136,22 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="mediaPathLabel">
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="dataPath">
|
||||
<property name="toolTip">
|
||||
<string>Path to the game data files. Set this to the CD image root.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QLineEdit" name="savePath">
|
||||
<property name="toolTip">
|
||||
<string>Folder where save files are kept.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="dataPathLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
@ -227,7 +159,7 @@
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Media Path:</string>
|
||||
<string>Data Path:</string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::PlainText</enum>
|
||||
@ -237,9 +169,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<widget class="QLineEdit" name="savePath"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@ -266,6 +195,9 @@
|
||||
<height>120</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Set 3D model detail level.</string>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Island Model Quality</string>
|
||||
</property>
|
||||
@ -345,6 +277,9 @@
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QGroupBox" name="textureQualityGroup">
|
||||
<property name="toolTip">
|
||||
<string>Set texture detail level.</string>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Island Texture Quality</string>
|
||||
</property>
|
||||
@ -422,16 +357,13 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="musicJoystickWidget" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="checkboxWidget" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="sound3DCheckBox">
|
||||
<property name="toolTip">
|
||||
<string>Enable 3D positional audio effects.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>3D Sound</string>
|
||||
</property>
|
||||
@ -439,6 +371,9 @@
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="musicCheckBox">
|
||||
<property name="toolTip">
|
||||
<string>Enable in-game background music.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Music</string>
|
||||
</property>
|
||||
@ -446,11 +381,24 @@
|
||||
</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">
|
||||
<string>Toggle fullscreen display mode.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Fullscreen</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@ -462,6 +410,9 @@
|
||||
<height>225</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>3D graphics device used to render the game.</string>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string/>
|
||||
</property>
|
||||
@ -581,12 +532,8 @@
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>diskPath</tabstop>
|
||||
<tabstop>diskPathOpen</tabstop>
|
||||
<tabstop>cdPath</tabstop>
|
||||
<tabstop>cdPathOpen</tabstop>
|
||||
<tabstop>mediaPath</tabstop>
|
||||
<tabstop>mediaPathOpen</tabstop>
|
||||
<tabstop>dataPath</tabstop>
|
||||
<tabstop>dataPathOpen</tabstop>
|
||||
<tabstop>savePath</tabstop>
|
||||
<tabstop>savePathOpen</tabstop>
|
||||
<tabstop>textureQualityFastRadioButton</tabstop>
|
||||
|
Loading…
x
Reference in New Issue
Block a user