1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 17:43:05 +08:00

Move shared implementation to a named function

This commit is contained in:
Dean Herbert 2020-12-14 13:56:46 +09:00
parent 5b5e883904
commit b81dbfc192

View File

@ -55,8 +55,8 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()
{ {
OriginalXBindable.BindValueChanged(_ => X = OriginalXBindable.Value + XOffsetBindable.Value); OriginalXBindable.BindValueChanged(updateXPosition);
XOffsetBindable.BindValueChanged(_ => X = OriginalXBindable.Value + XOffsetBindable.Value, true); XOffsetBindable.BindValueChanged(updateXPosition, true);
ScaleBindable.BindValueChanged(scale => ScaleBindable.BindValueChanged(scale =>
{ {
@ -67,6 +67,11 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables
IndexInBeatmap.BindValueChanged(_ => UpdateComboColour()); IndexInBeatmap.BindValueChanged(_ => UpdateComboColour());
} }
private void updateXPosition(ValueChangedEvent<float> _)
{
X = OriginalXBindable.Value + XOffsetBindable.Value;
}
protected override void OnApply() protected override void OnApply()
{ {
base.OnApply(); base.OnApply();