mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 16:59:53 +09:00
Update bindables.
# Conflicts: # osu.Desktop.VisualTests/Tests/TestCaseResults.cs # osu.Game/Screens/Ranking/ResultModeButton.cs # osu.Game/Screens/Ranking/Results.cs
This commit is contained in:
@ -78,8 +78,6 @@ namespace osu.Game.Overlays
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuGameBase game, OsuConfigManager config, BeatmapDatabase beatmaps, OsuColour colours)
|
||||
{
|
||||
unicodeString = config.GetUnicodeString;
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
dragContainer = new Container
|
||||
@ -210,7 +208,7 @@ namespace osu.Game.Overlays
|
||||
this.beatmaps = beatmaps;
|
||||
trackManager = game.Audio.Track;
|
||||
preferUnicode = config.GetBindable<bool>(OsuConfig.ShowUnicode);
|
||||
preferUnicode.ValueChanged += preferUnicode_changed;
|
||||
preferUnicode.ValueChanged += unicode => updateDisplay(current, TransformDirection.None);
|
||||
|
||||
beatmapSource = game.Beatmap ?? new Bindable<WorkingBeatmap>();
|
||||
playList = beatmaps.GetAllWithChildren<BeatmapSetInfo>();
|
||||
@ -222,7 +220,8 @@ namespace osu.Game.Overlays
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
beatmapSource.ValueChanged += workingChanged;
|
||||
workingChanged();
|
||||
beatmapSource.TriggerChange();
|
||||
|
||||
base.LoadComplete();
|
||||
}
|
||||
|
||||
@ -247,17 +246,12 @@ namespace osu.Game.Overlays
|
||||
playButton.Icon = FontAwesome.fa_play_circle_o;
|
||||
}
|
||||
|
||||
private void preferUnicode_changed(object sender, EventArgs e)
|
||||
private void workingChanged(WorkingBeatmap beatmap)
|
||||
{
|
||||
updateDisplay(current, TransformDirection.None);
|
||||
}
|
||||
|
||||
private void workingChanged(object sender = null, EventArgs e = null)
|
||||
{
|
||||
progress.IsEnabled = beatmapSource.Value != null;
|
||||
if (beatmapSource.Value == current) return;
|
||||
bool audioEquals = current?.BeatmapInfo?.AudioEquals(beatmapSource?.Value?.BeatmapInfo) ?? false;
|
||||
current = beatmapSource.Value;
|
||||
progress.IsEnabled = beatmap != null;
|
||||
if (beatmap == current) return;
|
||||
bool audioEquals = current?.BeatmapInfo?.AudioEquals(beatmap?.BeatmapInfo) ?? false;
|
||||
current = beatmap;
|
||||
updateDisplay(current, audioEquals ? TransformDirection.None : TransformDirection.Next);
|
||||
appendToHistory(current?.BeatmapInfo);
|
||||
}
|
||||
@ -342,8 +336,8 @@ namespace osu.Game.Overlays
|
||||
else
|
||||
{
|
||||
BeatmapMetadata metadata = beatmap.Beatmap.BeatmapInfo.Metadata;
|
||||
title.Text = unicodeString(metadata.Title, metadata.TitleUnicode);
|
||||
artist.Text = unicodeString(metadata.Artist, metadata.ArtistUnicode);
|
||||
title.Text = preferUnicode ? metadata.TitleUnicode : metadata.Title;
|
||||
artist.Text = preferUnicode ? metadata.ArtistUnicode : metadata.Artist;
|
||||
}
|
||||
});
|
||||
|
||||
@ -374,21 +368,12 @@ namespace osu.Game.Overlays
|
||||
};
|
||||
}
|
||||
|
||||
private Func<string, string, string> unicodeString;
|
||||
|
||||
private void seek(float position)
|
||||
{
|
||||
current?.Track?.Seek(current.Track.Length * position);
|
||||
current?.Track?.Start();
|
||||
}
|
||||
|
||||
protected override void Dispose(bool isDisposing)
|
||||
{
|
||||
if (preferUnicode != null)
|
||||
preferUnicode.ValueChanged -= preferUnicode_changed;
|
||||
base.Dispose(isDisposing);
|
||||
}
|
||||
|
||||
private const float transition_length = 800;
|
||||
|
||||
protected override void PopIn()
|
||||
|
Reference in New Issue
Block a user