Skip to content
This repository has been archived by the owner on Jun 6, 2022. It is now read-only.

Commit

Permalink
Fixes #261 - Texplorer extracting DLC on startup.
Browse files Browse the repository at this point in the history
Fixes #260 - TPFTools game checking.
Fixes #259 - Path changer was "fixing" paths...
Fixes #140 - DLC asking despite DLC being extracted.
Fixes #242 - Modmaker script errors fixed.
Fixes #200 - Initial DLC window pathing/changing pathing.
  • Loading branch information
KFreon committed Mar 24, 2016
1 parent ea18cd5 commit 14c40eb
Show file tree
Hide file tree
Showing 8 changed files with 1,569 additions and 1,569 deletions.
2 changes: 1 addition & 1 deletion KFreonLib/Helpers/PathChanger.cs
Expand Up @@ -133,7 +133,7 @@ string GetBIOGame(string path, int whichGame)

if (whichGame == 3)
BIOGame = Path.GetDirectoryName(BIOGame);
return Path.Combine(BIOGame, "BIOGame");
return BIOGame;
}
}
}
4 changes: 2 additions & 2 deletions KFreonLib/Misc/Misc.cs
Expand Up @@ -46,11 +46,11 @@ public static List<bool> CheckGameState(MEDirectories.MEDirectories MEExDirecs,
{
case 0:
temp = Path.GetDirectoryName(temp);
tocPath = Path.Combine(temp, "MassEffectLauncher.exe");
tocPath = Path.Combine(temp, "\\Binaries\\MassEffect.exe");
break;
case 1:
temp = Path.GetDirectoryName(temp);
tocPath = Path.Combine(temp, "MassEffect2Launcher.exe");
tocPath = Path.Combine(temp, "\\Binaries\\MassEffect2.exe");
break;
case 2:
tocPath = Path.Combine(temp, "PCConsoleTOC.bin");
Expand Down
4 changes: 2 additions & 2 deletions ME3Explorer/ModMaker.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 10 additions & 18 deletions ME3Explorer/ModMaker.cs
Expand Up @@ -331,20 +331,7 @@ public List<string> FormatJobs(bool? autoupdate, bool ExternalCall, out bool ver

// KFreon: Format size
double len = job.Length;
string size = len.ToString() + " bytes.";
if (len > 1024) // KFreon: Kilobyte
{
double siz = 1024;
string ending = " Kilobytes.";
if (len > 1024 * 1024) // KFreon: Megabytes
{
siz = 1024 * 1024;
ending = " Megabytes.";
}

string newsize = (len / siz).ToString();
size = newsize.Substring(0, newsize.IndexOf('.') + 3) + ending;
}
string size = UsefulThings.General.GetFileSizeAsString(len);
names[i] = (job.Name + " --> Size: " + size);

DebugOutput.PrintLn(String.Format("Job: {0} size: {1}", job.Name, job.Length));
Expand Down Expand Up @@ -787,7 +774,8 @@ private bool IsAlreadyExtracted
bool alreadyExtracted = true;
foreach (var item in Directory.GetDirectories(ME3Directory.DLCPath))
{
if (!Directory.EnumerateFiles(item).ToList().Any(f => f.EndsWith(".pcc")))
// KFreon: Skip metadata
if (!item.Contains("__metadata") && !Directory.EnumerateFiles(item).ToList().Any(f => f.EndsWith(".pcc")))
{
alreadyExtracted = false;
break;
Expand All @@ -806,7 +794,8 @@ private List<string> RunJobs(List<ModJob> joblist, ref List<int> whichgames)
DialogResult result = DialogResult.Yes;
this.Invoke(new Action(() =>
{
if (!IsAlreadyExtracted && joblist.Any(job => job.HasDLCPCCs))
// KFreon: only for ME3
if (joblist.Any(job => job.WhichGame == 3) && !IsAlreadyExtracted && joblist.Any(job => job.HasDLCPCCs))
result = MessageBox.Show("Some jobs contain DLC references, but you don't have DLC extracted. You should restart the toolset and allow DLC Extraction." + Environment.NewLine + "Continue installing anyway? If you do, only basegame will be affected.", "Don't **** with Aria.", MessageBoxButtons.YesNo);
}));

Expand Down Expand Up @@ -955,8 +944,7 @@ private void RunSelectedButton_Click(object sender, EventArgs e)
else
{
ModJob job = KFreonLib.Scripting.ModMaker.JobList[index];
if (job.HasDLCPCCs && !IsAlreadyExtracted)
if (job.WhichGame == 3 && job.HasDLCPCCs && !IsAlreadyExtracted)
{
if (MessageBox.Show("Some jobs contain DLC references, but you don't have DLC extracted. You should restart the toolset and allow DLC Extraction." + Environment.NewLine + "Continue installing anyway? If you do, only basegame will be affected.", "Don't **** with Aria.", MessageBoxButtons.YesNo) == DialogResult.No)
{
Expand Down Expand Up @@ -1540,6 +1528,10 @@ public void CreateJobsFromPCCDiff(string basePCCName, string modPCCName)

for (int i = 0; i < basePCC.ExportCount; i++)
{
if (modifiedPCC.Exports.Count == i) // KFreon: Not adding exports just yet.
break;


if (!basePCC.Exports[i].Data.SequenceEqual(modifiedPCC.Exports[i].Data))
{
ModJob job = new ModJob();
Expand Down
38 changes: 19 additions & 19 deletions ME3Explorer/Texplorer2.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 13 additions & 3 deletions ME3Explorer/Texplorer2.cs
Expand Up @@ -983,17 +983,26 @@ private bool FirstTimeSetup()
DebugOutput.PrintLn("Beginning First Time Setup...");
List<string> dlcfiles = new List<string>();


// KFreon: Removed for rev 745 fix #261
// KFreon: Added game gate here to stop it trying to do stuff for other games
if (WhichGame == 3)
{
DebugOutput.PrintLn("Starting DLC Extraction...");
/*DebugOutput.PrintLn("Starting DLC Extraction...");
StatusUpdater.UpdateText("Extracting all DLC. This will take time...");
DLCEditor2.DLCEditor2 dlcedit2 = new DLCEditor2.DLCEditor2();
dlcedit2.ExtractAllDLC();
dlcedit2.ExtractAllDLC();*/

// KFreon: Enumerate DLC files here
dlcfiles = new List<string>(Directory.EnumerateFiles(DLCPath).Where(file => file.ToLower().EndsWith(".pcc") || file.ToLower().EndsWith(".tfc")));
try
{
dlcfiles = new List<string>(Directory.EnumerateFiles(DLCPath).Where(file => file.ToLower().EndsWith(".pcc") || file.ToLower().EndsWith(".tfc")));
}
catch
{
// Kfreon: Ignore.
}
}

DebugOutput.PrintLn(String.Format("Starting FTS Window with parameters: Game: {0} DLCPath: {1} Cooked: {2}", WhichGame, DLCPath, pathCooked));
Expand All @@ -1011,6 +1020,7 @@ private bool FirstTimeSetup()
{
Tree.Clear(true);
Tree.AddPCCs(fts.FilesToAddToTree);
if (dlcfiles.Count != 0)
Tree.AddPCCs(dlcfiles);
}
}
Expand Down

0 comments on commit 14c40eb

Please sign in to comment.