mirror of
https://github.com/ppy/osu.git
synced 2025-02-21 18:42:56 +08: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:
parent
f6303d55ec
commit
7c74951454
@ -1 +1 @@
|
|||||||
Subproject commit 12bbab717d372dadbd3220d38da862276ac97e98
|
Subproject commit 0d6dc294738d433999c6c68ff61169d3a8e6ce5f
|
@ -112,7 +112,7 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
Width = 150,
|
Width = 150,
|
||||||
Height = 10,
|
Height = 10,
|
||||||
SelectionColor = Color4.Orange,
|
SelectionColor = Color4.Orange,
|
||||||
Bindable = playbackSpeed
|
Value = playbackSpeed
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -57,7 +57,7 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
Width = 150,
|
Width = 150,
|
||||||
Height = 10,
|
Height = 10,
|
||||||
SelectionColor = Color4.Orange,
|
SelectionColor = Color4.Orange,
|
||||||
Bindable = bindable
|
Value = bindable
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -36,9 +36,9 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
filter.PinItem(GroupMode.All);
|
filter.PinItem(GroupMode.All);
|
||||||
filter.PinItem(GroupMode.RecentlyPlayed);
|
filter.PinItem(GroupMode.RecentlyPlayed);
|
||||||
|
|
||||||
filter.SelectedItem.ValueChanged += (sender, args) =>
|
filter.SelectedItem.ValueChanged += newFilter =>
|
||||||
{
|
{
|
||||||
text.Text = "Currently Selected: " + filter.SelectedItem.ToString();
|
text.Text = "Currently Selected: " + newFilter.ToString();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,8 +22,9 @@ namespace osu.Game.Beatmaps.Drawables
|
|||||||
public Action<BeatmapSetHeader> GainedSelection;
|
public Action<BeatmapSetHeader> GainedSelection;
|
||||||
private readonly SpriteText title;
|
private readonly SpriteText title;
|
||||||
private readonly SpriteText artist;
|
private readonly SpriteText artist;
|
||||||
private OsuConfigManager config;
|
|
||||||
private Bindable<bool> preferUnicode;
|
private Bindable<bool> preferUnicode;
|
||||||
|
|
||||||
private readonly WorkingBeatmap beatmap;
|
private readonly WorkingBeatmap beatmap;
|
||||||
private readonly FillFlowContainer difficultyIcons;
|
private readonly FillFlowContainer difficultyIcons;
|
||||||
|
|
||||||
@ -83,24 +84,13 @@ namespace osu.Game.Beatmaps.Drawables
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuConfigManager config)
|
private void load(OsuConfigManager config)
|
||||||
{
|
{
|
||||||
this.config = config;
|
|
||||||
|
|
||||||
preferUnicode = config.GetBindable<bool>(OsuConfig.ShowUnicode);
|
preferUnicode = config.GetBindable<bool>(OsuConfig.ShowUnicode);
|
||||||
preferUnicode.ValueChanged += preferUnicode_changed;
|
preferUnicode.ValueChanged += unicode =>
|
||||||
preferUnicode_changed(preferUnicode, null);
|
{
|
||||||
}
|
title.Text = unicode ? beatmap.BeatmapSetInfo.Metadata.TitleUnicode : beatmap.BeatmapSetInfo.Metadata.Title;
|
||||||
|
artist.Text = unicode ? beatmap.BeatmapSetInfo.Metadata.ArtistUnicode : beatmap.BeatmapSetInfo.Metadata.Artist;
|
||||||
private void preferUnicode_changed(object sender, EventArgs e)
|
};
|
||||||
{
|
preferUnicode.TriggerChange();
|
||||||
title.Text = config.GetUnicodeString(beatmap.BeatmapSetInfo.Metadata.Title, beatmap.BeatmapSetInfo.Metadata.TitleUnicode);
|
|
||||||
artist.Text = config.GetUnicodeString(beatmap.BeatmapSetInfo.Metadata.Artist, beatmap.BeatmapSetInfo.Metadata.ArtistUnicode);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Dispose(bool isDisposing)
|
|
||||||
{
|
|
||||||
if (preferUnicode != null)
|
|
||||||
preferUnicode.ValueChanged -= preferUnicode_changed;
|
|
||||||
base.Dispose(isDisposing);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private class PanelBackground : BufferedContainer
|
private class PanelBackground : BufferedContainer
|
||||||
|
@ -187,10 +187,6 @@ namespace osu.Game.Configuration
|
|||||||
#pragma warning restore CS0612 // Type or member is obsolete
|
#pragma warning restore CS0612 // Type or member is obsolete
|
||||||
}
|
}
|
||||||
|
|
||||||
//todo: make a UnicodeString class/struct rather than requiring this helper method.
|
|
||||||
public string GetUnicodeString(string nonunicode, string unicode)
|
|
||||||
=> Get<bool>(OsuConfig.ShowUnicode) ? unicode ?? nonunicode : nonunicode ?? unicode;
|
|
||||||
|
|
||||||
public OsuConfigManager(Storage storage) : base(storage)
|
public OsuConfigManager(Storage storage) : base(storage)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,6 @@ using osu.Framework.Graphics.Cursor;
|
|||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
using osu.Game.Configuration;
|
using osu.Game.Configuration;
|
||||||
using System;
|
|
||||||
|
|
||||||
namespace osu.Game.Graphics.Cursor
|
namespace osu.Game.Graphics.Cursor
|
||||||
{
|
{
|
||||||
@ -116,14 +115,9 @@ namespace osu.Game.Graphics.Cursor
|
|||||||
};
|
};
|
||||||
|
|
||||||
cursorScale = config.GetBindable<double>(OsuConfig.GameplayCursorSize);
|
cursorScale = config.GetBindable<double>(OsuConfig.GameplayCursorSize);
|
||||||
cursorScale.ValueChanged += scaleChanged;
|
cursorScale.ValueChanged += newScale => cursorContainer.Scale = new Vector2((float)cursorScale);
|
||||||
cursorScale.TriggerChange();
|
cursorScale.TriggerChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void scaleChanged(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
cursorContainer.Scale = new Vector2((float)cursorScale);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -131,14 +131,9 @@ namespace osu.Game.Graphics.Cursor
|
|||||||
};
|
};
|
||||||
|
|
||||||
cursorScale = config.GetBindable<double>(OsuConfig.MenuCursorSize);
|
cursorScale = config.GetBindable<double>(OsuConfig.MenuCursorSize);
|
||||||
cursorScale.ValueChanged += scaleChanged;
|
cursorScale.ValueChanged += newScale => cursorContainer.Scale = new Vector2((float)newScale);
|
||||||
cursorScale.TriggerChange();
|
cursorScale.TriggerChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void scaleChanged(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
cursorContainer.Scale = new Vector2((float)cursorScale);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Audio;
|
using osu.Framework.Audio;
|
||||||
using osu.Framework.Audio.Sample;
|
using osu.Framework.Audio.Sample;
|
||||||
@ -86,9 +85,9 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private void bindableValueChanged(object sender, EventArgs e)
|
private void bindableValueChanged(bool isChecked)
|
||||||
{
|
{
|
||||||
State = bindable.Value ? CheckboxState.Checked : CheckboxState.Unchecked;
|
State = isChecked ? CheckboxState.Checked : CheckboxState.Unchecked;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Dispose(bool isDisposing)
|
protected override void Dispose(bool isDisposing)
|
||||||
|
@ -98,13 +98,10 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
DisplayedCount = Current;
|
DisplayedCount = Current;
|
||||||
|
|
||||||
Current.ValueChanged += currentChanged;
|
Current.ValueChanged += newValue =>
|
||||||
}
|
{
|
||||||
|
if (IsLoaded) TransformCount(displayedCount, newValue);
|
||||||
private void currentChanged(object sender, EventArgs e)
|
};
|
||||||
{
|
|
||||||
if (IsLoaded)
|
|
||||||
TransformCount(displayedCount, Current);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System;
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
@ -19,7 +18,7 @@ namespace osu.Game.Graphics.UserInterface.Volume
|
|||||||
|
|
||||||
protected override bool HideOnEscape => false;
|
protected override bool HideOnEscape => false;
|
||||||
|
|
||||||
private void volumeChanged(object sender, EventArgs e)
|
private void volumeChanged(double newVolume)
|
||||||
{
|
{
|
||||||
Show();
|
Show();
|
||||||
schedulePopOut();
|
schedulePopOut();
|
||||||
|
@ -66,12 +66,7 @@ namespace osu.Game.Modes.UI
|
|||||||
|
|
||||||
TextSize = 80;
|
TextSize = 80;
|
||||||
|
|
||||||
Current.ValueChanged += comboChanged;
|
Current.ValueChanged += newValue => updateCount(newValue == 0);
|
||||||
}
|
|
||||||
|
|
||||||
private void comboChanged(object sender, System.EventArgs e)
|
|
||||||
{
|
|
||||||
updateCount(Current.Value == 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
|
@ -16,7 +16,7 @@ namespace osu.Game.Modes.UI
|
|||||||
|
|
||||||
protected HealthDisplay()
|
protected HealthDisplay()
|
||||||
{
|
{
|
||||||
Current.ValueChanged += (s, e) => SetHealth((float)Current);
|
Current.ValueChanged += newValue => SetHealth((float)newValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract void SetHealth(float value);
|
protected abstract void SetHealth(float value);
|
||||||
|
@ -8,7 +8,6 @@ using osu.Framework.Graphics.Containers;
|
|||||||
using osu.Game.Configuration;
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
using osu.Game.Screens.Play;
|
using osu.Game.Screens.Play;
|
||||||
using System;
|
|
||||||
using osu.Game.Modes.Scoring;
|
using osu.Game.Modes.Scoring;
|
||||||
|
|
||||||
namespace osu.Game.Modes.UI
|
namespace osu.Game.Modes.UI
|
||||||
@ -47,18 +46,16 @@ namespace osu.Game.Modes.UI
|
|||||||
private void load(OsuConfigManager config)
|
private void load(OsuConfigManager config)
|
||||||
{
|
{
|
||||||
showKeyCounter = config.GetBindable<bool>(OsuConfig.KeyOverlay);
|
showKeyCounter = config.GetBindable<bool>(OsuConfig.KeyOverlay);
|
||||||
showKeyCounter.ValueChanged += visibilityChanged;
|
showKeyCounter.ValueChanged += visibility =>
|
||||||
|
{
|
||||||
|
if (visibility)
|
||||||
|
KeyCounter.Show();
|
||||||
|
else
|
||||||
|
KeyCounter.Hide();
|
||||||
|
};
|
||||||
showKeyCounter.TriggerChange();
|
showKeyCounter.TriggerChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void visibilityChanged(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (showKeyCounter)
|
|
||||||
KeyCounter.Show();
|
|
||||||
else
|
|
||||||
KeyCounter.Hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void BindProcessor(ScoreProcessor processor)
|
public void BindProcessor(ScoreProcessor processor)
|
||||||
{
|
{
|
||||||
//bind processor bindables to combocounter, score display etc.
|
//bind processor bindables to combocounter, score display etc.
|
||||||
|
@ -39,9 +39,9 @@ namespace osu.Game.Overlays.Mods
|
|||||||
|
|
||||||
public readonly Bindable<PlayMode> PlayMode = new Bindable<PlayMode>();
|
public readonly Bindable<PlayMode> PlayMode = new Bindable<PlayMode>();
|
||||||
|
|
||||||
private void modeChanged(object sender, EventArgs eventArgs)
|
private void modeChanged(PlayMode newMode)
|
||||||
{
|
{
|
||||||
var ruleset = Ruleset.GetRuleset(PlayMode);
|
var ruleset = Ruleset.GetRuleset(newMode);
|
||||||
foreach (ModSection section in modSectionsContainer.Children)
|
foreach (ModSection section in modSectionsContainer.Children)
|
||||||
section.Buttons = ruleset.GetModsFor(section.ModType).Select(m => new ModButton(m)).ToArray();
|
section.Buttons = ruleset.GetModsFor(section.ModType).Select(m => new ModButton(m)).ToArray();
|
||||||
refreshSelectedMods();
|
refreshSelectedMods();
|
||||||
@ -56,7 +56,7 @@ namespace osu.Game.Overlays.Mods
|
|||||||
if (osu != null)
|
if (osu != null)
|
||||||
PlayMode.BindTo(osu.PlayMode);
|
PlayMode.BindTo(osu.PlayMode);
|
||||||
PlayMode.ValueChanged += modeChanged;
|
PlayMode.ValueChanged += modeChanged;
|
||||||
modeChanged(null, null);
|
PlayMode.TriggerChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void PopOut()
|
protected override void PopOut()
|
||||||
|
@ -78,8 +78,6 @@ namespace osu.Game.Overlays
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuGameBase game, OsuConfigManager config, BeatmapDatabase beatmaps, OsuColour colours)
|
private void load(OsuGameBase game, OsuConfigManager config, BeatmapDatabase beatmaps, OsuColour colours)
|
||||||
{
|
{
|
||||||
unicodeString = config.GetUnicodeString;
|
|
||||||
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
dragContainer = new Container
|
dragContainer = new Container
|
||||||
@ -210,7 +208,7 @@ namespace osu.Game.Overlays
|
|||||||
this.beatmaps = beatmaps;
|
this.beatmaps = beatmaps;
|
||||||
trackManager = game.Audio.Track;
|
trackManager = game.Audio.Track;
|
||||||
preferUnicode = config.GetBindable<bool>(OsuConfig.ShowUnicode);
|
preferUnicode = config.GetBindable<bool>(OsuConfig.ShowUnicode);
|
||||||
preferUnicode.ValueChanged += preferUnicode_changed;
|
preferUnicode.ValueChanged += unicode => updateDisplay(current, TransformDirection.None);
|
||||||
|
|
||||||
beatmapSource = game.Beatmap ?? new Bindable<WorkingBeatmap>();
|
beatmapSource = game.Beatmap ?? new Bindable<WorkingBeatmap>();
|
||||||
playList = beatmaps.GetAllWithChildren<BeatmapSetInfo>();
|
playList = beatmaps.GetAllWithChildren<BeatmapSetInfo>();
|
||||||
@ -222,7 +220,8 @@ namespace osu.Game.Overlays
|
|||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
beatmapSource.ValueChanged += workingChanged;
|
beatmapSource.ValueChanged += workingChanged;
|
||||||
workingChanged();
|
beatmapSource.TriggerChange();
|
||||||
|
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -247,17 +246,12 @@ namespace osu.Game.Overlays
|
|||||||
playButton.Icon = FontAwesome.fa_play_circle_o;
|
playButton.Icon = FontAwesome.fa_play_circle_o;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void preferUnicode_changed(object sender, EventArgs e)
|
private void workingChanged(WorkingBeatmap beatmap)
|
||||||
{
|
{
|
||||||
updateDisplay(current, TransformDirection.None);
|
progress.IsEnabled = beatmap != null;
|
||||||
}
|
if (beatmap == current) return;
|
||||||
|
bool audioEquals = current?.BeatmapInfo?.AudioEquals(beatmap?.BeatmapInfo) ?? false;
|
||||||
private void workingChanged(object sender = null, EventArgs e = null)
|
current = beatmap;
|
||||||
{
|
|
||||||
progress.IsEnabled = beatmapSource.Value != null;
|
|
||||||
if (beatmapSource.Value == current) return;
|
|
||||||
bool audioEquals = current?.BeatmapInfo?.AudioEquals(beatmapSource?.Value?.BeatmapInfo) ?? false;
|
|
||||||
current = beatmapSource.Value;
|
|
||||||
updateDisplay(current, audioEquals ? TransformDirection.None : TransformDirection.Next);
|
updateDisplay(current, audioEquals ? TransformDirection.None : TransformDirection.Next);
|
||||||
appendToHistory(current?.BeatmapInfo);
|
appendToHistory(current?.BeatmapInfo);
|
||||||
}
|
}
|
||||||
@ -342,8 +336,8 @@ namespace osu.Game.Overlays
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
BeatmapMetadata metadata = beatmap.Beatmap.BeatmapInfo.Metadata;
|
BeatmapMetadata metadata = beatmap.Beatmap.BeatmapInfo.Metadata;
|
||||||
title.Text = unicodeString(metadata.Title, metadata.TitleUnicode);
|
title.Text = preferUnicode ? metadata.TitleUnicode : metadata.Title;
|
||||||
artist.Text = unicodeString(metadata.Artist, metadata.ArtistUnicode);
|
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)
|
private void seek(float position)
|
||||||
{
|
{
|
||||||
current?.Track?.Seek(current.Track.Length * position);
|
current?.Track?.Seek(current.Track.Length * position);
|
||||||
current?.Track?.Start();
|
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;
|
private const float transition_length = 800;
|
||||||
|
|
||||||
protected override void PopIn()
|
protected override void PopIn()
|
||||||
|
@ -29,10 +29,10 @@ namespace osu.Game.Overlays.Options
|
|||||||
|
|
||||||
public BindableNumber<T> Bindable
|
public BindableNumber<T> Bindable
|
||||||
{
|
{
|
||||||
get { return slider.Bindable; }
|
get { return slider.Value; }
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
slider.Bindable = value;
|
slider.Value = value;
|
||||||
if (value?.Disabled ?? true)
|
if (value?.Disabled ?? true)
|
||||||
Alpha = 0.3f;
|
Alpha = 0.3f;
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System;
|
|
||||||
using osu.Framework.Configuration;
|
using osu.Framework.Configuration;
|
||||||
using osu.Framework.Graphics.UserInterface;
|
using osu.Framework.Graphics.UserInterface;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
@ -41,10 +40,7 @@ namespace osu.Game.Overlays.Options
|
|||||||
bindable.Value = Text;
|
bindable.Value = Text;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void bindableValueChanged(object sender, EventArgs e)
|
private void bindableValueChanged(string newValue) => Text = newValue;
|
||||||
{
|
|
||||||
Text = bindable.Value;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Dispose(bool isDisposing)
|
protected override void Dispose(bool isDisposing)
|
||||||
{
|
{
|
||||||
|
@ -5,7 +5,6 @@ using osu.Framework.Allocation;
|
|||||||
using osu.Framework.Configuration;
|
using osu.Framework.Configuration;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
using System;
|
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Options.Sections.Graphics
|
namespace osu.Game.Overlays.Options.Sections.Graphics
|
||||||
{
|
{
|
||||||
@ -52,9 +51,9 @@ namespace osu.Game.Overlays.Options.Sections.Graphics
|
|||||||
letterboxing.TriggerChange();
|
letterboxing.TriggerChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void visibilityChanged(object sender, EventArgs e)
|
private void visibilityChanged(bool newVisibility)
|
||||||
{
|
{
|
||||||
if (letterboxing)
|
if (newVisibility)
|
||||||
{
|
{
|
||||||
letterboxPositionX.Show();
|
letterboxPositionX.Show();
|
||||||
letterboxPositionY.Show();
|
letterboxPositionY.Show();
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Configuration;
|
using osu.Framework.Configuration;
|
||||||
using osu.Framework.Screens;
|
using osu.Framework.Screens;
|
||||||
@ -40,11 +39,6 @@ namespace osu.Game.Screens
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void beatmap_ValueChanged(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
OnBeatmapChanged(beatmap.Value);
|
|
||||||
}
|
|
||||||
|
|
||||||
[BackgroundDependencyLoader(permitNulls: true)]
|
[BackgroundDependencyLoader(permitNulls: true)]
|
||||||
private void load(OsuGameBase game)
|
private void load(OsuGameBase game)
|
||||||
{
|
{
|
||||||
@ -57,7 +51,7 @@ namespace osu.Game.Screens
|
|||||||
beatmap.Value = localMap;
|
beatmap.Value = localMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
beatmap.ValueChanged += beatmap_ValueChanged;
|
beatmap.ValueChanged += OnBeatmapChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void OnBeatmapChanged(WorkingBeatmap beatmap)
|
protected virtual void OnBeatmapChanged(WorkingBeatmap beatmap)
|
||||||
|
@ -275,7 +275,8 @@ namespace osu.Game.Screens.Play
|
|||||||
Background?.FadeTo((100f - dimLevel) / 100, 1500, EasingTypes.OutQuint);
|
Background?.FadeTo((100f - dimLevel) / 100, 1500, EasingTypes.OutQuint);
|
||||||
|
|
||||||
Content.Alpha = 0;
|
Content.Alpha = 0;
|
||||||
dimLevel.ValueChanged += dimChanged;
|
|
||||||
|
dimLevel.ValueChanged += newDim => Background?.FadeTo((100f - newDim) / 100, 800);
|
||||||
|
|
||||||
Content.ScaleTo(0.7f);
|
Content.ScaleTo(0.7f);
|
||||||
|
|
||||||
@ -318,18 +319,11 @@ namespace osu.Game.Screens.Play
|
|||||||
{
|
{
|
||||||
FadeOut(250);
|
FadeOut(250);
|
||||||
Content.ScaleTo(0.7f, 750, EasingTypes.InQuint);
|
Content.ScaleTo(0.7f, 750, EasingTypes.InQuint);
|
||||||
|
|
||||||
dimLevel.ValueChanged -= dimChanged;
|
|
||||||
Background?.FadeTo(1f, 200);
|
Background?.FadeTo(1f, 200);
|
||||||
return base.OnExiting(next);
|
return base.OnExiting(next);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void dimChanged(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
Background?.FadeTo((100f - dimLevel) / 100, 800);
|
|
||||||
}
|
|
||||||
|
|
||||||
private Bindable<bool> mouseWheelDisabled;
|
private Bindable<bool> mouseWheelDisabled;
|
||||||
|
|
||||||
protected override bool OnWheel(InputState state) => mouseWheelDisabled.Value && !IsPaused;
|
protected override bool OnWheel(InputState state) => mouseWheelDisabled.Value && !IsPaused;
|
||||||
|
@ -61,7 +61,7 @@ namespace osu.Game.Screens.Select
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
tabs.SelectedItem.ValueChanged += (sender, e) => invokeOnFilter();
|
tabs.SelectedItem.ValueChanged += item => invokeOnFilter();
|
||||||
modsCheckbox.Action += (sender, e) => invokeOnFilter();
|
modsCheckbox.Action += (sender, e) => invokeOnFilter();
|
||||||
|
|
||||||
tabs.SelectedItem.Value = BeatmapDetailTab.Global;
|
tabs.SelectedItem.Value = BeatmapDetailTab.Global;
|
||||||
|
@ -151,8 +151,8 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
groupTabs.PinItem(GroupMode.All);
|
groupTabs.PinItem(GroupMode.All);
|
||||||
groupTabs.PinItem(GroupMode.RecentlyPlayed);
|
groupTabs.PinItem(GroupMode.RecentlyPlayed);
|
||||||
groupTabs.ItemChanged += (sender, value) => Group = value;
|
groupTabs.SelectedItem.ValueChanged += val => Group = val;
|
||||||
sortTabs.ItemChanged += (sender, value) => Sort = value;
|
sortTabs.SelectedItem.ValueChanged += val => Sort = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Deactivate()
|
public void Deactivate()
|
||||||
@ -175,7 +175,7 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
if (osu != null)
|
if (osu != null)
|
||||||
playMode.BindTo(osu.PlayMode);
|
playMode.BindTo(osu.PlayMode);
|
||||||
playMode.ValueChanged += (s, e) => FilterChanged?.Invoke(CreateCriteria());
|
playMode.ValueChanged += val => FilterChanged?.Invoke(CreateCriteria());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => true;
|
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => true;
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
@ -170,7 +169,7 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
if (osu != null)
|
if (osu != null)
|
||||||
playMode.BindTo(osu.PlayMode);
|
playMode.BindTo(osu.PlayMode);
|
||||||
playMode.ValueChanged += playMode_ValueChanged;
|
playMode.ValueChanged += val => Beatmap.PreferredPlayMode = val;
|
||||||
|
|
||||||
if (database == null)
|
if (database == null)
|
||||||
database = beatmaps;
|
database = beatmaps;
|
||||||
@ -276,8 +275,6 @@ namespace osu.Game.Screens.Select
|
|||||||
initialAddSetsTask.Cancel();
|
initialAddSetsTask.Cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void playMode_ValueChanged(object sender, EventArgs e) => Beatmap.PreferredPlayMode = playMode;
|
|
||||||
|
|
||||||
private void changeBackground(WorkingBeatmap beatmap)
|
private void changeBackground(WorkingBeatmap beatmap)
|
||||||
{
|
{
|
||||||
var backgroundModeBeatmap = Background as BackgroundScreenBeatmap;
|
var backgroundModeBeatmap = Background as BackgroundScreenBeatmap;
|
||||||
|
Loading…
Reference in New Issue
Block a user