mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-05-31 19:51:20 +00:00
Added support for building Wii ISOs
This commit is contained in:
parent
665a098d50
commit
096ef45bac
@ -81,24 +81,23 @@ bool CGameProject::BuildISO(const TString& rkIsoPath, IProgressNotifier *pProgre
|
|||||||
{
|
{
|
||||||
ASSERT( FileUtil::IsValidPath(rkIsoPath, false) );
|
ASSERT( FileUtil::IsValidPath(rkIsoPath, false) );
|
||||||
|
|
||||||
if (IsWiiBuild())
|
auto ProgressCallback = [&](float ProgressPercent, const nod::SystemString& rkInfoString, size_t)
|
||||||
{
|
{
|
||||||
Log::Error("Wii ISO building not supported!");
|
pProgress->Report((int) (ProgressPercent * 10000), 10000, TWideString(rkInfoString).ToUTF8());
|
||||||
return false;
|
};
|
||||||
}
|
|
||||||
|
|
||||||
|
pProgress->SetTask(0, "Building " + rkIsoPath.GetFileName());
|
||||||
|
TWideString DiscRoot = DiscDir(false).ToUTF16();
|
||||||
|
|
||||||
|
if (!IsWiiBuild())
|
||||||
|
{
|
||||||
|
nod::DiscBuilderGCN Builder(*rkIsoPath.ToUTF16(), ProgressCallback);
|
||||||
|
return Builder.buildFromDirectory(*DiscRoot) == nod::EBuildResult::Success;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
auto ProgressCallback = [&](float ProgressPercent, const nod::SystemString& rkInfoString, size_t)
|
nod::DiscBuilderWii Builder(*rkIsoPath.ToUTF16(), IsTrilogy(), ProgressCallback);
|
||||||
{
|
return Builder.buildFromDirectory(*DiscRoot) == nod::EBuildResult::Success;
|
||||||
pProgress->Report((int) (ProgressPercent * 10000), 10000, TWideString(rkInfoString).ToUTF8());
|
|
||||||
};
|
|
||||||
|
|
||||||
nod::DiscBuilderGCN *pBuilder = new nod::DiscBuilderGCN(*rkIsoPath.ToUTF16(), ProgressCallback);
|
|
||||||
pProgress->SetTask(0, "Building " + rkIsoPath.GetFileName());
|
|
||||||
|
|
||||||
TWideString DiscRoot = DiscDir(false).ToUTF16();
|
|
||||||
return pBuilder->buildFromDirectory(*DiscRoot) == nod::EBuildResult::Success;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,7 +69,6 @@ void CProjectSettingsDialog::ActiveProjectChanged(CGameProject *pProj)
|
|||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
mpUI->BuildIsoButton->setEnabled( pProj && !pProj->IsWiiBuild() );
|
|
||||||
SetupPackagesList();
|
SetupPackagesList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -108,10 +107,23 @@ void CProjectSettingsDialog::CookAllDirtyPackages()
|
|||||||
void CProjectSettingsDialog::BuildISO()
|
void CProjectSettingsDialog::BuildISO()
|
||||||
{
|
{
|
||||||
CGameProject *pProj = gpEdApp->ActiveProject();
|
CGameProject *pProj = gpEdApp->ActiveProject();
|
||||||
ASSERT(pProj && !pProj->IsWiiBuild());
|
ASSERT(pProj);
|
||||||
|
|
||||||
QString DefaultPath = TO_QSTRING( pProj->ProjectRoot() + FileUtil::SanitizeName(pProj->Name(), false) + ".gcm" );
|
QString DefaultExtension, FilterString;
|
||||||
QString IsoPath = UICommon::SaveFileDialog(this, "Choose output ISO path", "*.gcm", DefaultPath);
|
|
||||||
|
if (!pProj->IsWiiBuild())
|
||||||
|
{
|
||||||
|
DefaultExtension = ".gcm";
|
||||||
|
FilterString = "*.gcm;*.iso";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DefaultExtension = ".iso";
|
||||||
|
FilterString = "*.iso";
|
||||||
|
}
|
||||||
|
|
||||||
|
QString DefaultPath = TO_QSTRING( pProj->ProjectRoot() + FileUtil::SanitizeName(pProj->Name(), false) ) + DefaultExtension;
|
||||||
|
QString IsoPath = UICommon::SaveFileDialog(this, "Choose output ISO path", FilterString, DefaultPath);
|
||||||
|
|
||||||
if (!IsoPath.isEmpty())
|
if (!IsoPath.isEmpty())
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user