Many changes once again
This commit is contained in:
131
BMGEditor/BMG.cs
131
BMGEditor/BMG.cs
@@ -9,14 +9,20 @@ namespace BMGEditor
|
||||
public class BMG
|
||||
{
|
||||
private FileBase m_File;
|
||||
private Int32 m_Signature = 0x4D455347;
|
||||
private Int32 m_FileType = 0x626D6731;
|
||||
private Byte m_ExpectedEncoding = 0x02;
|
||||
private const Int32 m_Signature = 0x4D455347;
|
||||
private const Int32 m_FileType = 0x626D6731;
|
||||
private const Byte m_ExpectedEncoding = 0x02;
|
||||
|
||||
public BMG(FileBase file)
|
||||
private const Int32 INF1magic = 0x494E4631;
|
||||
private const Int32 DAT1magic = 0x44415431;
|
||||
private const Int32 FLW1magic = 0x464C5731;
|
||||
private const Int32 FLI1magic = 0x464C4931;
|
||||
|
||||
public BMG(FileBase file, Bcsv tbl)
|
||||
{
|
||||
m_File = file;
|
||||
m_File.BigEndian = true;
|
||||
m_File.Encoding = Encoding.BigEndianUnicode;
|
||||
m_File.Stream.Position = 0;
|
||||
|
||||
Int32 headermagic1 = m_File.Reader.ReadInt32();
|
||||
@@ -26,33 +32,124 @@ namespace BMGEditor
|
||||
UInt32 fileSize = m_File.Reader.ReadUInt32();
|
||||
UInt32 numberOfSections = m_File.Reader.ReadUInt32();
|
||||
Byte fileEncoding = m_File.Reader.ReadByte();
|
||||
Console.WriteLine("File size: " + fileSize);
|
||||
Console.WriteLine("File sections: " + numberOfSections);
|
||||
|
||||
if (fileEncoding != m_ExpectedEncoding) throw new Exception("sorry but no");
|
||||
m_File.Stream.Position = 0x20;
|
||||
|
||||
//INF1
|
||||
Int32 INF1sectionMagic = m_File.Reader.ReadInt32();
|
||||
if (INF1sectionMagic != INF1magic)
|
||||
{
|
||||
throw new Exception("BMG File exists but isn't in the expected format");
|
||||
}
|
||||
UInt32 INF1sectionSize = m_File.Reader.ReadUInt32();
|
||||
UInt16 INF1itemNumber = m_File.Reader.ReadUInt16();
|
||||
UInt16 INF1itemLength = m_File.Reader.ReadUInt16();
|
||||
m_File.Stream.Position += 0x04;
|
||||
|
||||
Entries = new List<TextEntry>();
|
||||
for (int i = 0; i < INF1itemNumber; i++)
|
||||
{
|
||||
TextEntry txtEntry = new TextEntry();
|
||||
txtEntry.entryNo = i;
|
||||
txtEntry.offset = m_File.Reader.ReadUInt32();
|
||||
txtEntry.unk1 = m_File.Reader.ReadByte();
|
||||
txtEntry.cameraOpt = m_File.Reader.ReadByte();
|
||||
txtEntry.sndEffectOpt = m_File.Reader.ReadByte();
|
||||
txtEntry.unk2 = m_File.Reader.ReadByte();
|
||||
txtEntry.messageTriggerOpt = m_File.Reader.ReadByte();
|
||||
txtEntry.messageLayoutOpt = m_File.Reader.ReadByte();
|
||||
txtEntry.messageAreaOpt = m_File.Reader.ReadByte();
|
||||
|
||||
Entries.Add(txtEntry);
|
||||
m_File.Stream.Position += 0x01;
|
||||
}
|
||||
m_File.Stream.Position += 0x10;
|
||||
|
||||
//DAT1
|
||||
long DAT1sectionStart = m_File.Stream.Position;
|
||||
Int32 DAT1sectionMagic = m_File.Reader.ReadInt32();
|
||||
UInt32 DAT1sectionSize = m_File.Reader.ReadUInt32();
|
||||
long strPoolStart = m_File.Stream.Position;
|
||||
if (DAT1sectionMagic != DAT1magic) throw new Exception("BMG exists but isn\'t in the expected format");
|
||||
for (int j = 0; j < INF1itemNumber; j++)
|
||||
{
|
||||
m_File.Stream.Position = strPoolStart + Entries[j].offset;
|
||||
Entries[j].text = ReadWideCharString();
|
||||
}
|
||||
|
||||
int l = 0;
|
||||
foreach (Bcsv.Entry bcsvEntry in tbl.Entries)
|
||||
{
|
||||
string entName = bcsvEntry[563954530].ToString();
|
||||
Entries[l].entryName = entName;
|
||||
l++;
|
||||
}
|
||||
|
||||
//FLW1
|
||||
m_File.Stream.Position = DAT1sectionStart + DAT1sectionSize;
|
||||
long FLW1sectionStart = m_File.Stream.Position;
|
||||
Int32 FLW1sectionMagic = m_File.Reader.ReadInt32();
|
||||
if (FLW1sectionMagic != FLW1magic) throw new Exception("FLW1 section missing. Check your BMG file");
|
||||
UInt32 FLW1sectionSize = m_File.Reader.ReadUInt32();
|
||||
|
||||
|
||||
//FLI1
|
||||
m_File.Stream.Position = FLW1sectionStart + FLW1sectionSize;
|
||||
long FLI1sectionStart = m_File.Stream.Position;
|
||||
Int32 FLI1sectionMagic = m_File.Reader.ReadInt32();
|
||||
if (FLI1sectionMagic != FLI1magic) throw new Exception("FLI1 section missing. Check your BMG file");
|
||||
UInt32 FLI1sectionSize = m_File.Reader.ReadUInt32();
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
m_File.Close();
|
||||
}
|
||||
|
||||
public class TextEntry
|
||||
{
|
||||
public int entryNo;
|
||||
public string text;
|
||||
public UInt32 offset;
|
||||
public string entryName;
|
||||
|
||||
//Properties
|
||||
public byte unk1;
|
||||
public byte cameraOpt;
|
||||
public byte sndEffectOpt;
|
||||
public byte unk2;
|
||||
public byte messageTriggerOpt;
|
||||
public byte messageLayoutOpt;
|
||||
public byte messageAreaOpt;
|
||||
}
|
||||
|
||||
/*public class BMGSection
|
||||
public string ReadWideCharString()
|
||||
{
|
||||
Int32 sectionMagic;
|
||||
public BMGSection()
|
||||
byte escSeqLength;
|
||||
|
||||
string ret = "";
|
||||
char c;
|
||||
while ((c = m_File.Reader.ReadChar()) != '\0')
|
||||
{
|
||||
if (c == 0x001A)
|
||||
{
|
||||
ret += "\"" + c;
|
||||
escSeqLength = m_File.Reader.ReadByte();
|
||||
ret += $" {escSeqLength} ";
|
||||
for (int k = 3; k < escSeqLength; k++)
|
||||
{
|
||||
ret += m_File.Reader.ReadByte() + " ";
|
||||
}
|
||||
ret += "\"";
|
||||
}
|
||||
else
|
||||
ret += c;
|
||||
}
|
||||
return ret;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public class INF1Section : BMGSection
|
||||
{
|
||||
public INF1Section()
|
||||
{
|
||||
|
||||
public List<TextEntry> Entries;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
39
BMGEditor/BMGEditForm.Designer.cs
generated
39
BMGEditor/BMGEditForm.Designer.cs
generated
@@ -1,39 +0,0 @@
|
||||
namespace BMGEditor
|
||||
{
|
||||
partial class BMGEditForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(800, 450);
|
||||
this.Text = "BMGEditForm";
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,120 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -301,6 +301,7 @@ namespace BMGEditor
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -5,16 +5,21 @@ using System.Windows.Forms;
|
||||
|
||||
namespace BMGEditor
|
||||
{
|
||||
public static class Variables
|
||||
{
|
||||
public const string softwareName = "Luma";
|
||||
public const string softwareVersion = "v0.1";
|
||||
public const bool isBeta = true;
|
||||
public const bool isPrivateBeta = true;
|
||||
}
|
||||
internal static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
ApplicationConfiguration.Initialize();
|
||||
Bcsv.PopulateHashtable();
|
||||
if (Variables.isBeta && Variables.isPrivateBeta) MessageBox.Show("This is a private beta, please don\'t leak it.", "Private", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
Application.Run(new MainForm());
|
||||
}
|
||||
}
|
||||
|
||||
138
BMGEditor/UI/BMGEditForm.Designer.cs
generated
Normal file
138
BMGEditor/UI/BMGEditForm.Designer.cs
generated
Normal file
@@ -0,0 +1,138 @@
|
||||
namespace BMGEditor
|
||||
{
|
||||
partial class BMGEditForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
|
||||
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.closeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.quitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.entriesListBox = new System.Windows.Forms.ListBox();
|
||||
this.menuStrip1.SuspendLayout();
|
||||
this.panel1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// menuStrip1
|
||||
//
|
||||
this.menuStrip1.ImageScalingSize = new System.Drawing.Size(20, 20);
|
||||
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.fileToolStripMenuItem});
|
||||
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
|
||||
this.menuStrip1.Name = "menuStrip1";
|
||||
this.menuStrip1.Size = new System.Drawing.Size(800, 28);
|
||||
this.menuStrip1.TabIndex = 0;
|
||||
this.menuStrip1.Text = "menuStrip1";
|
||||
//
|
||||
// fileToolStripMenuItem
|
||||
//
|
||||
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.openToolStripMenuItem,
|
||||
this.closeToolStripMenuItem,
|
||||
this.saveToolStripMenuItem,
|
||||
this.quitToolStripMenuItem});
|
||||
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
|
||||
this.fileToolStripMenuItem.Size = new System.Drawing.Size(46, 24);
|
||||
this.fileToolStripMenuItem.Text = "File";
|
||||
//
|
||||
// openToolStripMenuItem
|
||||
//
|
||||
this.openToolStripMenuItem.Name = "openToolStripMenuItem";
|
||||
this.openToolStripMenuItem.Size = new System.Drawing.Size(128, 26);
|
||||
this.openToolStripMenuItem.Text = "Open";
|
||||
//
|
||||
// closeToolStripMenuItem
|
||||
//
|
||||
this.closeToolStripMenuItem.Name = "closeToolStripMenuItem";
|
||||
this.closeToolStripMenuItem.Size = new System.Drawing.Size(128, 26);
|
||||
this.closeToolStripMenuItem.Text = "Close";
|
||||
//
|
||||
// saveToolStripMenuItem
|
||||
//
|
||||
this.saveToolStripMenuItem.Name = "saveToolStripMenuItem";
|
||||
this.saveToolStripMenuItem.Size = new System.Drawing.Size(128, 26);
|
||||
this.saveToolStripMenuItem.Text = "Save";
|
||||
//
|
||||
// quitToolStripMenuItem
|
||||
//
|
||||
this.quitToolStripMenuItem.Name = "quitToolStripMenuItem";
|
||||
this.quitToolStripMenuItem.Size = new System.Drawing.Size(128, 26);
|
||||
this.quitToolStripMenuItem.Text = "Quit";
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
this.panel1.Controls.Add(this.entriesListBox);
|
||||
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.panel1.Location = new System.Drawing.Point(0, 28);
|
||||
this.panel1.Name = "panel1";
|
||||
this.panel1.Size = new System.Drawing.Size(800, 422);
|
||||
this.panel1.TabIndex = 1;
|
||||
//
|
||||
// entriesListBox
|
||||
//
|
||||
this.entriesListBox.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.entriesListBox.FormattingEnabled = true;
|
||||
this.entriesListBox.ItemHeight = 20;
|
||||
this.entriesListBox.Location = new System.Drawing.Point(0, 0);
|
||||
this.entriesListBox.Name = "entriesListBox";
|
||||
this.entriesListBox.Size = new System.Drawing.Size(800, 422);
|
||||
this.entriesListBox.TabIndex = 0;
|
||||
//
|
||||
// BMGEditForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(800, 450);
|
||||
this.Controls.Add(this.panel1);
|
||||
this.Controls.Add(this.menuStrip1);
|
||||
this.MainMenuStrip = this.menuStrip1;
|
||||
this.Name = "BMGEditForm";
|
||||
this.Text = "BMGEditForm";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.BMGEditForm_FormClosing);
|
||||
this.menuStrip1.ResumeLayout(false);
|
||||
this.menuStrip1.PerformLayout();
|
||||
this.panel1.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.MenuStrip menuStrip1;
|
||||
private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
|
||||
private System.Windows.Forms.Panel panel1;
|
||||
private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem closeToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem quitToolStripMenuItem;
|
||||
private System.Windows.Forms.ListBox entriesListBox;
|
||||
}
|
||||
}
|
||||
40
BMGEditor/UI/BMGEditForm.cs
Normal file
40
BMGEditor/UI/BMGEditForm.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace BMGEditor
|
||||
{
|
||||
public partial class BMGEditForm : Form
|
||||
{
|
||||
public BMGEditForm(RarcFilesystem arcFs)
|
||||
{
|
||||
InitializeComponent();
|
||||
Text = $"Text editor - {Variables.softwareName} {Variables.softwareVersion}";
|
||||
if (Variables.isBeta) Text += " [BETA]";
|
||||
|
||||
m_FileTbl = new Bcsv(arcFs.OpenFile($"{arcFs.rootName}/messageid.tbl"));
|
||||
m_File = new BMG(arcFs.OpenFile($"{arcFs.rootName}/message.bmg"), m_FileTbl);
|
||||
|
||||
foreach (BMG.TextEntry txtEntry in m_File.Entries)
|
||||
{
|
||||
entriesListBox.Items.Add(txtEntry.entryName);
|
||||
}
|
||||
}
|
||||
|
||||
private BMG m_File = null;
|
||||
private Bcsv m_FileTbl = null;
|
||||
|
||||
private void BMGEditForm_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
m_File.Close();
|
||||
m_FileTbl.Close();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
63
BMGEditor/UI/BMGEditForm.resx
Normal file
63
BMGEditor/UI/BMGEditForm.resx
Normal file
@@ -0,0 +1,63 @@
|
||||
<root>
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
@@ -61,6 +61,7 @@
|
||||
// dgvBcsv
|
||||
//
|
||||
this.dgvBcsv.AllowUserToResizeRows = false;
|
||||
this.dgvBcsv.BackgroundColor = System.Drawing.SystemColors.Control;
|
||||
this.dgvBcsv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.dgvBcsv.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.dgvBcsv.Location = new System.Drawing.Point(0, 27);
|
||||
@@ -80,7 +81,7 @@
|
||||
this.Controls.Add(this.tsToolbar);
|
||||
this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
|
||||
this.Name = "BcsvEditorForm";
|
||||
this.Text = "[DEBUG] BCSV editor";
|
||||
this.Text = "Entries Editor";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.BcsvEditorForm_FormClosing);
|
||||
this.tsToolbar.ResumeLayout(false);
|
||||
this.tsToolbar.PerformLayout();
|
||||
@@ -14,6 +14,8 @@ namespace BMGEditor
|
||||
public BcsvEditorForm(RarcFilesystem arcFs)
|
||||
{
|
||||
InitializeComponent();
|
||||
Text += $" - {Variables.softwareName} {Variables.softwareVersion}";
|
||||
if (Variables.isBeta) Text += " [BETA]";
|
||||
m_File = new Bcsv(arcFs.OpenFile($"{arcFs.rootName}/messageid.tbl"));
|
||||
|
||||
dgvBcsv.Rows.Clear();
|
||||
@@ -18,6 +18,8 @@ namespace BMGEditor
|
||||
public MainForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
Text = $"{Variables.softwareName} {Variables.softwareVersion}";
|
||||
if (Variables.isBeta) this.Text += " [BETA]";
|
||||
}
|
||||
|
||||
private void openBcsvEditorBtn_Click(object sender, EventArgs e)
|
||||
@@ -49,6 +51,8 @@ namespace BMGEditor
|
||||
"Error while loading file",
|
||||
MessageBoxButtons.OK,
|
||||
MessageBoxIcon.Error);
|
||||
arc.Close();
|
||||
return;
|
||||
}
|
||||
|
||||
openBcsvEditorBtn.Enabled = true;
|
||||
132
BMGEditor/UI/TextEntryEditorForm.Designer.cs
generated
Normal file
132
BMGEditor/UI/TextEntryEditorForm.Designer.cs
generated
Normal file
@@ -0,0 +1,132 @@
|
||||
namespace BMGEditor.UI
|
||||
{
|
||||
partial class TextEntryEditorForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.textBox1 = new System.Windows.Forms.TextBox();
|
||||
this.textBox2 = new System.Windows.Forms.TextBox();
|
||||
this.textBox3 = new System.Windows.Forms.TextBox();
|
||||
this.textBox4 = new System.Windows.Forms.TextBox();
|
||||
this.comboBox1 = new System.Windows.Forms.ComboBox();
|
||||
this.comboBox2 = new System.Windows.Forms.ComboBox();
|
||||
this.comboBox3 = new System.Windows.Forms.ComboBox();
|
||||
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// textBox1
|
||||
//
|
||||
this.textBox1.Location = new System.Drawing.Point(176, 35);
|
||||
this.textBox1.Name = "textBox1";
|
||||
this.textBox1.Size = new System.Drawing.Size(125, 27);
|
||||
this.textBox1.TabIndex = 0;
|
||||
//
|
||||
// textBox2
|
||||
//
|
||||
this.textBox2.Location = new System.Drawing.Point(569, 35);
|
||||
this.textBox2.Name = "textBox2";
|
||||
this.textBox2.Size = new System.Drawing.Size(125, 27);
|
||||
this.textBox2.TabIndex = 1;
|
||||
//
|
||||
// textBox3
|
||||
//
|
||||
this.textBox3.Location = new System.Drawing.Point(438, 35);
|
||||
this.textBox3.Name = "textBox3";
|
||||
this.textBox3.Size = new System.Drawing.Size(125, 27);
|
||||
this.textBox3.TabIndex = 2;
|
||||
//
|
||||
// textBox4
|
||||
//
|
||||
this.textBox4.Location = new System.Drawing.Point(307, 35);
|
||||
this.textBox4.Name = "textBox4";
|
||||
this.textBox4.Size = new System.Drawing.Size(125, 27);
|
||||
this.textBox4.TabIndex = 3;
|
||||
//
|
||||
// comboBox1
|
||||
//
|
||||
this.comboBox1.FormattingEnabled = true;
|
||||
this.comboBox1.Location = new System.Drawing.Point(198, 123);
|
||||
this.comboBox1.Name = "comboBox1";
|
||||
this.comboBox1.Size = new System.Drawing.Size(151, 28);
|
||||
this.comboBox1.TabIndex = 4;
|
||||
//
|
||||
// comboBox2
|
||||
//
|
||||
this.comboBox2.FormattingEnabled = true;
|
||||
this.comboBox2.Location = new System.Drawing.Point(512, 123);
|
||||
this.comboBox2.Name = "comboBox2";
|
||||
this.comboBox2.Size = new System.Drawing.Size(151, 28);
|
||||
this.comboBox2.TabIndex = 5;
|
||||
//
|
||||
// comboBox3
|
||||
//
|
||||
this.comboBox3.FormattingEnabled = true;
|
||||
this.comboBox3.Location = new System.Drawing.Point(355, 123);
|
||||
this.comboBox3.Name = "comboBox3";
|
||||
this.comboBox3.Size = new System.Drawing.Size(151, 28);
|
||||
this.comboBox3.TabIndex = 6;
|
||||
//
|
||||
// richTextBox1
|
||||
//
|
||||
this.richTextBox1.Location = new System.Drawing.Point(235, 234);
|
||||
this.richTextBox1.Name = "richTextBox1";
|
||||
this.richTextBox1.Size = new System.Drawing.Size(125, 120);
|
||||
this.richTextBox1.TabIndex = 7;
|
||||
this.richTextBox1.Text = "";
|
||||
//
|
||||
// TextEntryEditorForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(800, 450);
|
||||
this.Controls.Add(this.richTextBox1);
|
||||
this.Controls.Add(this.comboBox3);
|
||||
this.Controls.Add(this.comboBox2);
|
||||
this.Controls.Add(this.comboBox1);
|
||||
this.Controls.Add(this.textBox4);
|
||||
this.Controls.Add(this.textBox3);
|
||||
this.Controls.Add(this.textBox2);
|
||||
this.Controls.Add(this.textBox1);
|
||||
this.Name = "TextEntryEditorForm";
|
||||
this.Text = "TextEntryEditorForm";
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TextBox textBox1;
|
||||
private System.Windows.Forms.TextBox textBox2;
|
||||
private System.Windows.Forms.TextBox textBox3;
|
||||
private System.Windows.Forms.TextBox textBox4;
|
||||
private System.Windows.Forms.ComboBox comboBox1;
|
||||
private System.Windows.Forms.ComboBox comboBox2;
|
||||
private System.Windows.Forms.ComboBox comboBox3;
|
||||
private System.Windows.Forms.RichTextBox richTextBox1;
|
||||
}
|
||||
}
|
||||
@@ -8,11 +8,11 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace BMGEditor
|
||||
namespace BMGEditor.UI
|
||||
{
|
||||
public partial class BMGEditForm : Form
|
||||
public partial class TextEntryEditorForm : Form
|
||||
{
|
||||
public BMGEditForm(RarcFilesystem arcFs)
|
||||
public TextEntryEditorForm(BMG.TextEntry txtEntry)
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
60
BMGEditor/UI/TextEntryEditorForm.resx
Normal file
60
BMGEditor/UI/TextEntryEditorForm.resx
Normal file
@@ -0,0 +1,60 @@
|
||||
<root>
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
Reference in New Issue
Block a user