diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/ElongatedCirclePiece.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/ElongatedCirclePiece.cs
index 1af3705694..bed54d358e 100644
--- a/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/ElongatedCirclePiece.cs
+++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/Pieces/ElongatedCirclePiece.cs
@@ -3,14 +3,13 @@
using System;
using osu.Framework.Graphics.Primitives;
-using osu.Game.Rulesets.Taiko.UI;
namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces
{
public class ElongatedCirclePiece : CirclePiece
{
///
- /// As we are being used to define the absolute size of hits, we need to be given a relative reference of our containing .
+ /// As we are being used to define the absolute size of hits, we need to be given a relative reference of our containing playfield container.
///
public Func PlayfieldLengthReference;
@@ -38,4 +37,4 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces
Width = (PlayfieldLengthReference?.Invoke() ?? 0) * Length + DrawHeight;
}
}
-}
\ No newline at end of file
+}
diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs
index a31c1f882d..d47ed48e99 100644
--- a/osu.Game/Configuration/OsuConfigManager.cs
+++ b/osu.Game/Configuration/OsuConfigManager.cs
@@ -38,6 +38,8 @@ namespace osu.Game.Configuration
Set(OsuConfig.KeyOverlay, false);
//todo: implement all settings below this line (remove the Disabled set when doing so).
+ Set(OsuConfig.AudioOffset, 0, -500.0, 500.0);
+
Set(OsuConfig.MouseSpeed, 1.0).Disabled = true;
Set(OsuConfig.BeatmapDirectory, @"Songs").Disabled = true; // TODO: use thi.Disabled = trues
Set(OsuConfig.AllowPublicInvites, true).Disabled = true;
@@ -103,7 +105,6 @@ namespace osu.Game.Configuration
Set(OsuConfig.ManiaSpeedBPMScale, true).Disabled = true;
Set(OsuConfig.MenuTip, 0).Disabled = true;
Set(OsuConfig.MouseSpeed, 1, 0.4, 6).Disabled = true;
- Set(OsuConfig.Offset, 0, -300, 300).Disabled = true;
Set(OsuConfig.ScoreMeterScale, 1, 0.5, 2).Disabled = true;
//Set(OsuConfig.ScoreMeterScale, 1, 0.5, OsuGame.Tournament ? 10 : 2).Disabled = true;
Set(OsuConfig.DistanceSpacing, 0.8, 0.1, 6).Disabled = true;
@@ -270,7 +271,7 @@ namespace osu.Game.Configuration
MouseDisableButtons,
MouseDisableWheel,
MouseSpeed,
- Offset,
+ AudioOffset,
ScoreMeterScale,
DistanceSpacing,
EditorBeatDivisor,
diff --git a/osu.Game/Graphics/UserInterface/OsuCheckbox.cs b/osu.Game/Graphics/UserInterface/OsuCheckbox.cs
index d339388aa5..e81db4954e 100644
--- a/osu.Game/Graphics/UserInterface/OsuCheckbox.cs
+++ b/osu.Game/Graphics/UserInterface/OsuCheckbox.cs
@@ -25,8 +25,6 @@ namespace osu.Game.Graphics.UserInterface
{
bindable = value;
Current.BindTo(bindable);
- if (value?.Disabled ?? true)
- Alpha = 0.3f;
}
}
@@ -84,6 +82,11 @@ namespace osu.Game.Graphics.UserInterface
else
sampleUnchecked?.Play();
};
+
+ Current.DisabledChanged += disabled =>
+ {
+ Alpha = disabled ? 0.3f : 1;
+ };
}
protected override bool OnHover(InputState state)
diff --git a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs
index 6d36c1a585..9b9a774049 100644
--- a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs
+++ b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs
@@ -74,6 +74,11 @@ namespace osu.Game.Graphics.UserInterface
Expanded = true,
}
};
+
+ Current.DisabledChanged += disabled =>
+ {
+ Alpha = disabled ? 0.3f : 1;
+ };
}
[BackgroundDependencyLoader]
diff --git a/osu.Game/Graphics/UserInterface/OsuTextBox.cs b/osu.Game/Graphics/UserInterface/OsuTextBox.cs
index a54b122615..62b10b96ef 100644
--- a/osu.Game/Graphics/UserInterface/OsuTextBox.cs
+++ b/osu.Game/Graphics/UserInterface/OsuTextBox.cs
@@ -33,6 +33,11 @@ namespace osu.Game.Graphics.UserInterface
Height = 40;
TextContainer.Height = 0.5f;
CornerRadius = 5;
+
+ Current.DisabledChanged += disabled =>
+ {
+ Alpha = disabled ? 0.3f : 1;
+ };
}
[BackgroundDependencyLoader]
diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs
index a139c4d6ce..c9f41de5f2 100644
--- a/osu.Game/OsuGame.cs
+++ b/osu.Game/OsuGame.cs
@@ -203,13 +203,7 @@ namespace osu.Game
{
Depth = -3,
OnHome = delegate { intro?.ChildScreen?.MakeCurrent(); },
- OnRulesetChange = r => Ruleset.Value = r,
- }, t =>
- {
- Ruleset.ValueChanged += delegate { Toolbar.SetRuleset(Ruleset.Value); };
- Ruleset.TriggerChange();
- overlayContent.Add(Toolbar);
- });
+ }, overlayContent.Add);
options.StateChanged += delegate
{
diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs
index 48c7890f6e..6eb9747eef 100644
--- a/osu.Game/OsuGameBase.cs
+++ b/osu.Game/OsuGameBase.cs
@@ -147,8 +147,16 @@ namespace osu.Game
{
Children = new Drawable[]
{
- Cursor = new MenuCursor { Depth = float.MinValue },
- new TooltipContainer(Cursor) { Depth = float.MinValue }
+ new Container
+ {
+ RelativeSizeAxes = Axes.Both,
+ Depth = float.MinValue,
+ Children = new Drawable[]
+ {
+ Cursor = new MenuCursor(),
+ new TooltipContainer(Cursor) { Depth = -1 },
+ }
+ },
}
});
}
diff --git a/osu.Game/Overlays/Options/OptionDropdown.cs b/osu.Game/Overlays/Options/OptionDropdown.cs
index ee12ba9b05..8642b132df 100644
--- a/osu.Game/Overlays/Options/OptionDropdown.cs
+++ b/osu.Game/Overlays/Options/OptionDropdown.cs
@@ -34,8 +34,6 @@ namespace osu.Game.Overlays.Options
{
bindable = value;
dropdown.Current.BindTo(bindable);
- if (value?.Disabled ?? true)
- Alpha = 0.3f;
}
}
@@ -75,6 +73,11 @@ namespace osu.Game.Overlays.Options
Items = Items,
}
};
+
+ dropdown.Current.DisabledChanged += disabled =>
+ {
+ Alpha = disabled ? 0.3f : 1;
+ };
}
}
}
diff --git a/osu.Game/Overlays/Options/OptionSlider.cs b/osu.Game/Overlays/Options/OptionSlider.cs
index 1c4b54a080..5c383c74a8 100644
--- a/osu.Game/Overlays/Options/OptionSlider.cs
+++ b/osu.Game/Overlays/Options/OptionSlider.cs
@@ -35,8 +35,6 @@ namespace osu.Game.Overlays.Options
{
bindable = value;
slider.Current.BindTo(bindable);
- if (value?.Disabled ?? true)
- Alpha = 0.3f;
}
}
diff --git a/osu.Game/Overlays/Options/OptionTextBox.cs b/osu.Game/Overlays/Options/OptionTextBox.cs
index b5ef39c8b2..4927122181 100644
--- a/osu.Game/Overlays/Options/OptionTextBox.cs
+++ b/osu.Game/Overlays/Options/OptionTextBox.cs
@@ -16,9 +16,7 @@ namespace osu.Game.Overlays.Options
{
bindable = value;
Current.BindTo(bindable);
- if (value?.Disabled ?? true)
- Alpha = 0.3f;
}
}
}
-}
\ No newline at end of file
+}
diff --git a/osu.Game/Overlays/Options/Sections/Audio/OffsetOptions.cs b/osu.Game/Overlays/Options/Sections/Audio/OffsetOptions.cs
index 2602565c29..c1f5359585 100644
--- a/osu.Game/Overlays/Options/Sections/Audio/OffsetOptions.cs
+++ b/osu.Game/Overlays/Options/Sections/Audio/OffsetOptions.cs
@@ -18,10 +18,10 @@ namespace osu.Game.Overlays.Options.Sections.Audio
{
Children = new Drawable[]
{
- new OptionSlider
+ new OptionSlider
{
- LabelText = "Universal Offset",
- Bindable = (BindableInt)config.GetBindable(OsuConfig.Offset)
+ LabelText = "Audio Offset",
+ Bindable = (BindableDouble)config.GetBindable(OsuConfig.AudioOffset)
},
new OsuButton
{
diff --git a/osu.Game/Overlays/Toolbar/Toolbar.cs b/osu.Game/Overlays/Toolbar/Toolbar.cs
index a5074100c7..43c3cd32f2 100644
--- a/osu.Game/Overlays/Toolbar/Toolbar.cs
+++ b/osu.Game/Overlays/Toolbar/Toolbar.cs
@@ -8,7 +8,6 @@ using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Input;
-using osu.Game.Database;
using osu.Game.Graphics;
using OpenTK;
@@ -20,9 +19,7 @@ namespace osu.Game.Overlays.Toolbar
public const float TOOLTIP_HEIGHT = 30;
public Action OnHome;
- public Action OnRulesetChange;
- private readonly ToolbarModeSelector modeSelector;
private readonly ToolbarUserArea userArea;
protected override bool HideOnEscape => false;
@@ -53,13 +50,7 @@ namespace osu.Game.Overlays.Toolbar
{
Action = () => OnHome?.Invoke()
},
- modeSelector = new ToolbarModeSelector
- {
- OnRulesetChange = mode =>
- {
- OnRulesetChange?.Invoke(mode);
- }
- }
+ new ToolbarModeSelector()
}
},
new FillFlowContainer
@@ -130,8 +121,6 @@ namespace osu.Game.Overlays.Toolbar
}
}
- public void SetRuleset(RulesetInfo ruleset) => modeSelector.SetRuleset(ruleset);
-
protected override void PopIn()
{
MoveToY(0, transition_time, EasingTypes.OutQuint);
diff --git a/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs b/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs
index 1d3260bb23..209b64e709 100644
--- a/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs
+++ b/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs
@@ -1,7 +1,6 @@
// Copyright (c) 2007-2017 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using System;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Caching;
@@ -12,6 +11,7 @@ using osu.Framework.Graphics.Sprites;
using osu.Game.Database;
using OpenTK;
using OpenTK.Graphics;
+using osu.Framework.Configuration;
namespace osu.Game.Overlays.Toolbar
{
@@ -23,7 +23,7 @@ namespace osu.Game.Overlays.Toolbar
private readonly Drawable modeButtonLine;
private ToolbarModeButton activeButton;
- public Action OnRulesetChange;
+ private readonly Bindable ruleset = new Bindable();
public ToolbarModeSelector()
{
@@ -66,30 +66,36 @@ namespace osu.Game.Overlays.Toolbar
}
[BackgroundDependencyLoader]
- private void load(RulesetDatabase rulesets)
+ private void load(RulesetDatabase rulesets, OsuGame game)
{
- foreach (var ruleset in rulesets.AllRulesets)
+ foreach (var r in rulesets.AllRulesets)
{
modeButtons.Add(new ToolbarModeButton
{
- Ruleset = ruleset,
+ Ruleset = r,
Action = delegate
{
- SetRuleset(ruleset);
- OnRulesetChange?.Invoke(ruleset);
+ ruleset.Value = r;
}
});
}
+
+ ruleset.ValueChanged += rulesetChanged;
+ ruleset.DisabledChanged += disabledChanged;
+ ruleset.BindTo(game.Ruleset);
}
+ public override bool HandleInput => !ruleset.Disabled;
+
+ private void disabledChanged(bool isDisabled) => FadeColour(isDisabled ? Color4.Gray : Color4.White, 300);
+
protected override void Update()
{
base.Update();
-
Size = new Vector2(modeButtons.DrawSize.X, 1);
}
- public void SetRuleset(RulesetInfo ruleset)
+ private void rulesetChanged(RulesetInfo ruleset)
{
foreach (ToolbarModeButton m in modeButtons.Children.Cast())
{
diff --git a/osu.Game/Rulesets/Judgements/IPartialJudgement.cs b/osu.Game/Rulesets/Judgements/IPartialJudgement.cs
index e11270a8c0..38080835e0 100644
--- a/osu.Game/Rulesets/Judgements/IPartialJudgement.cs
+++ b/osu.Game/Rulesets/Judgements/IPartialJudgement.cs
@@ -1,22 +1,15 @@
// Copyright (c) 2007-2017 ppy Pty Ltd .
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
-using osu.Game.Rulesets.Objects.Drawables;
-using osu.Game.Rulesets.Scoring;
-
namespace osu.Game.Rulesets.Judgements
{
///
/// Inidicates that the judgement this is attached to is a partial judgement and the scoring value may change.
- ///
- /// This judgement will be continually processed by
- /// unless the result is a miss and will trigger a full re-process of the when changed.
- ///
///
public interface IPartialJudgement
{
///
- /// Indicates that this partial judgement has changed and requires a full re-process of the .
+ /// Indicates that this partial judgement has changed and requires reprocessing.
///
/// This is set to false once the judgement has been re-processed.
///
diff --git a/osu.Game/Screens/OsuScreen.cs b/osu.Game/Screens/OsuScreen.cs
index d0856bfe3e..0b3ecb4f5a 100644
--- a/osu.Game/Screens/OsuScreen.cs
+++ b/osu.Game/Screens/OsuScreen.cs
@@ -5,6 +5,7 @@ using osu.Framework.Allocation;
using osu.Framework.Configuration;
using osu.Framework.Screens;
using osu.Game.Beatmaps;
+using osu.Game.Database;
using osu.Game.Graphics.Containers;
namespace osu.Game.Screens
@@ -25,8 +26,12 @@ namespace osu.Game.Screens
internal virtual bool HasLocalCursorDisplayed => false;
+ internal virtual bool AllowRulesetChange => true;
+
private readonly Bindable beatmap = new Bindable();
+ private readonly Bindable ruleset = new Bindable();
+
public WorkingBeatmap Beatmap
{
get
@@ -40,7 +45,7 @@ namespace osu.Game.Screens
}
[BackgroundDependencyLoader(permitNulls: true)]
- private void load(OsuGameBase game)
+ private void load(OsuGameBase game, OsuGame osuGame)
{
if (game != null)
{
@@ -52,11 +57,23 @@ namespace osu.Game.Screens
}
beatmap.ValueChanged += OnBeatmapChanged;
+
+ if (osuGame != null)
+ ruleset.BindTo(osuGame.Ruleset);
}
+ ///
+ /// The global Beatmap was changed.
+ ///
protected virtual void OnBeatmapChanged(WorkingBeatmap beatmap)
{
+ }
+ protected override void Update()
+ {
+ if (!IsCurrentScreen) return;
+
+ ruleset.Disabled = !AllowRulesetChange;
}
protected override void OnEntering(Screen last)
diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs
index 5624cd75f9..a31ac25d60 100644
--- a/osu.Game/Screens/Play/Player.cs
+++ b/osu.Game/Screens/Play/Player.cs
@@ -40,6 +40,8 @@ namespace osu.Game.Screens.Play
public bool IsPaused => !interpolatedSourceClock.IsRunning;
+ internal override bool AllowRulesetChange => false;
+
public bool HasFailed { get; private set; }
public int RestartCount;
@@ -50,13 +52,22 @@ namespace osu.Game.Screens.Play
private bool canPause => ValidForResume && !HasFailed && Time.Current >= lastPauseActionTime + pause_cooldown;
private IAdjustableClock sourceClock;
+ private OffsetClock offsetClock;
private IFrameBasedClock interpolatedSourceClock;
private RulesetInfo ruleset;
private ScoreProcessor scoreProcessor;
protected HitRenderer HitRenderer;
+
+ #region User Settings
+
private Bindable dimLevel;
+ private Bindable mouseWheelDisabled;
+ private Bindable userAudioOffset;
+
+ #endregion
+
private SkipButton skipButton;
private HudOverlay hudOverlay;
@@ -116,7 +127,13 @@ namespace osu.Game.Screens.Play
}
sourceClock = (IAdjustableClock)track ?? new StopwatchClock();
- interpolatedSourceClock = new InterpolatingFramedClock(sourceClock);
+ offsetClock = new OffsetClock(sourceClock);
+
+ userAudioOffset = config.GetBindable(OsuConfig.AudioOffset);
+ userAudioOffset.ValueChanged += v => offsetClock.Offset = v;
+ userAudioOffset.TriggerChange();
+
+ interpolatedSourceClock = new InterpolatingFramedClock(offsetClock);
Schedule(() =>
{
@@ -363,8 +380,6 @@ namespace osu.Game.Screens.Play
Background?.FadeTo(1f, fade_out_duration);
}
- private Bindable mouseWheelDisabled;
-
protected override bool OnWheel(InputState state) => mouseWheelDisabled.Value && !IsPaused;
}
}
diff --git a/osu.Game/Screens/Play/PlayerLoader.cs b/osu.Game/Screens/Play/PlayerLoader.cs
index 615b138ead..765abd9873 100644
--- a/osu.Game/Screens/Play/PlayerLoader.cs
+++ b/osu.Game/Screens/Play/PlayerLoader.cs
@@ -27,6 +27,8 @@ namespace osu.Game.Screens.Play
private bool showOverlays = true;
internal override bool ShowOverlays => showOverlays;
+ internal override bool AllowRulesetChange => false;
+
protected override BackgroundScreen CreateBackground() => new BackgroundScreenBeatmap(Beatmap);
public PlayerLoader(Player player)
diff --git a/osu.Game/Screens/Ranking/Results.cs b/osu.Game/Screens/Ranking/Results.cs
index f4edc11436..ffe72966f5 100644
--- a/osu.Game/Screens/Ranking/Results.cs
+++ b/osu.Game/Screens/Ranking/Results.cs
@@ -31,6 +31,8 @@ namespace osu.Game.Screens.Ranking
private ResultModeTabControl modeChangeButtons;
+ internal override bool AllowRulesetChange => false;
+
private Container currentPage;
private static readonly Vector2 background_blur = new Vector2(20);
diff --git a/osu.Game/Screens/ScreenWhiteBox.cs b/osu.Game/Screens/ScreenWhiteBox.cs
index dca5e17efa..04432058dc 100644
--- a/osu.Game/Screens/ScreenWhiteBox.cs
+++ b/osu.Game/Screens/ScreenWhiteBox.cs
@@ -7,12 +7,15 @@ using osu.Framework.Screens;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
-using osu.Framework.Graphics.UserInterface;
using osu.Game.Graphics.Sprites;
using osu.Game.Screens.Backgrounds;
using osu.Game.Graphics.UserInterface;
using OpenTK;
using OpenTK.Graphics;
+using osu.Framework.Allocation;
+using osu.Framework.Audio;
+using osu.Game.Graphics;
+using osu.Framework.Extensions.Color4Extensions;
namespace osu.Game.Screens
{
@@ -24,8 +27,8 @@ namespace osu.Game.Screens
protected virtual IEnumerable PossibleChildren => null;
- private readonly Container textContainer;
- private readonly Box box;
+ private readonly FillFlowContainer textContainer;
+ private readonly Container boxContainer;
protected override BackgroundScreen CreateBackground() => new BackgroundScreenCustom(@"Backgrounds/bg2");
@@ -40,13 +43,13 @@ namespace osu.Game.Screens
Content.Alpha = 0;
textContainer.Position = new Vector2(DrawSize.X / 16, 0);
- box.ScaleTo(0.2f);
- box.RotateTo(-20);
+ boxContainer.ScaleTo(0.2f);
+ boxContainer.RotateTo(-20);
Content.Delay(300, true);
- box.ScaleTo(1, transition_time, EasingTypes.OutElastic);
- box.RotateTo(0, transition_time / 2, EasingTypes.OutQuint);
+ boxContainer.ScaleTo(1, transition_time, EasingTypes.OutElastic);
+ boxContainer.RotateTo(0, transition_time / 2, EasingTypes.OutQuint);
textContainer.MoveTo(Vector2.Zero, transition_time, EasingTypes.OutExpo);
Content.FadeIn(transition_time, EasingTypes.OutExpo);
@@ -82,36 +85,62 @@ namespace osu.Game.Screens
Children = new Drawable[]
{
- box = new Box
+ boxContainer = new Container
{
- RelativeSizeAxes = Axes.Both,
Size = new Vector2(0.3f),
+ RelativeSizeAxes = Axes.Both,
+ CornerRadius = 20,
+ Masking = true,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
- Colour = getColourFor(GetType()),
- Alpha = 1,
- BlendingMode = BlendingMode.Additive,
- },
- textContainer = new Container
- {
- AutoSizeAxes = Axes.Both,
- Anchor = Anchor.Centre,
- Origin = Anchor.Centre,
- Children = new[]
+ Children = new Drawable[]
{
- new OsuSpriteText
+ new Box
{
- Text = GetType().Name,
- Anchor = Anchor.Centre,
- Origin = Anchor.Centre,
- TextSize = 50,
+ RelativeSizeAxes = Axes.Both,
+
+ Colour = getColourFor(GetType()),
+ Alpha = 0.2f,
+ BlendingMode = BlendingMode.Additive,
},
- new OsuSpriteText
+ textContainer = new FillFlowContainer
{
- Text = GetType().Namespace,
+ AutoSizeAxes = Axes.Both,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
- Position = new Vector2(0, 30)
+ Direction = FillDirection.Vertical,
+ Children = new[]
+ {
+ new TextAwesome
+ {
+ Icon = FontAwesome.fa_universal_access,
+ Anchor = Anchor.TopCentre,
+ Origin = Anchor.TopCentre,
+ TextSize = 50,
+ },
+ new OsuSpriteText
+ {
+ Text = GetType().Name,
+ Colour = getColourFor(GetType()).Lighten(0.8f),
+ Anchor = Anchor.TopCentre,
+ Origin = Anchor.TopCentre,
+ TextSize = 50,
+ },
+ new OsuSpriteText
+ {
+ Text = "is not yet ready for use!",
+ TextSize = 20,
+ Anchor = Anchor.TopCentre,
+ Origin = Anchor.TopCentre,
+ },
+ new OsuSpriteText
+ {
+ Text = "please check back a bit later.",
+ TextSize = 14,
+ Anchor = Anchor.TopCentre,
+ Origin = Anchor.TopCentre,
+ },
+ }
},
}
},
@@ -120,17 +149,15 @@ namespace osu.Game.Screens
Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft,
Alpha = 0,
- Action = delegate {
- Exit();
- }
+ Action = Exit
},
childModeButtons = new FillFlowContainer
{
Direction = FillDirection.Vertical,
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
- RelativeSizeAxes = Axes.Both,
- Size = new Vector2(0.1f, 1)
+ RelativeSizeAxes = Axes.Y,
+ Size = new Vector2(TwoLayerButton.SIZE_RETRACTED.X, 1)
}
};
@@ -138,14 +165,11 @@ namespace osu.Game.Screens
{
foreach (Type t in PossibleChildren)
{
- childModeButtons.Add(new Button
+ childModeButtons.Add(new ChildModeButton
{
Text = $@"{t.Name}",
- RelativeSizeAxes = Axes.X,
- Size = new Vector2(1, 40),
- Anchor = Anchor.BottomRight,
- Origin = Anchor.BottomRight,
BackgroundColour = getColourFor(t),
+ HoverColour = getColourFor(t).Lighten(0.2f),
Action = delegate
{
Push(Activator.CreateInstance(t) as Screen);
@@ -163,5 +187,21 @@ namespace osu.Game.Screens
byte b = (byte)MathHelper.Clamp((hash & 0x0000FF) * 0.8f, 20, 255);
return new Color4(r, g, b, 255);
}
+
+ public class ChildModeButton : TwoLayerButton
+ {
+ public ChildModeButton()
+ {
+ Icon = FontAwesome.fa_osu_right_o;
+ Anchor = Anchor.BottomRight;
+ Origin = Anchor.BottomRight;
+ }
+
+ [BackgroundDependencyLoader]
+ private void load(AudioManager audio)
+ {
+ ActivationSound = audio.Sample.Get(@"Menu/menuhit");
+ }
+ }
}
}