Skip to content

Commit

Permalink
Fix loading ImGuiConfig (C# implementation)
Browse files Browse the repository at this point in the history
  • Loading branch information
pkdawson committed Jul 1, 2024
1 parent e917d4a commit de25ceb
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions addons/imgui-godot/ImGuiGodot/ImGuiController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,12 @@ public override void _EnterTree()
if (ResourceLoader.Exists(cfgPath))
{
cfg = ResourceLoader.Load(cfgPath);
bool cfgok = false;
foreach (var d in cfg.GetPropertyList())
{
if (d.TryGetValue("name", out var name) && (string)name == "ImGuiConfig.gd")
{
cfgok = true;
}
}
float scale = (float)cfg.Get("Scale");
bool cfgok = scale > 0.0f;

if (!cfgok)
{
GD.PushError($"imgui-godot: config not an ImGuiConfig resource: {cfgPath}");
GD.PushError($"imgui-godot: config not a valid ImGuiConfig resource: {cfgPath}");
cfg = null;
}
}
Expand Down

0 comments on commit de25ceb

Please sign in to comment.