Update code order to match everything else

This commit is contained in:
Salman Ahmed 2024-08-15 16:57:29 +09:00
parent a421231aad
commit 358572ebb3
2 changed files with 37 additions and 31 deletions

View File

@ -29,9 +29,6 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon
switch (lookup) switch (lookup)
{ {
case SkinComponentsContainerLookup containerLookup: case SkinComponentsContainerLookup containerLookup:
if (containerLookup.Target != SkinComponentsContainerLookup.TargetArea.MainHUDComponents)
return base.GetDrawableComponent(lookup);
// Only handle per ruleset defaults here. // Only handle per ruleset defaults here.
if (containerLookup.Ruleset == null) if (containerLookup.Ruleset == null)
return base.GetDrawableComponent(lookup); return base.GetDrawableComponent(lookup);
@ -40,21 +37,27 @@ namespace osu.Game.Rulesets.Mania.Skinning.Argon
if (base.GetDrawableComponent(lookup) is UserConfiguredLayoutContainer d) if (base.GetDrawableComponent(lookup) is UserConfiguredLayoutContainer d)
return d; return d;
return new DefaultSkinComponentsContainer(container => switch (containerLookup.Target)
{ {
var combo = container.ChildrenOfType<ArgonManiaComboCounter>().FirstOrDefault(); case SkinComponentsContainerLookup.TargetArea.MainHUDComponents:
return new DefaultSkinComponentsContainer(container =>
{
var combo = container.ChildrenOfType<ArgonManiaComboCounter>().FirstOrDefault();
if (combo != null) if (combo != null)
{ {
combo.ShowLabel.Value = false; combo.ShowLabel.Value = false;
combo.Anchor = Anchor.TopCentre; combo.Anchor = Anchor.TopCentre;
combo.Origin = Anchor.Centre; combo.Origin = Anchor.Centre;
combo.Y = 200; combo.Y = 200;
} }
}) })
{ {
new ArgonManiaComboCounter(), new ArgonManiaComboCounter(),
}; };
}
return null;
case GameplaySkinComponentLookup<HitResult> resultComponent: case GameplaySkinComponentLookup<HitResult> resultComponent:
// This should eventually be moved to a skin setting, when supported. // This should eventually be moved to a skin setting, when supported.

View File

@ -81,9 +81,6 @@ namespace osu.Game.Rulesets.Mania.Skinning.Legacy
switch (lookup) switch (lookup)
{ {
case SkinComponentsContainerLookup containerLookup: case SkinComponentsContainerLookup containerLookup:
if (containerLookup.Target != SkinComponentsContainerLookup.TargetArea.MainHUDComponents)
return base.GetDrawableComponent(lookup);
// Modifications for global components. // Modifications for global components.
if (containerLookup.Ruleset == null) if (containerLookup.Ruleset == null)
return base.GetDrawableComponent(lookup); return base.GetDrawableComponent(lookup);
@ -96,20 +93,26 @@ namespace osu.Game.Rulesets.Mania.Skinning.Legacy
if (!IsProvidingLegacyResources) if (!IsProvidingLegacyResources)
return null; return null;
return new DefaultSkinComponentsContainer(container => switch (containerLookup.Target)
{ {
var combo = container.ChildrenOfType<LegacyManiaComboCounter>().FirstOrDefault(); case SkinComponentsContainerLookup.TargetArea.MainHUDComponents:
return new DefaultSkinComponentsContainer(container =>
{
var combo = container.ChildrenOfType<LegacyManiaComboCounter>().FirstOrDefault();
if (combo != null) if (combo != null)
{ {
combo.Anchor = Anchor.TopCentre; combo.Anchor = Anchor.TopCentre;
combo.Origin = Anchor.Centre; combo.Origin = Anchor.Centre;
combo.Y = this.GetManiaSkinConfig<float>(LegacyManiaSkinConfigurationLookups.ComboPosition)?.Value ?? 0; combo.Y = this.GetManiaSkinConfig<float>(LegacyManiaSkinConfigurationLookups.ComboPosition)?.Value ?? 0;
} }
}) })
{ {
new LegacyManiaComboCounter(), new LegacyManiaComboCounter(),
}; };
}
return null;
case GameplaySkinComponentLookup<HitResult> resultComponent: case GameplaySkinComponentLookup<HitResult> resultComponent:
return getResult(resultComponent.Component); return getResult(resultComponent.Component);