2019-08-01 21:47:35 +00:00
|
|
|
|
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;
|
|
|
|
|
|
2019-08-27 20:38:06 +00:00
|
|
|
|
namespace FirstPlugin.Forms
|
2019-08-01 21:47:35 +00:00
|
|
|
|
{
|
|
|
|
|
public partial class LayoutEditor : UserControl
|
|
|
|
|
{
|
2019-08-27 20:38:06 +00:00
|
|
|
|
public List<BFLYT.Header> LayoutFiles = new List<BFLYT.Header>();
|
|
|
|
|
|
2019-08-28 01:14:37 +00:00
|
|
|
|
private BFLYT.Header ActiveLayout;
|
|
|
|
|
|
2019-08-27 20:38:06 +00:00
|
|
|
|
public enum DockLayout
|
|
|
|
|
{
|
|
|
|
|
Default,
|
|
|
|
|
Animation,
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-01 21:47:35 +00:00
|
|
|
|
public LayoutEditor()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
}
|
2019-08-27 20:38:06 +00:00
|
|
|
|
|
2019-08-28 01:14:37 +00:00
|
|
|
|
private bool isLoaded = false;
|
2019-08-27 20:38:06 +00:00
|
|
|
|
public void LoadBflyt(BFLYT.Header header, string fileName)
|
|
|
|
|
{
|
2019-08-28 01:14:37 +00:00
|
|
|
|
if (isLoaded) return;
|
|
|
|
|
|
2019-08-27 20:38:06 +00:00
|
|
|
|
LayoutViewer viewer = new LayoutViewer();
|
2019-08-27 23:03:01 +00:00
|
|
|
|
viewer.Dock = DockStyle.Fill;
|
2019-08-28 01:14:37 +00:00
|
|
|
|
viewer.TopLevel = false;
|
|
|
|
|
viewer.FormBorderStyle = FormBorderStyle.SizableToolWindow;
|
|
|
|
|
stPanel1.Controls.Add(viewer);
|
|
|
|
|
|
|
|
|
|
isLoaded = true;
|
|
|
|
|
ActiveLayout = header;
|
2019-08-27 20:38:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
2019-08-28 01:14:37 +00:00
|
|
|
|
|
|
|
|
|
|
2019-08-27 20:38:06 +00:00
|
|
|
|
public void LoadBflan()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void InitalizeEditors()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
2019-08-28 01:14:37 +00:00
|
|
|
|
|
|
|
|
|
private void LayoutEditor_ParentChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (this.ParentForm == null) return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void textureListToolStripMenuItem_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
LayoutTextureList textureListForm = new LayoutTextureList();
|
|
|
|
|
textureListForm.LoadTextures(ActiveLayout);
|
|
|
|
|
|
|
|
|
|
if (ParentForm != null && ParentForm.TopLevel)
|
|
|
|
|
textureListForm.Show(ParentForm);
|
|
|
|
|
else
|
|
|
|
|
textureListForm.Show();
|
|
|
|
|
}
|
2019-08-01 21:47:35 +00:00
|
|
|
|
}
|
|
|
|
|
}
|