let user change some config settings
- use encounter json - use poryscript - monitor files
This commit is contained in:
parent
df8dac965f
commit
401d2e4884
5 changed files with 67 additions and 5 deletions
|
@ -2872,6 +2872,7 @@
|
|||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusBar"/>
|
||||
<widget class="QMenuBar" name="menuBar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
|
@ -2935,13 +2936,21 @@
|
|||
</property>
|
||||
<addaction name="actionAbout_Porymap"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuOptions">
|
||||
<property name="title">
|
||||
<string>Options</string>
|
||||
</property>
|
||||
<addaction name="actionUse_Encounter_Json"/>
|
||||
<addaction name="actionMonitor_Project_Files"/>
|
||||
<addaction name="actionUse_Poryscript"/>
|
||||
</widget>
|
||||
<addaction name="menuFile"/>
|
||||
<addaction name="menuEdit"/>
|
||||
<addaction name="menuView"/>
|
||||
<addaction name="menuTools"/>
|
||||
<addaction name="menuOptions"/>
|
||||
<addaction name="menuHelp"/>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusBar"/>
|
||||
<action name="action_Save_Project">
|
||||
<property name="text">
|
||||
<string>Save All</string>
|
||||
|
@ -3178,6 +3187,30 @@
|
|||
<string>Reload Project</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionUse_Encounter_Json">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Show Wild Encounter Tables</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionMonitor_Project_Files">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Monitor Project Files</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionUse_Poryscript">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Use PoryScript</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<customwidgets>
|
||||
|
|
|
@ -74,6 +74,9 @@ private slots:
|
|||
void on_checkBox_AllowBiking_clicked(bool checked);
|
||||
void on_checkBox_AllowEscapeRope_clicked(bool checked);
|
||||
void on_spinBox_FloorNumber_valueChanged(int offset);
|
||||
void on_actionUse_Encounter_Json_triggered(bool checked);
|
||||
void on_actionMonitor_Project_Files_triggered(bool checked);
|
||||
void on_actionUse_Poryscript_triggered(bool checked);
|
||||
|
||||
void on_tabWidget_currentChanged(int index);
|
||||
|
||||
|
|
|
@ -204,6 +204,7 @@ private:
|
|||
|
||||
signals:
|
||||
void reloadProject();
|
||||
void uncheckMonitorFilesAction();
|
||||
};
|
||||
|
||||
#endif // PROJECT_H
|
||||
|
|
|
@ -43,7 +43,7 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||
QCoreApplication::setOrganizationName("pret");
|
||||
QCoreApplication::setApplicationName("porymap");
|
||||
QApplication::setApplicationDisplayName("porymap");
|
||||
QApplication::setWindowIcon(QIcon(":/icons/porymap-icon-1.ico"));
|
||||
QApplication::setWindowIcon(QIcon(":/icons/porymap-icon-2.ico"));
|
||||
ui->setupUi(this);
|
||||
|
||||
this->initWindow();
|
||||
|
@ -151,8 +151,10 @@ void MainWindow::initMapSortOrder() {
|
|||
|
||||
void MainWindow::setProjectSpecificUIVisibility()
|
||||
{
|
||||
if (!projectConfig.getEncounterJsonActive())
|
||||
ui->tabWidget->removeTab(4);
|
||||
ui->tabWidget->setTabEnabled(4, projectConfig.getEncounterJsonActive());
|
||||
|
||||
ui->actionUse_Encounter_Json->setChecked(projectConfig.getEncounterJsonActive());
|
||||
ui->actionUse_Poryscript->setChecked(projectConfig.getUsePoryScript());
|
||||
|
||||
switch (projectConfig.getBaseGameVersion())
|
||||
{
|
||||
|
@ -247,6 +249,7 @@ void MainWindow::loadUserSettings() {
|
|||
ui->horizontalSlider_MetatileZoom->blockSignals(true);
|
||||
ui->horizontalSlider_MetatileZoom->setValue(porymapConfig.getMetatilesZoom());
|
||||
ui->horizontalSlider_MetatileZoom->blockSignals(false);
|
||||
ui->actionMonitor_Project_Files->setChecked(porymapConfig.getMonitorFiles());
|
||||
setTheme(porymapConfig.getTheme());
|
||||
}
|
||||
|
||||
|
@ -301,7 +304,8 @@ bool MainWindow::openProject(QString dir) {
|
|||
if (!already_open) {
|
||||
editor->closeProject();
|
||||
editor->project = new Project(this);
|
||||
QObject::connect(editor->project, SIGNAL(reloadProject), this, SLOT(on_action_Reload_Project_triggered));
|
||||
QObject::connect(editor->project, SIGNAL(reloadProject()), this, SLOT(on_action_Reload_Project_triggered()));
|
||||
QObject::connect(editor->project, &Project::uncheckMonitorFilesAction, [this] () { ui->actionMonitor_Project_Files->setChecked(false); });
|
||||
editor->project->set_root(dir);
|
||||
success = loadDataStructures()
|
||||
&& populateMapList()
|
||||
|
@ -1243,6 +1247,26 @@ void MainWindow::on_actionCursor_Tile_Outline_triggered()
|
|||
this->editor->settings->cursorTileRectEnabled = enabled;
|
||||
}
|
||||
|
||||
void MainWindow::on_actionUse_Encounter_Json_triggered(bool checked)
|
||||
{
|
||||
QMessageBox warning(this);
|
||||
warning.setText("You must reload the project for this setting to take effect.");
|
||||
warning.setIcon(QMessageBox::Information);
|
||||
warning.exec();
|
||||
projectConfig.setEncounterJsonActive(checked);
|
||||
}
|
||||
|
||||
void MainWindow::on_actionMonitor_Project_Files_triggered(bool checked)
|
||||
{
|
||||
editor->project->fileWatcher.blockSignals(!checked);
|
||||
porymapConfig.setMonitorFiles(checked);
|
||||
}
|
||||
|
||||
void MainWindow::on_actionUse_Poryscript_triggered(bool checked)
|
||||
{
|
||||
projectConfig.setUsePoryScript(checked);
|
||||
}
|
||||
|
||||
void MainWindow::on_actionPencil_triggered()
|
||||
{
|
||||
on_toolButton_Paint_clicked();
|
||||
|
|
|
@ -105,6 +105,7 @@ void Project::initSignals() {
|
|||
if (showAgainCheck.isChecked()) {
|
||||
porymapConfig.setMonitorFiles(false);
|
||||
this->fileWatcher.blockSignals(true);
|
||||
emit uncheckMonitorFilesAction();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue