Many changes once again

This commit is contained in:
2021-11-28 00:04:16 +01:00
parent f54c500f48
commit e5814a4b0c
17 changed files with 570 additions and 186 deletions

138
BMGEditor/UI/BMGEditForm.Designer.cs generated Normal file
View 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;
}
}

View 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();
}
}
}

View 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>

100
BMGEditor/UI/BcsvEditorForm.Designer.cs generated Normal file
View File

@@ -0,0 +1,100 @@
namespace BMGEditor
{
partial class BcsvEditorForm
{
/// <summary>
/// Variable nécessaire au concepteur.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Nettoyage des ressources utilisées.
/// </summary>
/// <param name="disposing">true si les ressources managées doivent être supprimées ; sinon, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Code généré par le Concepteur Windows Form
/// <summary>
/// Méthode requise pour la prise en charge du concepteur - ne modifiez pas
/// le contenu de cette méthode avec l'éditeur de code.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(BcsvEditorForm));
this.tsToolbar = new System.Windows.Forms.ToolStrip();
this.btnSave = new System.Windows.Forms.ToolStripButton();
this.dgvBcsv = new System.Windows.Forms.DataGridView();
this.tsToolbar.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dgvBcsv)).BeginInit();
this.SuspendLayout();
//
// tsToolbar
//
this.tsToolbar.ImageScalingSize = new System.Drawing.Size(20, 20);
this.tsToolbar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.btnSave});
this.tsToolbar.Location = new System.Drawing.Point(0, 0);
this.tsToolbar.Name = "tsToolbar";
this.tsToolbar.Size = new System.Drawing.Size(1039, 27);
this.tsToolbar.TabIndex = 0;
this.tsToolbar.Text = "toolStrip1";
//
// btnSave
//
this.btnSave.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.btnSave.Enabled = false;
this.btnSave.Image = ((System.Drawing.Image)(resources.GetObject("btnSave.Image")));
this.btnSave.ImageTransparentColor = System.Drawing.Color.Magenta;
this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(44, 24);
this.btnSave.Text = "Save";
this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
//
// 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);
this.dgvBcsv.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.dgvBcsv.MultiSelect = false;
this.dgvBcsv.Name = "dgvBcsv";
this.dgvBcsv.RowHeadersWidth = 51;
this.dgvBcsv.Size = new System.Drawing.Size(1039, 731);
this.dgvBcsv.TabIndex = 1;
//
// BcsvEditorForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1039, 758);
this.Controls.Add(this.dgvBcsv);
this.Controls.Add(this.tsToolbar);
this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.Name = "BcsvEditorForm";
this.Text = "Entries Editor";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.BcsvEditorForm_FormClosing);
this.tsToolbar.ResumeLayout(false);
this.tsToolbar.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.dgvBcsv)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.ToolStrip tsToolbar;
private System.Windows.Forms.DataGridView dgvBcsv;
private System.Windows.Forms.ToolStripButton btnSave;
}
}

View File

@@ -0,0 +1,100 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace BMGEditor
{
public partial class BcsvEditorForm : Form
{
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();
dgvBcsv.Columns.Clear();
foreach (Bcsv.Field field in m_File.Fields.Values)
{
dgvBcsv.Columns.Add(field.NameHash.ToString("X8"), field.Name);
}
foreach (Bcsv.Entry entry in m_File.Entries)
{
object[] row = new object[entry.Count];
int i = 0;
foreach (KeyValuePair<uint, object> _val in entry)
{
object val = _val.Value;
row[i++] = val;
}
dgvBcsv.Rows.Add(row);
}
btnSave.Enabled = true;
}
private Bcsv m_File = null;
private void btnSave_Click(object sender, EventArgs e)
{
m_File.Entries.Clear();
foreach (DataGridViewRow row in dgvBcsv.Rows)
{
if (row.IsNewRow) continue;
Bcsv.Entry entry = new Bcsv.Entry();
m_File.Entries.Add(entry);
foreach (Bcsv.Field field in m_File.Fields.Values)
{
uint hash = field.NameHash;
string valstring = row.Cells[hash.ToString("X8")].FormattedValue.ToString();
try
{
switch (field.Type)
{
case 0:
case 3: entry.Add(hash, uint.Parse(valstring)); break;
case 4: entry.Add(hash, ushort.Parse(valstring)); break;
case 5: entry.Add(hash, byte.Parse(valstring)); break;
case 2: entry.Add(hash, float.Parse(valstring)); break;
case 6: entry.Add(hash, valstring); break;
}
}
catch
{
switch (field.Type)
{
case 0:
case 3: entry.Add(hash, (uint)0); break;
case 4: entry.Add(hash, (ushort)0); break;
case 5: entry.Add(hash, (byte)0); break;
case 2: entry.Add(hash, 0f); break;
case 6: entry.Add(hash, ""); break;
}
}
}
}
m_File.Flush();
}
private void BcsvEditorForm_FormClosing(object sender, FormClosingEventArgs e)
{
m_File.Close();
}
}
}

View File

@@ -0,0 +1,79 @@
<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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="tsToolbar.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="btnSave.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
</value>
</data>
</root>

126
BMGEditor/UI/MainForm.Designer.cs generated Normal file
View File

@@ -0,0 +1,126 @@
using System;
using System.Collections;
using System.Windows.Forms;
namespace BMGEditor
{
partial class MainForm
{
/// <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.openFileBtn = new System.Windows.Forms.Button();
this.closeFileBtn = new System.Windows.Forms.Button();
this.openTextEditorBtn = new System.Windows.Forms.Button();
this.openBcsvEditorBtn = new System.Windows.Forms.Button();
this.openARCFileDialog = new System.Windows.Forms.OpenFileDialog();
this.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// openFileBtn
//
this.openFileBtn.Location = new System.Drawing.Point(12, 12);
this.openFileBtn.Name = "openFileBtn";
this.openFileBtn.Size = new System.Drawing.Size(94, 29);
this.openFileBtn.TabIndex = 0;
this.openFileBtn.Text = "Open file";
this.openFileBtn.UseVisualStyleBackColor = true;
this.openFileBtn.Click += new System.EventHandler(this.openFileBtn_Click);
//
// closeFileBtn
//
this.closeFileBtn.Enabled = false;
this.closeFileBtn.Location = new System.Drawing.Point(220, 12);
this.closeFileBtn.Name = "closeFileBtn";
this.closeFileBtn.Size = new System.Drawing.Size(94, 29);
this.closeFileBtn.TabIndex = 1;
this.closeFileBtn.Text = "Close file";
this.closeFileBtn.UseVisualStyleBackColor = true;
this.closeFileBtn.Click += new System.EventHandler(this.closeFileBtn_Click);
//
// openTextEditorBtn
//
this.openTextEditorBtn.Enabled = false;
this.openTextEditorBtn.Location = new System.Drawing.Point(12, 60);
this.openTextEditorBtn.Name = "openTextEditorBtn";
this.openTextEditorBtn.Size = new System.Drawing.Size(94, 29);
this.openTextEditorBtn.TabIndex = 2;
this.openTextEditorBtn.Text = "Text edit";
this.openTextEditorBtn.UseVisualStyleBackColor = true;
this.openTextEditorBtn.Click += new System.EventHandler(this.openTextEditorBtn_Click);
//
// openBcsvEditorBtn
//
this.openBcsvEditorBtn.Enabled = false;
this.openBcsvEditorBtn.Location = new System.Drawing.Point(220, 60);
this.openBcsvEditorBtn.Name = "openBcsvEditorBtn";
this.openBcsvEditorBtn.Size = new System.Drawing.Size(94, 29);
this.openBcsvEditorBtn.TabIndex = 3;
this.openBcsvEditorBtn.Text = "Entries editor";
this.openBcsvEditorBtn.UseVisualStyleBackColor = true;
this.openBcsvEditorBtn.Click += new System.EventHandler(this.openBcsvEditorBtn_Click);
//
// openARCFileDialog
//
this.openARCFileDialog.FileName = "Message.arc";
this.openARCFileDialog.Filter = "Nintendo archive files|*.arc";
//
// button1
//
this.button1.Location = new System.Drawing.Point(112, 26);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(102, 50);
this.button1.TabIndex = 4;
this.button1.Text = "button1";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(326, 101);
this.Controls.Add(this.button1);
this.Controls.Add(this.openBcsvEditorBtn);
this.Controls.Add(this.openTextEditorBtn);
this.Controls.Add(this.closeFileBtn);
this.Controls.Add(this.openFileBtn);
this.Name = "MainForm";
this.Text = "MainForm";
this.ResumeLayout(false);
}
#endregion
private Button openFileBtn;
private Button closeFileBtn;
private Button openTextEditorBtn;
private Button openBcsvEditorBtn;
private OpenFileDialog openARCFileDialog;
private Button button1;
}
}

87
BMGEditor/UI/MainForm.cs Normal file
View File

@@ -0,0 +1,87 @@
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 MainForm : Form
{
RarcFilesystem arc;
bool arcOpen = false;
public MainForm()
{
InitializeComponent();
Text = $"{Variables.softwareName} {Variables.softwareVersion}";
if (Variables.isBeta) this.Text += " [BETA]";
}
private void openBcsvEditorBtn_Click(object sender, EventArgs e)
{
Form bcsvEdit = new BcsvEditorForm(arc);
bcsvEdit.Show();
}
private void openFileBtn_Click(object sender, EventArgs e)
{
if (arcOpen) {
MessageBox.Show("Please close the current file first.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
string fileName;
if (openARCFileDialog.ShowDialog() == DialogResult.OK)
{
fileName = openARCFileDialog.FileName;
arc = new RarcFilesystem(new ExternalFile(fileName, false));
if (arc.FileExists($"{arc.rootName}/message.bmg") && arc.FileExists($"{arc.rootName}/messageid.tbl"))
{
}
else
{
MessageBox.Show(
"Selected archive doesn\'t contain all the required files. Please check your file.",
"Error while loading file",
MessageBoxButtons.OK,
MessageBoxIcon.Error);
arc.Close();
return;
}
openBcsvEditorBtn.Enabled = true;
openTextEditorBtn.Enabled = true;
closeFileBtn.Enabled = true;
arcOpen = true;
}
else
return;
}
private void closeFileBtn_Click(object sender, EventArgs e)
{
arc.Close();
arcOpen = false;
openBcsvEditorBtn.Enabled = false;
openTextEditorBtn.Enabled = false;
closeFileBtn.Enabled = false;
}
private void openTextEditorBtn_Click(object sender, EventArgs e)
{
Form bmgEdit = new BMGEditForm(arc);
bmgEdit.Show();
}
private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show("BMG Editor by Bussun", "About", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
}

View 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="openARCFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View 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;
}
}

View File

@@ -0,0 +1,20 @@
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.UI
{
public partial class TextEntryEditorForm : Form
{
public TextEntryEditorForm(BMG.TextEntry txtEntry)
{
InitializeComponent();
}
}
}

View 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>