From 67014c4d39383ab413c3a2c23ecb623567e50cbe Mon Sep 17 00:00:00 2001 From: dexy Date: Sun, 21 Nov 2021 00:20:03 +1100 Subject: [PATCH] Fix for selecting multiple entities in MLO via project explorer --- CodeWalker/Project/ProjectForm.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CodeWalker/Project/ProjectForm.cs b/CodeWalker/Project/ProjectForm.cs index dcc79af..11e45a8 100644 --- a/CodeWalker/Project/ProjectForm.cs +++ b/CodeWalker/Project/ProjectForm.cs @@ -765,6 +765,19 @@ namespace CodeWalker.Project { if (item is object[] arr) { + + for (int i = 0; i < arr.Length; i++) + { + if (arr[i] is MCEntityDef mcent)//for MLO entities, need to transform this into an actual entity instance + { + var instance = TryGetMloInstance(mcent.OwnerMlo); + if (instance != null) + { + arr[i] = instance.TryGetYmapEntity(mcent); + } + } + } + var multisel = MapSelection.FromProjectObject(arr); //convert to MapSelection array item = multisel.MultipleSelectionItems; }