Skip to content

Commit

Permalink
Added more images, better bank5/6 support
Browse files Browse the repository at this point in the history
  • Loading branch information
ihatecompvir committed Jan 2, 2025
1 parent c06be24 commit 2d65c33
Show file tree
Hide file tree
Showing 27 changed files with 190 additions and 25 deletions.
Binary file added MiloEditor/Images/AnimFilter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MiloEditor/Images/BandStarDisplay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MiloEditor/Images/Button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MiloEditor/Images/CharClip.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MiloEditor/Images/Environ.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MiloEditor/Images/FileMerger.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MiloEditor/Images/Group.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MiloEditor/Images/Line.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MiloEditor/Images/Lipsync.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MiloEditor/Images/MatAnim.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MiloEditor/Images/MeshAnim.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MiloEditor/Images/MidiInstrument.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MiloEditor/Images/ParticleSys.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MiloEditor/Images/PropAnim.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified MiloEditor/Images/Sfx.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified MiloEditor/Images/TransAnim.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MiloEditor/Images/TransProxy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MiloEditor/Images/Trigger.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MiloEditor/Images/UILabel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 35 additions & 7 deletions MiloEditor/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ private int GetImageIndex(ImageList imageList, string key)

private void Form1_Load(object sender, EventArgs e)
{
// change title of window to "Milo Editor (version)"
this.Text = "Milo Editor (" + Application.ProductVersion + ")";

}
Expand All @@ -57,13 +56,15 @@ private void quitToolStripMenuItem_Click(object sender, EventArgs e)

private void LoadAssetClassImages()
{
imageList.ImageSize = new Size(24, 24);
imageList.Images.Add("default", Image.FromFile("Images/default.png"));
imageList.Images.Add("ObjectDir", Image.FromFile("Images/ObjectDir.png"));
imageList.Images.Add("RndDir", Image.FromFile("Images/RndDir.png"));
imageList.Images.Add("Object", Image.FromFile("Images/default.png"));
imageList.Images.Add("BandSongPref", Image.FromFile("Images/BandSongPref.png"));
imageList.Images.Add("Tex", Image.FromFile("Images/RndTex.png"));
imageList.Images.Add("TexRenderer", Image.FromFile("Images/RndTex.png"));
imageList.Images.Add("Group", Image.FromFile("Images/Group.png"));
imageList.Images.Add("Mat", Image.FromFile("Images/RndMat.png"));
imageList.Images.Add("Mesh", Image.FromFile("Images/RndMesh.png"));
imageList.Images.Add("MultiMesh", Image.FromFile("Images/RndMultiMesh.png"));
Expand All @@ -83,7 +84,31 @@ private void LoadAssetClassImages()
imageList.Images.Add("BandCrowdMeterDir", Image.FromFile("Images/BandCrowdMeterDir.png"));
imageList.Images.Add("Font", Image.FromFile("Images/Font.png"));
imageList.Images.Add("Text", Image.FromFile("Images/Text.png"));
imageList.Images.Add("BandList", Image.FromFile("Images/Text.png"));
imageList.Images.Add("BandCamShot", Image.FromFile("Images/Camera.png"));
imageList.Images.Add("UIColor", Image.FromFile("Images/UIColor.png"));
imageList.Images.Add("UILabel", Image.FromFile("Images/UILabel.png"));
imageList.Images.Add("BandLabel", Image.FromFile("Images/UILabel.png"));
imageList.Images.Add("CharLipSync", Image.FromFile("Images/Lipsync.png"));
imageList.Images.Add("UIButton", Image.FromFile("Images/Button.png"));
imageList.Images.Add("BandButton", Image.FromFile("Images/Button.png"));
imageList.Images.Add("BandStarDisplay", Image.FromFile("Images/BandStarDisplay.png"));
imageList.Images.Add("Environ", Image.FromFile("Images/Environ.png"));
imageList.Images.Add("PropAnim", Image.FromFile("Images/PropAnim.png"));
imageList.Images.Add("MeshAnim", Image.FromFile("Images/PropAnim.png"));
imageList.Images.Add("Line", Image.FromFile("Images/Line.png"));
imageList.Images.Add("AnimFilter", Image.FromFile("Images/AnimFilter.png"));
imageList.Images.Add("UITrigger", Image.FromFile("Images/Trigger.png"));
imageList.Images.Add("EventTrigger", Image.FromFile("Images/Trigger.png"));
imageList.Images.Add("Cam", Image.FromFile("Images/Camera.png"));
imageList.Images.Add("MeshAnim", Image.FromFile("Images/MeshAnim.png"));
imageList.Images.Add("ParticleSys", Image.FromFile("Images/ParticleSys.png"));
imageList.Images.Add("MatAnim", Image.FromFile("Images/MatAnim.png"));
imageList.Images.Add("CharClip", Image.FromFile("Images/CharClip.png"));
imageList.Images.Add("CharClipSet", Image.FromFile("Images/CharClip.png"));
imageList.Images.Add("MidiInstrument", Image.FromFile("Images/MidiInstrument.png"));
imageList.Images.Add("FileMerger", Image.FromFile("Images/FileMerger.png"));
imageList.Images.Add("TransProxy", Image.FromFile("Images/TransProxy.png"));
imageList.Images.Add("", Image.FromFile("Images/NoDir.png"));

imageList.ColorDepth = ColorDepth.Depth32Bit;
Expand All @@ -96,10 +121,10 @@ private void PopulateListWithEntries()
throw new Exception("Tried to populate list with milo scene entries when no Milo scene was loaded!");
}

// clear the TreeView of all existing nodes
miloSceneItemsTree.Nodes.Clear();

// clear the editor panel
miloSceneItemsTree.ShowNodeToolTips = true;

splitContainer1.Panel2.Controls.Clear();

miloSceneItemsTree.ImageList = imageList;
Expand All @@ -113,15 +138,16 @@ private void PopulateListWithEntries()

TreeNode rootNode = new TreeNode(rootName, GetImageIndex(imageList, currentMiloScene.dirMeta?.type), GetImageIndex(imageList, currentMiloScene.dirMeta?.type))
{
Tag = currentMiloScene.dirMeta
Tag = currentMiloScene.dirMeta,
ToolTipText = $"{currentMiloScene.dirMeta?.name ?? "<empty name>"} ({currentMiloScene.dirMeta?.type ?? "Unknown"})"
};

miloSceneItemsTree.Nodes.Add(rootNode);

// Handle inline subdirectories
if (currentMiloScene.dirMeta != null && currentMiloScene.dirMeta.directory is ObjectDir objDir && objDir.inlineSubDirs.Count > 0)
{
TreeNode inlineSubdirsNode = new TreeNode("Inline Subdirectories", -1, -1);
TreeNode inlineSubdirsNode = new TreeNode("Inline Subdirectories", GetImageIndex(imageList, "ObjectDir"), GetImageIndex(imageList, "ObjectDir"));
foreach (var subDir in objDir.inlineSubDirs)
{
AddDirectoryNode(subDir, inlineSubdirsNode);
Expand All @@ -148,7 +174,8 @@ private void AddChildNodes(DirectoryMeta parentDirMeta, TreeNode parentNode)
{
TreeNode node = new TreeNode(entry.name.value, GetImageIndex(imageList, entry.type), GetImageIndex(imageList, entry.type))
{
Tag = entry
Tag = entry,
ToolTipText = $"{entry.name ?? "<empty name>"} ({entry.type ?? "Unknown"})"
};

if (entry.dir != null)
Expand All @@ -164,7 +191,8 @@ private void AddDirectoryNode(DirectoryMeta dirMeta, TreeNode parentNode)
{
TreeNode subDirNode = new TreeNode(dirMeta.name.value, GetImageIndex(imageList, dirMeta.type), GetImageIndex(imageList, dirMeta.type))
{
Tag = dirMeta
Tag = dirMeta,
ToolTipText = $"{dirMeta.name ?? "<empty name>"} ({dirMeta.type ?? "Unknown"})"
};

//Recursively add entries
Expand Down
71 changes: 71 additions & 0 deletions MiloEditor/MiloEditor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,29 @@
</PropertyGroup>

<ItemGroup>
<None Remove="Images\AnimFilter.png" />
<None Remove="Images\BandCharDesc.png" />
<None Remove="Images\BandCrowdMeterDir.png" />
<None Remove="Images\BandStarDisplay.png" />
<None Remove="Images\Button.png" />
<None Remove="Images\Camera.png" />
<None Remove="Images\Character.png" />
<None Remove="Images\CharClip.png" />
<None Remove="Images\ColorPalette.png" />
<None Remove="Images\default.png" />
<None Remove="Images\Environ.png" />
<None Remove="Images\FileMerger.png" />
<None Remove="Images\Font.png" />
<None Remove="Images\Group.png" />
<None Remove="Images\Line.png" />
<None Remove="Images\Lipsync.png" />
<None Remove="Images\MatAnim.png" />
<None Remove="Images\MeshAnim.png" />
<None Remove="Images\MidiInstrument.png" />
<None Remove="Images\NoDir.png" />
<None Remove="Images\ObjectDir.png" />
<None Remove="Images\ParticleSys.png" />
<None Remove="Images\PropAnim.png" />
<None Remove="Images\RndAnim.png" />
<None Remove="Images\RndDir.png" />
<None Remove="Images\RndLight.png" />
Expand All @@ -38,35 +52,77 @@
<None Remove="Images\TexMovie.png" />
<None Remove="Images\Text.png" />
<None Remove="Images\TransAnim.png" />
<None Remove="Images\TransProxy.png" />
<None Remove="Images\Trigger.png" />
<None Remove="Images\UIColor.png" />
<None Remove="Images\UILabel.png" />
<None Remove="Images\WorldDir.png" />
</ItemGroup>

<ItemGroup>
<Content Include="Images\AnimFilter.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Images\BandCharDesc.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Images\BandCrowdMeterDir.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Images\BandStarDisplay.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Images\Button.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Images\Camera.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Images\Character.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Images\CharClip.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Images\ColorPalette.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Images\default.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Images\Environ.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Images\Font.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Images\Group.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Images\Line.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Images\Lipsync.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Images\MatAnim.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Images\MeshAnim.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Images\MidiInstrument.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Images\NoDir.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Images\ParticleSys.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Images\PropAnim.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Images\RndLight.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
Expand Down Expand Up @@ -109,9 +165,18 @@
<Content Include="Images\TransAnim.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Images\TransProxy.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Images\Trigger.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Images\UIColor.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Images\UILabel.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Images\WorldDir.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
Expand All @@ -128,6 +193,12 @@
</Content>
</ItemGroup>

<ItemGroup>
<Content Include="Images\FileMerger.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Pfim" Version="0.11.3" />
</ItemGroup>
Expand Down
4 changes: 3 additions & 1 deletion MiloEditor/Panels/BitmapEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,13 @@ private void RndTexEditor_Load(object sender, EventArgs e)
string encodingName = encodingTypeNames.Find(x => x.Item2 == (int)tex.bitmap.encoding).Item1;

dataGridView1.Rows.Add("Texture Encoding", encodingName);
dataGridView1.Rows.Add("Number of Mip Maps", tex.bitmap.mipMaps);

bitmapBox.SizeMode = PictureBoxSizeMode.Zoom;

// convert the tex into a DDS and load it into the picturebox
LoadDdsIntoPictureBox(tex.bitmap.ConvertToImage(), bitmapBox);
if (tex.bitmap.encoding == TextureEncoding.DXT1_BC1 || tex.bitmap.encoding == TextureEncoding.DXT5_BC3 || tex.bitmap.encoding == TextureEncoding.ATI2_BC5)
LoadDdsIntoPictureBox(tex.bitmap.ConvertToImage(), bitmapBox);
}

private void exportButton_Click(object sender, EventArgs e)
Expand Down
1 change: 1 addition & 0 deletions MiloLib/Assets/ObjectDir.cs
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ public ObjectDir Read(EndianReader reader, bool standalone, DirectoryMeta parent
for (int i = 0; i < inlineSubDirCount; i++)
{
DirectoryMeta inlineSubDir = new DirectoryMeta();
inlineSubDir.platform = parent.platform;
inlineSubDir.Read(reader);
inlineSubDirs.Add(inlineSubDir);
}
Expand Down
4 changes: 2 additions & 2 deletions MiloLib/Assets/Rnd/RndGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class RndGroup : Object
[Name("Environ"), MinVersion(16)]
public Symbol environ = new(0, "");

[Name("Draw Only"), Description("If set, only draws this member of the group"), MinVersion(14)]
[Name("Draw Only"), Description("If set, only draws this member of the group"), MinVersion(13)]
public Symbol drawOnly = new(0, "");

[Name("LOD"), Description("Object to draw instead below lod_screen_size"), MinVersion(12), MaxVersion(15)]
Expand Down Expand Up @@ -66,7 +66,7 @@ public RndGroup Read(EndianReader reader, bool standalone, DirectoryMeta parent,
if (revision < 16)
environ = Symbol.Read(reader);

if (revision > 13)
if (revision > 12)
drawOnly = Symbol.Read(reader);
}

Expand Down
32 changes: 29 additions & 3 deletions MiloLib/Assets/Rnd/RndTex.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,20 @@ public class RndTex : Object
public uint index2;

[MinVersion(11)]
public bool unk;
public bool optimizeForPS3;

[Name("Use External Path"), Description("Whether or not to use the external path.")]
public bool useExternalPath;

[Name("Bitmap"), Description("The bitmap data.")]
public RndBitmap bitmap = new();

public ushort unkShort;

public uint unkInt;
public uint unkInt2;
public ushort unkShort2;

public RndTex Read(EndianReader reader, bool standalone, DirectoryMeta parent, DirectoryMeta.Entry entry)
{
uint combinedRevision = reader.ReadUInt32();
Expand All @@ -56,15 +62,32 @@ public RndTex Read(EndianReader reader, bool standalone, DirectoryMeta parent, D
index2 = reader.ReadUInt32();

if (revision >= 11)
unk = reader.ReadBoolean();
optimizeForPS3 = reader.ReadBoolean();

if (revision != 7)
useExternalPath = reader.ReadBoolean();
else
useExternalPath = reader.ReadUInt32() == 1;

if (parent.platform == DirectoryMeta.Platform.Wii && revision > 10)
unkShort = reader.ReadUInt16();

Endian origEndian = reader.Endianness;

if (parent.platform == DirectoryMeta.Platform.Wii && revision > 10)
reader.Endianness = Endian.LittleEndian;

bitmap = new RndBitmap().Read(reader, false, parent, entry);

reader.Endianness = origEndian;

if (parent.platform == DirectoryMeta.Platform.Wii && revision > 10)
{
unkInt = reader.ReadUInt32();
unkInt2 = reader.ReadUInt32();
unkShort2 = reader.ReadUInt16();
}

if (standalone)
{
if ((reader.Endianness == Endian.BigEndian ? 0xADDEADDE : 0xDEADDEAD) != reader.ReadUInt32()) throw new Exception("Got to end of standalone asset but didn't find the expected end bytes, read likely did not succeed");
Expand Down Expand Up @@ -92,13 +115,16 @@ public override void Write(EndianWriter writer, bool standalone, DirectoryMeta p
writer.WriteUInt32(index2);

if (revision >= 11)
writer.WriteBoolean(unk);
writer.WriteBoolean(optimizeForPS3);

if (revision != 7)
writer.WriteBoolean(useExternalPath);
else
writer.WriteUInt32(useExternalPath ? 1u : 0u);

if (altRevision == 1)
writer.WriteUInt16(unkShort);

bitmap.Write(writer, false, parent, entry);

if (standalone)
Expand Down
16 changes: 4 additions & 12 deletions MiloLib/Assets/UI/UIColor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ public class UIColor : Object
public ushort altRevision;
public ushort revision;

public float r;
public float g;
public float b;
public float a;
[Name("Color")]
public HmxColor4 color = new();

public UIColor Read(EndianReader reader, bool standalone, DirectoryMeta parent, DirectoryMeta.Entry entry)
{
Expand All @@ -27,10 +25,7 @@ public UIColor Read(EndianReader reader, bool standalone, DirectoryMeta parent,

base.objFields.Read(reader, parent, entry);

r = reader.ReadFloat();
g = reader.ReadFloat();
b = reader.ReadFloat();
a = reader.ReadFloat();
color.Read(reader);

if (standalone)
{
Expand All @@ -46,10 +41,7 @@ public override void Write(EndianWriter writer, bool standalone, DirectoryMeta p

base.objFields.Write(writer);

writer.WriteFloat(r);
writer.WriteFloat(g);
writer.WriteFloat(b);
writer.WriteFloat(a);
color.Write(writer);

if (standalone)
{
Expand Down
Loading

0 comments on commit 2d65c33

Please sign in to comment.