public bool UpdateJob(List<string> BIOGames, string ExecFolder)
{
bool retval = true;
// KFreon: Ensure game target known
/*if (WhichGame == -1)
{
// KFreon: See if given pcc's exist on disk, and if so which game to they belong to. All basegame pcc's must be part of the same game.
int game = PCCObjects.Misc.SearchForPCC(PCCs, BIOGames, ExpIDs, ObjectName, JobType =="TEXTURE");
DebugOutput.PrintLn("Got game: " + game);
if (game == -1)
{
DebugOutput.PrintLn("Unable to find pcc's for job: " + Name);
retval = false;
WhichGame = 0;
}
else
WhichGame = game;
}*/
// KFreon: Return if already failed
if (!retval)
return retval;
// KFreon: If texture job, fix pcc pathing.
//string pathBIOGame = WhichGame == 1 ? Path.GetDirectoryName(BIOGames[WhichGame - 1]) : BIOGames[WhichGame - 1];
// Heff: Seems like we change the paths in so many places that it's bound to fuck up somewhere. Also VERY unfriendly to DLC mods, so chanigs this.
string pathBIOGame = BIOGames[WhichGame - 1];
/*if (WhichGame == 3)
pathBIOGame = Path.Combine(pathBIOGame, "CookedPCConsole");
else
pathBIOGame = Path.Combine(pathBIOGame, "CookedPC");*/
// KFreon: Deal with multiple files found during search
List<string> multiples;
List<int> MultiInds;
// KFreon: Must be the same number of pcc's and expID's
if (PCCs.Count != ExpIDs.Count)
DebugOutput.PrintLn("Job: " + Name + " has " + PCCs.Count + " PCC's and " + ExpIDs.Count + " ExpID's. Incorrect, so skipping...");
else
{
string script = "";
DebugOutput.PrintLn("Validating pccs");
OrigPCCs = ValidateGivenModPCCs(ref PCCs, ExpIDs, WhichGame, pathBIOGame, out multiples, out MultiInds, ref retval, JobType == "TEXTURE");
// KFreon: Texture job
if (JobType == "TEXTURE")
{
DebugOutput.PrintLn(Name + " is a texture mod.");
// KFreon: Get script for job
script = ModMaker.GenerateTextureScript(ExecFolder, OrigPCCs, ExpIDs, Texname, WhichGame, pathBIOGame);
}
else
{
// KFreon: HOPEFULLY a mesh mod...
DebugOutput.PrintLn(Name + " is a mesh mod. Hopefully...");
script = ModMaker.GenerateMeshScript(ExpIDs[0].ToString(), PCCs[0]);
// SirCxyrtyx: Might be a pcc compare job, so check for added names
List<string> namesToAdd = GetNamesFromScript(Script);
if(namesToAdd.Count > 0)
{
string names = "";
foreach (var name in namesToAdd)
names += "names.Add(\"" + name + "\");" + Environment.NewLine;
script = script.Replace("// **KF_NAMES", names);
}
}
Script = script;
}
return retval;
}
}