1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 05:27:23 +08:00

Merge pull request #4314 from peppy/fix-more-e

Revert some more instances of 'e' variable names
This commit is contained in:
Dan Balasescu 2019-02-22 20:34:08 +09:00 committed by GitHub
commit 89a05c086c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
50 changed files with 99 additions and 99 deletions

View File

@ -49,9 +49,9 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables.Pieces
private void load(IScrollingInfo scrollingInfo) private void load(IScrollingInfo scrollingInfo)
{ {
direction.BindTo(scrollingInfo.Direction); direction.BindTo(scrollingInfo.Direction);
direction.BindValueChanged(e => direction.BindValueChanged(dir =>
{ {
colouredBox.Anchor = colouredBox.Origin = e.NewValue == ScrollingDirection.Up ? Anchor.TopCentre : Anchor.BottomCentre; colouredBox.Anchor = colouredBox.Origin = dir.NewValue == ScrollingDirection.Up ? Anchor.TopCentre : Anchor.BottomCentre;
}, true); }, true);
} }

View File

@ -82,15 +82,15 @@ namespace osu.Game.Rulesets.Mania.UI
TopLevelContainer.Add(explosionContainer.CreateProxy()); TopLevelContainer.Add(explosionContainer.CreateProxy());
Direction.BindValueChanged(e => Direction.BindValueChanged(dir =>
{ {
hitTargetContainer.Padding = new MarginPadding hitTargetContainer.Padding = new MarginPadding
{ {
Top = e.NewValue == ScrollingDirection.Up ? ManiaStage.HIT_TARGET_POSITION : 0, Top = dir.NewValue == ScrollingDirection.Up ? ManiaStage.HIT_TARGET_POSITION : 0,
Bottom = e.NewValue == ScrollingDirection.Down ? ManiaStage.HIT_TARGET_POSITION : 0, Bottom = dir.NewValue == ScrollingDirection.Down ? ManiaStage.HIT_TARGET_POSITION : 0,
}; };
keyArea.Anchor = keyArea.Origin = e.NewValue == ScrollingDirection.Up ? Anchor.TopLeft : Anchor.BottomLeft; keyArea.Anchor = keyArea.Origin = dir.NewValue == ScrollingDirection.Up ? Anchor.TopLeft : Anchor.BottomLeft;
}, true); }, true);
} }

View File

@ -48,9 +48,9 @@ namespace osu.Game.Rulesets.Mania.UI.Components
}; };
direction.BindTo(scrollingInfo.Direction); direction.BindTo(scrollingInfo.Direction);
direction.BindValueChanged(e => direction.BindValueChanged(dir =>
{ {
backgroundOverlay.Anchor = backgroundOverlay.Origin = e.NewValue == ScrollingDirection.Up ? Anchor.TopLeft : Anchor.BottomLeft; backgroundOverlay.Anchor = backgroundOverlay.Origin = dir.NewValue == ScrollingDirection.Up ? Anchor.TopLeft : Anchor.BottomLeft;
updateColours(); updateColours();
}, true); }, true);
} }

View File

@ -49,9 +49,9 @@ namespace osu.Game.Rulesets.Mania.UI.Components
private void load(IScrollingInfo scrollingInfo) private void load(IScrollingInfo scrollingInfo)
{ {
direction.BindTo(scrollingInfo.Direction); direction.BindTo(scrollingInfo.Direction);
direction.BindValueChanged(e => direction.BindValueChanged(dir =>
{ {
Anchor anchor = e.NewValue == ScrollingDirection.Up ? Anchor.TopLeft : Anchor.BottomLeft; Anchor anchor = dir.NewValue == ScrollingDirection.Up ? Anchor.TopLeft : Anchor.BottomLeft;
hitTargetBar.Anchor = hitTargetBar.Origin = anchor; hitTargetBar.Anchor = hitTargetBar.Origin = anchor;
hitTargetLine.Anchor = hitTargetLine.Origin = anchor; hitTargetLine.Anchor = hitTargetLine.Origin = anchor;

View File

@ -64,11 +64,11 @@ namespace osu.Game.Rulesets.Mania.UI.Components
}; };
direction.BindTo(scrollingInfo.Direction); direction.BindTo(scrollingInfo.Direction);
direction.BindValueChanged(e => direction.BindValueChanged(dir =>
{ {
gradient.Colour = ColourInfo.GradientVertical( gradient.Colour = ColourInfo.GradientVertical(
e.NewValue == ScrollingDirection.Up ? Color4.Black : Color4.Black.Opacity(0), dir.NewValue == ScrollingDirection.Up ? Color4.Black : Color4.Black.Opacity(0),
e.NewValue == ScrollingDirection.Up ? Color4.Black.Opacity(0) : Color4.Black); dir.NewValue == ScrollingDirection.Up ? Color4.Black.Opacity(0) : Color4.Black);
}, true); }, true);
} }

View File

@ -76,7 +76,7 @@ namespace osu.Game.Rulesets.Mania.UI
BarLines.ForEach(Playfield.Add); BarLines.ForEach(Playfield.Add);
Config.BindWith(ManiaSetting.ScrollDirection, configDirection); Config.BindWith(ManiaSetting.ScrollDirection, configDirection);
configDirection.BindValueChanged(e => Direction.Value = (ScrollingDirection)e.NewValue, true); configDirection.BindValueChanged(direction => Direction.Value = (ScrollingDirection)direction.NewValue, true);
Config.BindWith(ManiaSetting.ScrollTime, TimeRange); Config.BindWith(ManiaSetting.ScrollTime, TimeRange);
} }

View File

@ -136,12 +136,12 @@ namespace osu.Game.Rulesets.Mania.UI
AddColumn(column); AddColumn(column);
} }
Direction.BindValueChanged(e => Direction.BindValueChanged(dir =>
{ {
barLineContainer.Padding = new MarginPadding barLineContainer.Padding = new MarginPadding
{ {
Top = e.NewValue == ScrollingDirection.Up ? HIT_TARGET_POSITION : 0, Top = dir.NewValue == ScrollingDirection.Up ? HIT_TARGET_POSITION : 0,
Bottom = e.NewValue == ScrollingDirection.Down ? HIT_TARGET_POSITION : 0, Bottom = dir.NewValue == ScrollingDirection.Down ? HIT_TARGET_POSITION : 0,
}; };
}, true); }, true);
} }

View File

@ -34,7 +34,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.HitCircles.Components
PositionBindable.BindValueChanged(_ => UpdatePosition(), true); PositionBindable.BindValueChanged(_ => UpdatePosition(), true);
StackHeightBindable.BindValueChanged(_ => UpdatePosition()); StackHeightBindable.BindValueChanged(_ => UpdatePosition());
ScaleBindable.BindValueChanged(e => Scale = new Vector2(e.NewValue), true); ScaleBindable.BindValueChanged(scale => Scale = new Vector2(scale.NewValue), true);
} }
protected virtual void UpdatePosition() => Position = hitCircle.StackedPosition; protected virtual void UpdatePosition() => Position = hitCircle.StackedPosition;

View File

@ -34,7 +34,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
body.BorderColour = colours.Yellow; body.BorderColour = colours.Yellow;
PositionBindable.BindValueChanged(_ => updatePosition(), true); PositionBindable.BindValueChanged(_ => updatePosition(), true);
ScaleBindable.BindValueChanged(e => body.PathWidth = e.NewValue * 64, true); ScaleBindable.BindValueChanged(scale => body.PathWidth = scale.NewValue * 64, true);
} }
private void updatePosition() => Position = slider.StackedPosition; private void updatePosition() => Position = slider.StackedPosition;

View File

@ -55,7 +55,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Spinners.Components
PositionBindable.BindValueChanged(_ => updatePosition(), true); PositionBindable.BindValueChanged(_ => updatePosition(), true);
StackHeightBindable.BindValueChanged(_ => updatePosition()); StackHeightBindable.BindValueChanged(_ => updatePosition());
ScaleBindable.BindValueChanged(e => ring.Scale = new Vector2(e.NewValue), true); ScaleBindable.BindValueChanged(scale => ring.Scale = new Vector2(scale.NewValue), true);
} }
private void updatePosition() => Position = spinner.Position; private void updatePosition() => Position = spinner.Position;

View File

@ -91,7 +91,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
{ {
positionBindable.BindValueChanged(_ => Position = HitObject.StackedPosition); positionBindable.BindValueChanged(_ => Position = HitObject.StackedPosition);
stackHeightBindable.BindValueChanged(_ => Position = HitObject.StackedPosition); stackHeightBindable.BindValueChanged(_ => Position = HitObject.StackedPosition);
scaleBindable.BindValueChanged(e => scaleContainer.Scale = new Vector2(e.NewValue), true); scaleBindable.BindValueChanged(scale => scaleContainer.Scale = new Vector2(scale.NewValue), true);
positionBindable.BindTo(HitObject.PositionBindable); positionBindable.BindTo(HitObject.PositionBindable);
stackHeightBindable.BindTo(HitObject.StackHeightBindable); stackHeightBindable.BindTo(HitObject.StackHeightBindable);

View File

@ -99,10 +99,10 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
config.BindWith(OsuSetting.SnakingOutSliders, Body.SnakingOut); config.BindWith(OsuSetting.SnakingOutSliders, Body.SnakingOut);
positionBindable.BindValueChanged(_ => Position = HitObject.StackedPosition); positionBindable.BindValueChanged(_ => Position = HitObject.StackedPosition);
scaleBindable.BindValueChanged(e => scaleBindable.BindValueChanged(scale =>
{ {
Body.PathWidth = HitObject.Scale * 64; Body.PathWidth = scale.NewValue * 64;
Ball.Scale = new Vector2(HitObject.Scale); Ball.Scale = new Vector2(scale.NewValue);
}); });
positionBindable.BindTo(HitObject.PositionBindable); positionBindable.BindTo(HitObject.PositionBindable);

View File

@ -130,7 +130,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
circle.Colour = colours.BlueDark; circle.Colour = colours.BlueDark;
glow.Colour = colours.BlueDark; glow.Colour = colours.BlueDark;
positionBindable.BindValueChanged(e => Position = e.NewValue); positionBindable.BindValueChanged(pos => Position = pos.NewValue);
positionBindable.BindTo(HitObject.PositionBindable); positionBindable.BindTo(HitObject.PositionBindable);
} }

View File

@ -128,7 +128,7 @@ namespace osu.Game.Tests.Visual
}, },
}; };
idleTracker.IsIdle.BindValueChanged(e => box.Colour = e.NewValue ? Color4.White : Color4.Black, true); idleTracker.IsIdle.BindValueChanged(idle => box.Colour = idle.NewValue ? Color4.White : Color4.Black, true);
} }
} }
} }

View File

@ -20,7 +20,7 @@ namespace osu.Game.Beatmaps.Drawables
public UpdateableBeatmapBackgroundSprite() public UpdateableBeatmapBackgroundSprite()
{ {
Beatmap.BindValueChanged(e => Model = e.NewValue); Beatmap.BindValueChanged(b => Model = b.NewValue);
} }
protected override Drawable CreateDrawable(BeatmapInfo model) protected override Drawable CreateDrawable(BeatmapInfo model)

View File

@ -73,7 +73,7 @@ namespace osu.Game.Graphics.UserInterface
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuColour colours) private void load(OsuColour colours)
{ {
Enabled.BindValueChanged(e => this.FadeColour(e.NewValue ? Color4.White : colours.Gray9, 200, Easing.OutQuint), true); Enabled.BindValueChanged(enabled => this.FadeColour(enabled.NewValue ? Color4.White : colours.Gray9, 200, Easing.OutQuint), true);
} }
protected override bool OnHover(HoverEvent e) protected override bool OnHover(HoverEvent e)

View File

@ -95,7 +95,7 @@ namespace osu.Game.Graphics.UserInterface
protected override void LoadComplete() protected override void LoadComplete()
{ {
base.LoadComplete(); base.LoadComplete();
CurrentNumber.BindValueChanged(e => updateTooltipText(e.NewValue), true); CurrentNumber.BindValueChanged(current => updateTooltipText(current.NewValue), true);
} }
protected override bool OnHover(HoverEvent e) protected override bool OnHover(HoverEvent e)

View File

@ -55,7 +55,7 @@ namespace osu.Game.Online.Chat
{ {
CurrentChannel.ValueChanged += currentChannelChanged; CurrentChannel.ValueChanged += currentChannelChanged;
HighPollRate.BindValueChanged(e => TimeBetweenPolls = e.NewValue ? 1000 : 6000, true); HighPollRate.BindValueChanged(enabled => TimeBetweenPolls = enabled.NewValue ? 1000 : 6000, true);
} }
/// <summary> /// <summary>

View File

@ -185,7 +185,7 @@ namespace osu.Game
LocalConfig.BindWith(OsuSetting.VolumeInactive, inactiveVolumeAdjust); LocalConfig.BindWith(OsuSetting.VolumeInactive, inactiveVolumeAdjust);
IsActive.BindValueChanged(e => updateActiveState(e.NewValue), true); IsActive.BindValueChanged(active => updateActiveState(active.NewValue), true);
} }
private ExternalLinkOpener externalLinkOpener; private ExternalLinkOpener externalLinkOpener;

View File

@ -108,9 +108,9 @@ namespace osu.Game.Overlays.BeatmapSet.Buttons
localUser.BindValueChanged(userChanged, true); localUser.BindValueChanged(userChanged, true);
button.Enabled.BindValueChanged(enabledChanged, true); button.Enabled.BindValueChanged(enabledChanged, true);
State.BindValueChanged(e => State.BindValueChanged(state =>
{ {
switch (e.NewValue) switch (state.NewValue)
{ {
case DownloadState.Downloading: case DownloadState.Downloading:
textSprites.Children = new Drawable[] textSprites.Children = new Drawable[]

View File

@ -187,16 +187,16 @@ namespace osu.Game.Overlays.BeatmapSet
State.BindValueChanged(_ => updateDownloadButtons()); State.BindValueChanged(_ => updateDownloadButtons());
BeatmapSet.BindValueChanged(e => BeatmapSet.BindValueChanged(setInfo =>
{ {
Picker.BeatmapSet = author.BeatmapSet = Details.BeatmapSet = e.NewValue; Picker.BeatmapSet = author.BeatmapSet = Details.BeatmapSet = setInfo.NewValue;
title.Text = e.NewValue?.Metadata.Title ?? string.Empty; title.Text = setInfo.NewValue?.Metadata.Title ?? string.Empty;
artist.Text = e.NewValue?.Metadata.Artist ?? string.Empty; artist.Text = setInfo.NewValue?.Metadata.Artist ?? string.Empty;
onlineStatusPill.Status = e.NewValue?.OnlineInfo.Status ?? BeatmapSetOnlineStatus.None; onlineStatusPill.Status = setInfo.NewValue?.OnlineInfo.Status ?? BeatmapSetOnlineStatus.None;
cover.BeatmapSet = e.NewValue; cover.BeatmapSet = setInfo.NewValue;
if (e.NewValue != null) if (setInfo.NewValue != null)
{ {
downloadButtonsContainer.FadeIn(transition_duration); downloadButtonsContainer.FadeIn(transition_duration);
favouriteButton.FadeIn(transition_duration); favouriteButton.FadeIn(transition_duration);

View File

@ -67,7 +67,7 @@ namespace osu.Game.Overlays.Direct
{ {
base.LoadComplete(); base.LoadComplete();
State.BindValueChanged(e => updateState(e.NewValue), true); State.BindValueChanged(state => updateState(state.NewValue), true);
FinishTransforms(true); FinishTransforms(true);
} }

View File

@ -35,9 +35,9 @@ namespace osu.Game.Overlays.Direct
progressBar.BackgroundColour = Color4.Black.Opacity(0.7f); progressBar.BackgroundColour = Color4.Black.Opacity(0.7f);
progressBar.Current = Progress; progressBar.Current = Progress;
State.BindValueChanged(e => State.BindValueChanged(state =>
{ {
switch (e.NewValue) switch (state.NewValue)
{ {
case DownloadState.NotDownloaded: case DownloadState.NotDownloaded:
progressBar.Current.Value = 0; progressBar.Current.Value = 0;

View File

@ -37,14 +37,14 @@ namespace osu.Game.Overlays.Direct
{ {
this.beatmaps = beatmaps; this.beatmaps = beatmaps;
BeatmapSet.BindValueChanged(e => BeatmapSet.BindValueChanged(setInfo =>
{ {
if (e.NewValue == null) if (setInfo.NewValue == null)
attachDownload(null); attachDownload(null);
else if (beatmaps.QueryBeatmapSets(s => s.OnlineBeatmapSetID == e.NewValue.OnlineBeatmapSetID).Any()) else if (beatmaps.QueryBeatmapSets(s => s.OnlineBeatmapSetID == setInfo.NewValue.OnlineBeatmapSetID).Any())
State.Value = DownloadState.LocallyAvailable; State.Value = DownloadState.LocallyAvailable;
else else
attachDownload(beatmaps.GetExistingDownload(e.NewValue)); attachDownload(beatmaps.GetExistingDownload(setInfo.NewValue));
}, true); }, true);
beatmaps.BeatmapDownloadBegan += download => beatmaps.BeatmapDownloadBegan += download =>

View File

@ -35,8 +35,8 @@ namespace osu.Game.Overlays.Settings.Sections.Debug
}; };
configLatencyMode = config.GetBindable<GCLatencyMode>(DebugSetting.ActiveGCMode); configLatencyMode = config.GetBindable<GCLatencyMode>(DebugSetting.ActiveGCMode);
configLatencyMode.BindValueChanged(e => latencyMode.Value = (LatencyMode)e.NewValue, true); configLatencyMode.BindValueChanged(mode => latencyMode.Value = (LatencyMode)mode.NewValue, true);
latencyMode.BindValueChanged(e => configLatencyMode.Value = (GCLatencyMode)e.NewValue); latencyMode.BindValueChanged(mode => configLatencyMode.Value = (GCLatencyMode)mode.NewValue);
} }
private enum LatencyMode private enum LatencyMode

View File

@ -128,9 +128,9 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
Bindable = sizeFullscreen Bindable = sizeFullscreen
}; };
windowModeDropdown.Bindable.BindValueChanged(e => windowModeDropdown.Bindable.BindValueChanged(mode =>
{ {
if (e.NewValue == WindowMode.Fullscreen) if (mode.NewValue == WindowMode.Fullscreen)
{ {
resolutionDropdown.Show(); resolutionDropdown.Show();
sizeFullscreen.TriggerChange(); sizeFullscreen.TriggerChange();
@ -140,15 +140,15 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
}, true); }, true);
} }
scalingMode.BindValueChanged(e => scalingMode.BindValueChanged(mode =>
{ {
scalingSettings.ClearTransforms(); scalingSettings.ClearTransforms();
scalingSettings.AutoSizeAxes = e.NewValue != ScalingMode.Off ? Axes.Y : Axes.None; scalingSettings.AutoSizeAxes = mode.NewValue != ScalingMode.Off ? Axes.Y : Axes.None;
if (e.NewValue == ScalingMode.Off) if (mode.NewValue == ScalingMode.Off)
scalingSettings.ResizeHeightTo(0, transition_duration, Easing.OutQuint); scalingSettings.ResizeHeightTo(0, transition_duration, Easing.OutQuint);
scalingSettings.ForEach(s => s.TransferValueOnCommit = e.NewValue == ScalingMode.Everything); scalingSettings.ForEach(s => s.TransferValueOnCommit = mode.NewValue == ScalingMode.Everything);
}, true); }, true);
} }

View File

@ -76,8 +76,8 @@ namespace osu.Game.Overlays.Settings.Sections
if (skinDropdown.Items.All(s => s.ID != configBindable.Value)) if (skinDropdown.Items.All(s => s.ID != configBindable.Value))
configBindable.Value = 0; configBindable.Value = 0;
configBindable.BindValueChanged(e => dropdownBindable.Value = skinDropdown.Items.Single(s => s.ID == e.NewValue), true); configBindable.BindValueChanged(id => dropdownBindable.Value = skinDropdown.Items.Single(s => s.ID == id.NewValue), true);
dropdownBindable.BindValueChanged(e => configBindable.Value = e.NewValue.ID); dropdownBindable.BindValueChanged(skin => configBindable.Value = skin.NewValue.ID);
} }
private void itemRemoved(SkinInfo s) => Schedule(() => skinDropdown.Items = skinDropdown.Items.Where(i => i.ID != s.ID).ToArray()); private void itemRemoved(SkinInfo s) => Schedule(() => skinDropdown.Items = skinDropdown.Items.Where(i => i.ID != s.ID).ToArray());

View File

@ -52,10 +52,10 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
WaveformVisible.ValueChanged += visible => waveform.FadeTo(visible.NewValue ? 1 : 0, 200, Easing.OutQuint); WaveformVisible.ValueChanged += visible => waveform.FadeTo(visible.NewValue ? 1 : 0, 200, Easing.OutQuint);
Beatmap.BindTo(beatmap); Beatmap.BindTo(beatmap);
Beatmap.BindValueChanged(e => Beatmap.BindValueChanged(b =>
{ {
waveform.Waveform = e.NewValue.Waveform; waveform.Waveform = b.NewValue.Waveform;
track = e.NewValue.Track; track = b.NewValue.Track;
}, true); }, true);
} }

View File

@ -25,7 +25,7 @@ namespace osu.Game.Screens.Multi.Components
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()
{ {
CurrentItem.BindValueChanged(e => updateText(), true); CurrentItem.BindValueChanged(_ => updateText(), true);
} }
private float textSize = OsuFont.DEFAULT_FONT_SIZE; private float textSize = OsuFont.DEFAULT_FONT_SIZE;

View File

@ -51,11 +51,11 @@ namespace osu.Game.Screens.Multi.Components
} }
}; };
CurrentItem.BindValueChanged(e => CurrentItem.BindValueChanged(item =>
{ {
beatmapAuthor.Clear(); beatmapAuthor.Clear();
var beatmap = e.NewValue?.Beatmap; var beatmap = item.NewValue?.Beatmap;
if (beatmap != null) if (beatmap != null)
{ {

View File

@ -46,9 +46,9 @@ namespace osu.Game.Screens.Multi.Components
}, },
}; };
CurrentItem.BindValueChanged(e => updateBeatmap(e.NewValue), true); CurrentItem.BindValueChanged(item => updateBeatmap(item.NewValue), true);
Type.BindValueChanged(e => gameTypeContainer.Child = new DrawableGameType(e.NewValue) { Size = new Vector2(height) }, true); Type.BindValueChanged(type => gameTypeContainer.Child = new DrawableGameType(type.NewValue) { Size = new Vector2(height) }, true);
} }
private void updateBeatmap(PlaylistItem item) private void updateBeatmap(PlaylistItem item)

View File

@ -16,7 +16,7 @@ namespace osu.Game.Screens.Multi.Components
InternalChild = sprite = CreateBackgroundSprite(); InternalChild = sprite = CreateBackgroundSprite();
CurrentItem.BindValueChanged(e => sprite.Beatmap.Value = e.NewValue?.Beatmap, true); CurrentItem.BindValueChanged(item => sprite.Beatmap.Value = item.NewValue?.Beatmap, true);
} }
protected virtual UpdateableBeatmapBackgroundSprite CreateBackgroundSprite() => new UpdateableBeatmapBackgroundSprite { RelativeSizeAxes = Axes.Both }; protected virtual UpdateableBeatmapBackgroundSprite CreateBackgroundSprite() => new UpdateableBeatmapBackgroundSprite { RelativeSizeAxes = Axes.Both };

View File

@ -50,7 +50,7 @@ namespace osu.Game.Screens.Multi.Components
}; };
MaxParticipants.BindValueChanged(_ => updateMax(), true); MaxParticipants.BindValueChanged(_ => updateMax(), true);
ParticipantCount.BindValueChanged(e => count.Text = e.NewValue.ToString("#,0"), true); ParticipantCount.BindValueChanged(c => count.Text = c.NewValue.ToString("#,0"), true);
} }
private void updateMax() private void updateMax()

View File

@ -53,7 +53,7 @@ namespace osu.Game.Screens.Multi.Components
public EndDatePart() public EndDatePart()
: base(DateTimeOffset.UtcNow) : base(DateTimeOffset.UtcNow)
{ {
EndDate.BindValueChanged(e => Date = e.NewValue); EndDate.BindValueChanged(date => Date = date.NewValue);
} }
protected override string Format() protected override string Format()

View File

@ -25,7 +25,7 @@ namespace osu.Game.Screens.Multi.Components
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuColour colours) private void load(OsuColour colours)
{ {
status.BindValueChanged(e => this.FadeColour(e.NewValue.GetAppropriateColour(colours), transitionDuration), true); status.BindValueChanged(s => this.FadeColour(s.NewValue.GetAppropriateColour(colours), transitionDuration), true);
} }
} }
} }

View File

@ -101,7 +101,7 @@ namespace osu.Game.Screens.Multi.Lounge.Components
} }
}, true); }, true);
ParticipantCount.BindValueChanged(e => summary.Text = $"{e.NewValue:#,0}{" participant".Pluralize(e.NewValue == 1)}", true); ParticipantCount.BindValueChanged(count => summary.Text = $"{count.NewValue:#,0}{" participant".Pluralize(count.NewValue == 1)}", true);
/*Participants.BindValueChanged(e => /*Participants.BindValueChanged(e =>
{ {

View File

@ -214,7 +214,7 @@ namespace osu.Game.Screens.Multi.Lounge.Components
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()
{ {
status.BindValueChanged(e => Text = e.NewValue.Message, true); status.BindValueChanged(s => Text = s.NewValue.Message, true);
} }
} }

View File

@ -108,7 +108,7 @@ namespace osu.Game.Screens.Multi.Match.Components
}, },
}; };
CurrentItem.BindValueChanged(e => modDisplay.Current.Value = e.NewValue?.RequiredMods, true); CurrentItem.BindValueChanged(item => modDisplay.Current.Value = item.NewValue?.RequiredMods, true);
beatmapButton.Action = () => RequestBeatmapSelection?.Invoke(); beatmapButton.Action = () => RequestBeatmapSelection?.Invoke();
} }
@ -126,7 +126,7 @@ namespace osu.Game.Screens.Multi.Match.Components
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()
{ {
roomId.BindValueChanged(e => this.FadeTo(e.NewValue.HasValue ? 0 : 1), true); roomId.BindValueChanged(id => this.FadeTo(id.NewValue.HasValue ? 0 : 1), true);
} }
} }

View File

@ -43,7 +43,7 @@ namespace osu.Game.Screens.Multi.Match.Components
} }
}; };
Host.BindValueChanged(e => updateHost(e.NewValue)); Host.BindValueChanged(host => updateHost(host.NewValue));
} }
private void updateHost(User host) private void updateHost(User host)

View File

@ -92,10 +92,10 @@ namespace osu.Game.Screens.Multi.Match.Components
}, },
}; };
CurrentItem.BindValueChanged(e => CurrentItem.BindValueChanged(item =>
{ {
viewBeatmapButton.Beatmap.Value = e.NewValue?.Beatmap; viewBeatmapButton.Beatmap.Value = item.NewValue?.Beatmap;
readyButton.Beatmap.Value = e.NewValue?.Beatmap; readyButton.Beatmap.Value = item.NewValue?.Beatmap;
}, true); }, true);
hostInfo.Host.BindTo(Host); hostInfo.Host.BindTo(Host);

View File

@ -23,9 +23,9 @@ namespace osu.Game.Screens.Multi.Match.Components
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()
{ {
roomId.BindValueChanged(e => roomId.BindValueChanged(id =>
{ {
if (e.NewValue == null) if (id.NewValue == null)
return; return;
Scores = null; Scores = null;

View File

@ -264,12 +264,12 @@ namespace osu.Game.Screens.Multi.Match.Components
processingOverlay = new ProcessingOverlay { Alpha = 0 } processingOverlay = new ProcessingOverlay { Alpha = 0 }
}; };
TypePicker.Current.BindValueChanged(e => typeLabel.Text = e.NewValue?.Name ?? string.Empty, true); TypePicker.Current.BindValueChanged(type => typeLabel.Text = type.NewValue?.Name ?? string.Empty, true);
Name.BindValueChanged(e => NameField.Text = e.NewValue, true); Name.BindValueChanged(name => NameField.Text = name.NewValue, true);
Availability.BindValueChanged(e => AvailabilityPicker.Current.Value = e.NewValue, true); Availability.BindValueChanged(availability => AvailabilityPicker.Current.Value = availability.NewValue, true);
Type.BindValueChanged(e => TypePicker.Current.Value = e.NewValue, true); Type.BindValueChanged(type => TypePicker.Current.Value = type.NewValue, true);
MaxParticipants.BindValueChanged(e => MaxParticipantsField.Text = e.NewValue?.ToString(), true); MaxParticipants.BindValueChanged(count => MaxParticipantsField.Text = count.NewValue?.ToString(), true);
Duration.BindValueChanged(e => DurationField.Current.Value = e.NewValue, true); Duration.BindValueChanged(duration => DurationField.Current.Value = duration.NewValue, true);
} }
protected override void Update() protected override void Update()

View File

@ -26,9 +26,9 @@ namespace osu.Game.Screens.Multi.Match.Components
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()
{ {
roomId.BindValueChanged(e => roomId.BindValueChanged(id =>
{ {
if (e.NewValue.HasValue) if (id.NewValue.HasValue)
{ {
Items.ForEach(t => t.Enabled.Value = !(t is SettingsMatchPage)); Items.ForEach(t => t.Enabled.Value = !(t is SettingsMatchPage));
Current.Value = new RoomMatchPage(); Current.Value = new RoomMatchPage();
@ -51,7 +51,7 @@ namespace osu.Game.Screens.Multi.Match.Components
: base(value) : base(value)
{ {
enabled.BindTo(value.Enabled); enabled.BindTo(value.Enabled);
enabled.BindValueChanged(e => Colour = e.NewValue ? Color4.White : Color4.Gray); enabled.BindValueChanged(enabled => Colour = enabled.NewValue ? Color4.White : Color4.Gray, true);
} }
protected override bool OnClick(ClickEvent e) protected override bool OnClick(ClickEvent e)

View File

@ -50,9 +50,9 @@ namespace osu.Game.Screens.Multi.Match.Components
}, },
}; };
Participants.BindValueChanged(e => Participants.BindValueChanged(participants =>
{ {
usersFlow.Children = e.NewValue.Select(u => new UserPanel(u) usersFlow.Children = participants.NewValue.Select(u => new UserPanel(u)
{ {
Anchor = Anchor.TopCentre, Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre, Origin = Anchor.TopCentre,

View File

@ -40,7 +40,7 @@ namespace osu.Game.Screens.Multi.Match.Components
{ {
beatmaps.ItemAdded += beatmapAdded; beatmaps.ItemAdded += beatmapAdded;
Beatmap.BindValueChanged(e => updateBeatmap(e.NewValue), true); Beatmap.BindValueChanged(b => updateBeatmap(b.NewValue), true);
} }
private void updateBeatmap(BeatmapInfo beatmap) private void updateBeatmap(BeatmapInfo beatmap)

View File

@ -28,7 +28,7 @@ namespace osu.Game.Screens.Multi.Match.Components
private void load() private void load()
{ {
if (osuGame != null) if (osuGame != null)
Beatmap.BindValueChanged(e => updateAction(e.NewValue), true); Beatmap.BindValueChanged(beatmap => updateAction(beatmap.NewValue), true);
} }
private void updateAction(BeatmapInfo beatmap) private void updateAction(BeatmapInfo beatmap)

View File

@ -146,10 +146,10 @@ namespace osu.Game.Screens.Multi.Match
}, },
}; };
header.Tabs.Current.BindValueChanged(e => header.Tabs.Current.BindValueChanged(tab =>
{ {
const float fade_duration = 500; const float fade_duration = 500;
if (e.NewValue is SettingsMatchPage) if (tab.NewValue is SettingsMatchPage)
{ {
settings.Show(); settings.Show();
info.FadeOut(fade_duration, Easing.OutQuint); info.FadeOut(fade_duration, Easing.OutQuint);

View File

@ -135,7 +135,7 @@ namespace osu.Game.Screens.Multi
protected override void LoadComplete() protected override void LoadComplete()
{ {
base.LoadComplete(); base.LoadComplete();
isIdle.BindValueChanged(e => updatePollingRate(e.NewValue), true); isIdle.BindValueChanged(idle => updatePollingRate(idle.NewValue), true);
} }
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)

View File

@ -266,12 +266,12 @@ namespace osu.Game.Screens.Ranking
modeChangeButtons.AddItem(t); modeChangeButtons.AddItem(t);
modeChangeButtons.Current.Value = modeChangeButtons.Items.FirstOrDefault(); modeChangeButtons.Current.Value = modeChangeButtons.Items.FirstOrDefault();
modeChangeButtons.Current.BindValueChanged(e => modeChangeButtons.Current.BindValueChanged(page =>
{ {
currentPage?.FadeOut(); currentPage?.FadeOut();
currentPage?.Expire(); currentPage?.Expire();
currentPage = e.NewValue?.CreatePage(); currentPage = page.NewValue?.CreatePage();
if (currentPage != null) if (currentPage != null)
circleInner.Add(currentPage); circleInner.Add(currentPage);

View File

@ -263,8 +263,8 @@ namespace osu.Game.Screens.Select
} }
}; };
titleBinding.BindValueChanged(e => setMetadata(metadata.Source)); titleBinding.BindValueChanged(_ => setMetadata(metadata.Source));
artistBinding.BindValueChanged(e => setMetadata(metadata.Source), true); artistBinding.BindValueChanged(_ => setMetadata(metadata.Source), true);
// no difficulty means it can't have a status to show // no difficulty means it can't have a status to show
if (beatmapInfo.Version == null) if (beatmapInfo.Version == null)