Skip to content

Commit

Permalink
Add log output of skin lookup hierarchy
Browse files Browse the repository at this point in the history
  • Loading branch information
peppy committed Sep 30, 2024
1 parent c84c72e commit 6cbc3e8
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion osu.Game/Screens/Play/HUDOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using osu.Framework.Graphics.Primitives;
using osu.Framework.Input.Bindings;
using osu.Framework.Input.Events;
using osu.Framework.Logging;
using osu.Game.Configuration;
using osu.Game.Input.Bindings;
using osu.Game.Localisation;
Expand Down Expand Up @@ -183,7 +184,7 @@ public HUDOverlay([CanBeNull] DrawableRuleset drawableRuleset, IReadOnlyList<Mod
}

[BackgroundDependencyLoader(true)]
private void load(OsuConfigManager config, INotificationOverlay notificationOverlay)
private void load(OsuConfigManager config, INotificationOverlay notificationOverlay, ISkinSource skinSource)
{
if (drawableRuleset != null)
{
Expand All @@ -208,6 +209,27 @@ private void load(OsuConfigManager config, INotificationOverlay notificationOver

// start all elements hidden
hideTargets.ForEach(d => d.Hide());

logSkinLookupHierarchy(skinSource);
}

private void logSkinLookupHierarchy(ISkinSource skinSource)
{
Logger.Log("Skin lookup hierarchy for HUD:");
Logger.Log(string.Empty);

log(skinSource);

void log(ISkin s, int depth = 0)
{
Logger.Log(new string('-', depth) + $"| {s}");

if (s is ISkinSource ss)
{
foreach (var nestedSource in ss.AllSources)
log(nestedSource, depth + 1);
}
}
}

public override void Hide() =>
Expand Down

0 comments on commit 6cbc3e8

Please sign in to comment.