From d350e983d97541d537438299c276745679e6c3e9 Mon Sep 17 00:00:00 2001 From: Aruki Date: Mon, 20 Feb 2017 23:40:19 -0700 Subject: [PATCH] Updated POI map sidebar icon, fixed minor spacing issue in the world info sidebar --- src/Editor/CExportGameDialog.cpp | 4 ++++ src/Editor/Icons.qrc | 1 + src/Editor/WorldEditor/CWorldEditor.cpp | 2 +- src/Editor/WorldEditor/CWorldInfoSidebar.cpp | 19 ++++++++++++++++--- src/Editor/WorldEditor/CWorldInfoSidebar.ui | 4 ++-- src/Editor/icons/PoiSymbol_24px.png | Bin 0 -> 396 bytes 6 files changed, 24 insertions(+), 6 deletions(-) create mode 100644 src/Editor/icons/PoiSymbol_24px.png diff --git a/src/Editor/CExportGameDialog.cpp b/src/Editor/CExportGameDialog.cpp index f5cbeb82..b5df68f5 100644 --- a/src/Editor/CExportGameDialog.cpp +++ b/src/Editor/CExportGameDialog.cpp @@ -114,6 +114,10 @@ bool CExportGameDialog::ValidateGame() mGameID = TString(6, 0); memcpy(&mGameID[0], rkHeader.m_gameID, 6); + // The MP2 ISO doesn't have a colon in the game name and it kinda annoys me + if (mGameTitle == "Metroid Prime 2 Echoes") + mGameTitle = "Metroid Prime 2: Echoes"; + // Check region byte switch (mGameID[3]) { diff --git a/src/Editor/Icons.qrc b/src/Editor/Icons.qrc index 40893644..eae96bfe 100644 --- a/src/Editor/Icons.qrc +++ b/src/Editor/Icons.qrc @@ -71,5 +71,6 @@ icons/New_16px.png icons/Disc_16px.png icons/World_16px.png + icons/PoiSymbol_24px.png diff --git a/src/Editor/WorldEditor/CWorldEditor.cpp b/src/Editor/WorldEditor/CWorldEditor.cpp index d246cb10..d02bb21a 100644 --- a/src/Editor/WorldEditor/CWorldEditor.cpp +++ b/src/Editor/WorldEditor/CWorldEditor.cpp @@ -83,7 +83,7 @@ CWorldEditor::CWorldEditor(QWidget *parent) AddEditModeButton( QIcon(":/icons/World.png"), "Edit World Info",eWEM_EditWorldInfo ); AddEditModeButton( QIcon(":/icons/Modify.png"), "Edit Script", eWEM_EditScript ); - mpPoiMapButton = AddEditModeButton( QIcon(":/icons/POI Normal.png"), "Edit POI Mappings", eWEM_EditPOIMappings ); + mpPoiMapButton = AddEditModeButton( QIcon(":/icons/PoiSymbol_24px.png"), "Edit POI Mappings", eWEM_EditPOIMappings ); mpPoiMapButton->setEnabled(false); ChangeEditMode(eWEM_EditWorldInfo); diff --git a/src/Editor/WorldEditor/CWorldInfoSidebar.cpp b/src/Editor/WorldEditor/CWorldInfoSidebar.cpp index ba7a231b..9d5dab43 100644 --- a/src/Editor/WorldEditor/CWorldInfoSidebar.cpp +++ b/src/Editor/WorldEditor/CWorldInfoSidebar.cpp @@ -37,9 +37,7 @@ CWorldInfoSidebar::CWorldInfoSidebar(CWorldEditor *pEditor) mpUI->WorldSelector->SetEditable(false); mpUI->WorldNameSelector->SetEditable(false); - mpUI->DarkWorldNameStringLabel->setHidden(true); mpUI->DarkWorldNameSelector->SetEditable(false); - mpUI->DarkWorldNameSelector->setHidden(true); mpUI->SkySelector->SetEditable(false); mpUI->AreaNameLineEdit->setEnabled(false); @@ -61,10 +59,25 @@ void CWorldInfoSidebar::OnActiveProjectChanged(CGameProject *pProj) mpUI->AreaSearchLineEdit->clear(); mProxyModel.SetFilterString(""); - bool IsEchoes = pProj && (pProj->Game() == eEchoesDemo || pProj->Game() == eEchoes); mpUI->GameNameLabel->setText( pProj ? TO_QSTRING(pProj->Name()) : "" ); + + // Add/remove widgets from the form layout based on the game. This is needed because + // simply hiding the widgets causes a minor spacing issue. The only fix seems to be + // actually entirely removing the widgets from the layout when not in use. + bool IsEchoes = pProj && (pProj->Game() == eEchoesDemo || pProj->Game() == eEchoes); mpUI->DarkWorldNameStringLabel->setHidden(!IsEchoes); mpUI->DarkWorldNameSelector->setHidden(!IsEchoes); + + if (IsEchoes) + { + mpUI->WorldInfoFormLayout->insertRow(2, mpUI->DarkWorldNameStringLabel, mpUI->DarkWorldNameSelector); + } + else + { + mpUI->WorldInfoFormLayout->removeWidget(mpUI->DarkWorldNameStringLabel); + mpUI->WorldInfoFormLayout->removeWidget(mpUI->DarkWorldNameSelector); + } + ClearWorldInfo(); } diff --git a/src/Editor/WorldEditor/CWorldInfoSidebar.ui b/src/Editor/WorldEditor/CWorldInfoSidebar.ui index 6c785c9a..0ef86103 100644 --- a/src/Editor/WorldEditor/CWorldInfoSidebar.ui +++ b/src/Editor/WorldEditor/CWorldInfoSidebar.ui @@ -148,7 +148,7 @@ - + @@ -242,7 +242,7 @@ - + diff --git a/src/Editor/icons/PoiSymbol_24px.png b/src/Editor/icons/PoiSymbol_24px.png new file mode 100644 index 0000000000000000000000000000000000000000..f368e5444a54a8dc9b0c6469a6b3e35c7427f405 GIT binary patch literal 396 zcmV;70dxL|P)V zziL!b5C`CcNX(i%f<+XIU_!EBB-^sKt?#y> z5I$PIXz7E;<}Eo)X) qQ26QQv>h{v4(0000