mirror of
https://github.com/ppy/osu.git
synced 2025-02-14 19:12:59 +08:00
Use RulesetInfo
instead of Ruleset
in skin components lookup
This commit is contained in:
parent
675e5b81f3
commit
209d41ee9d
@ -115,7 +115,7 @@ namespace osu.Game.Screens.Play
|
||||
//Needs to be initialized before skinnable drawables.
|
||||
tally = new JudgementTally(),
|
||||
mainComponents = new HUDComponentsContainer { AlwaysPresent = true, },
|
||||
rulesetComponents = new HUDComponentsContainer(drawableRuleset.Ruleset) { AlwaysPresent = true, },
|
||||
rulesetComponents = new HUDComponentsContainer(drawableRuleset.Ruleset.RulesetInfo) { AlwaysPresent = true, },
|
||||
topRightElements = new FillFlowContainer
|
||||
{
|
||||
Anchor = Anchor.TopRight,
|
||||
@ -399,7 +399,7 @@ namespace osu.Game.Screens.Play
|
||||
[Resolved]
|
||||
private OsuConfigManager config { get; set; }
|
||||
|
||||
public HUDComponentsContainer([CanBeNull] Ruleset ruleset = null)
|
||||
public HUDComponentsContainer([CanBeNull] RulesetInfo ruleset = null)
|
||||
: base(new SkinComponentsContainerLookup(SkinComponentsContainerLookup.TargetArea.MainHUDComponents, ruleset))
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
|
@ -15,11 +15,11 @@ namespace osu.Game.Skinning
|
||||
/// </summary>
|
||||
public readonly TargetArea Target;
|
||||
|
||||
public readonly Ruleset? Ruleset;
|
||||
public readonly RulesetInfo? Ruleset;
|
||||
|
||||
public string GetSerialisableIdentifier() => Ruleset?.ShortName ?? "global";
|
||||
|
||||
public SkinComponentsContainerLookup(TargetArea target, Ruleset? ruleset = null)
|
||||
public SkinComponentsContainerLookup(TargetArea target, RulesetInfo? ruleset = null)
|
||||
{
|
||||
Target = target;
|
||||
Ruleset = ruleset;
|
||||
|
@ -24,13 +24,13 @@ namespace osu.Game.Skinning
|
||||
[JsonProperty]
|
||||
public Dictionary<string, SerialisedDrawableInfo[]> DrawableInfo { get; set; } = new Dictionary<string, SerialisedDrawableInfo[]>();
|
||||
|
||||
public bool TryGetDrawableInfo(Ruleset? ruleset, [NotNullWhen(true)] out SerialisedDrawableInfo[]? components) =>
|
||||
public bool TryGetDrawableInfo(RulesetInfo? ruleset, [NotNullWhen(true)] out SerialisedDrawableInfo[]? components) =>
|
||||
DrawableInfo.TryGetValue(ruleset?.ShortName ?? global_identifier, out components);
|
||||
|
||||
public void Reset(Ruleset? ruleset) =>
|
||||
public void Reset(RulesetInfo? ruleset) =>
|
||||
DrawableInfo.Remove(ruleset?.ShortName ?? global_identifier);
|
||||
|
||||
public void Update(Ruleset? ruleset, SerialisedDrawableInfo[] components) =>
|
||||
public void Update(RulesetInfo? ruleset, SerialisedDrawableInfo[] components) =>
|
||||
DrawableInfo[ruleset?.ShortName ?? global_identifier] = components;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user