Rewrite catch combo counter hide logic

This commit is contained in:
Salman Ahmed 2021-05-30 14:20:03 +03:00
parent fb81e5133f
commit 60b781701f
1 changed files with 3 additions and 6 deletions

View File

@ -29,20 +29,17 @@ public override Drawable GetDrawableComponent(ISkinComponent component)
switch (targetComponent.Target)
{
case SkinnableTarget.MainHUDComponents:
if (!providesComboCounter)
break;
var components = Source.GetDrawableComponent(component) as SkinnableTargetComponentsContainer;
if (Source.GetDrawableComponent(component) is SkinnableTargetComponentsContainer components)
if (providesComboCounter && components != null)
{
// catch may provide its own combo counter; hide the default.
// todo: this should be done in an elegant way per ruleset, defining which HUD skin components should be displayed.
foreach (var legacyComboCounter in components.OfType<LegacyComboCounter>())
legacyComboCounter.ContentVisible = false;
return components;
}
break;
return components;
}
}