From c67e8dec89b61d32b1e2cbd26d0e4c0758457e94 Mon Sep 17 00:00:00 2001 From: spherallic Date: Tue, 28 May 2024 15:54:36 +0200 Subject: [PATCH] Maintain category of edited existing thing's info --- Source/Core/SRB2/LuaMobjStructure.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Source/Core/SRB2/LuaMobjStructure.cs b/Source/Core/SRB2/LuaMobjStructure.cs index dd315dfc..b17e92ea 100644 --- a/Source/Core/SRB2/LuaMobjStructure.cs +++ b/Source/Core/SRB2/LuaMobjStructure.cs @@ -12,13 +12,13 @@ namespace CodeImp.DoomBuilder.ZDoom public sealed class LuaMobjStructure : ActorStructure { - #region ================== DECORATE Actor Structure parsing + #region ================== Lua Actor Structure parsing internal LuaMobjStructure(ZDTextParser zdparser, string objname, int editnum) { classname = string.Empty; - LuaParser parser = (LuaParser)zdparser; + LuaParser parser = (LuaParser)zdparser; bool done = false; //mxd General.WriteLogLine(objname); @@ -31,7 +31,15 @@ namespace CodeImp.DoomBuilder.ZDoom props["$title"] = new List { objname }; if (editnum > 0) - doomednum = editnum; + { + Dictionary thingtypes = General.Map.Config.GetThingTypes(); + thingtypes.TryGetValue(editnum, out ThingTypeInfo ti); + if (ti != null) + { + doomednum = editnum; + props["category"] = new List() { ti.Category.Title }; + } + } // Now parse the contents of actor structure