Improve bcres editor. Start to add drawing
This commit is contained in:
parent
7f35cce88f
commit
67d17a5a11
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -8,6 +8,8 @@ using System.Windows.Forms;
|
||||
using Switch_Toolbox.Library;
|
||||
using Switch_Toolbox.Library.Forms;
|
||||
using BcresLibrary;
|
||||
using FirstPlugin.Forms;
|
||||
using GL_EditorFramework.Interfaces;
|
||||
|
||||
namespace FirstPlugin
|
||||
{
|
||||
@ -88,33 +90,58 @@ namespace FirstPlugin
|
||||
}
|
||||
}
|
||||
|
||||
List<AbstractGlDrawable> drawables = new List<AbstractGlDrawable>();
|
||||
|
||||
public void LoadEditors(TreeNode Wrapper, Action OnPropertyChanged)
|
||||
{
|
||||
BcresEditor bcresEditor = (BcresEditor)LibraryGUI.Instance.GetActiveContent(typeof(BcresEditor));
|
||||
bool HasModels = RenderedBcres.Models.Count > 0;
|
||||
if (bcresEditor == null)
|
||||
{
|
||||
bcresEditor = new BcresEditor(HasModels);
|
||||
bcresEditor.Dock = DockStyle.Fill;
|
||||
LibraryGUI.Instance.LoadEditor(bcresEditor);
|
||||
}
|
||||
|
||||
if (drawables.Count <= 0)
|
||||
{
|
||||
//Add drawables
|
||||
drawables.Add(RenderedBcres);
|
||||
|
||||
for (int m = 0; m < RenderedBcres.Models.Count; m++)
|
||||
drawables.Add(RenderedBcres.Models[m].Skeleton.Renderable);
|
||||
}
|
||||
|
||||
if (Runtime.UseOpenGL)
|
||||
bcresEditor.LoadViewport(drawables);
|
||||
|
||||
|
||||
|
||||
if (Wrapper is MTOBWrapper) {
|
||||
LoadPropertyGrid(((MTOBWrapper)Wrapper).Material, OnPropertyChanged);
|
||||
LoadPropertyGrid(((MTOBWrapper)Wrapper).Material, bcresEditor, OnPropertyChanged);
|
||||
}
|
||||
|
||||
if (Wrapper is CMDLWrapper) {
|
||||
LoadPropertyGrid(((CMDLWrapper)Wrapper).Model, OnPropertyChanged);
|
||||
LoadPropertyGrid(((CMDLWrapper)Wrapper).Model, bcresEditor, OnPropertyChanged);
|
||||
}
|
||||
|
||||
if (Wrapper is CRESBoneWrapper) {
|
||||
LoadPropertyGrid(((CRESBoneWrapper)Wrapper).Bone, OnPropertyChanged);
|
||||
LoadPropertyGrid(((CRESBoneWrapper)Wrapper).Bone, bcresEditor, OnPropertyChanged);
|
||||
}
|
||||
|
||||
if (Wrapper is CRESSkeletonWrapper) {
|
||||
LoadPropertyGrid(((CRESSkeletonWrapper)Wrapper).Skeleton, OnPropertyChanged);
|
||||
LoadPropertyGrid(((CRESSkeletonWrapper)Wrapper).Skeleton, bcresEditor, OnPropertyChanged);
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadPropertyGrid(object property, Action OnPropertyChanged)
|
||||
private void LoadPropertyGrid(object property, BcresEditor bcresEditor, Action OnPropertyChanged)
|
||||
{
|
||||
STPropertyGrid editor = (STPropertyGrid)LibraryGUI.Instance.GetActiveContent(typeof(STPropertyGrid));
|
||||
STPropertyGrid editor = (STPropertyGrid)bcresEditor.GetActiveEditor(typeof(STPropertyGrid));
|
||||
if (editor == null)
|
||||
{
|
||||
editor = new STPropertyGrid();
|
||||
editor.Dock = DockStyle.Fill;
|
||||
LibraryGUI.Instance.LoadEditor(editor);
|
||||
bcresEditor.LoadEditor(editor);
|
||||
}
|
||||
editor.LoadProperty(property, OnPropertyChanged);
|
||||
}
|
||||
|
@ -15,6 +15,8 @@ namespace FirstPlugin
|
||||
internal BCRES BcresParent;
|
||||
internal Model Model;
|
||||
|
||||
public CRESSkeletonWrapper Skeleton;
|
||||
|
||||
public List<SOBJWrapper> Shapes = new List<SOBJWrapper>();
|
||||
|
||||
public CMDLWrapper()
|
||||
@ -47,11 +49,11 @@ namespace FirstPlugin
|
||||
|
||||
var MaterialFolder = new TreeNode("Materials");
|
||||
var MeshFolder = new TreeNode("Meshes");
|
||||
var SkeletonWrapper = new CRESSkeletonWrapper();
|
||||
Skeleton = new CRESSkeletonWrapper();
|
||||
|
||||
Nodes.Add(MeshFolder);
|
||||
Nodes.Add(MaterialFolder);
|
||||
Nodes.Add(SkeletonWrapper);
|
||||
Nodes.Add(Skeleton);
|
||||
|
||||
foreach (var material in model.Materials.Values)
|
||||
{
|
||||
@ -61,14 +63,13 @@ namespace FirstPlugin
|
||||
}
|
||||
foreach (var mesh in model.Meshes)
|
||||
{
|
||||
var meshWrapper = new SOBJWrapper() { BcresParent = bcres };
|
||||
meshWrapper.Load(mesh);
|
||||
var meshWrapper = new SOBJWrapper(model, mesh) { BcresParent = bcres };
|
||||
MeshFolder.Nodes.Add(meshWrapper);
|
||||
Shapes.Add(meshWrapper);
|
||||
}
|
||||
if (model.HasSkeleton)
|
||||
{
|
||||
SkeletonWrapper.Load(model.Skeleton, bcres);
|
||||
Skeleton.Load(model.Skeleton, bcres);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -42,6 +42,23 @@ namespace FirstPlugin
|
||||
|
||||
Bone = bone;
|
||||
Text = bone.Name;
|
||||
|
||||
parentIndex = bone.ParentIndex;
|
||||
RotationType = BoneRotationType.Euler;
|
||||
position = new float[3];
|
||||
scale = new float[3];
|
||||
rotation = new float[4];
|
||||
scale[0] = bone.Scale.X;
|
||||
scale[1] = bone.Scale.Y;
|
||||
scale[2] = bone.Scale.Z;
|
||||
rotation[0] = bone.Rotation.X;
|
||||
rotation[1] = bone.Rotation.Y;
|
||||
rotation[2] = bone.Rotation.Z;
|
||||
rotation[3] = 1;
|
||||
position[0] = bone.Position.X;
|
||||
position[1] = bone.Position.Y;
|
||||
position[2] = bone.Position.Z;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -94,6 +94,26 @@ namespace FirstPlugin
|
||||
Mesh = mesh;
|
||||
|
||||
Text = mesh.Name;
|
||||
|
||||
lodMeshes = new List<LOD_Mesh>();
|
||||
foreach (var group in Shape.FaceGroups)
|
||||
{
|
||||
foreach (var faceDescriptors in group.FaceDescriptors)
|
||||
{
|
||||
foreach (var buffer in faceDescriptors.Buffers)
|
||||
{
|
||||
LOD_Mesh msh = new LOD_Mesh();
|
||||
msh.PrimitiveType = STPolygonType.Triangle;
|
||||
msh.FirstVertex = 0;
|
||||
|
||||
uint[] indicesArray = buffer.GetIndices().ToArray();
|
||||
for (int face = 0; face < indicesArray.Length; face++)
|
||||
msh.faces.Add((int)indicesArray[face] + (int)msh.FirstVertex);
|
||||
|
||||
lodMeshes.Add(msh);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
135
Switch_FileFormatsMain/GUI/BCRES/BfresEditor.Designer.cs
generated
Normal file
135
Switch_FileFormatsMain/GUI/BCRES/BfresEditor.Designer.cs
generated
Normal file
@ -0,0 +1,135 @@
|
||||
namespace FirstPlugin.Forms
|
||||
{
|
||||
partial class BcresEditor
|
||||
{
|
||||
/// <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 Component 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.stPanel2 = new Switch_Toolbox.Library.Forms.STPanel();
|
||||
this.stToolStrip1 = new Switch_Toolbox.Library.Forms.STToolStrip();
|
||||
this.toggleViewportToolStripBtn = new System.Windows.Forms.ToolStripButton();
|
||||
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||
this.stPanel3 = new Switch_Toolbox.Library.Forms.STPanel();
|
||||
this.splitter1 = new System.Windows.Forms.Splitter();
|
||||
this.stPanel2.SuspendLayout();
|
||||
this.stToolStrip1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
|
||||
this.splitContainer1.Panel1.SuspendLayout();
|
||||
this.splitContainer1.SuspendLayout();
|
||||
this.stPanel3.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// stPanel2
|
||||
//
|
||||
this.stPanel2.Controls.Add(this.stToolStrip1);
|
||||
this.stPanel2.Controls.Add(this.splitContainer1);
|
||||
this.stPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.stPanel2.Location = new System.Drawing.Point(0, 0);
|
||||
this.stPanel2.Name = "stPanel2";
|
||||
this.stPanel2.Size = new System.Drawing.Size(712, 543);
|
||||
this.stPanel2.TabIndex = 4;
|
||||
//
|
||||
// stToolStrip1
|
||||
//
|
||||
this.stToolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.toggleViewportToolStripBtn});
|
||||
this.stToolStrip1.Location = new System.Drawing.Point(0, 0);
|
||||
this.stToolStrip1.Name = "stToolStrip1";
|
||||
this.stToolStrip1.Size = new System.Drawing.Size(712, 25);
|
||||
this.stToolStrip1.TabIndex = 2;
|
||||
this.stToolStrip1.Text = "stToolStrip1";
|
||||
//
|
||||
// toggleViewportToolStripBtn
|
||||
//
|
||||
this.toggleViewportToolStripBtn.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
|
||||
this.toggleViewportToolStripBtn.Image = global::FirstPlugin.Properties.Resources.ViewportIcon;
|
||||
this.toggleViewportToolStripBtn.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.toggleViewportToolStripBtn.Name = "toggleViewportToolStripBtn";
|
||||
this.toggleViewportToolStripBtn.Size = new System.Drawing.Size(23, 22);
|
||||
this.toggleViewportToolStripBtn.Text = "toolStripButton1";
|
||||
this.toggleViewportToolStripBtn.Click += new System.EventHandler(this.toggleViewportToolStripBtn_Click);
|
||||
//
|
||||
// splitContainer1
|
||||
//
|
||||
this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.splitContainer1.Location = new System.Drawing.Point(0, 28);
|
||||
this.splitContainer1.Name = "splitContainer1";
|
||||
//
|
||||
// splitContainer1.Panel1
|
||||
//
|
||||
this.splitContainer1.Panel1.Controls.Add(this.stPanel3);
|
||||
this.splitContainer1.Size = new System.Drawing.Size(712, 515);
|
||||
this.splitContainer1.SplitterDistance = 440;
|
||||
this.splitContainer1.TabIndex = 1;
|
||||
//
|
||||
// stPanel3
|
||||
//
|
||||
this.stPanel3.Controls.Add(this.splitter1);
|
||||
this.stPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.stPanel3.Location = new System.Drawing.Point(0, 0);
|
||||
this.stPanel3.Name = "stPanel3";
|
||||
this.stPanel3.Size = new System.Drawing.Size(440, 515);
|
||||
this.stPanel3.TabIndex = 4;
|
||||
//
|
||||
// splitter1
|
||||
//
|
||||
this.splitter1.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.splitter1.Location = new System.Drawing.Point(0, 512);
|
||||
this.splitter1.Name = "splitter1";
|
||||
this.splitter1.Size = new System.Drawing.Size(440, 3);
|
||||
this.splitter1.TabIndex = 4;
|
||||
this.splitter1.TabStop = false;
|
||||
//
|
||||
// BcresEditor
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.stPanel2);
|
||||
this.Name = "BcresEditor";
|
||||
this.Size = new System.Drawing.Size(712, 543);
|
||||
this.stPanel2.ResumeLayout(false);
|
||||
this.stPanel2.PerformLayout();
|
||||
this.stToolStrip1.ResumeLayout(false);
|
||||
this.stToolStrip1.PerformLayout();
|
||||
this.splitContainer1.Panel1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
|
||||
this.splitContainer1.ResumeLayout(false);
|
||||
this.stPanel3.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
private System.Windows.Forms.SplitContainer splitContainer1;
|
||||
private Switch_Toolbox.Library.Forms.STPanel stPanel2;
|
||||
private Switch_Toolbox.Library.Forms.STPanel stPanel3;
|
||||
private System.Windows.Forms.Splitter splitter1;
|
||||
private Switch_Toolbox.Library.Forms.STToolStrip stToolStrip1;
|
||||
private System.Windows.Forms.ToolStripButton toggleViewportToolStripBtn;
|
||||
}
|
||||
}
|
252
Switch_FileFormatsMain/GUI/BCRES/BfresEditor.cs
Normal file
252
Switch_FileFormatsMain/GUI/BCRES/BfresEditor.cs
Normal file
@ -0,0 +1,252 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Switch_Toolbox.Library.Forms;
|
||||
using Switch_Toolbox.Library;
|
||||
using GL_EditorFramework.Interfaces;
|
||||
using GL_EditorFramework.EditorDrawables;
|
||||
|
||||
namespace FirstPlugin.Forms
|
||||
{
|
||||
public partial class BcresEditor : STUserControl, IViewportContainer
|
||||
{
|
||||
private bool _displayViewport = true;
|
||||
|
||||
public bool DisplayViewport
|
||||
{
|
||||
get
|
||||
{
|
||||
return _displayViewport;
|
||||
}
|
||||
set
|
||||
{
|
||||
_displayViewport = value;
|
||||
SetupViewport();
|
||||
}
|
||||
}
|
||||
|
||||
private void SetupViewport()
|
||||
{
|
||||
if (DisplayViewport == true && Runtime.UseOpenGL)
|
||||
{
|
||||
stPanel3.Controls.Add(viewport);
|
||||
splitContainer1.Panel1Collapsed = false;
|
||||
toggleViewportToolStripBtn.Image = Properties.Resources.ViewportIcon;
|
||||
|
||||
if (viewport != null)
|
||||
OnLoadedTab();
|
||||
else
|
||||
{
|
||||
viewport = new Viewport();
|
||||
viewport.Dock = DockStyle.Fill;
|
||||
OnLoadedTab();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
stPanel3.Controls.Clear();
|
||||
splitContainer1.Panel1Collapsed = true;
|
||||
toggleViewportToolStripBtn.Image = Properties.Resources.ViewportIconDisable;
|
||||
}
|
||||
}
|
||||
|
||||
Viewport viewport
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!Runtime.UseOpenGL || !DisplayViewport)
|
||||
return null;
|
||||
|
||||
var editor = LibraryGUI.Instance.GetObjectEditor();
|
||||
return editor.GetViewport();
|
||||
}
|
||||
set
|
||||
{
|
||||
var editor = LibraryGUI.Instance.GetObjectEditor();
|
||||
editor.LoadViewport(value);
|
||||
}
|
||||
}
|
||||
|
||||
public BcresEditor(bool HasModels)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
//Always create an instance of the viewport unless opengl is disabled
|
||||
if (viewport == null && Runtime.UseOpenGL)
|
||||
{
|
||||
viewport = new Viewport();
|
||||
viewport.Dock = DockStyle.Fill;
|
||||
}
|
||||
|
||||
//If the option is enabled by settings, and it has models display the viewport
|
||||
if (Runtime.UseOpenGL && Runtime.DisplayViewport && HasModels)
|
||||
{
|
||||
stPanel3.Controls.Add(viewport);
|
||||
DisplayViewport = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
DisplayViewport = false;
|
||||
splitContainer1.Panel1Collapsed = true;
|
||||
}
|
||||
}
|
||||
|
||||
public UserControl GetActiveEditor(Type type)
|
||||
{
|
||||
foreach (var ctrl in splitContainer1.Panel2.Controls)
|
||||
{
|
||||
if (type == null)
|
||||
{
|
||||
return (UserControl)ctrl;
|
||||
}
|
||||
|
||||
if (ctrl.GetType() == type)
|
||||
{
|
||||
return (UserControl)ctrl;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void LoadEditor(UserControl Control)
|
||||
{
|
||||
Control.Dock = DockStyle.Fill;
|
||||
|
||||
splitContainer1.Panel2.Controls.Clear();
|
||||
splitContainer1.Panel2.Controls.Add(Control);
|
||||
}
|
||||
|
||||
public AnimationPanel GetAnimationPanel() => null;
|
||||
|
||||
public Viewport GetViewport() => viewport;
|
||||
|
||||
public void UpdateViewport()
|
||||
{
|
||||
if (viewport != null && Runtime.UseOpenGL && Runtime.DisplayViewport)
|
||||
viewport.UpdateViewport();
|
||||
}
|
||||
|
||||
|
||||
public bool IsLoaded = false;
|
||||
|
||||
//All drawables for this particular editor
|
||||
List<AbstractGlDrawable> Drawables;
|
||||
|
||||
//Drawables removed but the viewport is toggled off to update
|
||||
List<AbstractGlDrawable> RemovedDrawables = new List<AbstractGlDrawable>();
|
||||
|
||||
public void LoadViewport(List<AbstractGlDrawable> drawables, List<ToolStripMenuItem> customContextMenus = null)
|
||||
{
|
||||
Drawables = drawables;
|
||||
|
||||
if (!Runtime.UseOpenGL || !DisplayViewport)
|
||||
return;
|
||||
|
||||
if (customContextMenus != null)
|
||||
{
|
||||
foreach (var menu in customContextMenus)
|
||||
viewport.LoadCustomMenuItem(menu);
|
||||
}
|
||||
|
||||
OnLoadedTab();
|
||||
}
|
||||
|
||||
public void AddDrawable(AbstractGlDrawable draw)
|
||||
{
|
||||
Drawables.Add(draw);
|
||||
|
||||
if (!Runtime.UseOpenGL || !Runtime.DisplayViewport || viewport == null)
|
||||
{
|
||||
IsLoaded = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!viewport.scene.staticObjects.Contains(draw) &&
|
||||
!viewport.scene.objects.Contains(draw))
|
||||
{
|
||||
viewport.AddDrawable(draw);
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveDrawable(AbstractGlDrawable draw)
|
||||
{
|
||||
Drawables.Remove(draw);
|
||||
|
||||
if (!Runtime.UseOpenGL || !Runtime.DisplayViewport || viewport == null)
|
||||
{
|
||||
IsLoaded = false;
|
||||
RemovedDrawables.Add(draw);
|
||||
return;
|
||||
}
|
||||
|
||||
viewport.RemoveDrawable(draw);
|
||||
}
|
||||
|
||||
public override void OnControlClosing()
|
||||
{
|
||||
}
|
||||
|
||||
private void OnLoadedTab()
|
||||
{
|
||||
//If a model was loaded we don't need to load the drawables again
|
||||
if (IsLoaded || Drawables == null || !Runtime.UseOpenGL || !Runtime.DisplayViewport)
|
||||
return;
|
||||
|
||||
Console.WriteLine("drawables count " + Drawables.Count);
|
||||
|
||||
foreach (var draw in Drawables)
|
||||
{
|
||||
if (!viewport.scene.staticObjects.Contains(draw) &&
|
||||
!viewport.scene.objects.Contains(draw))
|
||||
{
|
||||
viewport.AddDrawable(draw);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var draw in RemovedDrawables)
|
||||
viewport.RemoveDrawable(draw);
|
||||
|
||||
viewport.LoadObjects();
|
||||
|
||||
IsLoaded = true;
|
||||
}
|
||||
|
||||
private void stTabControl1_TabIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void stTabControl1_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
bool IsTimelineVisable = true;
|
||||
int controlHeight = 0;
|
||||
private void stPanel1_DoubleClick(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void toggleViewportToolStripBtn_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Runtime.DisplayViewport)
|
||||
{
|
||||
Runtime.DisplayViewport = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
Runtime.DisplayViewport = true;
|
||||
}
|
||||
|
||||
DisplayViewport = Runtime.DisplayViewport;
|
||||
Config.Save();
|
||||
}
|
||||
}
|
||||
}
|
123
Switch_FileFormatsMain/GUI/BCRES/BfresEditor.resx
Normal file
123
Switch_FileFormatsMain/GUI/BCRES/BfresEditor.resx
Normal file
@ -0,0 +1,123 @@
|
||||
<?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>
|
||||
<metadata name="stToolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
@ -261,6 +261,12 @@
|
||||
<DependentUpon>AampEditor.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="GUI\AAMP\YamlConverter.cs" />
|
||||
<Compile Include="GUI\BCRES\BfresEditor.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="GUI\BCRES\BfresEditor.Designer.cs">
|
||||
<DependentUpon>BfresEditor.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="GUI\BFRES\BoneVisualAnims\BoneVisualAnimEditor.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
@ -876,6 +882,9 @@
|
||||
<EmbeddedResource Include="GUI\AttributeEditor.resx">
|
||||
<DependentUpon>AttributeEditor.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="GUI\BCRES\BfresEditor.resx">
|
||||
<DependentUpon>BfresEditor.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="GUI\BFRES\BfresEditor.resx">
|
||||
<DependentUpon>BfresEditor.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
|
Binary file not shown.
@ -1 +1 @@
|
||||
6a0ed70e297938eacb07b25b8680e0a366c6a29f
|
||||
5ea073b5bafa34e04386f041af991d4d1ae4fc05
|
||||
|
@ -327,3 +327,4 @@ C:\Users\Nathan\Documents\GitHub\SwitchToolboxV1\Switch_FileFormatsMain\obj\Rele
|
||||
C:\Users\Nathan\Documents\GitHub\SwitchToolboxV1\Switch_FileFormatsMain\obj\Release\FirstPlugin.Forms.AampEditorBase.resources
|
||||
C:\Users\Nathan\Documents\GitHub\SwitchToolboxV1\Switch_FileFormatsMain\obj\Release\FirstPlugin.Forms.MaterialReplaceDialog.resources
|
||||
C:\Users\Nathan\Documents\GitHub\SwitchToolboxV1\Switch_FileFormatsMain\obj\Release\FirstPlugin.CTR_3DSTextureImporter.resources
|
||||
C:\Users\Nathan\Documents\GitHub\SwitchToolboxV1\Switch_FileFormatsMain\obj\Release\FirstPlugin.Forms.BcresEditor.resources
|
||||
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user