Skip to content

Commit

Permalink
Merge pull request #1 from sewer56lol/master
Browse files Browse the repository at this point in the history
[E3 Beta] Add Support for .ONE Archives Storing RWSDK 3.3 & RWSDK 3.4 content.
  • Loading branch information
MainMemory authored Aug 26, 2016
2 parents a05bc53 + 9a32679 commit 7e8609f
Show file tree
Hide file tree
Showing 5 changed files with 340 additions and 267 deletions.
14 changes: 11 additions & 3 deletions HeroesONE/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ static class Program
new LongOpt("pack", Argument.No, null, 'p'),
new LongOpt("unpack", Argument.No, null, 'u'),
new LongOpt("shadow060", Argument.No, null, '6'),
new LongOpt("shadow050", Argument.No, null, '5')
};
new LongOpt("shadow050", Argument.No, null, '5'),
new LongOpt("heroesE3", Argument.No, null, 'e'),
new LongOpt("heroesPreE3", Argument.No, null, '0'),
};

/// <summary>
/// The main entry point for the application.
Expand Down Expand Up @@ -42,7 +44,13 @@ static void Main(string[] args)
case '5':
type = ArchiveType.Shadow050;
break;
}
case 'e':
type = ArchiveType.HeroesE3;
break;
case '0':
type = ArchiveType.HeroesPreE3;
break;
}
opt = getopt.getopt();
}
if (mode == null || getopt.Optind + (mode == Mode.Unpack ? 0 : 1) >= args.Length)
Expand Down
10 changes: 10 additions & 0 deletions HeroesONE/Resources/HelpText.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,13 @@ Arguments:
Hedgehog" 0.60 format.
-5, --shadow050 Packs the archive with the "Shadow the
Hedgehog" 0.50 format.
-e, --heroesE3 Packs the archive with the "Sonic Heroes
E3 Beta" headers to support the prototype.
-0, --heroesPreE3 Packs the archive with the "Sonic Heroes
'Alpha'" headers to support prototypes
earlier than the E3 release.

*Note: -0 is based on a found archive in the E3 prototype, it is untested
as we do not have a prototype as aged as the specified archive. It
is included as the format did not have seemed to change and as such
it should work.
30 changes: 24 additions & 6 deletions HeroesONEEdit/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,13 @@ private void LoadFile(string filename)
case ArchiveType.Shadow050:
shadow050ToolStripMenuItem_Click(this, EventArgs.Empty);
break;
}
case ArchiveType.HeroesE3:
heroesE3ToolStripMenuItem_Click(this, EventArgs.Empty);
break;
case ArchiveType.HeroesPreE3:
heroesPreE3ToolStripMenuItem_Click(this, EventArgs.Empty);
break;
}
this.filename = filename;
listView1.Items.Clear();
imageList1.Images.Clear();
Expand Down Expand Up @@ -81,15 +87,15 @@ private void saveToolStripMenuItem_Click(object sender, EventArgs e)
if (string.IsNullOrEmpty(filename))
saveAsToolStripMenuItem_Click(sender, e);
else
file.Save(filename, heroesToolStripMenuItem.Checked ? ArchiveType.Heroes : shadow060ToolStripMenuItem.Checked ? ArchiveType.Shadow060 : ArchiveType.Shadow050);
file.Save(filename, heroesToolStripMenuItem.Checked ? ArchiveType.Heroes : heroesE3ToolStripMenuItem.Checked ? ArchiveType.HeroesE3 : heroesPreE3ToolStripMenuItem.Checked ? ArchiveType.HeroesPreE3 : shadow060ToolStripMenuItem.Checked ? ArchiveType.Shadow060 : ArchiveType.Shadow050);
}

private void saveAsToolStripMenuItem_Click(object sender, EventArgs e)
{
using (SaveFileDialog a = new SaveFileDialog() { Filter = "ONE Files|*.one|All Files|*.*" })
if (a.ShowDialog() == DialogResult.OK)
{
file.Save(a.FileName, heroesToolStripMenuItem.Checked ? ArchiveType.Heroes : shadow060ToolStripMenuItem.Checked ? ArchiveType.Shadow060 : ArchiveType.Shadow050);
file.Save(a.FileName, heroesToolStripMenuItem.Checked ? ArchiveType.Heroes : heroesE3ToolStripMenuItem.Checked ? ArchiveType.HeroesE3 : heroesPreE3ToolStripMenuItem.Checked ? ArchiveType.HeroesPreE3 : shadow060ToolStripMenuItem.Checked ? ArchiveType.Shadow060 : ArchiveType.Shadow050);
this.filename = a.FileName;
}
}
Expand Down Expand Up @@ -323,19 +329,31 @@ private void quitToolStripMenuItem_Click(object sender, EventArgs e)
private void heroesToolStripMenuItem_Click(object sender, EventArgs e)
{
heroesToolStripMenuItem.Checked = true;
shadow050ToolStripMenuItem.Checked = shadow060ToolStripMenuItem.Checked = false;
shadow050ToolStripMenuItem.Checked = shadow060ToolStripMenuItem.Checked = heroesE3ToolStripMenuItem.Checked = heroesPreE3ToolStripMenuItem.Checked = false;
}

private void shadow060ToolStripMenuItem_Click(object sender, EventArgs e)
{
shadow060ToolStripMenuItem.Checked = true;
heroesToolStripMenuItem.Checked = shadow050ToolStripMenuItem.Checked = false;
heroesToolStripMenuItem.Checked = shadow050ToolStripMenuItem.Checked = heroesE3ToolStripMenuItem.Checked = heroesPreE3ToolStripMenuItem.Checked = false;
}

private void shadow050ToolStripMenuItem_Click(object sender, EventArgs e)
{
shadow050ToolStripMenuItem.Checked = true;
heroesToolStripMenuItem.Checked = shadow060ToolStripMenuItem.Checked = false;
heroesToolStripMenuItem.Checked = shadow060ToolStripMenuItem.Checked = heroesE3ToolStripMenuItem.Checked = heroesPreE3ToolStripMenuItem.Checked = false;
}

private void heroesE3ToolStripMenuItem_Click(object sender, EventArgs e)
{
heroesE3ToolStripMenuItem.Checked = true;
shadow050ToolStripMenuItem.Checked = shadow060ToolStripMenuItem.Checked = heroesToolStripMenuItem.Checked = heroesPreE3ToolStripMenuItem.Checked = false;
}

private void heroesPreE3ToolStripMenuItem_Click(object sender, EventArgs e)
{
heroesPreE3ToolStripMenuItem.Checked = true;
shadow050ToolStripMenuItem.Checked = shadow060ToolStripMenuItem.Checked = heroesToolStripMenuItem.Checked = heroesE3ToolStripMenuItem.Checked = false;
}
}
}
Loading

0 comments on commit 7e8609f

Please sign in to comment.