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

Commit

Permalink
Fixes #273 - ME1 transparent avina fixed by refreshing objects before…
Browse files Browse the repository at this point in the history
… multiple saving.
  • Loading branch information
KFreon committed Apr 8, 2016
1 parent 7432969 commit 7425a1e
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions ME3Explorer/Texplorer2.cs
Expand Up @@ -277,7 +277,7 @@ private void saveChangesToolStripMenuItem_Click(object sender, EventArgs e)
// KFreon: Setup objects
TreeTexInfo tex = Tree.GetTex(ChangedTextures[i]);
StatusUpdater.UpdateText("Saving " + tex.TexName + " | " + MainProgressBar.Value + 1 + " \\ " + MainProgressBar.Maximum);
using (PCCObjects.IPCCObject pcc = PCCObjects.Creation.CreatePCCObject(tex.Files[0], WhichGame))
PCCObjects.IPCCObject pcc = PCCObjects.Creation.CreatePCCObject(tex.Files[0], WhichGame);
{
Textures.ITexture2D tex2D = tex.Textures[0];
{
Expand All @@ -289,8 +289,20 @@ private void saveChangesToolStripMenuItem_Click(object sender, EventArgs e)
/*this.Invoke(new Action(() => MainProgressBar.Increment(1)));
OutputBoxPrintLn("Initial saving complete for " + tex.TexName + ". Now saving remaining PCC's for this texture...");*/
// KFreon: Save first file and refresh object for next file. Dunno why necessary but it is. git: #296
if (!SaveFile(new List<string>() { tex.Files[0] }, new List<int>() { tex.ExpIDs[0] }, tex2D, 0))
return false;
// KFreon: Refresh objects
if (tex.Files.Count > 1)
{
pcc = PCCObjects.Creation.CreatePCCObject(tex.Files[0], WhichGame);
tex2D = pcc.CreateTexture2D(tex.ExpIDs[0], pathBIOGame);
}
// KFreon: Save files
for (int j = 0; j < tex.Files.Count; j++)
for (int j = 1; j < tex.Files.Count; j++)
{
if (!SaveFile(tex.Files, tex.ExpIDs, tex2D, j))
return false;
Expand Down

0 comments on commit 7425a1e

Please sign in to comment.