Initialize doc color of display types

main
copygirl 12 months ago
parent 50c3ccd014
commit 330c11f217
  1. 23
      src/gaemstone.Client/Systems/EntityInspector.cs

@ -14,6 +14,7 @@ namespace gaemstone.Client.Systems;
[Module]
[DependsOn<gaemstone.Client.Systems.ImGuiManager>]
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<Doc.DisplayType>, Set<Priority>(0), Set<Icon>(ForkAwesome.Archive)]
public struct Module { }
[Path("/flecs/system/System")]
// [Doc(Color = "#FFB2B2")]
[Add<Doc.DisplayType>, Set<Priority>(1), Set<Icon>(ForkAwesome.Cog)]
public struct System { }
[Path("/flecs/core/Observer")]
// [Doc(Color = "#FFCCCC")]
[Add<Doc.DisplayType>, Set<Priority>(2), Set<Icon>(ForkAwesome.Eye)]
public struct Observer { }
[Path("/gaemstone/Doc/Relation")]
// [Doc(Color = "#B2FFCC")]
[Add<Doc.DisplayType>, Set<Priority>(3), Set<Icon>(ForkAwesome.ShareAlt)]
public struct Relation { }
[Path("/flecs/core/Component")]
// [Doc(Color = "#9999FF")]
[Add<Doc.DisplayType>, Set<Priority>(4), Set<Icon>(ForkAwesome.PencilSquare)]
public struct Component { }
[Path("/gaemstone/Doc/Tag")]
// [Doc(Color = "#B2CCFF")]
[Add<Doc.DisplayType>, Set<Priority>(5), Set<Icon>(ForkAwesome.Tag)]
public struct Tag { }
[Path("/flecs/core/Prefab")]
// [Doc(Color = "#E4CCFF")]
[Add<Doc.DisplayType>, Set<Priority>(6), Set<Icon>(ForkAwesome.Cube)]
public struct Prefab { }
@ -97,6 +91,21 @@ public partial class EntityInspector
private const string DefaultWindowTitle = "Inspector Gadget";
public static void OnEnable<T>(Entity<T> 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<T>(Entity<T> module) { }
[System]
public static void ShowUIButton<T>(World<T> world, ImGuiData _)
{

Loading…
Cancel
Save