mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 13:01:52 +00:00
Settings / SettingsWindow
This commit is contained in:
@@ -2,13 +2,14 @@ using System;
|
||||
using ImGui;
|
||||
using GlitchyEngine.Events;
|
||||
using ImGuizmo;
|
||||
using GlitchyEngine.Renderer;
|
||||
using System.IO;
|
||||
|
||||
using internal ImGui;
|
||||
|
||||
#if GE_GRAPHICS_DX11
|
||||
|
||||
using GlitchyEngine.Platform.DX11;
|
||||
using GlitchyEngine.Renderer;
|
||||
using internal GlitchyEngine.Platform.DX11;
|
||||
|
||||
#endif
|
||||
@@ -19,6 +20,8 @@ namespace GlitchyEngine.ImGui
|
||||
{
|
||||
ImGui.IO* _io;
|
||||
|
||||
public bool SettingsInvalid;
|
||||
|
||||
public this() : base("ImGuiLayer") { }
|
||||
|
||||
public override void OnAttach()
|
||||
@@ -87,6 +90,30 @@ namespace GlitchyEngine.ImGui
|
||||
{
|
||||
Debug.Profiler.ProfileFunction!();
|
||||
|
||||
if (SettingsInvalid)
|
||||
{
|
||||
var settings = Application.Get().Settings.ImGuiSettings;
|
||||
|
||||
ImGui.GetIO().Fonts.Clear();
|
||||
|
||||
String fullpath = scope String();
|
||||
Application.Get().ContentManager.GetFilePath(fullpath, settings.FontName);
|
||||
if (File.Exists(fullpath))
|
||||
{
|
||||
ImGui.GetIO().Fonts.AddFontFromFileTTF(fullpath, settings.FontSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
ImGui.GetIO().Fonts.AddFontDefault();
|
||||
}
|
||||
|
||||
#if GE_GRAPHICS_DX11
|
||||
ImGuiImplDX11.CreateDeviceObjects();
|
||||
#endif
|
||||
|
||||
SettingsInvalid = false;
|
||||
}
|
||||
|
||||
Begin();
|
||||
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user