Add latest bflyt progress and add some animation fixes

This commit is contained in:
KillzXGaming 2019-08-29 15:45:32 -04:00
parent a3f76e99d0
commit 47fc8b39cb
67 changed files with 13060 additions and 320 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load diff

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load diff

View file

@ -226,24 +226,6 @@ namespace FirstPlugin
GC.SuppressFinalize(this);
}
IEnumerable<TreeNode> Collect(TreeNodeCollection nodes)
{
foreach (TreeNode node in nodes)
{
yield return node;
bool IsNodeFile = node is IFileFormat;
if (!IsNodeFile)
{
//We don't need to save the child of IFIleFormats
//If opened the file should save it's own children
foreach (var child in Collect(node.Nodes))
yield return child;
}
}
}
static uint NameHash(string name)
{
uint result = 0;

View file

@ -399,6 +399,7 @@ namespace Bfres.Structs
Textures.Add(name);
}
Materials.Clear();
foreach (var matanim in anim.MaterialAnimDataList)
{
var mat = new MaterialAnimEntry(matanim.Name);

View file

@ -154,6 +154,8 @@ namespace Bfres.Structs
FrameCount = anim.FrameCount;
ShaderParamAnim = anim;
Materials.Clear();
foreach (ShaderParamMatAnim matAnim in anim.ShaderParamMatAnims)
{
MaterialAnimEntry matNode = new MaterialAnimEntry(matAnim.Name);

View file

@ -133,17 +133,10 @@ namespace Bfres.Structs
{
STSkeleton skeleton = GetActiveSkeleton();
for (int i = 0; i <= FrameCount; i++)
{
}
if (SkeletalAnimU != null)
BrawlboxHelper.FSKAConverter.Fska2Chr0(BfresPlatformConverter.FSKAConvertWiiUToSwitch(SkeletalAnimU), FileName);
else
BrawlboxHelper.FSKAConverter.Fska2Chr0(SkeletalAnim, FileName);
// BrawlboxHelper.FSKAConverter.Fska2Chr0(this, skeleton, FileName);
}
else if (ext == ".smd")
{

View file

@ -13,7 +13,7 @@ using SharpYaml.Serialization;
namespace FirstPlugin
{
public class BFLYT : IFileFormat, IEditor<LayoutEditor>, IConvertableTextFormat
public class BFLYT : IFileFormat, IEditorForm<LayoutEditor>, IConvertableTextFormat
{
public FileType FileType { get; set; } = FileType.Layout;
@ -75,7 +75,7 @@ namespace FirstPlugin
return editor;
}
public void FillEditor(UserControl control) {
public void FillEditor(Form control) {
((LayoutEditor)control).LoadBflyt(header, FileName);
}
@ -85,7 +85,101 @@ namespace FirstPlugin
CanSave = false;
header = new Header();
header.Read(new FileReader(stream), FileName);
header.Read(new FileReader(stream), this);
}
public List<GTXFile> GetShadersGTX()
{
List<GTXFile> shaders = new List<GTXFile>();
if (IFileInfo.ArchiveParent != null)
{
foreach (var file in IFileInfo.ArchiveParent.Files)
{
if (Utils.GetExtension(file.FileName) == ".gsh")
{
GTXFile bnsh = (GTXFile)file.OpenFile();
shaders.Add(bnsh);
}
}
}
return shaders;
}
public List<BNSH> GetShadersNX()
{
List<BNSH> shaders = new List<BNSH>();
if (IFileInfo.ArchiveParent != null)
{
foreach (var file in IFileInfo.ArchiveParent.Files)
{
if (Utils.GetExtension(file.FileName) == ".bnsh")
{
BNSH bnsh = (BNSH)file.OpenFile();
shaders.Add(bnsh);
}
}
}
return shaders;
}
public List<BFLYT> GetLayouts()
{
List<BFLYT> animations = new List<BFLYT>();
if (IFileInfo.ArchiveParent != null)
{
foreach (var file in IFileInfo.ArchiveParent.Files)
{
if (Utils.GetExtension(file.FileName) == ".bflyt")
{
BFLYT bflyt = (BFLYT)file.OpenFile();
animations.Add(bflyt);
}
}
}
return animations;
}
public List<BFLAN> GetAnimations()
{
List<BFLAN> animations = new List<BFLAN>();
if (IFileInfo.ArchiveParent != null)
{
foreach (var file in IFileInfo.ArchiveParent.Files)
{
if (Utils.GetExtension(file.FileName) == ".bflan")
{
BFLAN bflan = (BFLAN)file.OpenFile();
animations.Add(bflan);
}
}
}
return animations;
}
public Dictionary<string, STGenericTexture> GetTextures()
{
Console.WriteLine($"ArchiveParent {IFileInfo.ArchiveParent != null}");
Dictionary<string, STGenericTexture> textures = new Dictionary<string, STGenericTexture>();
if (IFileInfo.ArchiveParent != null)
{
foreach (var file in IFileInfo.ArchiveParent.Files)
{
if (Utils.GetExtension(file.FileName) == ".bntx")
{
BNTX bntx = (BNTX)file.OpenFile();
foreach (var tex in bntx.Textures)
textures.Add(tex.Key, tex.Value);
}
else if (Utils.GetExtension(file.FileName) == ".bflim")
{
BFLIM bflim = (BFLIM)file.OpenFile();
textures.Add(bflim.FileName, bflim);
}
}
}
return textures;
}
public void Unload()
@ -101,7 +195,12 @@ namespace FirstPlugin
//https://github.com/FuryBaguette/SwitchLayoutEditor/tree/master/SwitchThemesCommon
public class Header
{
public string FileName { get; set; }
internal BFLYT FileInfo;
public string FileName
{
get { return FileInfo.FileName; }
}
private const string Magic = "FLYT";
@ -122,7 +221,25 @@ namespace FirstPlugin
}
}
public uint VersionMajor
{
get { return Version >> 24; }
}
public uint VersionMinor
{
get { return Version >> 16 & 0xFF; }
}
public uint VersionMicro
{
get { return Version >> 8 & 0xFF; }
}
public uint VersionMicro2
{
get { return Version & 0xFF; }
}
public LYT1 LayoutInfo { get; set; }
public TXL1 TextureList { get; set; }
@ -136,9 +253,16 @@ namespace FirstPlugin
// public List<PAN1> Panes = new List<PAN1>();
public void Read(FileReader reader, string fileName)
public void Read(FileReader reader, BFLYT bflyt)
{
FileName = fileName;
LayoutInfo = new LYT1();
TextureList = new TXL1();
MaterialList = new MAT1();
FontList = new FNL1();
RootPane = new PAN1();
RootGroup = new GRP1();
FileInfo = bflyt;
reader.SetByteOrder(true);
reader.ReadSignature(4, Magic);
@ -164,10 +288,7 @@ namespace FirstPlugin
string Signature = reader.ReadString(4, Encoding.ASCII);
uint SectionSize = reader.ReadUInt32();
Console.WriteLine($"{Signature} {SectionSize}");
SectionCommon section = new SectionCommon();
switch (Signature)
{
case "lyt1":
@ -194,7 +315,7 @@ namespace FirstPlugin
currentPane = panel;
break;
case "pic1":
var picturePanel = new PIC1(reader);
var picturePanel = new PIC1(reader, this);
SetPane(picturePanel, parentPane);
currentPane = picturePanel;
@ -218,8 +339,7 @@ namespace FirstPlugin
currentPane = partsPanel;
break;
case "wnd1":
var windowPanel = new PRT1(reader);
var windowPanel = new WND1(reader);
SetPane(windowPanel, parentPane);
currentPane = windowPanel;
break;
@ -273,6 +393,8 @@ namespace FirstPlugin
public void Write(FileWriter writer)
{
Version = VersionMajor << 24 | VersionMinor << 16 | VersionMicro << 8 | VersionMicro2;
writer.WriteSignature(Magic);
writer.Write(ByteOrderMark);
writer.Write(HeaderSize);
@ -291,9 +413,24 @@ namespace FirstPlugin
public class BasePane : SectionCommon
{
public bool DisplayInEditor { get; set; } = true;
public string Name { get; set; }
public Vector3F Translate { get; set; }
public Vector3F Rotate { get; set; }
public Vector2F Scale { get; set; }
public float Width { get; set; }
public float Height { get; set; }
public BasePane Parent { get; set; }
public List<BasePane> Childern { get; set; } = new List<BasePane>();
public bool HasChildern
{
get { return Childern.Count > 0; }
}
}
public class TexCoord
@ -339,10 +476,10 @@ namespace FirstPlugin
}
}
public ushort TextLength;
public ushort MaxTextLength;
public ushort MaterialIndex;
public ushort FontIndex;
public ushort TextLength { get; set; }
public ushort MaxTextLength { get; set; }
public ushort MaterialIndex { get; set; }
public ushort FontIndex { get; set; }
public byte TextAlignment { get; set; }
public LineAlign LineAlignment { get; set; }
@ -483,10 +620,24 @@ namespace FirstPlugin
}
}
public class CustomRectangle
{
public int LeftPoint;
public int RightPoint;
public int TopPoint;
public int BottomPoint;
public CustomRectangle(int left, int right, int top, int bottom)
{
LeftPoint = left;
RightPoint = right;
TopPoint = top;
BottomPoint = bottom;
}
}
public class GRP1 : BasePane
{
public string Name { get; set; }
public List<string> Panes { get; set; } = new List<string>();
public GRP1() : base()
@ -497,7 +648,7 @@ namespace FirstPlugin
public GRP1(FileReader reader, Header header)
{
ushort numNodes = 0;
if (header.Version >= 0x05020000)
if (header.VersionMajor >= 5)
{
Name = reader.ReadString(34).Replace("\0", string.Empty);
numNodes = reader.ReadUInt16();
@ -561,6 +712,13 @@ namespace FirstPlugin
public ushort MaterialIndex { get; set; }
public Material GetMaterial()
{
return ParentLayout.MaterialList.Materials[MaterialIndex];
}
private BFLYT.Header ParentLayout;
public PIC1() : base() {
ColorTopLeft = STColor8.White;
ColorTopRight = STColor8.White;
@ -571,8 +729,10 @@ namespace FirstPlugin
TexCoords[0] = new TexCoord();
}
public PIC1(FileReader reader) : base(reader)
public PIC1(FileReader reader, BFLYT.Header header) : base(reader)
{
ParentLayout = header;
ColorTopLeft = STColor8.FromBytes(reader.ReadBytes(4));
ColorTopRight = STColor8.FromBytes(reader.ReadBytes(4));
ColorBottomLeft = STColor8.FromBytes(reader.ReadBytes(4));
@ -580,6 +740,18 @@ namespace FirstPlugin
MaterialIndex = reader.ReadUInt16();
byte numUVs = reader.ReadByte();
reader.Seek(1); //padding
TexCoords = new TexCoord[numUVs];
for (int i = 0; i < numUVs; i++)
{
TexCoords[i] = new TexCoord()
{
TopLeft = reader.ReadVec2SY(),
TopRight = reader.ReadVec2SY(),
BottomLeft = reader.ReadVec2SY(),
BottomRight = reader.ReadVec2SY(),
};
}
}
public override void Write(FileWriter writer, Header header)
@ -665,15 +837,8 @@ namespace FirstPlugin
public byte Alpha { get; set; }
public byte Unknown { get; set; }
public string Name { get; set; }
public string UserDataInfo { get; set; }
public Vector3F Translate;
public Vector3F Rotate;
public Vector2F Scale;
public float Width;
public float Height;
public PAN1() : base()
{
@ -686,7 +851,7 @@ namespace FirstPlugin
Alpha = reader.ReadByte();
Unknown = reader.ReadByte();
Name = reader.ReadString(0x18).Replace("\0", string.Empty);
UserDataInfo = reader.ReadString(0x18).Replace("\0", string.Empty);
UserDataInfo = reader.ReadString(0x8).Replace("\0", string.Empty);
Translate = reader.ReadVec3SY();
Rotate = reader.ReadVec3SY();
Scale = reader.ReadVec2SY();
@ -701,7 +866,7 @@ namespace FirstPlugin
writer.Write(Alpha);
writer.Write(Unknown);
writer.WriteString(Name, 0x18);
writer.WriteString(UserDataInfo, 0x18);
writer.WriteString(UserDataInfo, 0x8);
writer.Write(Translate);
writer.Write(Rotate);
writer.Write(Scale);
@ -722,6 +887,82 @@ namespace FirstPlugin
Top = 1,
Bottom = 2
};
public BFLYT.CustomRectangle CreateRectangle()
{
int left = 0;
int right = 0;
int top = 0;
int bottom = 0;
//Do origin transforms
var transformed = TransformOrientation((int)Width, (int)Height);
//Now do parent transforms
Vector2 ParentWH = new Vector2(0,0);
if (Parent != null && Parent is BasePane)
ParentWH = new Vector2((int)Parent.Width, (int)Parent.Height);
var transformedParent = TransformOrientation(ParentWH.X, ParentWH.Y);
// if (Parent != null)
// transformed -= transformedParent;
return new CustomRectangle(
transformed.X,
transformed.Y,
transformed.Z,
transformed.W);
}
private Vector4 TransformOrientation(int Width, int Height)
{
int left = 0;
int right = 0;
int top = 0;
int bottom = 0;
if (originX == OriginX.Left)
right = Width;
else if (originX == OriginX.Right)
left = -Width;
else //To center
{
left = -Width / 2;
right = Width / 2;
}
if (originY == OriginY.Top)
bottom = Height;
else if (originY == OriginY.Bottom)
top = -Height;
else //To center
{
top = -Height / 2;
bottom = Height / 2;
}
return new Vector4(left, right, top, bottom);
}
public bool ParentVisibility
{
get
{
if (Scale.X == 0 || Scale.Y == 0)
return false;
if (!Visible)
return false;
if (Parent != null && Parent is PAN1)
{
return ((PAN1)Parent).ParentVisibility && Visible;
}
return true;
}
}
}
public class MAT1 : SectionCommon
@ -766,7 +1007,7 @@ namespace FirstPlugin
public List<TextureRef> TextureMaps { get; set; }
public List<TextureTransform> TextureTransforms { get; set; }
private int flags;
private uint flags;
private int unknown;
public Material()
@ -781,9 +1022,9 @@ namespace FirstPlugin
TextureTransforms = new List<TextureTransform>();
Name = reader.ReadString(0x1C).Replace("\0", string.Empty);
if (header.Version == 0x8030000)
if (header.VersionMajor == 8)
{
flags = reader.ReadInt32();
flags = reader.ReadUInt32();
unknown = reader.ReadInt32();
ForeColor = STColor8.FromBytes(reader.ReadBytes(4));
BackColor = STColor8.FromBytes(reader.ReadBytes(4));
@ -792,11 +1033,11 @@ namespace FirstPlugin
{
ForeColor = STColor8.FromBytes(reader.ReadBytes(4));
BackColor = STColor8.FromBytes(reader.ReadBytes(4));
flags = reader.ReadInt32();
flags = reader.ReadUInt32();
}
int texCount = flags & 3;
int mtxCount = (flags & 0xC) >> 2;
uint texCount = Convert.ToUInt32(flags & 3);
uint mtxCount = Convert.ToUInt32(flags >> 2) & 3;
for (int i = 0; i < texCount; i++)
TextureMaps.Add(new TextureRef(reader));
@ -855,22 +1096,55 @@ namespace FirstPlugin
public class TextureRef
{
public ushort ID;
public byte WrapS;
public byte WrapT;
byte flag1;
byte flag2;
public WrapMode WrapModeU
{
get { return (WrapMode)(flag1 & 0x3); }
}
public WrapMode WrapModeV
{
get { return (WrapMode)(flag2 & 0x3); }
}
public FilterMode MinFilterMode
{
get { return (FilterMode)((flag1 >> 2) & 0x3); }
}
public FilterMode MaxFilterMode
{
get { return (FilterMode)((flag2 >> 2) & 0x3); }
}
public TextureRef() {}
public TextureRef(FileReader reader) {
ID = reader.ReadUInt16();
WrapS = reader.ReadByte();
WrapT = reader.ReadByte();
flag1 = reader.ReadByte();
flag2 = reader.ReadByte();
}
public void Write(FileWriter writer)
{
writer.Write(ID);
writer.Write(WrapS);
writer.Write(WrapT);
writer.Write(flag1);
writer.Write(flag2);
}
public enum FilterMode
{
Near = 0,
Linear = 1
}
public enum WrapMode
{
Clamp = 0,
Repeat = 1,
Mirror = 2
}
}
@ -939,6 +1213,7 @@ namespace FirstPlugin
for (int i = 0; i < offsets.Length; i++)
{
reader.SeekBegin(offsets[i] + pos);
Textures.Add(reader.ReadZeroTerminatedString());
}
}

View file

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Toolbox.Library;
namespace FirstPlugin
{
public class PaneTreeWrapper : TreeNodeCustom
{
}
}

View file

@ -199,6 +199,12 @@
<HintPath>..\Toolbox\Lib\VGAudio.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="WeifenLuo.WinFormsUI.Docking, Version=3.0.6.0, Culture=neutral, PublicKeyToken=5cded1a1a0a7b481, processorArchitecture=MSIL">
<HintPath>..\packages\DockPanelSuite.3.0.6\lib\net40\WeifenLuo.WinFormsUI.Docking.dll</HintPath>
</Reference>
<Reference Include="WeifenLuo.WinFormsUI.Docking.ThemeVS2015, Version=3.0.6.0, Culture=neutral, PublicKeyToken=5cded1a1a0a7b481, processorArchitecture=MSIL">
<HintPath>..\packages\DockPanelSuite.ThemeVS2015.3.0.6\lib\net40\WeifenLuo.WinFormsUI.Docking.ThemeVS2015.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Actors\BotwActorLoader.cs" />
@ -287,6 +293,7 @@
<Compile Include="FileFormats\Font\BFTTF.cs" />
<Compile Include="FileFormats\HyruleWarriors\G1M\G1M.cs" />
<Compile Include="FileFormats\HyruleWarriors\LINKDATA.cs" />
<Compile Include="FileFormats\Layout\PaneTreeWrapper.cs" />
<Compile Include="FileFormats\Message\MSBP.cs" />
<Compile Include="FileFormats\CrashBandicoot\IGZ_TEX.cs" />
<Compile Include="FileFormats\MOD.cs" />
@ -307,14 +314,26 @@
<Compile Include="GL\GXToOpenGL.cs" />
<Compile Include="GL\KCL_Render.cs" />
<Compile Include="GL\LM2_Render.cs" />
<Compile Include="GUI\BFLYT\LayoutHierarchy.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="GUI\BFLYT\LayoutHierarchy.Designer.cs">
<DependentUpon>LayoutHierarchy.cs</DependentUpon>
</Compile>
<Compile Include="GUI\BFLYT\LayoutProperties.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="GUI\BFLYT\LayoutProperties.Designer.cs">
<DependentUpon>LayoutProperties.cs</DependentUpon>
</Compile>
<Compile Include="GUI\BFLYT\LayoutTextureList.cs">
<SubType>Form</SubType>
<SubType>UserControl</SubType>
</Compile>
<Compile Include="GUI\BFLYT\LayoutTextureList.Designer.cs">
<DependentUpon>LayoutTextureList.cs</DependentUpon>
</Compile>
<Compile Include="GUI\BFLYT\LayoutViewer.cs">
<SubType>Form</SubType>
<SubType>UserControl</SubType>
</Compile>
<Compile Include="GUI\BFLYT\LayoutViewer.Designer.cs">
<DependentUpon>LayoutViewer.cs</DependentUpon>
@ -332,7 +351,7 @@
<DependentUpon>BffntEditor.cs</DependentUpon>
</Compile>
<Compile Include="GUI\BFLYT\LayoutEditor.cs">
<SubType>UserControl</SubType>
<SubType>Form</SubType>
</Compile>
<Compile Include="GUI\BFLYT\LayoutEditor.Designer.cs">
<DependentUpon>LayoutEditor.cs</DependentUpon>
@ -1056,6 +1075,7 @@
<Compile Include="YAML\YamlFska.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<None Include="Resources\InjectTexErrored.dds" />
</ItemGroup>
<ItemGroup>
@ -1081,6 +1101,12 @@
<EmbeddedResource Include="GUI\BFLYT\LayoutEditor.resx">
<DependentUpon>LayoutEditor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="GUI\BFLYT\LayoutHierarchy.resx">
<DependentUpon>LayoutHierarchy.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="GUI\BFLYT\LayoutProperties.resx">
<DependentUpon>LayoutProperties.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="GUI\BFLYT\LayoutTextureList.resx">
<DependentUpon>LayoutTextureList.cs</DependentUpon>
</EmbeddedResource>
@ -1366,7 +1392,6 @@
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BrawlboxHelper\BrawlboxHelper.csproj">
@ -1449,5 +1474,26 @@
<ItemGroup>
<None Include="Resources\MetaInfo.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\Layout\AlignmentPane.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\Layout\BoundryPane.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\Layout\NullPane.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\Layout\PicturePane.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\Layout\ScissorPane.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\Layout\TextPane.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\Layout\WindowPane.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<EnableUnmanagedDebugging>true</EnableUnmanagedDebugging>
</PropertyGroup>
</Project>

View file

@ -29,24 +29,59 @@
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LayoutEditor));
this.dockPanel1 = new WeifenLuo.WinFormsUI.Docking.DockPanel();
this.backColorDisplay = new System.Windows.Forms.PictureBox();
this.viewportBackColorCB = new Toolbox.Library.Forms.STComboBox();
this.stToolStrip1 = new Toolbox.Library.Forms.STToolStrip();
this.toolStripButton1 = new System.Windows.Forms.ToolStripButton();
this.stMenuStrip1 = new Toolbox.Library.Forms.STMenuStrip();
this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.stPanel1 = new Toolbox.Library.Forms.STPanel();
this.viewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.textureListToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
((System.ComponentModel.ISupportInitialize)(this.backColorDisplay)).BeginInit();
this.stToolStrip1.SuspendLayout();
this.stMenuStrip1.SuspendLayout();
this.SuspendLayout();
//
// dockPanel1
//
this.dockPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.dockPanel1.Location = new System.Drawing.Point(0, 49);
this.dockPanel1.Name = "dockPanel1";
this.dockPanel1.Size = new System.Drawing.Size(549, 349);
this.dockPanel1.TabIndex = 6;
//
// backColorDisplay
//
this.backColorDisplay.Location = new System.Drawing.Point(319, 25);
this.backColorDisplay.Name = "backColorDisplay";
this.backColorDisplay.Size = new System.Drawing.Size(21, 21);
this.backColorDisplay.TabIndex = 10;
this.backColorDisplay.TabStop = false;
this.backColorDisplay.Click += new System.EventHandler(this.backColorDisplay_Click);
//
// viewportBackColorCB
//
this.viewportBackColorCB.BorderColor = System.Drawing.Color.Empty;
this.viewportBackColorCB.BorderStyle = System.Windows.Forms.ButtonBorderStyle.Solid;
this.viewportBackColorCB.ButtonColor = System.Drawing.Color.Empty;
this.viewportBackColorCB.FormattingEnabled = true;
this.viewportBackColorCB.IsReadOnly = false;
this.viewportBackColorCB.Location = new System.Drawing.Point(167, 25);
this.viewportBackColorCB.Name = "viewportBackColorCB";
this.viewportBackColorCB.Size = new System.Drawing.Size(146, 21);
this.viewportBackColorCB.TabIndex = 9;
this.viewportBackColorCB.SelectedIndexChanged += new System.EventHandler(this.viewportBackColorCB_SelectedIndexChanged);
this.viewportBackColorCB.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.stComboBox1_MouseDoubleClick);
//
// stToolStrip1
//
this.stToolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripButton1});
this.stToolStrip1.Location = new System.Drawing.Point(0, 24);
this.stToolStrip1.Name = "stToolStrip1";
this.stToolStrip1.Size = new System.Drawing.Size(836, 25);
this.stToolStrip1.Size = new System.Drawing.Size(549, 25);
this.stToolStrip1.TabIndex = 3;
this.stToolStrip1.Text = "stToolStrip1";
//
@ -62,11 +97,12 @@
// stMenuStrip1
//
this.stMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.fileToolStripMenuItem,
this.editToolStripMenuItem,
this.viewToolStripMenuItem});
this.stMenuStrip1.Location = new System.Drawing.Point(0, 0);
this.stMenuStrip1.Name = "stMenuStrip1";
this.stMenuStrip1.Size = new System.Drawing.Size(836, 24);
this.stMenuStrip1.Size = new System.Drawing.Size(549, 24);
this.stMenuStrip1.TabIndex = 0;
this.stMenuStrip1.Text = "stMenuStrip1";
//
@ -76,14 +112,6 @@
this.editToolStripMenuItem.Size = new System.Drawing.Size(39, 20);
this.editToolStripMenuItem.Text = "Edit";
//
// stPanel1
//
this.stPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.stPanel1.Location = new System.Drawing.Point(0, 49);
this.stPanel1.Name = "stPanel1";
this.stPanel1.Size = new System.Drawing.Size(836, 469);
this.stPanel1.TabIndex = 4;
//
// viewToolStripMenuItem
//
this.viewToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
@ -95,20 +123,30 @@
// textureListToolStripMenuItem
//
this.textureListToolStripMenuItem.Name = "textureListToolStripMenuItem";
this.textureListToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.textureListToolStripMenuItem.Size = new System.Drawing.Size(133, 22);
this.textureListToolStripMenuItem.Text = "Texture List";
this.textureListToolStripMenuItem.Click += new System.EventHandler(this.textureListToolStripMenuItem_Click);
//
// fileToolStripMenuItem
//
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
this.fileToolStripMenuItem.Text = "File";
//
// LayoutEditor
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.stPanel1);
this.ClientSize = new System.Drawing.Size(549, 398);
this.Controls.Add(this.backColorDisplay);
this.Controls.Add(this.viewportBackColorCB);
this.Controls.Add(this.dockPanel1);
this.Controls.Add(this.stToolStrip1);
this.Controls.Add(this.stMenuStrip1);
this.IsMdiContainer = true;
this.Name = "LayoutEditor";
this.Size = new System.Drawing.Size(836, 518);
this.ParentChanged += new System.EventHandler(this.LayoutEditor_ParentChanged);
((System.ComponentModel.ISupportInitialize)(this.backColorDisplay)).EndInit();
this.stToolStrip1.ResumeLayout(false);
this.stToolStrip1.PerformLayout();
this.stMenuStrip1.ResumeLayout(false);
@ -124,8 +162,11 @@
private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem;
private Toolbox.Library.Forms.STToolStrip stToolStrip1;
private System.Windows.Forms.ToolStripButton toolStripButton1;
private Toolbox.Library.Forms.STPanel stPanel1;
private System.Windows.Forms.ToolStripMenuItem viewToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem textureListToolStripMenuItem;
private WeifenLuo.WinFormsUI.Docking.DockPanel dockPanel1;
private Toolbox.Library.Forms.STComboBox viewportBackColorCB;
private System.Windows.Forms.PictureBox backColorDisplay;
private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
}
}

View file

@ -7,10 +7,15 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Toolbox.Library.Forms;
using WeifenLuo.WinFormsUI.Docking;
using WeifenLuo.WinFormsUI.ThemeVS2015;
using Toolbox.Library.IO;
using Toolbox.Library;
namespace FirstPlugin.Forms
{
public partial class LayoutEditor : UserControl
public partial class LayoutEditor : Form
{
public List<BFLYT.Header> LayoutFiles = new List<BFLYT.Header>();
@ -22,27 +27,138 @@ namespace FirstPlugin.Forms
Animation,
}
public EventHandler ObjectSelected;
public EventHandler ObjectChanged;
public LayoutEditor()
{
InitializeComponent();
var theme = new VS2015DarkTheme();
this.dockPanel1.Theme = theme;
this.dockPanel1.BackColor = FormThemes.BaseTheme.FormBackColor;
this.BackColor = FormThemes.BaseTheme.FormBackColor;
viewportBackColorCB.Items.Add("Back Color : Default");
viewportBackColorCB.Items.Add("Back Color : Custom");
viewportBackColorCB.SelectedIndex = 0;
ObjectSelected += OnObjectSelected;
ObjectChanged += OnObjectChanged;
}
private DockContent TextureListDock;
private DockContent GroupTreeDock;
private DockContent PaneTreeDock;
private DockContent ColorDock;
private DockContent PropertiesDock;
private List<LayoutViewer> Viewports = new List<LayoutViewer>();
private LayoutViewer ActiveViewport;
private bool isLoaded = false;
public void LoadBflyt(BFLYT.Header header, string fileName)
{
if (isLoaded) return;
LayoutFiles.Add(header);
ActiveLayout = header;
LayoutViewer viewer = new LayoutViewer();
viewer.Dock = DockStyle.Fill;
viewer.TopLevel = false;
viewer.FormBorderStyle = FormBorderStyle.SizableToolWindow;
stPanel1.Controls.Add(viewer);
LayoutViewer Viewport = new LayoutViewer(header);
Viewport.Dock = DockStyle.Fill;
DockShow(Viewport, fileName, DockState.Document);
Viewports.Add(Viewport);
ActiveViewport = Viewport;
if (!isLoaded)
InitializeDockPanels();
isLoaded = true;
ActiveLayout = header;
}
private void InitializeDockPanels()
{
ShowTextureList();
ShowPaneHierarchy();
ShowGroupsHierarchy();
ShowPropertiesPanel();
UpdateBackColor();
}
private void OnObjectChanged(object sender, EventArgs e)
{
}
private void OnProperyChanged()
{
if (ActiveViewport != null)
ActiveViewport.UpdateViewport();
}
private bool isChecked = false;
private void OnObjectSelected(object sender, EventArgs e)
{
if (isChecked) return;
ActiveViewport.SelectedPanes.Clear();
if (PropertiesDock != null && (string)sender == "Select")
{
if (e is TreeViewEventArgs) {
var node = ((TreeViewEventArgs)e).Node;
var pane = (BFLYT.BasePane)node.Tag;
((LayoutProperties)PropertiesDock.Controls[0]).LoadProperties(pane, OnProperyChanged);
ActiveViewport.SelectedPanes.Add(pane);
}
}
if (ActiveViewport != null)
{
if (e is TreeViewEventArgs && (string)sender == "Checked" && !isChecked) {
isChecked = true;
var node = ((TreeViewEventArgs)e).Node;
ToggleChildern(node, node.Checked);
isChecked = false;
}
ActiveViewport.UpdateViewport();
}
}
private void ToggleChildern(TreeNode node, bool isChecked)
{
if (node.Tag is BFLYT.BasePane)
((BFLYT.BasePane)node.Tag).DisplayInEditor = isChecked;
node.Checked = isChecked;
foreach (TreeNode child in node.Nodes)
ToggleChildern(child, isChecked);
}
private DockContent DockShow(UserControl control, string text, DockAlignment dockState, DockContent dockSide = null, float Alignment = 0)
{
DockContent content = CreateContent(control, text);
content.Show(dockSide.Pane, dockState, Alignment);
return content;
}
private DockContent DockShow(UserControl control, string text, DockState dockState)
{
DockContent content = CreateContent(control, text);
content.Show(dockPanel1, dockState);
return content;
}
private DockContent CreateContent(UserControl control, string text)
{
DockContent content = new DockContent();
content.Text = text;
control.Dock = DockStyle.Fill;
content.Controls.Add(control);
return content;
}
public void LoadBflan()
{
@ -59,15 +175,87 @@ namespace FirstPlugin.Forms
if (this.ParentForm == null) return;
}
private void textureListToolStripMenuItem_Click(object sender, EventArgs e)
private void textureListToolStripMenuItem_Click(object sender, EventArgs e) {
ShowTextureList();
}
private void ShowGroupsHierarchy()
{
dockPanel1.GetContainerControl();
LayoutHierarchy hierarchyList = new LayoutHierarchy();
hierarchyList.LoadLayout(ActiveLayout,ObjectSelected, true);
GroupTreeDock = DockShow(hierarchyList, "Groups", DockAlignment.Top, TextureListDock, 0.5f);
}
private void ShowPropertiesPanel()
{
LayoutProperties properties = new LayoutProperties();
PropertiesDock = DockShow(properties, "Properties", DockAlignment.Top, TextureListDock, 0.5f);
}
private void ShowPaneHierarchy()
{
LayoutHierarchy hierarchyList = new LayoutHierarchy();
hierarchyList.LoadLayout(ActiveLayout, ObjectSelected);
PaneTreeDock = DockShow(hierarchyList, "Panes", DockAlignment.Top, TextureListDock, 0.5f);
}
private void ShowTextureList()
{
LayoutTextureList textureListForm = new LayoutTextureList();
textureListForm.LoadTextures(ActiveLayout);
TextureListDock = DockShow(textureListForm, "Texture List", DockState.DockRight);
}
if (ParentForm != null && ParentForm.TopLevel)
textureListForm.Show(ParentForm);
private void stComboBox1_MouseDoubleClick(object sender, MouseEventArgs e)
{
}
private bool isBGUpdating = false;
private void viewportBackColorCB_SelectedIndexChanged(object sender, EventArgs e)
{
if (ActiveViewport == null || isBGUpdating) return;
UpdateBackColor();
}
private void UpdateBackColor()
{
if (viewportBackColorCB.SelectedIndex == 0)
{
ActiveViewport.UpdateBackgroundColor(Color.FromArgb(130, 130, 130));
backColorDisplay.BackColor = Color.FromArgb(130, 130, 130);
}
else
textureListForm.Show();
{
ColorDialog dlg = new ColorDialog();
if (dlg.ShowDialog() == DialogResult.OK)
{
ActiveViewport.UpdateBackgroundColor(dlg.Color);
backColorDisplay.BackColor = dlg.Color;
}
else
viewportBackColorCB.SelectedIndex = 0;
}
}
private void backColorDisplay_Click(object sender, EventArgs e)
{
isBGUpdating = true;
ColorDialog dlg = new ColorDialog();
if (dlg.ShowDialog() == DialogResult.OK)
{
ActiveViewport.UpdateBackgroundColor(dlg.Color);
backColorDisplay.BackColor = dlg.Color;
if (viewportBackColorCB.SelectedIndex == 0)
viewportBackColorCB.SelectedIndex = 1;
}
isBGUpdating = false;
}
}
}

View file

@ -0,0 +1,60 @@
namespace FirstPlugin.Forms
{
partial class LayoutHierarchy
{
/// <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.treeView1 = new System.Windows.Forms.TreeView();
this.SuspendLayout();
//
// treeView1
//
this.treeView1.CheckBoxes = true;
this.treeView1.Dock = System.Windows.Forms.DockStyle.Fill;
this.treeView1.Location = new System.Drawing.Point(0, 0);
this.treeView1.Name = "treeView1";
this.treeView1.Size = new System.Drawing.Size(317, 372);
this.treeView1.TabIndex = 0;
this.treeView1.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.treeView1_AfterCheck);
this.treeView1.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView1_AfterSelect);
//
// LayoutHierarchy
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.treeView1);
this.Name = "LayoutHierarchy";
this.Size = new System.Drawing.Size(317, 372);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.TreeView treeView1;
}
}

View file

@ -0,0 +1,87 @@
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 FirstPlugin;
using Toolbox.Library.Forms;
namespace FirstPlugin.Forms
{
public partial class LayoutHierarchy : UserControl
{
public LayoutHierarchy()
{
InitializeComponent();
treeView1.BackColor = FormThemes.BaseTheme.FormBackColor;
treeView1.ForeColor = FormThemes.BaseTheme.FormForeColor;
var imgList = new ImageList();
imgList.Images.Add("AlignmentPane", Properties.Resources.AlignmentPane);
imgList.Images.Add("WindowPane", Properties.Resources.WindowPane);
imgList.Images.Add("ScissorPane", Properties.Resources.ScissorPane);
imgList.Images.Add("BoundryPane", Properties.Resources.BoundryPane);
imgList.Images.Add("NullPane", Properties.Resources.NullPane);
imgList.Images.Add("PicturePane", Properties.Resources.PicturePane);
imgList.ImageSize = new Size(22,22);
treeView1.ImageList = imgList;
}
private bool isLoaded = false;
private EventHandler OnProperySelected;
public void LoadLayout(BFLYT.Header bflyt, EventHandler onPropertySelected, bool useGroup = false)
{
isLoaded = false;
OnProperySelected = onPropertySelected;
if (useGroup)
LoadPane(bflyt.RootGroup);
else
LoadPane(bflyt.RootPane);
isLoaded = true;
}
private void LoadPane(BFLYT.BasePane pane, TreeNode parent = null)
{
PaneTreeWrapper paneNode = new PaneTreeWrapper();
paneNode.Checked = true;
paneNode.Text = pane.Name;
paneNode.Tag = pane;
string imageKey = "";
if (pane is BFLYT.WND1) imageKey = "WindowPane";
else if (pane is BFLYT.PIC1) imageKey = "PicturePane";
else if (pane is BFLYT.BND1) imageKey = "BoundryPane";
else imageKey = "NullPane";
paneNode.ImageKey = imageKey;
paneNode.SelectedImageKey = imageKey;
if (parent == null)
treeView1.Nodes.Add(paneNode);
else
parent.Nodes.Add(paneNode);
foreach (var childPane in pane.Childern)
LoadPane(childPane, paneNode);
}
private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
{
if (isLoaded)
OnProperySelected.Invoke("Select", e);
}
private void treeView1_AfterCheck(object sender, TreeViewEventArgs e)
{
if (isLoaded)
OnProperySelected.Invoke("Checked", e);
}
}
}

View file

@ -0,0 +1,120 @@
<?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>

View file

@ -0,0 +1,59 @@
namespace FirstPlugin.Forms
{
partial class LayoutProperties
{
/// <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.stTabControl1 = new FlatTabControl.FlatTabControl();
this.SuspendLayout();
//
// stTabControl1
//
this.stTabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.stTabControl1.Location = new System.Drawing.Point(0, 0);
this.stTabControl1.myBackColor = System.Drawing.Color.Empty;
this.stTabControl1.Name = "stTabControl1";
this.stTabControl1.SelectedIndex = 0;
this.stTabControl1.Size = new System.Drawing.Size(368, 338);
this.stTabControl1.TabIndex = 0;
//
// LayoutProperties
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.stTabControl1);
this.Name = "LayoutProperties";
this.Size = new System.Drawing.Size(368, 338);
this.ResumeLayout(false);
}
#endregion
private FlatTabControl.FlatTabControl stTabControl1;
}
}

View file

@ -0,0 +1,47 @@
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 Toolbox.Library.Forms;
namespace FirstPlugin.Forms
{
public partial class LayoutProperties : UserControl
{
public LayoutProperties()
{
InitializeComponent();
stTabControl1.myBackColor = FormThemes.BaseTheme.FormBackColor;
}
public void LoadProperties(BFLYT.BasePane prop, Action propChanged)
{
stTabControl1.Controls.Clear();
if (prop is BFLYT.PIC1)
{
LoadPropertyTab("Pane", prop, propChanged);
LoadPropertyTab("Materials", ((BFLYT.PIC1)prop).GetMaterial(), propChanged);
}
else
LoadPropertyTab("Pane", prop, propChanged);
}
private void LoadPropertyTab(string text, object prop, Action propChanged)
{
TabPage page = new TabPage();
page.Text = text;
var propGrid = new STPropertyGrid();
propGrid.Dock = DockStyle.Fill;
propGrid.LoadProperty(prop, propChanged);
page.Controls.Add(propGrid);
stTabControl1.Controls.Add(page);
}
}
}

View file

@ -0,0 +1,120 @@
<?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>

View file

@ -28,7 +28,6 @@
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LayoutTextureList));
this.stToolStrip1 = new Toolbox.Library.Forms.STToolStrip();
this.toolStripButton1 = new System.Windows.Forms.ToolStripButton();
this.toolStripButton2 = new System.Windows.Forms.ToolStripButton();
@ -39,34 +38,24 @@
this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader5 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.contentContainer.SuspendLayout();
this.stToolStrip1.SuspendLayout();
this.SuspendLayout();
//
// contentContainer
//
this.contentContainer.Controls.Add(this.listViewCustom1);
this.contentContainer.Controls.Add(this.listViewTpyeCB);
this.contentContainer.Controls.Add(this.stToolStrip1);
this.contentContainer.Controls.SetChildIndex(this.stToolStrip1, 0);
this.contentContainer.Controls.SetChildIndex(this.listViewTpyeCB, 0);
this.contentContainer.Controls.SetChildIndex(this.listViewCustom1, 0);
//
// stToolStrip1
//
this.stToolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripButton1,
this.toolStripButton2});
this.stToolStrip1.Location = new System.Drawing.Point(0, 25);
this.stToolStrip1.Location = new System.Drawing.Point(0, 0);
this.stToolStrip1.Name = "stToolStrip1";
this.stToolStrip1.Size = new System.Drawing.Size(543, 25);
this.stToolStrip1.Size = new System.Drawing.Size(549, 25);
this.stToolStrip1.TabIndex = 11;
this.stToolStrip1.Text = "stToolStrip1";
//
// toolStripButton1
//
this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.toolStripButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton1.Image")));
this.toolStripButton1.Image = global::FirstPlugin.Properties.Resources.AddIcon;
this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton1.Name = "toolStripButton1";
this.toolStripButton1.Size = new System.Drawing.Size(23, 22);
@ -75,7 +64,7 @@
// toolStripButton2
//
this.toolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.toolStripButton2.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton2.Image")));
this.toolStripButton2.Image = global::FirstPlugin.Properties.Resources.RemoveIcon;
this.toolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton2.Name = "toolStripButton2";
this.toolStripButton2.Size = new System.Drawing.Size(23, 22);
@ -88,7 +77,7 @@
this.listViewTpyeCB.ButtonColor = System.Drawing.Color.Empty;
this.listViewTpyeCB.FormattingEnabled = true;
this.listViewTpyeCB.IsReadOnly = false;
this.listViewTpyeCB.Location = new System.Drawing.Point(139, 27);
this.listViewTpyeCB.Location = new System.Drawing.Point(117, 2);
this.listViewTpyeCB.Name = "listViewTpyeCB";
this.listViewTpyeCB.Size = new System.Drawing.Size(146, 21);
this.listViewTpyeCB.TabIndex = 12;
@ -96,6 +85,7 @@
//
// listViewCustom1
//
this.listViewCustom1.AllowDrop = true;
this.listViewCustom1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.listViewCustom1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columnHeader1,
@ -104,21 +94,24 @@
this.columnHeader4,
this.columnHeader5});
this.listViewCustom1.Dock = System.Windows.Forms.DockStyle.Fill;
this.listViewCustom1.Location = new System.Drawing.Point(0, 50);
this.listViewCustom1.Location = new System.Drawing.Point(0, 25);
this.listViewCustom1.Name = "listViewCustom1";
this.listViewCustom1.OwnerDraw = true;
this.listViewCustom1.Size = new System.Drawing.Size(543, 343);
this.listViewCustom1.Size = new System.Drawing.Size(549, 373);
this.listViewCustom1.TabIndex = 13;
this.listViewCustom1.UseCompatibleStateImageBehavior = false;
this.listViewCustom1.View = System.Windows.Forms.View.Details;
this.listViewCustom1.DragEnter += new System.Windows.Forms.DragEventHandler(this.listViewCustom1_DragEnter);
//
// columnHeader1
//
this.columnHeader1.Text = "Name";
this.columnHeader1.Width = 118;
//
// columnHeader2
//
this.columnHeader2.Text = "Format";
this.columnHeader2.Width = 101;
//
// columnHeader3
//
@ -131,19 +124,22 @@
// columnHeader5
//
this.columnHeader5.Text = "Size";
this.columnHeader5.Width = 210;
//
// LayoutTextureList
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(549, 398);
this.Controls.Add(this.listViewCustom1);
this.Controls.Add(this.listViewTpyeCB);
this.Controls.Add(this.stToolStrip1);
this.Name = "LayoutTextureList";
this.Text = "LayoutTextureList";
this.contentContainer.ResumeLayout(false);
this.contentContainer.PerformLayout();
this.Size = new System.Drawing.Size(549, 398);
this.DragDrop += new System.Windows.Forms.DragEventHandler(this.LayoutTextureList_DragDrop);
this.stToolStrip1.ResumeLayout(false);
this.stToolStrip1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}

View file

@ -9,11 +9,15 @@ using System.Threading.Tasks;
using System.Windows.Forms;
using FirstPlugin;
using Toolbox.Library.Forms;
using Toolbox.Library;
using System.Threading;
using WeifenLuo.WinFormsUI.Docking;
namespace FirstPlugin.Forms
{
public partial class LayoutTextureList : STForm
public partial class LayoutTextureList : UserControl
{
ImageList imgList = new ImageList();
public LayoutTextureList()
{
InitializeComponent();
@ -24,18 +28,58 @@ namespace FirstPlugin.Forms
listViewTpyeCB.Items.Add(View.SmallIcon);
listViewTpyeCB.Items.Add(View.Tile);
listViewTpyeCB.SelectedIndex = 0;
listViewCustom1.FullRowSelect = true;
imgList = new ImageList()
{
ColorDepth = ColorDepth.Depth32Bit,
ImageSize = new Size(30, 30),
};
}
private bool isLoaded = false;
public void LoadTextures(BFLYT.Header header)
{
listViewCustom1.Items.Clear();
imgList.Images.Clear();
imgList.Images.Add(new Bitmap(30, 30));
listViewCustom1.LargeImageList = imgList;
listViewCustom1.SmallImageList = imgList;
var textureList = header.FileInfo.GetTextures();
listViewCustom1.BeginUpdate();
foreach (var texture in header.TextureList.Textures)
{
ListViewItem item = new ListViewItem();
item.Text = texture;
item.ImageIndex = 0;
listViewCustom1.Items.Add(item);
}
Console.WriteLine($"textureList " + textureList.Count);
//Load textures after on a seperate thread
Thread Thread = new Thread((ThreadStart)(() =>
{
foreach (ListViewItem item in listViewCustom1.Items)
{
if (textureList.ContainsKey(item.Text))
{
LoadTextureIcon(item, textureList[item.Text]);
}
}
}));
Thread.Start();
foreach (ListViewItem item in listViewCustom1.Items)
{
if (textureList.ContainsKey(item.Text))
LoadTextureIcon(item, textureList[item.Text]);
}
listViewCustom1.EndUpdate();
isLoaded = true;
@ -45,5 +89,54 @@ namespace FirstPlugin.Forms
if (isLoaded)
listViewCustom1.View = (View)listViewTpyeCB.SelectedItem;
}
private void LoadTextureIcon(ListViewItem item, STGenericTexture texture)
{
Bitmap temp = texture.GetBitmap();
if (listViewCustom1.InvokeRequired)
{
listViewCustom1.Invoke((MethodInvoker)delegate {
item.ImageIndex = imgList.Images.Count;
item.SubItems.Add(texture.Format.ToString());
item.SubItems.Add(texture.Width.ToString());
item.SubItems.Add(texture.Height.ToString());
item.SubItems.Add(texture.DataSize);
// Running on the UI thread
imgList.Images.Add(temp);
var dummy = imgList.Handle;
});
}
temp.Dispose();
}
private void LayoutTextureList_DragDrop(object sender, DragEventArgs e)
{
Cursor.Current = Cursors.WaitCursor;
string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
foreach (string filename in files)
OpenTextureFile(filename);
Cursor.Current = Cursors.Default;
}
private void OpenTextureFile(string fileName)
{
}
private void listViewCustom1_DragEnter(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop))
e.Effect = DragDropEffects.All;
else
{
String[] strGetFormats = e.Data.GetFormats();
e.Effect = DragDropEffects.None;
}
}
}
}

View file

@ -120,35 +120,4 @@
<metadata name="stToolStrip1.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="toolStripButton1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
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>
<data name="toolStripButton2.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
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>

View file

@ -8,18 +8,44 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using OpenTK.Graphics.OpenGL;
using OpenTK;
using Toolbox.Library;
using Toolbox.Library.Rendering;
using Toolbox.Library.IO;
namespace FirstPlugin.Forms
{
public partial class LayoutViewer : Form
public partial class LayoutViewer : UserControl
{
public List<BFLYT.BasePane> SelectedPanes = new List<BFLYT.BasePane>();
public Camera2D Camera = new Camera2D();
public class Camera2D
{
public float Zoom = 1;
public Vector2 Position;
}
private RenderableTex backgroundTex;
public LayoutViewer()
private BFLYT.Header LayoutFile;
private static Dictionary<string, STGenericTexture> Textures;
public LayoutViewer(BFLYT.Header bflyt)
{
InitializeComponent();
LayoutFile = bflyt;
Textures = new Dictionary<string, STGenericTexture>();
if (bflyt.TextureList.Textures.Count > 0)
Textures = bflyt.FileInfo.GetTextures();
}
public void UpdateViewport()
{
glControl1.Invalidate();
}
private void glControl1_Paint(object sender, PaintEventArgs e)
@ -31,8 +57,11 @@ namespace FirstPlugin.Forms
OnRender();
}
private Color BackgroundColor = Color.FromArgb(130, 130, 130);
private void OnRender()
{
if (LayoutFile == null) return;
GL.Viewport(0, 0, glControl1.Width, glControl1.Height);
GL.MatrixMode(MatrixMode.Projection);
GL.LoadIdentity();
@ -40,64 +69,406 @@ namespace FirstPlugin.Forms
GL.MatrixMode(MatrixMode.Modelview);
GL.LoadIdentity();
GL.ClearColor(System.Drawing.Color.FromArgb(40, 40, 40));
GL.ClearColor(BackgroundColor);
GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
DrawBackground();
GL.Enable(EnableCap.AlphaTest);
GL.AlphaFunc(AlphaFunction.Gequal, 0.1f);
GL.Enable(EnableCap.Blend);
GL.BlendFunc(BlendingFactor.SrcAlpha, BlendingFactor.OneMinusSrcAlpha);
DrawRootPane(LayoutFile.RootPane);
DrawGrid();
DrawXyLines();
GL.Scale(1 * Camera.Zoom, -1 * Camera.Zoom, 1);
GL.Translate(Camera.Position.X, Camera.Position.Y, 0);
RenderPanes(LayoutFile.RootPane, true);
glControl1.SwapBuffers();
}
private void RenderPanes(BFLYT.BasePane pane, bool isRoot)
{
if (!pane.DisplayInEditor)
return;
GL.PushMatrix();
GL.Translate(pane.Translate.X, pane.Translate.Y, 0);
GL.Rotate(pane.Rotate.Z, pane.Rotate.X, pane.Rotate.Y, pane.Rotate.Z);
GL.Scale(pane.Scale.X, pane.Scale.Y, 1);
if (!isRoot)
{
if (pane is BFLYT.PIC1)
DrawPicturePane(LayoutFile, (BFLYT.PIC1)pane);
else if (pane is BFLYT.PAN1)
DrawDefaultPane(LayoutFile, (BFLYT.PAN1)pane);
}
else
isRoot = false;
foreach (var childPane in pane.Childern)
RenderPanes(childPane, isRoot);
GL.PopMatrix();
}
private void DrawRootPane(BFLYT.PAN1 pane)
{
GL.LoadIdentity();
GL.PushMatrix();
GL.Scale(pane.Scale.X * Camera.Zoom, -pane.Scale.Y * Camera.Zoom, 1);
GL.Rotate(pane.Rotate.Z, pane.Rotate.X, pane.Rotate.Y, pane.Rotate.Z);
GL.Translate(pane.Translate.X + Camera.Position.X, pane.Translate.Y + Camera.Position.Y, 0);
Color color = Color.Black;
if (SelectedPanes.Contains(pane))
color = Color.Red;
BFLYT.CustomRectangle rect = pane.CreateRectangle();
//Draw a quad which is the backcolor but lighter
GL.Begin(PrimitiveType.Quads);
GL.Color3(BackgroundColor.Lighten(10));
GL.Vertex2(rect.LeftPoint, rect.TopPoint);
GL.Vertex2(rect.RightPoint, rect.TopPoint);
GL.Vertex2(rect.RightPoint, rect.BottomPoint);
GL.Vertex2(rect.LeftPoint, rect.BottomPoint);
GL.End();
//Draw outline of root pane
GL.Begin(PrimitiveType.LineLoop);
GL.PolygonOffset(0.5f, 2);
GL.LineWidth(33);
GL.Color3(color);
GL.Vertex2(rect.LeftPoint, rect.TopPoint);
GL.Vertex2(rect.RightPoint, rect.TopPoint);
GL.Vertex2(rect.RightPoint, rect.BottomPoint);
GL.Vertex2(rect.LeftPoint, rect.BottomPoint);
GL.End();
GL.PopMatrix();
}
private void DrawDefaultPane(BFLYT.Header bflyt, BFLYT.PAN1 pane)
{
Vector2[] TexCoords = new Vector2[] {
new Vector2(1,1),
new Vector2(0,1),
new Vector2(0,0),
new Vector2(1,0)
};
Color color = Color.White;
if (SelectedPanes.Contains(pane))
color = Color.Red;
Color[] Colors = new Color[] {
color,
color,
color,
color,
};
DrawRectangle(pane.CreateRectangle(), TexCoords, Colors);
}
private void DrawPicturePane(BFLYT.Header bflyt, BFLYT.PIC1 pane)
{
Vector2[] TexCoords = new Vector2[] {
new Vector2(1,1),
new Vector2(0,1),
new Vector2(0,0),
new Vector2(1,0)
};
Color[] Colors = new Color[] {
pane.ColorTopLeft.Color,
pane.ColorTopRight.Color,
pane.ColorBottomRight.Color,
pane.ColorBottomLeft.Color,
};
GL.Enable(EnableCap.Texture2D);
if (pane.TexCoords.Length > 0)
{
var mat = bflyt.MaterialList.Materials[pane.MaterialIndex];
string textureMap0 = "";
if (mat.TextureMaps.Count > 0)
textureMap0 = bflyt.TextureList.Textures[mat.TextureMaps[0].ID];
if (Textures.ContainsKey(textureMap0))
BindGLTexture(mat.TextureMaps[0], Textures[textureMap0]);
TexCoords = new Vector2[] {
pane.TexCoords[0].TopLeft.ToTKVector2(),
pane.TexCoords[0].TopRight.ToTKVector2(),
pane.TexCoords[0].BottomRight.ToTKVector2(),
pane.TexCoords[0].BottomLeft.ToTKVector2(),
};
}
DrawRectangle(pane.CreateRectangle(), TexCoords, Colors, false);
GL.BindTexture(TextureTarget.Texture2D, 0);
}
public void DrawRectangle(BFLYT.CustomRectangle rect, Vector2[] texCoords, Color[] colors, bool useLines = true)
{
if (useLines)
{
GL.Begin(PrimitiveType.LineLoop);
GL.Color3(colors[0]);
GL.Vertex2(rect.LeftPoint, rect.BottomPoint);
GL.Vertex2(rect.RightPoint, rect.BottomPoint);
GL.Vertex2(rect.RightPoint, rect.TopPoint);
GL.Vertex2(rect.LeftPoint, rect.TopPoint);
GL.End();
}
else
{
GL.Begin(PrimitiveType.Quads);
GL.Color3(colors[0]);
GL.TexCoord2(texCoords[0]);
GL.Vertex2(rect.LeftPoint, rect.BottomPoint);
GL.Color3(colors[1]);
GL.TexCoord2(texCoords[1]);
GL.Vertex2(rect.RightPoint, rect.BottomPoint);
GL.Color3(colors[2]);
GL.TexCoord2(texCoords[2]);
GL.Vertex2(rect.RightPoint, rect.TopPoint);
GL.Color3(colors[3]);
GL.TexCoord2(texCoords[3]);
GL.Vertex2(rect.LeftPoint, rect.TopPoint);
GL.End();
}
}
private static void BindGLTexture(BFLYT.TextureRef tex, STGenericTexture texture)
{
if (texture.RenderableTex == null || !texture.RenderableTex.GLInitialized)
texture.LoadOpenGLTexture();
//If the texture is still not initialized then return
if (!texture.RenderableTex.GLInitialized)
return;
// GL.ActiveTexture(TextureUnit.Texture0 + texid);
GL.BindTexture(TextureTarget.Texture2D, texture.RenderableTex.TexID);
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapS, ConvertTextureWrap(tex.WrapModeU));
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapT, ConvertTextureWrap(tex.WrapModeV));
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, ConvertMagFilterMode(tex.MaxFilterMode));
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, ConvertMinFilterMode(tex.MinFilterMode));
GL.TexParameter(TextureTarget.Texture2D, (TextureParameterName)ExtTextureFilterAnisotropic.TextureMaxAnisotropyExt, 0.0f);
}
private static int ConvertTextureWrap(BFLYT.TextureRef.WrapMode wrapMode)
{
switch (wrapMode)
{
case BFLYT.TextureRef.WrapMode.Clamp: return (int)TextureWrapMode.Clamp;
case BFLYT.TextureRef.WrapMode.Mirror: return (int)TextureWrapMode.MirroredRepeat;
case BFLYT.TextureRef.WrapMode.Repeat: return (int)TextureWrapMode.Repeat;
default: return (int)TextureWrapMode.Clamp;
}
}
private static int ConvertMagFilterMode(BFLYT.TextureRef.FilterMode filterMode)
{
switch (filterMode)
{
case BFLYT.TextureRef.FilterMode.Linear: return (int)TextureMagFilter.Linear;
case BFLYT.TextureRef.FilterMode.Near: return (int)TextureMagFilter.Nearest;
default: return (int)BFLYT.TextureRef.FilterMode.Linear;
}
}
private static int ConvertMinFilterMode(BFLYT.TextureRef.FilterMode filterMode)
{
switch (filterMode)
{
case BFLYT.TextureRef.FilterMode.Linear: return (int)TextureMinFilter.Linear;
case BFLYT.TextureRef.FilterMode.Near: return (int)TextureMinFilter.Nearest;
default: return (int)BFLYT.TextureRef.FilterMode.Linear;
}
}
private void DrawBackground()
{
if (backgroundTex == null)
backgroundTex = RenderableTex.FromBitmap(Properties.Resources.GridBackground);
{
/* backgroundTex = RenderableTex.FromBitmap(Properties.Resources.GridBackground);
backgroundTex.TextureWrapR = TextureWrapMode.Repeat;
backgroundTex.TextureWrapT = TextureWrapMode.Repeat;
GL.Enable(EnableCap.Texture2D);
GL.BindTexture(TextureTarget.Texture2D, backgroundTex.TexID);
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapS, (float)backgroundTex.TextureWrapR);
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapT, (float)backgroundTex.TextureWrapT);
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (float)backgroundTex.TextureMagFilter);
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (float)backgroundTex.TextureMinFilter);
float scale = 4;
GL.Enable(EnableCap.Texture2D);
GL.BindTexture(TextureTarget.Texture2D, backgroundTex.TexID);
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapS, (float)backgroundTex.TextureWrapR);
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapT, (float)backgroundTex.TextureWrapT);
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (float)backgroundTex.TextureMagFilter);
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (float)backgroundTex.TextureMinFilter);
GL.MatrixMode(MatrixMode.Modelview);
float UVscale = 15;
int PanelWidth = 9000;
int PanelWHeight = 9000;
Vector2 scaleCenter = new Vector2(0.5f, 0.5f);
Vector2[] TexCoords = new Vector2[] {
new Vector2(1,1),
new Vector2(0,1),
new Vector2(0,0),
new Vector2(1,0),
};
for (int i = 0; i < TexCoords.Length; i++)
TexCoords[i] = (TexCoords[i] - scaleCenter) * 20 + scaleCenter;
GL.MatrixMode(MatrixMode.Modelview);
GL.LoadIdentity();
GL.PushMatrix();
GL.Scale(1, 1, 1);
GL.Translate(0, 0, 0);
GL.Color4(Color.White);
GL.Begin(PrimitiveType.Quads);
GL.TexCoord2(TexCoords[0]);
GL.Vertex3(PanelWidth, PanelWHeight, 0);
GL.TexCoord2(TexCoords[1]);
GL.Vertex3(-PanelWidth, PanelWHeight, 0);
GL.TexCoord2(TexCoords[2]);
GL.Vertex3(-PanelWidth, -PanelWHeight, 0);
GL.TexCoord2(TexCoords[3]);
GL.Vertex3(PanelWidth, -PanelWHeight, 0);
GL.End();
GL.BindTexture(TextureTarget.Texture2D, 0);
GL.PopMatrix();*/
}
}
public void UpdateBackgroundColor(Color color)
{
BackgroundColor = color;
glControl1.Invalidate();
}
private void DrawXyLines()
{
GL.LoadIdentity();
GL.PushMatrix();
GL.Scale(scale, scale, scale);
GL.Translate(0, 0, 0);
GL.Scale(1 * Camera.Zoom, -1 * Camera.Zoom, 1);
GL.Translate(Camera.Position.X, Camera.Position.Y, 0);
GL.Color4(Color.White);
int lineLength = 20;
GL.Begin(PrimitiveType.Quads);
GL.TexCoord2(-1, -1);
GL.Vertex3(-Width, -Height, 0);
GL.TexCoord2(0, -1);
GL.Vertex3(Width, -Height, 0);
GL.TexCoord2(0, 0);
GL.Vertex3(Width, Height, 0);
GL.TexCoord2(-1, 0);
GL.Vertex3(-Width, Height, 0);
GL.Color3(Color.Green);
GL.Begin(PrimitiveType.Lines);
GL.Vertex2(0, 0);
GL.Vertex2(0, lineLength);
GL.End();
GL.Color3(Color.Red);
GL.Begin(PrimitiveType.Lines);
GL.Vertex2(0, 0);
GL.Vertex2(lineLength, 0);
GL.End();
GL.BindTexture(TextureTarget.Texture2D, 0);
GL.PopMatrix();
}
private void DrawGrid()
{
var size = 40;
var amount = 300;
GL.LoadIdentity();
GL.PushMatrix();
GL.Scale(1 * Camera.Zoom, -1 * Camera.Zoom, 1);
GL.Translate(Camera.Position.X, Camera.Position.Y, 0);
GL.Rotate(90, new Vector3(1,0,0));
GL.LineWidth(0.001f);
GL.Color3(BackgroundColor.Darken(20));
GL.Begin(PrimitiveType.Lines);
int squareGridCounter = 0;
for (var i = -amount; i <= amount; i++)
{
if (squareGridCounter > 5)
{
squareGridCounter = 0;
GL.LineWidth(33f);
}
else
{
GL.LineWidth(0.001f);
}
GL.Vertex3(new Vector3(-amount * size, 0f, i * size));
GL.Vertex3(new Vector3(amount * size, 0f, i * size));
GL.Vertex3(new Vector3(i * size, 0f, -amount * size));
GL.Vertex3(new Vector3(i * size, 0f, amount * size));
squareGridCounter++;
}
GL.End();
GL.Color3(Color.Transparent);
GL.PopAttrib();
GL.Enable(EnableCap.Texture2D);
GL.PopMatrix();
}
private bool mouseHeldDown = false;
private Point originMouse;
private void glControl1_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
mouseHeldDown = true;
originMouse = e.Location;
glControl1.Invalidate();
}
}
private void glControl1_MouseUp(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
mouseHeldDown = false;
glControl1.Invalidate();
}
}
private void glControl1_MouseMove(object sender, MouseEventArgs e)
{
if (mouseHeldDown)
{
var pos = new Vector2(e.Location.X - originMouse.X, e.Location.Y - originMouse.Y);
Camera.Position.X += pos.X;
Camera.Position.Y -= pos.Y;
originMouse = e.Location;
glControl1.Invalidate();
}
}
protected override void OnMouseWheel(MouseEventArgs e)
{
base.OnMouseWheel(e);
if (e.Delta > 0 && Camera.Zoom > 0)
Camera.Zoom += 0.1f;
if (e.Delta < 0 && Camera.Zoom < 10 && Camera.Zoom > 0.1)
Camera.Zoom -= 0.1f;
glControl1.Invalidate();
}
private void glControl1_Resize(object sender, EventArgs e)

View file

@ -70,6 +70,16 @@ namespace FirstPlugin.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap AlignmentPane {
get {
object obj = ResourceManager.GetObject("AlignmentPane", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
@ -150,6 +160,16 @@ namespace FirstPlugin.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap BoundryPane {
get {
object obj = ResourceManager.GetObject("BoundryPane", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
@ -170,6 +190,26 @@ namespace FirstPlugin.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap NullPane {
get {
object obj = ResourceManager.GetObject("NullPane", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap PicturePane {
get {
object obj = ResourceManager.GetObject("PicturePane", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
@ -180,6 +220,26 @@ namespace FirstPlugin.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap ScissorPane {
get {
object obj = ResourceManager.GetObject("ScissorPane", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap TextPane {
get {
object obj = ResourceManager.GetObject("TextPane", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
@ -219,5 +279,15 @@ namespace FirstPlugin.Properties {
return ((byte[])(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap WindowPane {
get {
object obj = ResourceManager.GetObject("WindowPane", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}

View file

@ -166,4 +166,25 @@
<data name="ArrowIcon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\ArrowIcon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="AlignmentPane" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Layout\AlignmentPane.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="BoundryPane" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Layout\BoundryPane.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="NullPane" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Layout\NullPane.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="PicturePane" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Layout\PicturePane.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="ScissorPane" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Layout\ScissorPane.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="TextPane" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Layout\TextPane.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="WindowPane" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Layout\WindowPane.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 465 KiB

After

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 290 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 290 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 844 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 317 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 347 B

View file

@ -10,6 +10,10 @@
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WeifenLuo.WinFormsUI.Docking" publicKeyToken="5cded1a1a0a7b481" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.1.0.0" newVersion="3.1.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View file

@ -1,3 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="DockPanelSuite" version="3.0.6" targetFramework="net462" />
<package id="DockPanelSuite.ThemeVS2015" version="3.0.6" targetFramework="net462" />
</packages>

View file

@ -47,6 +47,8 @@ namespace Toolbox.Library
uint bpp = STGenericTexture.GetBytesPerPixel(format);
int size = width * height * 4;
bpp = (uint)(data.Length / (width * height));
byte[] output = new byte[size];
int inPos = 0;
@ -54,6 +56,10 @@ namespace Toolbox.Library
byte[] compSel = new byte[4] {0,1,2,3 };
if (format == TEX_FORMAT.L8 || format == TEX_FORMAT.LA8)
compSel = new byte[4] { 0, 0, 0, 1 };
for (int Y = 0; Y < height; Y++)
{
for (int X = 0; X < width; X++)

View file

@ -15,6 +15,7 @@ namespace Toolbox.Library.Forms
public partial class ArchiveFilePanel : UserControl
{
ArchiveFileInfo ArchiveFileInfo;
IArchiveFile ArchiveFile;
private bool _IsLoaded = false;
@ -27,6 +28,12 @@ namespace Toolbox.Library.Forms
saveBtn.Visible = false;
}
public void LoadFile(ArchiveFileInfo archiveFileInfo, IArchiveFile archiveFile)
{
ArchiveFileInfo = archiveFileInfo;
ArchiveFile = archiveFile;
}
public void LoadFile(ArchiveFileInfo archiveFileInfo)
{
ArchiveFileInfo = archiveFileInfo;
@ -89,6 +96,9 @@ namespace Toolbox.Library.Forms
return;
}
if (File.IFileInfo != null && ArchiveFile != null)
File.IFileInfo.ArchiveParent = ArchiveFile;
ArchiveFileInfo.FileFormat = File;
SetEditorForm(File);
}

View file

@ -42,7 +42,7 @@
//
this.pictureBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.pictureBox1.Image = global::Toolbox.Library.Properties.Resources.arrowMinimize_;
this.pictureBox1.Image = global::Toolbox.Library.Properties.Resources.arrowMinimize;
this.pictureBox1.Location = new System.Drawing.Point(0, 0);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(30, 18);

View file

@ -399,6 +399,18 @@ namespace FlatTabControl
private void FlatTabControl_SelectedIndexChanged(object sender, EventArgs e)
{
foreach (TabPage tpCheck in TabPages)
{
tpCheck.BackColor = FormThemes.BaseTheme.TabPageInactive;
tpCheck.ForeColor = FormThemes.BaseTheme.DisabledItemColor;
}
if (SelectedTab != null)
{
SelectedTab.BackColor = FormThemes.BaseTheme.TabPageActive;
SelectedTab.ForeColor = FormThemes.BaseTheme.TextForeColor;
}
UpdateUpDown();
Invalidate(); // we need to update border and background colors
}

View file

@ -10,10 +10,9 @@ namespace Toolbox.Library.Forms
{
public class STTabControl : FlatTabControl.FlatTabControl
{
public STTabControl()
public STTabControl() : base()
{
myBackColor = FormThemes.BaseTheme.FormBackColor;
InitializeComponent();
}

View file

@ -29,28 +29,31 @@
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.splitter1 = new System.Windows.Forms.Splitter();
this.stPanel2 = new Toolbox.Library.Forms.STPanel();
this.stPanel1 = new Toolbox.Library.Forms.STPanel();
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.stPanel5 = new Toolbox.Library.Forms.STPanel();
this.nodeSizeCB = new Toolbox.Library.Forms.STComboBox();
this.stPanel4 = new Toolbox.Library.Forms.STPanel();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.treeViewCustom1 = new Toolbox.Library.TreeViewCustom();
this.stToolStrip1 = new Toolbox.Library.Forms.STToolStrip();
this.toolStripButton1 = new System.Windows.Forms.ToolStripButton();
this.searchFormToolStrip = new System.Windows.Forms.ToolStripButton();
this.stPanel3 = new Toolbox.Library.Forms.STPanel();
this.searchImgPB = new System.Windows.Forms.PictureBox();
this.activeEditorChkBox = new Toolbox.Library.Forms.STCheckBox();
this.searchImgPB = new System.Windows.Forms.PictureBox();
this.objectEditorMenu = new Toolbox.Library.Forms.STMenuStrip();
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.viewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.sortToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.dockSearchListToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.stPanel2 = new Toolbox.Library.Forms.STPanel();
this.btnPanelDisplay = new Toolbox.Library.Forms.STButton();
this.treeNodeContextMenu = new Toolbox.Library.Forms.STContextMenuStrip(this.components);
this.stPanel1.SuspendLayout();
this.stPanel4.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit();
this.splitContainer2.Panel1.SuspendLayout();
this.splitContainer2.Panel2.SuspendLayout();
this.splitContainer2.SuspendLayout();
this.stPanel5.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
@ -60,36 +63,36 @@
this.objectEditorMenu.SuspendLayout();
this.SuspendLayout();
//
// splitter1
// splitContainer2
//
this.splitter1.Location = new System.Drawing.Point(314, 0);
this.splitter1.Name = "splitter1";
this.splitter1.Size = new System.Drawing.Size(3, 542);
this.splitter1.TabIndex = 13;
this.splitter1.TabStop = false;
this.splitter1.LocationChanged += new System.EventHandler(this.splitter1_LocationChanged);
this.splitter1.Resize += new System.EventHandler(this.splitter1_Resize);
this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer2.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.splitContainer2.Location = new System.Drawing.Point(0, 0);
this.splitContainer2.Name = "splitContainer2";
//
// stPanel2
// splitContainer2.Panel1
//
this.stPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.stPanel2.Location = new System.Drawing.Point(314, 0);
this.stPanel2.Name = "stPanel2";
this.stPanel2.Size = new System.Drawing.Size(593, 542);
this.stPanel2.TabIndex = 12;
this.splitContainer2.Panel1.Controls.Add(this.stPanel5);
//
// stPanel1
// splitContainer2.Panel2
//
this.stPanel1.Controls.Add(this.nodeSizeCB);
this.stPanel1.Controls.Add(this.stPanel4);
this.stPanel1.Controls.Add(this.stToolStrip1);
this.stPanel1.Controls.Add(this.stPanel3);
this.stPanel1.Dock = System.Windows.Forms.DockStyle.Left;
this.stPanel1.Location = new System.Drawing.Point(0, 0);
this.stPanel1.Name = "stPanel1";
this.stPanel1.Size = new System.Drawing.Size(314, 542);
this.stPanel1.TabIndex = 11;
this.stPanel1.Resize += new System.EventHandler(this.stPanel1_Resize);
this.splitContainer2.Panel2.Controls.Add(this.stPanel2);
this.splitContainer2.Panel2.Controls.Add(this.btnPanelDisplay);
this.splitContainer2.Size = new System.Drawing.Size(907, 542);
this.splitContainer2.SplitterDistance = 302;
this.splitContainer2.TabIndex = 14;
//
// stPanel5
//
this.stPanel5.Controls.Add(this.nodeSizeCB);
this.stPanel5.Controls.Add(this.splitContainer1);
this.stPanel5.Controls.Add(this.stToolStrip1);
this.stPanel5.Controls.Add(this.stPanel3);
this.stPanel5.Dock = System.Windows.Forms.DockStyle.Fill;
this.stPanel5.Location = new System.Drawing.Point(0, 0);
this.stPanel5.Name = "stPanel5";
this.stPanel5.Size = new System.Drawing.Size(302, 542);
this.stPanel5.TabIndex = 2;
//
// nodeSizeCB
//
@ -99,35 +102,28 @@
this.nodeSizeCB.ButtonColor = System.Drawing.Color.Empty;
this.nodeSizeCB.FormattingEnabled = true;
this.nodeSizeCB.IsReadOnly = false;
this.nodeSizeCB.Location = new System.Drawing.Point(172, 29);
this.nodeSizeCB.Location = new System.Drawing.Point(138, 26);
this.nodeSizeCB.Name = "nodeSizeCB";
this.nodeSizeCB.Size = new System.Drawing.Size(136, 21);
this.nodeSizeCB.Size = new System.Drawing.Size(144, 21);
this.nodeSizeCB.TabIndex = 5;
this.nodeSizeCB.SelectedIndexChanged += new System.EventHandler(this.nodeSizeCB_SelectedIndexChanged);
//
// stPanel4
//
this.stPanel4.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.stPanel4.Controls.Add(this.splitContainer1);
this.stPanel4.Location = new System.Drawing.Point(3, 54);
this.stPanel4.Name = "stPanel4";
this.stPanel4.Size = new System.Drawing.Size(305, 485);
this.stPanel4.TabIndex = 4;
//
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
this.splitContainer1.Location = new System.Drawing.Point(0, 51);
this.splitContainer1.Name = "splitContainer1";
this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Resize += new System.EventHandler(this.splitContainer1_Panel1_Resize);
this.splitContainer1.Panel1Collapsed = true;
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.treeViewCustom1);
this.splitContainer1.Size = new System.Drawing.Size(305, 485);
this.splitContainer1.Size = new System.Drawing.Size(302, 491);
this.splitContainer1.SplitterDistance = 201;
this.splitContainer1.TabIndex = 1;
//
@ -142,7 +138,7 @@
this.treeViewCustom1.Location = new System.Drawing.Point(0, 0);
this.treeViewCustom1.Name = "treeViewCustom1";
this.treeViewCustom1.SelectedImageIndex = 0;
this.treeViewCustom1.Size = new System.Drawing.Size(305, 485);
this.treeViewCustom1.Size = new System.Drawing.Size(302, 491);
this.treeViewCustom1.TabIndex = 0;
this.treeViewCustom1.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.treeViewCustom1_AfterCheck);
this.treeViewCustom1.AfterCollapse += new System.Windows.Forms.TreeViewEventHandler(this.treeViewCustom1_AfterCollapse);
@ -166,7 +162,7 @@
this.searchFormToolStrip});
this.stToolStrip1.Location = new System.Drawing.Point(0, 26);
this.stToolStrip1.Name = "stToolStrip1";
this.stToolStrip1.Size = new System.Drawing.Size(314, 25);
this.stToolStrip1.Size = new System.Drawing.Size(302, 25);
this.stToolStrip1.TabIndex = 3;
this.stToolStrip1.Text = "stToolStrip1";
//
@ -183,7 +179,7 @@
// searchFormToolStrip
//
this.searchFormToolStrip.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.searchFormToolStrip.Image = global::Toolbox.Library.Properties.Resources.Antu_edit_find_mail1;
this.searchFormToolStrip.Image = global::Toolbox.Library.Properties.Resources.Antu_edit_find_mail_svg;
this.searchFormToolStrip.ImageTransparentColor = System.Drawing.Color.Magenta;
this.searchFormToolStrip.Name = "searchFormToolStrip";
this.searchFormToolStrip.Size = new System.Drawing.Size(23, 22);
@ -192,31 +188,20 @@
//
// stPanel3
//
this.stPanel3.Controls.Add(this.searchImgPB);
this.stPanel3.Controls.Add(this.activeEditorChkBox);
this.stPanel3.Controls.Add(this.searchImgPB);
this.stPanel3.Controls.Add(this.objectEditorMenu);
this.stPanel3.Dock = System.Windows.Forms.DockStyle.Top;
this.stPanel3.Location = new System.Drawing.Point(0, 0);
this.stPanel3.Name = "stPanel3";
this.stPanel3.Size = new System.Drawing.Size(314, 26);
this.stPanel3.Size = new System.Drawing.Size(302, 26);
this.stPanel3.TabIndex = 2;
//
// searchImgPB
//
this.searchImgPB.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.searchImgPB.BackColor = System.Drawing.Color.Transparent;
this.searchImgPB.Image = global::Toolbox.Library.Properties.Resources.Antu_edit_find_mail_svg;
this.searchImgPB.Location = new System.Drawing.Point(-654, 5);
this.searchImgPB.Name = "searchImgPB";
this.searchImgPB.Size = new System.Drawing.Size(22, 17);
this.searchImgPB.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.searchImgPB.TabIndex = 1;
this.searchImgPB.TabStop = false;
//
// activeEditorChkBox
//
this.activeEditorChkBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.activeEditorChkBox.AutoSize = true;
this.activeEditorChkBox.Location = new System.Drawing.Point(137, 6);
this.activeEditorChkBox.Location = new System.Drawing.Point(138, 3);
this.activeEditorChkBox.Name = "activeEditorChkBox";
this.activeEditorChkBox.Size = new System.Drawing.Size(144, 17);
this.activeEditorChkBox.TabIndex = 3;
@ -224,6 +209,18 @@
this.activeEditorChkBox.UseVisualStyleBackColor = true;
this.activeEditorChkBox.CheckedChanged += new System.EventHandler(this.activeEditorChkBox_CheckedChanged);
//
// searchImgPB
//
this.searchImgPB.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.searchImgPB.BackColor = System.Drawing.Color.Transparent;
this.searchImgPB.Image = global::Toolbox.Library.Properties.Resources.Antu_edit_find_mail_svg;
this.searchImgPB.Location = new System.Drawing.Point(-666, 5);
this.searchImgPB.Name = "searchImgPB";
this.searchImgPB.Size = new System.Drawing.Size(22, 17);
this.searchImgPB.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.searchImgPB.TabIndex = 1;
this.searchImgPB.TabStop = false;
//
// objectEditorMenu
//
this.objectEditorMenu.Dock = System.Windows.Forms.DockStyle.Fill;
@ -232,7 +229,7 @@
this.viewToolStripMenuItem});
this.objectEditorMenu.Location = new System.Drawing.Point(0, 0);
this.objectEditorMenu.Name = "objectEditorMenu";
this.objectEditorMenu.Size = new System.Drawing.Size(314, 26);
this.objectEditorMenu.Size = new System.Drawing.Size(302, 26);
this.objectEditorMenu.TabIndex = 1;
this.objectEditorMenu.Text = "stContextMenuStrip1";
//
@ -275,6 +272,26 @@
this.dockSearchListToolStripMenuItem.Text = "Dock Search List";
this.dockSearchListToolStripMenuItem.Click += new System.EventHandler(this.dockSearchListToolStripMenuItem_Click);
//
// stPanel2
//
this.stPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.stPanel2.Location = new System.Drawing.Point(14, 0);
this.stPanel2.Name = "stPanel2";
this.stPanel2.Size = new System.Drawing.Size(587, 542);
this.stPanel2.TabIndex = 12;
//
// btnPanelDisplay
//
this.btnPanelDisplay.Dock = System.Windows.Forms.DockStyle.Left;
this.btnPanelDisplay.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnPanelDisplay.Location = new System.Drawing.Point(0, 0);
this.btnPanelDisplay.Name = "btnPanelDisplay";
this.btnPanelDisplay.Size = new System.Drawing.Size(14, 542);
this.btnPanelDisplay.TabIndex = 3;
this.btnPanelDisplay.Text = "<";
this.btnPanelDisplay.UseVisualStyleBackColor = false;
this.btnPanelDisplay.Click += new System.EventHandler(this.btnPanelDisplay_Click);
//
// treeNodeContextMenu
//
this.treeNodeContextMenu.Name = "treeNodeContextMenu";
@ -282,14 +299,15 @@
//
// ObjectEditorTree
//
this.Controls.Add(this.splitter1);
this.Controls.Add(this.stPanel2);
this.Controls.Add(this.stPanel1);
this.Controls.Add(this.splitContainer2);
this.Name = "ObjectEditorTree";
this.Size = new System.Drawing.Size(907, 542);
this.stPanel1.ResumeLayout(false);
this.stPanel1.PerformLayout();
this.stPanel4.ResumeLayout(false);
this.splitContainer2.Panel1.ResumeLayout(false);
this.splitContainer2.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
this.splitContainer2.ResumeLayout(false);
this.stPanel5.ResumeLayout(false);
this.stPanel5.PerformLayout();
this.splitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
@ -305,10 +323,7 @@
}
#endregion
private System.Windows.Forms.Splitter splitter1;
public STPanel stPanel2;
private STPanel stPanel1;
private STPanel stPanel3;
private TreeViewCustom treeViewCustom1;
private System.Windows.Forms.PictureBox searchImgPB;
@ -322,9 +337,11 @@
private STToolStrip stToolStrip1;
private System.Windows.Forms.ToolStripButton searchFormToolStrip;
private System.Windows.Forms.ToolStripButton toolStripButton1;
private STPanel stPanel4;
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.ToolStripMenuItem dockSearchListToolStripMenuItem;
private STComboBox nodeSizeCB;
private STPanel stPanel5;
private STButton btnPanelDisplay;
private System.Windows.Forms.SplitContainer splitContainer2;
}
}

View file

@ -142,12 +142,14 @@ namespace Toolbox.Library.Forms
{
InitializeComponent();
btnPanelDisplay.ForeColor = FormThemes.BaseTheme.DisabledBorderColor;
UpdateSearchPanelDockState();
ObjectEditor = objectEditor;
if (Runtime.ObjectEditor.ListPanelWidth > 0)
stPanel1.Width = Runtime.ObjectEditor.ListPanelWidth;
splitContainer1.Panel1.Width = Runtime.ObjectEditor.ListPanelWidth;
treeViewCustom1.BackColor = FormThemes.BaseTheme.ObjectEditorBackColor;
@ -589,11 +591,6 @@ namespace Toolbox.Library.Forms
{
}
private void stPanel1_Resize(object sender, EventArgs e)
{
Runtime.ObjectEditor.ListPanelWidth = stPanel1.Width;
}
private void activeEditorChkBox_CheckedChanged(object sender, EventArgs e)
{
AddFilesToActiveEditor = activeEditorChkBox.Checked;
@ -860,5 +857,26 @@ namespace Toolbox.Library.Forms
treeViewCustom1.EndUpdate();
}
}
private bool DisplayEditor = true;
private void btnPanelDisplay_Click(object sender, EventArgs e)
{
if (DisplayEditor) {
splitContainer2.Panel1Collapsed = true;
splitContainer2.Panel1.Hide();
DisplayEditor = false;
btnPanelDisplay.Text = ">";
}
else {
splitContainer2.Panel1Collapsed = false;
splitContainer2.Panel1.Show();
DisplayEditor = true;
btnPanelDisplay.Text = "<";
}
}
private void splitContainer1_Panel1_Resize(object sender, EventArgs e) {
Runtime.ObjectEditor.ListPanelWidth = splitContainer1.Panel1.Width;
}
}
}

View file

@ -486,6 +486,8 @@ namespace Toolbox.Library
if (data == null)
throw new Exception("Data is null!");
Console.WriteLine("Decoding " + Format + " " + Runtime.UseDirectXTexDecoder);
if (PlatformSwizzle == PlatformSwizzle.Platform_3DS && !IsCompressed(Format))
{
var Image = BitmapExtension.GetBitmap(ConvertBgraToRgba(CTR_3DS.DecodeBlock(data, (int)width, (int)height, Format)),
@ -513,13 +515,14 @@ namespace Toolbox.Library
case TEX_FORMAT.ETC1_A4:
return BitmapExtension.GetBitmap(ETC1.ETC1Decompress(data, (int)width, (int)height, true),
(int)width, (int)height, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
case TEX_FORMAT.L8:
return BitmapExtension.GetBitmap(RGBAPixelDecoder.Decode(data, (int)width, (int)height, Format),
(int)width, (int)height, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
case TEX_FORMAT.LA8:
return BitmapExtension.GetBitmap(RGBAPixelDecoder.Decode(data, (int)width, (int)height, Format),
(int)width, (int)height, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
}
Console.WriteLine("Decoding " + Format + " " + Runtime.UseDirectXTexDecoder);
if (Runtime.UseDirectXTexDecoder)
{
return BitmapExtension.GetBitmap(DecodeBlock(data, width, height, Format, new byte[0], Parameters),
@ -627,6 +630,11 @@ namespace Toolbox.Library
if (Format == TEX_FORMAT.BC5_SNORM)
imageData = DDSCompressor.DecompressBC5(data, (int)Width, (int)Height, true, true);
if (Format == TEX_FORMAT.L8)
return RGBAPixelDecoder.Decode(data, (int)Width, (int)Height, Format);
if (Format == TEX_FORMAT.LA8)
return RGBAPixelDecoder.Decode(data, (int)Width, (int)Height, Format);
if (IsCompressed(Format))
imageData = DDSCompressor.DecompressBlock(data, (int)Width, (int)Height, (DDS.DXGI_FORMAT)Format);
else

View file

@ -15,6 +15,18 @@ namespace Toolbox.Library.IO
{
public static class IOExtensions
{
public static OpenTK.Vector2 ToTKVector2(this Syroot.Maths.Vector2F vec2) {
return new OpenTK.Vector2(vec2.X, vec2.Y);
}
public static OpenTK.Vector3 ToTKVector3(this Syroot.Maths.Vector3F vec3) {
return new OpenTK.Vector3(vec3.X, vec3.Y, vec3.Z);
}
public static OpenTK.Vector4 ToTKVector4(this Syroot.Maths.Vector4F vec4) {
return new OpenTK.Vector4(vec4.X, vec4.Y, vec4.Z, vec4.W);
}
public static byte[] DeserializeToBytes<T>(this T structure) where T : struct
{
using (MemoryStream stream = new MemoryStream())

View file

@ -45,12 +45,14 @@ namespace Toolbox.Library.IO
foreach (IFileFormat fileFormat in FileManager.GetFileFormats())
{
fileFormat.FileName = Path.GetFileName(FileName);
fileFormat.IFileInfo = new IFileInfo();
foreach (Type type in FileTypes)
{
if (fileFormat.Identify(stream) && fileFormat.GetType() == type)
{
fileFormat.IFileInfo = new IFileInfo();
return OpenFileFormat(FileName, data);
}
}
}
@ -335,10 +337,10 @@ namespace Toolbox.Library.IO
//Most is by magic but some can be extension or name.
fileFormat.FileName = Path.GetFileName(FileName);
fileFormat.IFileInfo = new IFileInfo();
if (fileFormat.Identify(stream))
{
fileFormat.IFileInfo = new IFileInfo();
fileFormat.IFileInfo.DecompressedSize = DecompressedFileSize;
fileFormat.IFileInfo.CompressedSize = CompressedFileSize;
return SetFileFormat(fileFormat, FileName, stream, LeaveStreamOpen, InArchive, archiveNode, Compressed, CompType);

View file

@ -79,6 +79,9 @@ namespace Toolbox.Library
[Browsable(false)]
public virtual IFileFormat OpenFile()
{
if (FileFormat != null)
return FileFormat;
if (FileDataStream != null)
{
return STFileLoader.OpenFileFormat(FileDataStream,
@ -881,10 +884,13 @@ namespace Toolbox.Library
if (file == null) //Format not supported so return
return;
if (file.IFileInfo != null)
file.IFileInfo.ArchiveParent = ArchiveFile;
if (Utils.HasInterface(file.GetType(), typeof(IEditor<>)))
{
OpenControlDialog(file);
else if (Utils.HasInterface(file.GetType(), typeof(IEditorForm<>)))
OpenFormDialog(file);
}
else if (file is IArchiveFile)
{
if (ArchiveFileInfo.FileFormat != null)
@ -912,9 +918,35 @@ namespace Toolbox.Library
ArchiveFileInfo.FileFormat = file;
}
private void OpenFormDialog(IFileFormat fileFormat)
private static Form activeForm;
public void OpenFormDialog(IFileFormat fileFormat)
{
UserControl form = GetEditorForm(fileFormat);
if (activeForm != null)
{
activeForm.Text = (((IFileFormat)fileFormat).FileName);
System.Reflection.MethodInfo methodFill = fileFormat.GetType().GetMethod("FillEditor");
methodFill.Invoke(fileFormat, new object[1] { activeForm });
}
else
{
activeForm = GetEditorForm(fileFormat);
activeForm.Text = (((IFileFormat)fileFormat).FileName);
activeForm.Show();
}
/* if (form.ShowDialog() == DialogResult.OK)
{
if (fileFormat.CanSave)
{
ArchiveFileInfo.SaveFileFormat();
UpdateEditor();
}
}*/
}
private void OpenControlDialog(IFileFormat fileFormat)
{
UserControl form = GetEditorControl(fileFormat);
form.Text = (((IFileFormat)fileFormat).FileName);
var parentForm = LibraryGUI.GetActiveForm();
@ -937,7 +969,21 @@ namespace Toolbox.Library
return;
}
public UserControl GetEditorForm(IFileFormat fileFormat)
public Form GetEditorForm(IFileFormat fileFormat)
{
Type objectType = fileFormat.GetType();
foreach (var inter in objectType.GetInterfaces())
{
if (inter.IsGenericType && inter.GetGenericTypeDefinition() == typeof(IEditorForm<>))
{
System.Reflection.MethodInfo method = objectType.GetMethod("OpenForm");
return (Form)method.Invoke(fileFormat, new object[0]);
}
}
return null;
}
public UserControl GetEditorControl(IFileFormat fileFormat)
{
Type objectType = fileFormat.GetType();
foreach (var inter in objectType.GetInterfaces())
@ -965,7 +1011,7 @@ namespace Toolbox.Library
LibraryGUI.LoadEditor(editor);
}
editor.LoadFile(ArchiveFileInfo);
editor.LoadFile(ArchiveFileInfo, ArchiveFile);
editor.UpdateEditor();
}

View file

@ -57,6 +57,7 @@ namespace Toolbox.Library
public class IFileInfo
{
public CompressionType CompressionType { get; set; }
public IArchiveFile ArchiveParent { get; set; }
public bool FileIsCompressed { get; set; }
public bool FileIsEdited { get; set; }
public bool UseEditMenu { get; set; }

View file

@ -105,17 +105,7 @@ namespace Toolbox.Library.Properties {
/// </summary>
public static System.Drawing.Bitmap Antu_edit_find_mail_svg {
get {
object obj = ResourceManager.GetObject("Antu_edit-find-mail.svg", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap Antu_edit_find_mail1 {
get {
object obj = ResourceManager.GetObject("Antu_edit-find-mail1", resourceCulture);
object obj = ResourceManager.GetObject("Antu_edit_find_mail_svg", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
@ -133,9 +123,9 @@ namespace Toolbox.Library.Properties {
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap arrowMinimize_ {
public static System.Drawing.Bitmap arrowMinimize {
get {
object obj = ResourceManager.GetObject("arrowMinimize ", resourceCulture);
object obj = ResourceManager.GetObject("arrowMinimize", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}

View file

@ -211,9 +211,6 @@
<data name="maximize1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\maximize.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Antu_edit-find-mail.svg" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Antu_edit-find-mail.svg.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="CheckClicked" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\CheckBox\CheckClicked.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@ -316,9 +313,6 @@
<data name="LoadingImage" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\LoadingImage.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Antu_edit-find-mail1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Antu_edit-find-mail.svg.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="InjectTexErrored" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\InjectTexErrored.dds;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
@ -352,9 +346,6 @@
<data name="materialSphereTransparent" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\materialSphereTransparent.tif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="arrowMinimize " type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\arrowMinimize .png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="UVPattern" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\UVPattern.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@ -385,4 +376,10 @@
<data name="AddIcon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\AddIcon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Antu_edit_find_mail_svg" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Antu_edit-find-mail.svg.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="arrowMinimize" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\arrowMinimize .png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

View file

@ -1317,6 +1317,27 @@
<ItemGroup>
<None Include="Resources\AddIcon.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\Layout\AlignmentPane.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\Layout\BoundryPane.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\Layout\NullPane.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\Layout\PicturePane.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\Layout\ScissorPane.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\Layout\TextPane.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\Layout\WindowPane.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>

View file

@ -35,6 +35,7 @@
this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.newFromFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.openFolderToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.recentToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -70,7 +71,6 @@
this.stToolStrip1 = new Toolbox.Library.Forms.STToolStrip();
this.saveToolStripButton = new System.Windows.Forms.ToolStripButton();
this.updateToolstrip = new System.Windows.Forms.ToolStripButton();
this.openFolderToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuStrip1.SuspendLayout();
this.stPanel1.SuspendLayout();
this.tabControlContextMenuStrip.SuspendLayout();
@ -119,33 +119,40 @@
// newToolStripMenuItem
//
this.newToolStripMenuItem.Name = "newToolStripMenuItem";
this.newToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.newToolStripMenuItem.Size = new System.Drawing.Size(150, 22);
this.newToolStripMenuItem.Text = "New";
//
// newFromFileToolStripMenuItem
//
this.newFromFileToolStripMenuItem.Name = "newFromFileToolStripMenuItem";
this.newFromFileToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.newFromFileToolStripMenuItem.Size = new System.Drawing.Size(150, 22);
this.newFromFileToolStripMenuItem.Text = "New From File";
//
// openToolStripMenuItem
//
this.openToolStripMenuItem.Name = "openToolStripMenuItem";
this.openToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.openToolStripMenuItem.Size = new System.Drawing.Size(150, 22);
this.openToolStripMenuItem.Text = "Open";
this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click);
//
// openFolderToolStripMenuItem
//
this.openFolderToolStripMenuItem.Name = "openFolderToolStripMenuItem";
this.openFolderToolStripMenuItem.Size = new System.Drawing.Size(150, 22);
this.openFolderToolStripMenuItem.Text = "Open (Folder)";
this.openFolderToolStripMenuItem.Click += new System.EventHandler(this.openFolderToolStripMenuItem_Click);
//
// recentToolStripMenuItem
//
this.recentToolStripMenuItem.Name = "recentToolStripMenuItem";
this.recentToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.recentToolStripMenuItem.Size = new System.Drawing.Size(150, 22);
this.recentToolStripMenuItem.Text = "Recent";
//
// saveToolStripMenuItem
//
this.saveToolStripMenuItem.Enabled = false;
this.saveToolStripMenuItem.Name = "saveToolStripMenuItem";
this.saveToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.saveToolStripMenuItem.Size = new System.Drawing.Size(150, 22);
this.saveToolStripMenuItem.Text = "Save";
this.saveToolStripMenuItem.Click += new System.EventHandler(this.saveToolStripMenuItem_Click);
//
@ -153,14 +160,14 @@
//
this.saveAsToolStripMenuItem.Enabled = false;
this.saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem";
this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(150, 22);
this.saveAsToolStripMenuItem.Text = "Save As";
this.saveAsToolStripMenuItem.Click += new System.EventHandler(this.saveAsToolStripMenuItem_Click);
//
// exitToolStripMenuItem
//
this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
this.exitToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.exitToolStripMenuItem.Size = new System.Drawing.Size(150, 22);
this.exitToolStripMenuItem.Text = "Exit";
this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
//
@ -328,7 +335,7 @@
// tabForms
//
this.tabForms.Dock = System.Windows.Forms.DockStyle.Top;
this.tabForms.Location = new System.Drawing.Point(0, 55);
this.tabForms.Location = new System.Drawing.Point(0, 49);
this.tabForms.myBackColor = System.Drawing.Color.Empty;
this.tabForms.Name = "tabForms";
this.tabForms.SelectedIndex = 0;
@ -361,7 +368,7 @@
this.stPanel2.Dock = System.Windows.Forms.DockStyle.Top;
this.stPanel2.Location = new System.Drawing.Point(0, 25);
this.stPanel2.Name = "stPanel2";
this.stPanel2.Size = new System.Drawing.Size(1108, 30);
this.stPanel2.Size = new System.Drawing.Size(1108, 24);
this.stPanel2.TabIndex = 7;
//
// BtnMdiMinimize
@ -371,7 +378,7 @@
this.BtnMdiMinimize.Image = ((System.Drawing.Image)(resources.GetObject("BtnMdiMinimize.Image")));
this.BtnMdiMinimize.Location = new System.Drawing.Point(991, 2);
this.BtnMdiMinimize.Name = "BtnMdiMinimize";
this.BtnMdiMinimize.Size = new System.Drawing.Size(38, 25);
this.BtnMdiMinimize.Size = new System.Drawing.Size(38, 22);
this.BtnMdiMinimize.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.BtnMdiMinimize.TabIndex = 6;
this.BtnMdiMinimize.TabStop = false;
@ -386,7 +393,7 @@
this.BtnMdiMinMax.Image = ((System.Drawing.Image)(resources.GetObject("BtnMdiMinMax.Image")));
this.BtnMdiMinMax.Location = new System.Drawing.Point(1029, 2);
this.BtnMdiMinMax.Name = "BtnMdiMinMax";
this.BtnMdiMinMax.Size = new System.Drawing.Size(38, 25);
this.BtnMdiMinMax.Size = new System.Drawing.Size(38, 22);
this.BtnMdiMinMax.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.BtnMdiMinMax.TabIndex = 5;
this.BtnMdiMinMax.TabStop = false;
@ -401,7 +408,7 @@
this.BtnMdiClose.Image = ((System.Drawing.Image)(resources.GetObject("BtnMdiClose.Image")));
this.BtnMdiClose.Location = new System.Drawing.Point(1067, 2);
this.BtnMdiClose.Name = "BtnMdiClose";
this.BtnMdiClose.Size = new System.Drawing.Size(38, 25);
this.BtnMdiClose.Size = new System.Drawing.Size(38, 22);
this.BtnMdiClose.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.BtnMdiClose.TabIndex = 4;
this.BtnMdiClose.TabStop = false;
@ -417,7 +424,7 @@
this.updateToolstrip});
this.stToolStrip1.Location = new System.Drawing.Point(0, 0);
this.stToolStrip1.Name = "stToolStrip1";
this.stToolStrip1.Size = new System.Drawing.Size(1108, 30);
this.stToolStrip1.Size = new System.Drawing.Size(1108, 24);
this.stToolStrip1.TabIndex = 0;
this.stToolStrip1.Text = "stToolStrip1";
//
@ -428,7 +435,7 @@
this.saveToolStripButton.Image = global::Toolbox.Properties.Resources.Save;
this.saveToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
this.saveToolStripButton.Name = "saveToolStripButton";
this.saveToolStripButton.Size = new System.Drawing.Size(23, 27);
this.saveToolStripButton.Size = new System.Drawing.Size(23, 21);
this.saveToolStripButton.Text = "saveToolStripButton1";
this.saveToolStripButton.ToolTipText = "Save File";
this.saveToolStripButton.Click += new System.EventHandler(this.saveToolStripButton_Click);
@ -440,18 +447,11 @@
this.updateToolstrip.Image = global::Toolbox.Properties.Resources.UpdateIcon;
this.updateToolstrip.ImageTransparentColor = System.Drawing.Color.Magenta;
this.updateToolstrip.Name = "updateToolstrip";
this.updateToolstrip.Size = new System.Drawing.Size(23, 27);
this.updateToolstrip.Size = new System.Drawing.Size(23, 21);
this.updateToolstrip.Text = "toolStripButton1";
this.updateToolstrip.ToolTipText = "Update Tool";
this.updateToolstrip.Click += new System.EventHandler(this.updateToolstrip_Click);
//
// openFolderToolStripMenuItem
//
this.openFolderToolStripMenuItem.Name = "openFolderToolStripMenuItem";
this.openFolderToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.openFolderToolStripMenuItem.Text = "Open (Folder)";
this.openFolderToolStripMenuItem.Click += new System.EventHandler(this.openFolderToolStripMenuItem_Click);
//
// MainForm
//
this.AllowDrop = true;

View file

@ -308,7 +308,6 @@ namespace Toolbox
var form = (Form)method.Invoke(file, new object[0]);
TabDupeIndex = 0;
form.Text = CheckTabDupes(((IFileFormat)file).FileName);
form.MdiParent = this;
form.Show();
HasEditorActive = true;

View file

@ -503,6 +503,9 @@
<Content Include="Lib\WeifenLuo.WinFormsUI.Docking.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Lib\WeifenLuo.WinFormsUI.Docking.ThemeVS2015.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="LZ4.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>

Binary file not shown.

Binary file not shown.

Binary file not shown.