mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2026-05-14 21:16:03 +08:00
MLO editing progress
This commit is contained in:
@@ -130,10 +130,15 @@ namespace CodeWalker.Project.Panels
|
||||
MiloFloorIDTextBox.Text = milo.floorId.ToString();
|
||||
MiloNumExitPortalsTextBox.Text = milo.numExitPortals.ToString();
|
||||
MiloFlagsTextBox.Text = milo.MLOInstflags.ToString();
|
||||
foreach (var sets in CurrentEntity.MloInstance.EntitySets)
|
||||
if (CurrentEntity.MloInstance.EntitySets != null)
|
||||
{
|
||||
MloInstanceEntitySet set = sets.Value;
|
||||
MiloEntitySetsListBox.Items.Add(set.EntitySet.ToString(), set.Visible);
|
||||
foreach (var set in CurrentEntity.MloInstance.EntitySets)
|
||||
{
|
||||
if (set?.EntitySet != null)
|
||||
{
|
||||
MiloEntitySetsListBox.Items.Add(set.EntitySet.ToString(), set.Visible);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -793,11 +798,9 @@ namespace CodeWalker.Project.Panels
|
||||
{
|
||||
if (populatingui) return;
|
||||
var inst = CurrentEntity?.MloInstance;
|
||||
var mloarch = CurrentEntity?.Archetype as MloArchetype;
|
||||
if ((inst != null) && (mloarch != null))
|
||||
if ((inst != null) && (inst.EntitySets != null) && (e.Index < inst.EntitySets.Length) && (e.Index >= 0))
|
||||
{
|
||||
MloInstanceEntitySet mloInstanceEntitySet = inst.EntitySets[mloarch.entitySets[e.Index]._Data.name];
|
||||
mloInstanceEntitySet.Visible = e.NewValue == CheckState.Checked;
|
||||
inst.EntitySets[e.Index].Visible = e.NewValue == CheckState.Checked;
|
||||
return;
|
||||
}
|
||||
e.NewValue = CheckState.Unchecked;
|
||||
|
||||
@@ -82,7 +82,7 @@ namespace CodeWalker.Project.Panels
|
||||
TreeNode tn = ProjectForm.ProjectExplorer?.FindMloRoomTreeNode(CurrentRoom);
|
||||
if (tn != null)
|
||||
{
|
||||
tn.Text = CurrentRoom.RoomName;
|
||||
tn.Text = CurrentRoom.Index.ToString() + ": " + CurrentRoom.RoomName;
|
||||
}
|
||||
|
||||
UpdateFormTitle();
|
||||
|
||||
@@ -281,7 +281,7 @@ namespace CodeWalker.Project.Panels
|
||||
for (int j = 0; j < rooms.Length; j++)
|
||||
{
|
||||
var room = rooms[j];
|
||||
var roomnode = roomsnode.Nodes.Add(room.RoomName);
|
||||
var roomnode = roomsnode.Nodes.Add(room.Index.ToString() + ": " + room.RoomName);
|
||||
roomnode.Tag = room;
|
||||
var roomentities = room.AttachedObjects;
|
||||
if ((roomentities != null) && (entities != null))
|
||||
@@ -646,6 +646,10 @@ namespace CodeWalker.Project.Panels
|
||||
}
|
||||
public void SetYmapHasChanged(YmapFile ymap, bool changed)
|
||||
{
|
||||
if (ymap != null)
|
||||
{
|
||||
ymap.HasChanged = true;
|
||||
}
|
||||
if (ProjectTreeView.Nodes.Count > 0)
|
||||
{
|
||||
var pnode = ProjectTreeView.Nodes[0];
|
||||
@@ -670,6 +674,10 @@ namespace CodeWalker.Project.Panels
|
||||
}
|
||||
public void SetYtypHasChanged(YtypFile ytyp, bool changed)
|
||||
{
|
||||
if (ytyp != null)
|
||||
{
|
||||
ytyp.HasChanged = true;
|
||||
}
|
||||
if (ProjectTreeView.Nodes.Count > 0)
|
||||
{
|
||||
var pnode = ProjectTreeView.Nodes[0];
|
||||
@@ -694,6 +702,10 @@ namespace CodeWalker.Project.Panels
|
||||
}
|
||||
public void SetYndHasChanged(YndFile ynd, bool changed)
|
||||
{
|
||||
if (ynd != null)
|
||||
{
|
||||
ynd.HasChanged = true;
|
||||
}
|
||||
if (ProjectTreeView.Nodes.Count > 0)
|
||||
{
|
||||
var pnode = ProjectTreeView.Nodes[0];
|
||||
@@ -718,6 +730,10 @@ namespace CodeWalker.Project.Panels
|
||||
}
|
||||
public void SetYnvHasChanged(YnvFile ynv, bool changed)
|
||||
{
|
||||
if (ynv != null)
|
||||
{
|
||||
ynv.HasChanged = true;
|
||||
}
|
||||
if (ProjectTreeView.Nodes.Count > 0)
|
||||
{
|
||||
var pnode = ProjectTreeView.Nodes[0];
|
||||
@@ -742,6 +758,10 @@ namespace CodeWalker.Project.Panels
|
||||
}
|
||||
public void SetTrainTrackHasChanged(TrainTrack track, bool changed)
|
||||
{
|
||||
if (track != null)
|
||||
{
|
||||
track.HasChanged = true;
|
||||
}
|
||||
if (ProjectTreeView.Nodes.Count > 0)
|
||||
{
|
||||
var pnode = ProjectTreeView.Nodes[0];
|
||||
@@ -766,6 +786,10 @@ namespace CodeWalker.Project.Panels
|
||||
}
|
||||
public void SetScenarioHasChanged(YmtFile scenario, bool changed)
|
||||
{
|
||||
if (scenario != null)
|
||||
{
|
||||
scenario.HasChanged = true;
|
||||
}
|
||||
if (ProjectTreeView.Nodes.Count > 0)
|
||||
{
|
||||
var pnode = ProjectTreeView.Nodes[0];
|
||||
@@ -790,6 +814,10 @@ namespace CodeWalker.Project.Panels
|
||||
}
|
||||
public void SetAudioRelHasChanged(RelFile rel, bool changed)
|
||||
{
|
||||
if (rel != null)
|
||||
{
|
||||
rel.HasChanged = true;
|
||||
}
|
||||
if (ProjectTreeView.Nodes.Count > 0)
|
||||
{
|
||||
var pnode = ProjectTreeView.Nodes[0];
|
||||
@@ -814,6 +842,10 @@ namespace CodeWalker.Project.Panels
|
||||
}
|
||||
public void SetGrassBatchHasChanged(YmapGrassInstanceBatch batch, bool changed)
|
||||
{
|
||||
if (batch?.Ymap != null)
|
||||
{
|
||||
batch.Ymap.HasChanged = true;
|
||||
}
|
||||
if (ProjectTreeView.Nodes.Count > 0)
|
||||
{
|
||||
var gbnode = FindGrassTreeNode(batch);
|
||||
@@ -1791,6 +1823,33 @@ namespace CodeWalker.Project.Panels
|
||||
tn.Parent.Nodes.Remove(tn);
|
||||
}
|
||||
}
|
||||
public void RemoveMloRoomTreeNode(MCMloRoomDef room)
|
||||
{
|
||||
var tn = FindMloRoomTreeNode(room);
|
||||
if ((tn != null) && (tn.Parent != null))
|
||||
{
|
||||
tn.Parent.Text = "Rooms (" + (room.OwnerMlo?.rooms?.Length.ToString() ?? "0") + ")";
|
||||
tn.Parent.Nodes.Remove(tn);
|
||||
}
|
||||
}
|
||||
public void RemoveMloPortalTreeNode(MCMloPortalDef portal)
|
||||
{
|
||||
var tn = FindMloPortalTreeNode(portal);
|
||||
if ((tn != null) && (tn.Parent != null))
|
||||
{
|
||||
tn.Parent.Text = "Portals (" + (portal.OwnerMlo?.portals?.Length.ToString() ?? "0") + ")";
|
||||
tn.Parent.Nodes.Remove(tn);
|
||||
}
|
||||
}
|
||||
public void RemoveMloEntitySetTreeNode(MCMloEntitySet set)
|
||||
{
|
||||
var tn = FindMloEntitySetTreeNode(set);
|
||||
if ((tn != null) && (tn.Parent != null))
|
||||
{
|
||||
tn.Parent.Text = "Entity Sets (" + (set.OwnerMlo?.entitySets?.Length.ToString() ?? "0") + ")";
|
||||
tn.Parent.Nodes.Remove(tn);
|
||||
}
|
||||
}
|
||||
public void RemovePathNodeTreeNode(YndNode node)
|
||||
{
|
||||
var tn = FindPathNodeTreeNode(node);
|
||||
|
||||
Reference in New Issue
Block a user