2018-03-03 21:03:08 +08:00
|
|
|
|
using CodeWalker.GameFiles;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
|
|
|
|
namespace CodeWalker.Project.Panels
|
|
|
|
|
{
|
|
|
|
|
public partial class EditYtypPanel : ProjectPanel
|
|
|
|
|
{
|
2018-03-03 21:09:31 +08:00
|
|
|
|
public ProjectForm ProjectForm;
|
2018-03-03 21:03:08 +08:00
|
|
|
|
public YtypFile Ytyp { get; set; }
|
|
|
|
|
|
|
|
|
|
//private bool populatingui = false;
|
|
|
|
|
private bool waschanged = false;
|
|
|
|
|
|
2018-03-03 21:09:31 +08:00
|
|
|
|
public EditYtypPanel(ProjectForm projectForm)
|
2018-03-03 21:03:08 +08:00
|
|
|
|
{
|
|
|
|
|
ProjectForm = projectForm;
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void SetYtyp(YtypFile ytyp)
|
|
|
|
|
{
|
|
|
|
|
Ytyp = ytyp;
|
|
|
|
|
Tag = ytyp;
|
|
|
|
|
UpdateFormTitle();
|
|
|
|
|
UpdateYtypUI();
|
|
|
|
|
waschanged = ytyp?.HasChanged ?? false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void UpdateFormTitleYtypChanged()
|
|
|
|
|
{
|
|
|
|
|
bool changed = Ytyp.HasChanged;
|
|
|
|
|
if (!waschanged && changed)
|
|
|
|
|
{
|
|
|
|
|
UpdateFormTitle();
|
|
|
|
|
waschanged = true;
|
|
|
|
|
}
|
|
|
|
|
else if (waschanged && !changed)
|
|
|
|
|
{
|
|
|
|
|
UpdateFormTitle();
|
|
|
|
|
waschanged = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
private void UpdateFormTitle()
|
|
|
|
|
{
|
|
|
|
|
string fn = Ytyp.RpfFileEntry?.Name ?? Ytyp.Name;
|
|
|
|
|
if (string.IsNullOrEmpty(fn)) fn = "untitled.ytyp";
|
|
|
|
|
Text = fn + (Ytyp.HasChanged ? "*" : "");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void UpdateYtypUI()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|