mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 12:42:54 +08:00
Few cleanups
This commit is contained in:
parent
efea8be97d
commit
0cf4db899f
@ -53,11 +53,12 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
AddStep("osu mods", () => ruleset.Value = new OsuRuleset().RulesetInfo);
|
AddStep("osu ruleset", () => ruleset.Value = new OsuRuleset().RulesetInfo);
|
||||||
AddStep("mania mods", () => ruleset.Value = new ManiaRuleset().RulesetInfo);
|
AddStep("mania ruleset", () => ruleset.Value = new ManiaRuleset().RulesetInfo);
|
||||||
AddStep("taiko mods", () => ruleset.Value = new TaikoRuleset().RulesetInfo);
|
AddStep("taiko ruleset", () => ruleset.Value = new TaikoRuleset().RulesetInfo);
|
||||||
AddStep("catch mods", () => ruleset.Value = new CatchRuleset().RulesetInfo);
|
AddStep("catch ruleset", () => ruleset.Value = new CatchRuleset().RulesetInfo);
|
||||||
AddStep("Deselect all", () => modSelector.DeselectAll());
|
AddStep("Deselect all", () => modSelector.DeselectAll());
|
||||||
|
AddStep("null ruleset", () => ruleset.Value = null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -74,10 +74,10 @@ namespace osu.Game.Overlays.BeatmapSet
|
|||||||
else
|
else
|
||||||
mods.Remove(mod);
|
mods.Remove(mod);
|
||||||
|
|
||||||
|
SelectedMods.Value = mods;
|
||||||
|
|
||||||
if (!mods.Any() && !IsHovered)
|
if (!mods.Any() && !IsHovered)
|
||||||
highlightAll();
|
highlightAll();
|
||||||
|
|
||||||
SelectedMods.Value = mods;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnHover(HoverEvent e)
|
protected override bool OnHover(HoverEvent e)
|
||||||
@ -116,6 +116,7 @@ namespace osu.Game.Overlays.BeatmapSet
|
|||||||
: base(mod)
|
: base(mod)
|
||||||
{
|
{
|
||||||
Scale = new Vector2(mod_scale);
|
Scale = new Vector2(mod_scale);
|
||||||
|
Highlighted.Value = true;
|
||||||
Add(new HoverClickSounds());
|
Add(new HoverClickSounds());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -123,8 +124,6 @@ namespace osu.Game.Overlays.BeatmapSet
|
|||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
Highlighted.Value = true;
|
|
||||||
|
|
||||||
Selected.BindValueChanged(selected =>
|
Selected.BindValueChanged(selected =>
|
||||||
{
|
{
|
||||||
updateState();
|
updateState();
|
||||||
@ -152,10 +151,8 @@ namespace osu.Game.Overlays.BeatmapSet
|
|||||||
|
|
||||||
private void updateState() => Highlighted.Value = IsHovered || Selected.Value;
|
private void updateState() => Highlighted.Value = IsHovered || Selected.Value;
|
||||||
|
|
||||||
protected override void OnHighlightedChange(ValueChangedEvent<bool> highlighted)
|
protected override void OnHighlightedChanged(ValueChangedEvent<bool> highlighted) =>
|
||||||
{
|
|
||||||
this.FadeColour(highlighted.NewValue ? Color4.White : Color4.Gray, duration, Easing.OutQuint);
|
this.FadeColour(highlighted.NewValue ? Color4.White : Color4.Gray, duration, Easing.OutQuint);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private class NoMod : Mod
|
private class NoMod : Mod
|
||||||
|
@ -114,10 +114,10 @@ namespace osu.Game.Rulesets.UI
|
|||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
Highlighted.BindValueChanged(OnHighlightedChange);
|
Highlighted.BindValueChanged(OnHighlightedChanged, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void OnHighlightedChange(ValueChangedEvent<bool> highlighted)
|
protected virtual void OnHighlightedChanged(ValueChangedEvent<bool> highlighted)
|
||||||
{
|
{
|
||||||
background.Colour = highlighted.NewValue ? highlightedColour : backgroundColour;
|
background.Colour = highlighted.NewValue ? highlightedColour : backgroundColour;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user