Automatic switch between Player <-> Editor Tabs

+ Allow Editor to inject into Settings
This commit is contained in:
Simon Lübeß
2023-08-14 22:10:27 +02:00
parent f71e851ab5
commit a112fcc64a
4 changed files with 203 additions and 92 deletions
+8 -2
View File
@@ -23,11 +23,13 @@ namespace GlitchyEngine
{
public String Category;
public String Name;
public String Tooltip;
public this(String category, String name)
public this(String category, String name, String tooltip = "")
{
Category = category;
Name = name;
Tooltip = tooltip;
}
}
@@ -38,6 +40,8 @@ namespace GlitchyEngine
[SettingContainer, BonInclude]
public readonly ImGuiSettings ImGuiSettings = new .() ~ delete _;
#endif
[BonIgnore]
public Event<EventHandler> OnApplySettings = .() ~ _.Dispose();
/*
[BonInclude]
@@ -57,6 +61,8 @@ namespace GlitchyEngine
ImGuiSettings.Apply();
#endif
OnApplySettings.Invoke(this, .Empty);
/*for (let settings in _userSettings)
{
settings.Apply();
@@ -119,7 +125,7 @@ namespace GlitchyEngine
public void Apply()
{
Application.Get().[Friend]_imGuiLayer.SettingsInvalid = true;
Application.Instance.[Friend]_imGuiLayer.SettingsInvalid = true;
}
}
#endif