Unsaved changes bugfix, added close event for start window

This commit is contained in:
parax0 2016-02-01 22:15:28 -07:00
parent 0fe0c667a1
commit 8e1b66fa5a
9 changed files with 20 additions and 12 deletions

View File

@ -28,24 +28,29 @@ CStartWindow::~CStartWindow()
delete mpModelEditor;
}
void CStartWindow::closeEvent(QCloseEvent *pEvent)
{
if (mpWorldEditor->close())
qApp->quit();
else
pEvent->ignore();
}
void CStartWindow::on_actionOpen_MLVL_triggered()
{
QString WorldFile = QFileDialog::getOpenFileName(this, "Open MLVL", "", "Metroid Prime World (*.MLVL)");
if (WorldFile.isEmpty()) return;
if (mpWorldEditor->CheckUnsavedChanges())
if (mpWorldEditor->close())
{
gResCache.SetFolder(TString(WorldFile.toStdString()).GetFileDirectory());
mpWorld = gResCache.GetResource(WorldFile.toStdString());
mpWorldEditor->close();
FillWorldUI();
}
}
void CStartWindow::FillWorldUI()
{
CStringTable *pWorldName = mpWorld->GetWorldName();
if (pWorldName)
{

View File

@ -26,6 +26,7 @@ class CStartWindow : public QMainWindow
public:
explicit CStartWindow(QWidget *parent = 0);
~CStartWindow();
void closeEvent(QCloseEvent *pEvent);
private slots:
void on_actionOpen_MLVL_triggered();

View File

@ -93,6 +93,8 @@ void CWorldEditor::closeEvent(QCloseEvent *pEvent)
if (ShouldClose)
{
mUndoStack.clear();
if (mpPoiDialog)
mpPoiDialog->close();
}

View File

@ -480,7 +480,7 @@
<property ID="0x1F5B271D" name="STRG"/>
<property ID="0x1F6813F1" name="Unknown"/>
<property ID="0x1F68F1B7" name="Unknown"/>
<property ID="0x1F715FD3" name="Unknown"/>
<property ID="0x1F715FD3" name="Light Layer Index"/>
<property ID="0x1F7EF449" name="Unknown"/>
<property ID="0x1F9A7DC4" name="Unknown"/>
<property ID="0x1F9BCB8F" name="Unknown"/>

View File

@ -21,6 +21,6 @@
<property ID="0x0A" name="Unknown 8" type="long"/>
<property ID="0x0B" name="Unknown 9" type="long"/>
<property ID="0x0C" name="Unknown 10" type="bool"/>
<property ID="0x0D" name="Unknown 11" type="long"/>
<property ID="0x0D" name="Light Layer Index" type="long"/>
</properties>
</struct>

View File

@ -864,8 +864,8 @@
<property ID="0x1F526953" name="Unknown"/>
<property ID="0x1F5E78C2" name="Unknown"/>
<property ID="0x1F6813F1" name="Unknown"/>
<property ID="0x1F6C1A6B" name="Power BeamInfo"/>
<property ID="0x1F715FD3" name="Unknown"/>
<property ID="0x1F6C1A6B" name="PowerBeamInfo"/>
<property ID="0x1F715FD3" name="Light Layer Index"/>
<property ID="0x1F80154D" name="Unknown"/>
<property ID="0x1F83D350" name="Unknown"/>
<property ID="0x1F844B33" name="Unknown"/>

View File

@ -794,7 +794,7 @@
<property ID="0x1F5E78C2" name="Unknown"/>
<property ID="0x1F6813F1" name="Unknown"/>
<property ID="0x1F6C1A6B" name="Power BeamInfo"/>
<property ID="0x1F715FD3" name="Unknown"/>
<property ID="0x1F715FD3" name="Light Layer Index"/>
<property ID="0x1F80154D" name="Unknown"/>
<property ID="0x1F83D350" name="Unknown"/>
<property ID="0x1F844B33" name="Unknown"/>

View File

@ -682,8 +682,8 @@
<property ID="0x1F526953" name="Unknown"/>
<property ID="0x1F5E78C2" name="Unknown"/>
<property ID="0x1F6813F1" name="Unknown"/>
<property ID="0x1F6C1A6B" name="Power BeamInfo"/>
<property ID="0x1F715FD3" name="Unknown"/>
<property ID="0x1F6C1A6B" name="Power Beam Info"/>
<property ID="0x1F715FD3" name="Light Layer Index"/>
<property ID="0x1F83D350" name="Unknown"/>
<property ID="0x1F844B33" name="Unknown"/>
<property ID="0x1FB988F2" name="Unknown"/>

View File

@ -258,7 +258,7 @@
<property ID="0x1EB90D06" name="Unknown"/>
<property ID="0x1F46CF01" name="Unknown"/>
<property ID="0x1F6813F1" name="Unknown"/>
<property ID="0x1F715FD3" name="Unknown"/>
<property ID="0x1F715FD3" name="Light Layer Index"/>
<property ID="0x1F83D350" name="Unknown"/>
<property ID="0x1FB988F2" name="Unknown"/>
<property ID="0x1FD78DD3" name="PuddleControlPhaseData"/>