Merge pull request #17226 from peppy/skin-component-settings

Allow skin components to have settings
This commit is contained in:
Dan Balasescu
2022-03-16 17:12:11 +09:00
committed by GitHub
13 changed files with 240 additions and 51 deletions

View File

@ -11,6 +11,8 @@ namespace osu.Game.Rulesets.Edit
{
protected readonly OsuScrollContainer Scroll;
protected readonly FillFlowContainer FillFlow;
protected override Container<Drawable> Content { get; }
public ScrollingToolboxGroup(string title, float scrollAreaHeight)
@ -20,7 +22,7 @@ namespace osu.Game.Rulesets.Edit
{
RelativeSizeAxes = Axes.X,
Height = scrollAreaHeight,
Child = Content = new FillFlowContainer
Child = Content = FillFlow = new FillFlowContainer
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,

View File

@ -192,7 +192,7 @@ namespace osu.Game.Rulesets.Mods
hashCode.Add(GetType());
foreach (var setting in Settings)
hashCode.Add(ModUtils.GetSettingUnderlyingValue(setting));
hashCode.Add(setting.GetUnderlyingSettingValue());
return hashCode.ToHashCode();
}
@ -208,13 +208,13 @@ namespace osu.Game.Rulesets.Mods
public bool Equals(IBindable x, IBindable y)
{
object xValue = x == null ? null : ModUtils.GetSettingUnderlyingValue(x);
object yValue = y == null ? null : ModUtils.GetSettingUnderlyingValue(y);
object xValue = x?.GetUnderlyingSettingValue();
object yValue = y?.GetUnderlyingSettingValue();
return EqualityComparer<object>.Default.Equals(xValue, yValue);
}
public int GetHashCode(IBindable obj) => ModUtils.GetSettingUnderlyingValue(obj).GetHashCode();
public int GetHashCode(IBindable obj) => obj.GetUnderlyingSettingValue().GetHashCode();
}
}
}