From 330c11f217ea340d00229af697f6ebc72dd4210e Mon Sep 17 00:00:00 2001 From: copygirl Date: Tue, 16 May 2023 13:13:06 +0200 Subject: [PATCH] Initialize doc color of display types --- .../Systems/EntityInspector.cs | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/gaemstone.Client/Systems/EntityInspector.cs b/src/gaemstone.Client/Systems/EntityInspector.cs index b4d4681..d9737a4 100644 --- a/src/gaemstone.Client/Systems/EntityInspector.cs +++ b/src/gaemstone.Client/Systems/EntityInspector.cs @@ -14,6 +14,7 @@ namespace gaemstone.Client.Systems; [Module] [DependsOn] public partial class EntityInspector + : IModuleLifetime { [Tag] public struct InspectorWindow { } @@ -59,37 +60,30 @@ public partial class EntityInspector [Path("/flecs/core/Module")] - // [Doc(Color = "#FFE4B2")] [Add, Set(0), Set(ForkAwesome.Archive)] public struct Module { } [Path("/flecs/system/System")] - // [Doc(Color = "#FFB2B2")] [Add, Set(1), Set(ForkAwesome.Cog)] public struct System { } [Path("/flecs/core/Observer")] - // [Doc(Color = "#FFCCCC")] [Add, Set(2), Set(ForkAwesome.Eye)] public struct Observer { } [Path("/gaemstone/Doc/Relation")] - // [Doc(Color = "#B2FFCC")] [Add, Set(3), Set(ForkAwesome.ShareAlt)] public struct Relation { } [Path("/flecs/core/Component")] - // [Doc(Color = "#9999FF")] [Add, Set(4), Set(ForkAwesome.PencilSquare)] public struct Component { } [Path("/gaemstone/Doc/Tag")] - // [Doc(Color = "#B2CCFF")] [Add, Set(5), Set(ForkAwesome.Tag)] public struct Tag { } [Path("/flecs/core/Prefab")] - // [Doc(Color = "#E4CCFF")] [Add, Set(6), Set(ForkAwesome.Cube)] public struct Prefab { } @@ -97,6 +91,21 @@ public partial class EntityInspector private const string DefaultWindowTitle = "Inspector Gadget"; + public static void OnEnable(Entity module) + { + var world = module.World; + world.LookupPathOrNull("/flecs/core/Module")?.SetDocColor("#FFE4B2"); + world.LookupPathOrNull("/flecs/system/System")?.SetDocColor("#FFB2B2"); + world.LookupPathOrNull("/flecs/core/Observer")?.SetDocColor("#FFCCCC"); + world.LookupPathOrNull("/gaemstone/Doc/Relation")?.SetDocColor("#B2FFCC"); + world.LookupPathOrNull("/flecs/core/Component")?.SetDocColor("#9999FF"); + world.LookupPathOrNull("/gaemstone/Doc/Tag")?.SetDocColor("#B2CCFF"); + world.LookupPathOrNull("/flecs/core/Prefab")?.SetDocColor("#E4CCFF"); + } + + public static void OnDisable(Entity module) { } + + [System] public static void ShowUIButton(World world, ImGuiData _) {