mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-01-11 18:41:14 +00:00
Merge branch 'isledecomp:master' into psp
This commit is contained in:
commit
3ee9c0ea1a
@ -7,12 +7,9 @@
|
||||
DECOMP_SIZE_ASSERT(CDialog, 0x60)
|
||||
DECOMP_SIZE_ASSERT(CAboutDialog, 0x60)
|
||||
|
||||
// FIXME: disable dialog resizing
|
||||
|
||||
// FUNCTION: CONFIG 0x00403c20
|
||||
CAboutDialog::CAboutDialog() : QDialog()
|
||||
{
|
||||
m_ui = new Ui::AboutDialog;
|
||||
m_ui->setupUi(this);
|
||||
layout()->setSizeConstraint(QLayout::SetFixedSize);
|
||||
}
|
||||
|
||||
@ -312,7 +312,11 @@ void CMainDialog::UpdateInterface()
|
||||
m_ui->savePath->setText(QString::fromStdString(currentConfigApp->m_save_path));
|
||||
|
||||
m_ui->textureCheckBox->setChecked(currentConfigApp->m_texture_load);
|
||||
m_ui->texturePath->setText(QString::fromStdString(currentConfigApp->m_texture_path));
|
||||
QString texture_path = QString::fromStdString(currentConfigApp->m_texture_path);
|
||||
if (texture_path.startsWith(QDir::separator())) {
|
||||
texture_path.remove(0, 1);
|
||||
}
|
||||
m_ui->texturePath->setText(texture_path);
|
||||
m_ui->texturePath->setEnabled(currentConfigApp->m_texture_load);
|
||||
m_ui->texturePathOpen->setEnabled(currentConfigApp->m_texture_load);
|
||||
|
||||
@ -324,6 +328,11 @@ void CMainDialog::UpdateInterface()
|
||||
|
||||
m_ui->customAssetPaths->clear();
|
||||
assetPaths = QString::fromStdString(currentConfigApp->m_custom_asset_path).split(u',');
|
||||
for (QString& path : assetPaths) {
|
||||
if (path.startsWith(QDir::separator())) {
|
||||
path.remove(0, 1);
|
||||
}
|
||||
}
|
||||
m_ui->customAssetPaths->addItems(assetPaths);
|
||||
|
||||
m_ui->aspectRatioComboBox->setCurrentIndex(currentConfigApp->m_aspect_ratio);
|
||||
@ -496,14 +505,15 @@ void CMainDialog::SelectDataPathDialog()
|
||||
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks
|
||||
);
|
||||
|
||||
QDir data_dir = QDir(data_path);
|
||||
|
||||
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;
|
||||
if (!data_path.isEmpty()) {
|
||||
QDir data_dir = QDir(data_path);
|
||||
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();
|
||||
}
|
||||
@ -518,11 +528,12 @@ void CMainDialog::SelectSavePathDialog()
|
||||
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks
|
||||
);
|
||||
|
||||
QDir save_dir = QDir(save_path);
|
||||
|
||||
if (save_dir.exists()) {
|
||||
currentConfigApp->m_save_path = save_dir.absolutePath().toStdString();
|
||||
m_modified = true;
|
||||
if (!save_path.isEmpty()) {
|
||||
QDir save_dir = QDir(save_path);
|
||||
if (save_dir.exists()) {
|
||||
currentConfigApp->m_save_path = save_dir.absolutePath().toStdString();
|
||||
m_modified = true;
|
||||
}
|
||||
}
|
||||
UpdateInterface();
|
||||
}
|
||||
@ -538,13 +549,11 @@ void CMainDialog::DataPathEdited()
|
||||
currentConfigApp->m_base_path = data_dir.absolutePath().toStdString();
|
||||
m_modified = true;
|
||||
}
|
||||
|
||||
UpdateInterface();
|
||||
}
|
||||
|
||||
void CMainDialog::SavePathEdited()
|
||||
{
|
||||
|
||||
QDir save_dir = QDir(m_ui->savePath->text());
|
||||
|
||||
if (save_dir.exists()) {
|
||||
@ -584,7 +593,12 @@ void CMainDialog::AFChanged(int value)
|
||||
|
||||
void CMainDialog::SelectTexturePathDialog()
|
||||
{
|
||||
QDir data_path = QDir(QString::fromStdString(currentConfigApp->m_cd_path));
|
||||
QString texture_path = QString::fromStdString(currentConfigApp->m_texture_path);
|
||||
if (texture_path.startsWith(QDir::separator())) {
|
||||
texture_path.remove(0, 1);
|
||||
}
|
||||
texture_path = data_path.absoluteFilePath(texture_path);
|
||||
texture_path = QFileDialog::getExistingDirectory(
|
||||
this,
|
||||
tr("Open Directory"),
|
||||
@ -592,10 +606,10 @@ void CMainDialog::SelectTexturePathDialog()
|
||||
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks
|
||||
);
|
||||
|
||||
QDir data_path = QDir(QString::fromStdString(currentConfigApp->m_cd_path));
|
||||
|
||||
if (data_path.exists(texture_path)) {
|
||||
currentConfigApp->m_texture_path = data_path.relativeFilePath(texture_path).toStdString();
|
||||
if (!texture_path.isEmpty() && data_path.exists(texture_path)) {
|
||||
texture_path = data_path.relativeFilePath(texture_path);
|
||||
texture_path.prepend(QDir::separator());
|
||||
currentConfigApp->m_texture_path = texture_path.toStdString();
|
||||
m_modified = true;
|
||||
}
|
||||
UpdateInterface();
|
||||
@ -606,8 +620,13 @@ void CMainDialog::TexturePathEdited()
|
||||
QString texture_path = m_ui->texturePath->text();
|
||||
QDir data_path = QDir(QString::fromStdString(currentConfigApp->m_cd_path));
|
||||
|
||||
if (data_path.exists(texture_path)) {
|
||||
currentConfigApp->m_texture_path = data_path.relativeFilePath(texture_path).toStdString();
|
||||
if (texture_path.startsWith(QDir::separator())) {
|
||||
texture_path.remove(0, 1);
|
||||
}
|
||||
if (data_path.exists(data_path.absoluteFilePath(texture_path))) {
|
||||
texture_path = data_path.relativeFilePath(texture_path);
|
||||
texture_path.prepend(QDir::separator());
|
||||
currentConfigApp->m_texture_path = texture_path.toStdString();
|
||||
m_modified = true;
|
||||
}
|
||||
UpdateInterface();
|
||||
@ -622,16 +641,20 @@ void CMainDialog::AddCustomAssetPath()
|
||||
data_path.absolutePath(),
|
||||
"Interleaf files (*.si)"
|
||||
);
|
||||
for (QString& item : new_files) {
|
||||
item = data_path.relativeFilePath(item);
|
||||
if (!new_files.isEmpty()) {
|
||||
for (QString& item : new_files) {
|
||||
item = data_path.relativeFilePath(item);
|
||||
}
|
||||
assetPaths += new_files;
|
||||
m_modified = true;
|
||||
}
|
||||
assetPaths += new_files;
|
||||
UpdateAssetPaths();
|
||||
}
|
||||
|
||||
void CMainDialog::RemoveCustomAssetPath()
|
||||
{
|
||||
assetPaths.removeAt(m_ui->customAssetPaths->currentRow());
|
||||
m_modified = true;
|
||||
UpdateAssetPaths();
|
||||
}
|
||||
|
||||
@ -653,6 +676,7 @@ void CMainDialog::EditCustomAssetPath()
|
||||
if (!new_file.isEmpty()) {
|
||||
new_file = data_path.relativeFilePath(new_file);
|
||||
assetPaths[m_ui->customAssetPaths->currentRow()] = new_file;
|
||||
m_modified = true;
|
||||
}
|
||||
UpdateAssetPaths();
|
||||
}
|
||||
@ -660,6 +684,12 @@ void CMainDialog::EditCustomAssetPath()
|
||||
void CMainDialog::UpdateAssetPaths()
|
||||
{
|
||||
assetPaths.removeDuplicates();
|
||||
|
||||
for (QString& path : assetPaths) {
|
||||
if (!path.startsWith(QDir::separator())) {
|
||||
path.prepend(QDir::separator());
|
||||
}
|
||||
}
|
||||
currentConfigApp->m_custom_asset_path = assetPaths.join(u',').toStdString();
|
||||
UpdateInterface();
|
||||
}
|
||||
|
||||
@ -368,6 +368,7 @@ void CConfigApp::WriteRegisterSettings() const
|
||||
dictionary* dict = dictionary_new(0);
|
||||
iniparser_set(dict, "isle", NULL);
|
||||
iniparser_set(dict, "extensions", NULL);
|
||||
iniparser_set(dict, "texture loader", NULL);
|
||||
iniparser_set(dict, "si loader", NULL);
|
||||
|
||||
if (m_device_enumerator->FormatDeviceName(buffer, m_driver, m_device) >= 0) {
|
||||
|
||||
@ -14,6 +14,9 @@
|
||||
<string>About Configure LEGO© Island</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,1,0">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SizeConstraint::SetFixedSize</enum>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="houseIcon">
|
||||
<property name="sizePolicy">
|
||||
@ -36,14 +39,14 @@
|
||||
<item>
|
||||
<widget class="QLabel" name="configureLabel">
|
||||
<property name="text">
|
||||
<string>Configure LEGO Island Version 1.0</string>
|
||||
<string>Configure LEGO Island Version 2.0</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="copyrightLabel">
|
||||
<property name="text">
|
||||
<string>Copyright © 1997 mindscape</string>
|
||||
<string>Copyright © 2025</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -53,7 +56,7 @@
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Ok</set>
|
||||
<set>QDialogButtonBox::StandardButton::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@ -1401,12 +1401,12 @@ SDL_AppResult IsleApp::ParseArguments(int argc, char** argv)
|
||||
consumed = 1;
|
||||
}
|
||||
else if (strcmp(argv[i], "--help") == 0) {
|
||||
DisplayArgumentHelp();
|
||||
DisplayArgumentHelp(argv[0]);
|
||||
return SDL_APP_SUCCESS;
|
||||
}
|
||||
if (consumed <= 0) {
|
||||
SDL_Log("Invalid argument(s): %s", argv[i]);
|
||||
DisplayArgumentHelp();
|
||||
DisplayArgumentHelp(argv[0]);
|
||||
return SDL_APP_FAILURE;
|
||||
}
|
||||
}
|
||||
@ -1414,9 +1414,9 @@ SDL_AppResult IsleApp::ParseArguments(int argc, char** argv)
|
||||
return SDL_APP_CONTINUE;
|
||||
}
|
||||
|
||||
void IsleApp::DisplayArgumentHelp()
|
||||
void IsleApp::DisplayArgumentHelp(const char* p_execName)
|
||||
{
|
||||
SDL_Log("Usage: isle [options]");
|
||||
SDL_Log("Usage: %s [options]", p_execName);
|
||||
SDL_Log("Options:");
|
||||
SDL_Log(" --ini <path> Set custom path to .ini config");
|
||||
#ifdef ISLE_DEBUG
|
||||
|
||||
@ -99,7 +99,7 @@ class IsleApp {
|
||||
const CursorBitmap* m_cursorCurrentBitmap;
|
||||
char* m_mediaPath;
|
||||
MxFloat m_cursorSensitivity;
|
||||
void DisplayArgumentHelp();
|
||||
void DisplayArgumentHelp(const char* p_execName);
|
||||
|
||||
char* m_iniPath;
|
||||
MxFloat m_maxLod;
|
||||
|
||||
@ -68,10 +68,10 @@ class DebugViewer {
|
||||
static void InsideBuildingManager()
|
||||
{
|
||||
auto buildingManager = Lego()->GetBuildingManager();
|
||||
ImGui::Text("nextVariant: %d", buildingManager->m_nextVariant);
|
||||
ImGui::Text("nextVariant: %u", buildingManager->m_nextVariant);
|
||||
ImGui::Text("m_boundariesDetermined: %d", buildingManager->m_boundariesDetermined);
|
||||
ImGui::Text("m_hideAfterAnimation: %d", buildingManager->m_hideAfterAnimation);
|
||||
ImGui::Text("#Animated Entries", buildingManager->m_numEntries);
|
||||
ImGui::Text("#Animated Entries: %d", buildingManager->m_numEntries);
|
||||
if (buildingManager->m_numEntries) {
|
||||
if (ImGui::BeginTable("Animated Entries", 6, ImGuiTableFlags_Borders)) {
|
||||
ImGui::TableSetupColumn("ROI Name");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user