Skip to content

Commit

Permalink
+Added null byte support via "\0" for control characters in the text.
Browse files Browse the repository at this point in the history
+Added a console window while in Debug mode.
+Implemented the IEntry interface to mostly separate the UI from the MSBT class.
~Extensive rewrite of the MSBT class to support IEntry and the removal of SubStrings.
~Extended BinaryReaderX and BinaryWriterX functionality.
~Patched the SearchDirectory feature to properly select the correct entry after double clicking a result.
~Patched the RemoveLabel functionality to correctly remove a label and re-sequence the existing TXT2 entries.
~Made the Add, Remove and Save label features only available for files that have an LBL1 section. (Temporary)
-Removed SubStrings and supporting UI elements. (Replaced by null byte support.)
-Removed the Preview box as the full string is now visible in the Edit box.
  • Loading branch information
IcySon55 committed Aug 22, 2016
1 parent 5a94184 commit e964494
Show file tree
Hide file tree
Showing 12 changed files with 507 additions and 672 deletions.
2 changes: 1 addition & 1 deletion App.config
Expand Up @@ -45,7 +45,7 @@
<applicationSettings>
<MsbtEditor.Properties.Settings>
<setting name="ApplicationName" serializeAs="String">
<value>MSBT Editor Reloaded v0.9.1</value>
<value>MSBT Editor Reloaded v0.9.2</value>
</setting>
</MsbtEditor.Properties.Settings>
</applicationSettings>
Expand Down
15 changes: 15 additions & 0 deletions BinaryTools.cs
Expand Up @@ -76,6 +76,16 @@ public override ulong ReadUInt64()
return BitConverter.ToUInt64(base.ReadBytes(8).Reverse().ToArray(), 0);
}

public string ReadString(int length)
{
return Encoding.ASCII.GetString(ReadBytes(length)).TrimEnd('\0');
}

public string ReadString(int length, Encoding encoding)
{
return encoding.GetString(ReadBytes(length)).TrimEnd('\0');
}

public string PeekString(int length = 4)
{
List<byte> bytes = new List<byte>();
Expand Down Expand Up @@ -166,5 +176,10 @@ public override void Write(ulong value)
else
base.Write(BitConverter.GetBytes(value).Reverse().ToArray());
}

public void WriteASCII(string value)
{
base.Write(Encoding.ASCII.GetBytes(value));
}
}
}

0 comments on commit e964494

Please sign in to comment.