1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-05 06:32:55 +08:00

Apply suggestions from code review

Co-Authored-By: smoogipoo <1329837+smoogipoo@users.noreply.github.com>
This commit is contained in:
Dean Herbert 2019-02-22 17:06:49 +09:00 committed by GitHub
parent 8f53af1c71
commit 452caabd40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 20 additions and 20 deletions

View File

@ -51,7 +51,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables.Pieces
direction.BindTo(scrollingInfo.Direction); direction.BindTo(scrollingInfo.Direction);
direction.BindValueChanged(e => direction.BindValueChanged(e =>
{ {
colouredBox.Anchor = colouredBox.Origin = direction.Value == ScrollingDirection.Up ? Anchor.TopCentre : Anchor.BottomCentre; colouredBox.Anchor = colouredBox.Origin = e.NewValue == ScrollingDirection.Up ? Anchor.TopCentre : Anchor.BottomCentre;
}, true); }, true);
} }

View File

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

View File

@ -51,7 +51,7 @@ namespace osu.Game.Rulesets.Mania.UI.Components
direction.BindTo(scrollingInfo.Direction); direction.BindTo(scrollingInfo.Direction);
direction.BindValueChanged(e => direction.BindValueChanged(e =>
{ {
Anchor anchor = direction.Value == ScrollingDirection.Up ? Anchor.TopLeft : Anchor.BottomLeft; Anchor anchor = e.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

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

View File

@ -183,13 +183,13 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
}; };
this.beatmap.BindTo(beatmap); this.beatmap.BindTo(beatmap);
this.beatmap.ValueChanged += e => calculateScale(); this.beatmap.ValueChanged += _ => calculateScale();
cursorScale = config.GetBindable<double>(OsuSetting.GameplayCursorSize); cursorScale = config.GetBindable<double>(OsuSetting.GameplayCursorSize);
cursorScale.ValueChanged += e => calculateScale(); cursorScale.ValueChanged += _ => calculateScale();
autoCursorScale = config.GetBindable<bool>(OsuSetting.AutoCursorSize); autoCursorScale = config.GetBindable<bool>(OsuSetting.AutoCursorSize);
autoCursorScale.ValueChanged += e => calculateScale(); autoCursorScale.ValueChanged += _ => calculateScale();
calculateScale(); calculateScale();
} }

View File

@ -60,7 +60,7 @@ namespace osu.Game.Tests.Visual
} }
}; };
drawableDate.Current.ValueChanged += e => flash.FadeOutFromOne(500); drawableDate.Current.ValueChanged += _ => flash.FadeOutFromOne(500);
} }
} }
} }

View File

@ -36,7 +36,7 @@ namespace osu.Game.Beatmaps
BeatmapSetInfo = beatmapInfo.BeatmapSet; BeatmapSetInfo = beatmapInfo.BeatmapSet;
Metadata = beatmapInfo.Metadata ?? BeatmapSetInfo?.Metadata ?? new BeatmapMetadata(); Metadata = beatmapInfo.Metadata ?? BeatmapSetInfo?.Metadata ?? new BeatmapMetadata();
Mods.ValueChanged += e => applyRateAdjustments(); Mods.ValueChanged += _ => applyRateAdjustments();
beatmap = new RecyclableLazy<IBeatmap>(() => beatmap = new RecyclableLazy<IBeatmap>(() =>
{ {

View File

@ -223,7 +223,7 @@ namespace osu.Game.Overlays.BeatmapSet
{ {
case DownloadState.LocallyAvailable: case DownloadState.LocallyAvailable:
// temporary for UX until new design is implemented. // temporary for UX until new design is implemented.
downloadButtonsContainer.Child = new osu.Game.Overlays.Direct.DownloadButton(BeatmapSet.Value) downloadButtonsContainer.Child = new osu.Game.Overlays.Direct.DownloadButton(e.NewValue)
{ {
Width = 50, Width = 50,
RelativeSizeAxes = Axes.Y RelativeSizeAxes = Axes.Y
@ -232,12 +232,12 @@ namespace osu.Game.Overlays.BeatmapSet
case DownloadState.Downloading: case DownloadState.Downloading:
case DownloadState.Downloaded: case DownloadState.Downloaded:
// temporary to avoid showing two buttons for maps with novideo. will be fixed in new beatmap overlay design. // temporary to avoid showing two buttons for maps with novideo. will be fixed in new beatmap overlay design.
downloadButtonsContainer.Child = new DownloadButton(BeatmapSet.Value); downloadButtonsContainer.Child = new DownloadButton(e.NewValue);
break; break;
default: default:
downloadButtonsContainer.Child = new DownloadButton(BeatmapSet.Value); downloadButtonsContainer.Child = new DownloadButton(e.NewValue);
if (BeatmapSet.Value.OnlineInfo.HasVideo) if (BeatmapSet.Value.OnlineInfo.HasVideo)
downloadButtonsContainer.Add(new DownloadButton(BeatmapSet.Value, true)); downloadButtonsContainer.Add(new DownloadButton(e.NewValue, true));
break; break;
} }
} }

View File

@ -100,7 +100,7 @@ namespace osu.Game.Overlays.Music
titleBind = localisation.GetLocalisedString(new LocalisedString((metadata.TitleUnicode, metadata.Title))); titleBind = localisation.GetLocalisedString(new LocalisedString((metadata.TitleUnicode, metadata.Title)));
artistBind = localisation.GetLocalisedString(new LocalisedString((metadata.ArtistUnicode, metadata.Artist))); artistBind = localisation.GetLocalisedString(new LocalisedString((metadata.ArtistUnicode, metadata.Artist)));
artistBind.BindValueChanged(e => recreateText(), true); artistBind.BindValueChanged(_ => recreateText(), true);
} }
private void recreateText() private void recreateText()

View File

@ -119,8 +119,8 @@ namespace osu.Game.Overlays.Settings
set set
{ {
bindable = value; bindable = value;
bindable.ValueChanged += e => UpdateState(); bindable.ValueChanged += _ => UpdateState();
bindable.DisabledChanged += disabled => UpdateState(); bindable.DisabledChanged += _ => UpdateState();
} }
} }

View File

@ -67,9 +67,9 @@ namespace osu.Game.Overlays
} }
}; };
Header.Tabs.Current.ValueChanged += e => Scheduler.AddOnce(updateSearch); Header.Tabs.Current.ValueChanged += _ => Scheduler.AddOnce(updateSearch);
Filter.Tabs.Current.ValueChanged += e => Scheduler.AddOnce(updateSearch); Filter.Tabs.Current.ValueChanged += _ => Scheduler.AddOnce(updateSearch);
Filter.DisplayStyleControl.DisplayStyle.ValueChanged += e => recreatePanels(e.NewValue); Filter.DisplayStyleControl.DisplayStyle.ValueChanged += e => recreatePanels(e.NewValue);
Filter.DisplayStyleControl.Dropdown.Current.ValueChanged += e => Scheduler.AddOnce(updateSearch); Filter.DisplayStyleControl.Dropdown.Current.ValueChanged += e => Scheduler.AddOnce(updateSearch);

View File

@ -28,7 +28,7 @@ namespace osu.Game.Screens.Multi.Match.Components
{ {
base.LoadComplete(); base.LoadComplete();
roomId.BindValueChanged(e => updateChannel(), true); roomId.BindValueChanged(_ => updateChannel(), true);
} }
private void updateChannel() private void updateChannel()