Skip to content

Commit

Permalink
Update code order to match everything else
Browse files Browse the repository at this point in the history
  • Loading branch information
frenzibyte committed Aug 15, 2024
1 parent a421231 commit 358572e
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 33 deletions.
37 changes: 20 additions & 17 deletions osu.Game.Rulesets.Mania/Skinning/Argon/ManiaArgonSkinTransformer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ public ManiaArgonSkinTransformer(ISkin skin, IBeatmap beatmap)
switch (lookup)
{
case SkinComponentsContainerLookup containerLookup:
if (containerLookup.Target != SkinComponentsContainerLookup.TargetArea.MainHUDComponents)
return base.GetDrawableComponent(lookup);

// Only handle per ruleset defaults here.
if (containerLookup.Ruleset == null)
return base.GetDrawableComponent(lookup);
Expand All @@ -40,21 +37,27 @@ public ManiaArgonSkinTransformer(ISkin skin, IBeatmap beatmap)
if (base.GetDrawableComponent(lookup) is UserConfiguredLayoutContainer d)
return d;

return new DefaultSkinComponentsContainer(container =>
{
var combo = container.ChildrenOfType<ArgonManiaComboCounter>().FirstOrDefault();
if (combo != null)
{
combo.ShowLabel.Value = false;
combo.Anchor = Anchor.TopCentre;
combo.Origin = Anchor.Centre;
combo.Y = 200;
}
})
switch (containerLookup.Target)
{
new ArgonManiaComboCounter(),
};
case SkinComponentsContainerLookup.TargetArea.MainHUDComponents:
return new DefaultSkinComponentsContainer(container =>
{
var combo = container.ChildrenOfType<ArgonManiaComboCounter>().FirstOrDefault();
if (combo != null)
{
combo.ShowLabel.Value = false;
combo.Anchor = Anchor.TopCentre;
combo.Origin = Anchor.Centre;
combo.Y = 200;
}
})
{
new ArgonManiaComboCounter(),
};
}

return null;

case GameplaySkinComponentLookup<HitResult> resultComponent:
// This should eventually be moved to a skin setting, when supported.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@ public override Drawable GetDrawableComponent(ISkinComponentLookup lookup)
switch (lookup)
{
case SkinComponentsContainerLookup containerLookup:
if (containerLookup.Target != SkinComponentsContainerLookup.TargetArea.MainHUDComponents)
return base.GetDrawableComponent(lookup);

// Modifications for global components.
if (containerLookup.Ruleset == null)
return base.GetDrawableComponent(lookup);
Expand All @@ -96,20 +93,26 @@ public override Drawable GetDrawableComponent(ISkinComponentLookup lookup)
if (!IsProvidingLegacyResources)
return null;

return new DefaultSkinComponentsContainer(container =>
{
var combo = container.ChildrenOfType<LegacyManiaComboCounter>().FirstOrDefault();
if (combo != null)
{
combo.Anchor = Anchor.TopCentre;
combo.Origin = Anchor.Centre;
combo.Y = this.GetManiaSkinConfig<float>(LegacyManiaSkinConfigurationLookups.ComboPosition)?.Value ?? 0;
}
})
switch (containerLookup.Target)
{
new LegacyManiaComboCounter(),
};
case SkinComponentsContainerLookup.TargetArea.MainHUDComponents:
return new DefaultSkinComponentsContainer(container =>
{
var combo = container.ChildrenOfType<LegacyManiaComboCounter>().FirstOrDefault();
if (combo != null)
{
combo.Anchor = Anchor.TopCentre;
combo.Origin = Anchor.Centre;
combo.Y = this.GetManiaSkinConfig<float>(LegacyManiaSkinConfigurationLookups.ComboPosition)?.Value ?? 0;
}
})
{
new LegacyManiaComboCounter(),
};
}

return null;

case GameplaySkinComponentLookup<HitResult> resultComponent:
return getResult(resultComponent.Component);
Expand Down

0 comments on commit 358572e

Please sign in to comment.