diff --git a/src/Editor/Icons.qrc b/src/Editor/Icons.qrc index ab4b1714..40893644 100644 --- a/src/Editor/Icons.qrc +++ b/src/Editor/Icons.qrc @@ -70,5 +70,6 @@ icons/Open_16px.png icons/New_16px.png icons/Disc_16px.png + icons/World_16px.png diff --git a/src/Editor/WorldEditor/CWorldEditor.cpp b/src/Editor/WorldEditor/CWorldEditor.cpp index cd029e63..786fc851 100644 --- a/src/Editor/WorldEditor/CWorldEditor.cpp +++ b/src/Editor/WorldEditor/CWorldEditor.cpp @@ -252,10 +252,6 @@ bool CWorldEditor::CloseWorld() if (mpPoiDialog) mpPoiDialog->close(); - // Clear old area - hack until better world/area loader is implemented - if (mpArea) - mpArea->ClearScriptLayers(); - mpArea = nullptr; mpWorld = nullptr; @@ -575,13 +571,6 @@ void CWorldEditor::OnActiveProjectChanged(CGameProject *pProj) if (!pProj) return; // Update recent projects list - QSettings Settings; - QStringList RecentProjectsList = Settings.value("WorldEditor/RecentProjectsList").toStringList(); - QString ProjPath = TO_QSTRING(pProj->ProjectPath()); - - RecentProjectsList.removeAll(ProjPath); - RecentProjectsList.prepend(ProjPath); - Settings.setValue("WorldEditor/RecentProjectsList", RecentProjectsList); UpdateOpenRecentActions(); ChangeEditMode(eWEM_EditWorldInfo); @@ -717,6 +706,26 @@ void CWorldEditor::UpdateOpenRecentActions() QSettings Settings; QStringList RecentProjectsList = Settings.value("WorldEditor/RecentProjectsList").toStringList(); + // Bump the current project to the front + CGameProject *pProj = gpEdApp->ActiveProject(); + + if (pProj) + { + QString ProjPath = TO_QSTRING(pProj->ProjectPath()); + RecentProjectsList.removeAll(ProjPath); + RecentProjectsList.prepend(ProjPath); + } + + // Remove projects that don't exist anymore + foreach (const QString& rkProj, RecentProjectsList) + { + if (!FileUtil::Exists( TO_TWIDESTRING(rkProj) )) + RecentProjectsList.removeAll(rkProj); + } + + Settings.setValue("WorldEditor/RecentProjectsList", RecentProjectsList); + + // Set up the menu actions for (int iProj = 0; iProj < mskMaxRecentProjects; iProj++) { QAction *pAction = mRecentProjectsActions[iProj]; diff --git a/src/Editor/WorldEditor/CWorldTreeModel.cpp b/src/Editor/WorldEditor/CWorldTreeModel.cpp index d72b02cb..7f5177cb 100644 --- a/src/Editor/WorldEditor/CWorldTreeModel.cpp +++ b/src/Editor/WorldEditor/CWorldTreeModel.cpp @@ -97,7 +97,7 @@ QVariant CWorldTreeModel::data(const QModelIndex& rkIndex, int Role) const else if (Role == Qt::DecorationRole) { - static QIcon sWorldIcon = QIcon(":/icons/World.png"); + static QIcon sWorldIcon = QIcon(":/icons/World_16px.png"); static QIcon sAreaIcon = QIcon(":/icons/New_16px.png"); if (rkIndex.column() == 1) diff --git a/src/Editor/icons/World_16px.png b/src/Editor/icons/World_16px.png new file mode 100644 index 00000000..0e417687 Binary files /dev/null and b/src/Editor/icons/World_16px.png differ diff --git a/src/Editor/main.cpp b/src/Editor/main.cpp index 777ff369..71f7e437 100644 --- a/src/Editor/main.cpp +++ b/src/Editor/main.cpp @@ -1,8 +1,10 @@ #include "CEditorApplication.h" +#include "UICommon.h" #include #include #include +#include #include #include #include