mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2024-11-25 08:22:54 +08:00
Moved UpdateEntityTreeNode code into ProjectExplorer
This commit is contained in:
parent
7922cff694
commit
89e838550f
@ -234,26 +234,6 @@ namespace CodeWalker.Project.Panels
|
||||
EntityArchetypeHashLabel.Text += " (not found)";
|
||||
}
|
||||
|
||||
TreeNode tn = ProjectForm.ProjectExplorer?.FindEntityTreeNode(CurrentEntity);
|
||||
if (tn != null)
|
||||
{
|
||||
if (ProjectForm.displayentityindexes)
|
||||
tn.Text = $"[{tn.Index}] {name}";
|
||||
else
|
||||
tn.Text = name;
|
||||
}
|
||||
else
|
||||
{
|
||||
tn = ProjectForm.ProjectExplorer?.FindMloEntityTreeNode(CurrentMCEntity);
|
||||
if (tn != null)
|
||||
{
|
||||
if (ProjectForm.displayentityindexes)
|
||||
tn.Text = $"[{tn.Index}] {name}";
|
||||
else
|
||||
tn.Text = name;
|
||||
}
|
||||
}
|
||||
|
||||
if (CurrentEntity != null)
|
||||
{
|
||||
lock (ProjectForm.ProjectSyncRoot)
|
||||
@ -278,6 +258,8 @@ namespace CodeWalker.Project.Panels
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ProjectForm.ProjectExplorer?.UpdateEntityTreeNode(CurrentEntity);
|
||||
}
|
||||
|
||||
private void ProjectItemChanged()
|
||||
|
@ -2092,6 +2092,32 @@ namespace CodeWalker.Project.Panels
|
||||
tn.Text = archetype._BaseArchetypeDef.ToString();
|
||||
}
|
||||
}
|
||||
public void UpdateEntityTreeNode(YmapEntityDef ent)
|
||||
{
|
||||
if (ent == null) return;
|
||||
var tn = FindEntityTreeNode(ent);
|
||||
var name = ent.CEntityDef.archetypeName.ToString();
|
||||
if (tn != null)
|
||||
{
|
||||
if (ProjectForm.displayentityindexes)
|
||||
tn.Text = $"[{tn.Index}] {name}";
|
||||
else
|
||||
tn.Text = name;
|
||||
}
|
||||
else
|
||||
{
|
||||
var instance = ent.MloParent?.MloInstance;
|
||||
var mcent = instance?.TryGetArchetypeEntity(ent);
|
||||
tn = FindMloEntityTreeNode(mcent);
|
||||
if (tn != null)
|
||||
{
|
||||
if (ProjectForm.displayentityindexes)
|
||||
tn.Text = $"[{tn.Index}] {name}";
|
||||
else
|
||||
tn.Text = name;
|
||||
}
|
||||
}
|
||||
}
|
||||
public void UpdateCarGenTreeNode(YmapCarGen cargen)
|
||||
{
|
||||
var tn = FindCarGenTreeNode(cargen);
|
||||
|
Loading…
Reference in New Issue
Block a user