mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-12-20 02:15:32 +00:00
Merge branch 'master' into release
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
#include <Core/GameProject/CAssetNameMap.h>
|
||||
#include <Core/GameProject/CGameExporter.h>
|
||||
#include <Core/GameProject/CGameInfo.h>
|
||||
#include <Core/Resource/Script/CMasterTemplate.h>
|
||||
#include <Core/Resource/Script/CGameTemplate.h>
|
||||
|
||||
#include <QComboBox>
|
||||
#include <QDialogButtonBox>
|
||||
@@ -24,8 +24,8 @@ CExportGameDialog::CExportGameDialog(const QString& rkIsoPath, const QString& rk
|
||||
, mpDisc(nullptr)
|
||||
, mpExporter(nullptr)
|
||||
, mDiscType(eDT_Normal)
|
||||
, mGame(eUnknownGame)
|
||||
, mRegion(eRegion_Unknown)
|
||||
, mGame(EGame::Invalid)
|
||||
, mRegion(ERegion::Unknown)
|
||||
, mBuildVer(0.f)
|
||||
, mWiiFrontend(false)
|
||||
, mExportSuccess(false)
|
||||
@@ -85,11 +85,10 @@ void CExportGameDialog::InitUI(QString ExportDir)
|
||||
mpUI->GameTitleLineEdit->setText( TO_QSTRING(mGameTitle) );
|
||||
mpUI->GameIdLineEdit->setText( TO_QSTRING(mGameID) );
|
||||
mpUI->BuildVersionLineEdit->setText( QString("%1 (%2)").arg(mBuildVer).arg( TO_QSTRING(GameInfo.GetBuildName(mBuildVer, mRegion)) ));
|
||||
mpUI->RegionLineEdit->setText( mRegion == eRegion_NTSC ? "NTSC" :
|
||||
mRegion == eRegion_PAL ? "PAL" : "JPN" );
|
||||
mpUI->RegionLineEdit->setText( TEnumReflection<ERegion>::ConvertValueToString(mRegion) );
|
||||
|
||||
// Disc tree widget
|
||||
nod::Partition *pPartition = mpDisc->getDataPartition();
|
||||
nod::IPartition *pPartition = mpDisc->getDataPartition();
|
||||
ASSERT(pPartition);
|
||||
|
||||
QTreeWidgetItem *pTreeRoot = new QTreeWidgetItem((QTreeWidgetItem*) nullptr, QStringList(QString("Disc")));
|
||||
@@ -126,15 +125,15 @@ bool CExportGameDialog::ValidateGame()
|
||||
switch (mGameID[3])
|
||||
{
|
||||
case 'E':
|
||||
mRegion = eRegion_NTSC;
|
||||
mRegion = ERegion::NTSC;
|
||||
break;
|
||||
|
||||
case 'P':
|
||||
mRegion = eRegion_PAL;
|
||||
mRegion = ERegion::PAL;
|
||||
break;
|
||||
|
||||
case 'J':
|
||||
mRegion = eRegion_JPN;
|
||||
mRegion = ERegion::JPN;
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -156,23 +155,23 @@ bool CExportGameDialog::ValidateGame()
|
||||
return false;
|
||||
}
|
||||
|
||||
mGame = ePrime;
|
||||
mGame = EGame::Prime;
|
||||
break;
|
||||
|
||||
case FOURCC('G2MX'):
|
||||
// Echoes, but also appears in the MP3 proto
|
||||
if (mGameID[4] == 'A' && mGameID[5] == 'B')
|
||||
mGame = eCorruptionProto;
|
||||
mGame = EGame::CorruptionProto;
|
||||
else
|
||||
mGame = eEchoes;
|
||||
mGame = EGame::Echoes;
|
||||
break;
|
||||
|
||||
case FOURCC('RM3X'):
|
||||
mGame = eCorruption;
|
||||
mGame = EGame::Corruption;
|
||||
break;
|
||||
|
||||
case FOURCC('SF8X'):
|
||||
mGame = eReturns;
|
||||
mGame = EGame::DKCReturns;
|
||||
break;
|
||||
|
||||
case FOURCC('R3MX'):
|
||||
@@ -188,13 +187,13 @@ bool CExportGameDialog::ValidateGame()
|
||||
|
||||
case FOURCC('R3IX'):
|
||||
// MP1 Wii de Asobu
|
||||
mGame = ePrime;
|
||||
mGame = EGame::Prime;
|
||||
mDiscType = eDT_WiiDeAsobu;
|
||||
if (!RequestWiiPortGame()) return false;
|
||||
break;
|
||||
|
||||
case FOURCC('R32X'):
|
||||
mGame = eEchoes;
|
||||
mGame = EGame::Echoes;
|
||||
mDiscType = eDT_WiiDeAsobu;
|
||||
if (!RequestWiiPortGame()) return false;
|
||||
break;
|
||||
@@ -212,9 +211,9 @@ bool CExportGameDialog::RequestWiiPortGame()
|
||||
QDialog Dialog;
|
||||
Dialog.setWindowTitle("Select Game");
|
||||
|
||||
bool IsTrilogy = (mGame == eUnknownGame);
|
||||
bool HasMP1 = (IsTrilogy || mGame == ePrime);
|
||||
bool HasMP2 = (IsTrilogy || mGame == eEchoes);
|
||||
bool IsTrilogy = (mGame == EGame::Invalid);
|
||||
bool HasMP1 = (IsTrilogy || mGame == EGame::Prime);
|
||||
bool HasMP2 = (IsTrilogy || mGame == EGame::Echoes);
|
||||
bool HasMP3 = IsTrilogy;
|
||||
|
||||
QString GameName = (IsTrilogy ? "Metroid Prime: Trilogy" : "Wii de Asobu");
|
||||
@@ -243,20 +242,20 @@ bool CExportGameDialog::RequestWiiPortGame()
|
||||
switch (ComboBox.currentIndex())
|
||||
{
|
||||
case 0:
|
||||
mGame = eCorruption;
|
||||
mGame = EGame::Corruption;
|
||||
mWiiFrontend = true;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
mGame = (HasMP1 ? ePrime : eEchoes);
|
||||
mGame = (HasMP1 ? EGame::Prime : EGame::Echoes);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
mGame = eEchoes;
|
||||
mGame = EGame::Echoes;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
mGame = eCorruption;
|
||||
mGame = EGame::Corruption;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -270,7 +269,7 @@ float CExportGameDialog::FindBuildVersion()
|
||||
ASSERT(mpDisc != nullptr);
|
||||
|
||||
// MP1 demo build doesn't have a build version
|
||||
if (mGame == ePrimeDemo) return 0.f;
|
||||
if (mGame == EGame::PrimeDemo) return 0.f;
|
||||
|
||||
// Get DOL buffer
|
||||
std::unique_ptr<uint8_t[]> pDolData = mpDisc->getDataPartition()->getDOLBuf();
|
||||
@@ -314,7 +313,7 @@ void CExportGameDialog::RecursiveAddToTree(const nod::Node *pkNode, QTreeWidgetI
|
||||
if (pkLeft->getKind() != pkRight->getKind())
|
||||
return pkLeft->getKind() == nod::Node::Kind::Directory;
|
||||
else
|
||||
return TString(pkLeft->getName()).ToUpper() < TString(pkRight->getName()).ToUpper();
|
||||
return TString(pkLeft->getName().data()).ToUpper() < TString(pkRight->getName().data()).ToUpper();
|
||||
});
|
||||
|
||||
// Add nodes to tree
|
||||
@@ -330,7 +329,7 @@ void CExportGameDialog::RecursiveAddToTree(const nod::Node *pkNode, QTreeWidgetI
|
||||
|
||||
bool IsDir = pkNode->getKind() == nod::Node::Kind::Directory;
|
||||
|
||||
QTreeWidgetItem *pItem = new QTreeWidgetItem(pParent, QStringList(QString::fromStdString(pkNode->getName())) );
|
||||
QTreeWidgetItem *pItem = new QTreeWidgetItem(pParent, QStringList(QString::fromStdString(pkNode->getName().data())) );
|
||||
pItem->setIcon(0, QIcon(IsDir ? skDirIcon : skFileIcon));
|
||||
|
||||
if (IsDir)
|
||||
|
||||
Reference in New Issue
Block a user