Skip to content

Commit

Permalink
Fix layouts not loading
Browse files Browse the repository at this point in the history
  • Loading branch information
flustix committed Jul 21, 2024
1 parent b838abf commit 1226719
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions fluXis.Game/Screens/Gameplay/HUD/LayoutManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,22 +89,23 @@ public void PresentExternally()

private void loadLayouts()
{
var files = storage.GetFiles("", "*.json");
var files = storage.GetFiles(".", "*.json");

foreach (var file in files)
{
try
{
var layout = File.ReadAllText(file).Deserialize<HUDLayout>();
var path = storage.GetFullPath(file);
var layout = File.ReadAllText(path).Deserialize<HUDLayout>();

layout.ID = Path.GetFileNameWithoutExtension(file);
layout.ID = Path.GetFileNameWithoutExtension(path);
Layouts.Add(layout);

Logger.Log($"Loaded layout {layout.ID}", LoggingTarget.Runtime, LogLevel.Debug);
}
catch
catch (Exception ex)
{
Logger.Log($"Failed to load layout {Path.GetFileName(file)}", LoggingTarget.Runtime, LogLevel.Error);
Logger.Error(ex, $"Failed to load layout {Path.GetFileName(file)}");
}
}
}
Expand Down

0 comments on commit 1226719

Please sign in to comment.