mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2026-05-17 05:06:18 +08:00
Collisions editing progress
This commit is contained in:
@@ -0,0 +1,77 @@
|
||||
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 EditYbnPanel : ProjectPanel
|
||||
{
|
||||
public ProjectForm ProjectForm;
|
||||
public YbnFile Ybn { get; set; }
|
||||
|
||||
//private bool populatingui = false;
|
||||
private bool waschanged = false;
|
||||
|
||||
public EditYbnPanel(ProjectForm projectForm)
|
||||
{
|
||||
ProjectForm = projectForm;
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public void SetYbn(YbnFile ybn)
|
||||
{
|
||||
Ybn = ybn;
|
||||
Tag = ybn;
|
||||
UpdateFormTitle();
|
||||
UpdateUI();
|
||||
waschanged = ybn?.HasChanged ?? false;
|
||||
}
|
||||
|
||||
public void UpdateFormTitleYbnChanged()
|
||||
{
|
||||
bool changed = Ybn?.HasChanged ?? false;
|
||||
if (!waschanged && changed)
|
||||
{
|
||||
UpdateFormTitle();
|
||||
waschanged = true;
|
||||
}
|
||||
else if (waschanged && !changed)
|
||||
{
|
||||
UpdateFormTitle();
|
||||
waschanged = false;
|
||||
}
|
||||
}
|
||||
private void UpdateFormTitle()
|
||||
{
|
||||
string fn = Ybn?.RpfFileEntry?.Name ?? Ybn?.Name;
|
||||
if (string.IsNullOrEmpty(fn)) fn = "untitled.ybn";
|
||||
Text = fn + ((Ybn?.HasChanged??false) ? "*" : "");
|
||||
}
|
||||
|
||||
|
||||
public void UpdateUI()
|
||||
{
|
||||
if (Ybn?.Bounds == null)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
var b = Ybn.Bounds;
|
||||
//populatingui = true;
|
||||
|
||||
|
||||
//populatingui = false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user