Fix depth values.

This commit is contained in:
Thomas Müller
2016-11-29 20:50:12 +01:00
parent 53df2932ad
commit b12b82fdd3
15 changed files with 19 additions and 19 deletions

View File

@ -32,7 +32,7 @@ namespace osu.Desktop.VisualTests.Tests
Clock.ProcessFrame(); Clock.ProcessFrame();
Container approachContainer = new Container { Depth = float.MaxValue, }; Container approachContainer = new Container { Depth = float.MinValue, };
Add(approachContainer); Add(approachContainer);
@ -50,7 +50,7 @@ namespace osu.Desktop.VisualTests.Tests
{ {
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
Depth = -i, Depth = i,
State = ArmedState.Hit, State = ArmedState.Hit,
}; };

View File

@ -44,7 +44,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
Colour = s.Colour, Colour = s.Colour,
}) })
{ {
Depth = 1 //override time-based depth. Depth = -1 //override time-based depth.
}, },
}; };
} }

View File

@ -119,7 +119,7 @@ namespace osu.Game.Beatmaps.Drawables
Children = new[] Children = new[]
{ {
new FlowContainer new FlowContainer
{ {
Depth = -1, Depth = -1,
Direction = FlowDirection.HorizontalOnly, Direction = FlowDirection.HorizontalOnly,
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,

View File

@ -22,7 +22,7 @@ namespace osu.Game.Graphics.Backgrounds
{ {
this.textureName = textureName; this.textureName = textureName;
RelativeSizeAxes = Axes.Both; RelativeSizeAxes = Axes.Both;
Depth = float.MinValue; Depth = float.MaxValue;
Add(Sprite = new Sprite Add(Sprite = new Sprite
{ {

View File

@ -19,7 +19,7 @@ namespace osu.Game.Graphics.Cursor
public OsuCursorContainer() public OsuCursorContainer()
{ {
Add(new CursorTrail { Depth = -1 }); Add(new CursorTrail { Depth = 1 });
} }
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)

View File

@ -28,7 +28,7 @@ namespace osu.Game.Modes.Objects.Drawables
public DrawableHitObject(HitObject hitObject) public DrawableHitObject(HitObject hitObject)
{ {
HitObject = hitObject; HitObject = hitObject;
Depth = -(float)hitObject.StartTime; Depth = (float)hitObject.StartTime;
} }
private ArmedState state; private ArmedState state;

View File

@ -116,11 +116,11 @@ namespace osu.Game
//overlay elements //overlay elements
(chat = new ChatConsole(API) { Depth = 0 }).Preload(this, overlayContent.Add); (chat = new ChatConsole(API) { Depth = 0 }).Preload(this, overlayContent.Add);
(Options = new OptionsOverlay { Depth = 1 }).Preload(this, overlayContent.Add); (Options = new OptionsOverlay { Depth = -1 }).Preload(this, overlayContent.Add);
(musicController = new MusicController() { Depth = 3 }).Preload(this, overlayContent.Add); (musicController = new MusicController() { Depth = -3 }).Preload(this, overlayContent.Add);
(Toolbar = new Toolbar (Toolbar = new Toolbar
{ {
Depth = 2, Depth = -2,
OnHome = delegate { mainMenu?.MakeCurrent(); }, OnHome = delegate { mainMenu?.MakeCurrent(); },
OnSettings = Options.ToggleVisibility, OnSettings = Options.ToggleVisibility,
OnPlayModeChange = delegate (PlayMode m) { PlayMode.Value = m; }, OnPlayModeChange = delegate (PlayMode m) { PlayMode.Value = m; },

View File

@ -83,7 +83,7 @@ namespace osu.Game
{ {
Children = new[] Children = new[]
{ {
Cursor = new OsuCursorContainer { Depth = float.MaxValue } Cursor = new OsuCursorContainer { Depth = float.MinValue }
} }
}); });
} }

View File

@ -45,7 +45,7 @@ namespace osu.Game.Overlays
{ {
new Box new Box
{ {
Depth = float.MinValue, Depth = float.MaxValue,
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Colour = new Color4(0.1f, 0.1f, 0.1f, 0.4f), Colour = new Color4(0.1f, 0.1f, 0.1f, 0.4f),
}, },

View File

@ -386,7 +386,7 @@ namespace osu.Game.Overlays
this.beatmap = beatmap; this.beatmap = beatmap;
CacheDrawnFrameBuffer = true; CacheDrawnFrameBuffer = true;
RelativeSizeAxes = Axes.Both; RelativeSizeAxes = Axes.Both;
Depth = float.MinValue; Depth = float.MaxValue;
Children = new Drawable[] Children = new Drawable[]
{ {

View File

@ -39,7 +39,7 @@ namespace osu.Game.Screens.Backgrounds
float newDepth = 0; float newDepth = 0;
if (background != null) if (background != null)
{ {
newDepth = background.Depth - 1; newDepth = background.Depth + 1;
background.Flush(); background.Flush();
background.FadeOut(250); background.FadeOut(250);
background.Expire(); background.Expire();

View File

@ -111,7 +111,7 @@ namespace osu.Game.Screens
{ {
AddInternal(new ParallaxContainer AddInternal(new ParallaxContainer
{ {
Depth = float.MinValue, Depth = float.MaxValue,
Children = new[] Children = new[]
{ {
Background = bg Background = bg

View File

@ -50,7 +50,7 @@ namespace osu.Game.Screens.Select
var lastContainer = beatmapInfoContainer; var lastContainer = beatmapInfoContainer;
float newDepth = lastContainer?.Depth - 1 ?? 0; float newDepth = lastContainer?.Depth + 1 ?? 0;
BeatmapSetInfo beatmapSetInfo = beatmap.BeatmapSetInfo; BeatmapSetInfo beatmapSetInfo = beatmap.BeatmapSetInfo;
BeatmapInfo beatmapInfo = beatmap.BeatmapInfo; BeatmapInfo beatmapInfo = beatmap.BeatmapInfo;

View File

@ -81,12 +81,12 @@ namespace osu.Game.Screens.Select
group.State = BeatmapGroupState.Collapsed; group.State = BeatmapGroupState.Collapsed;
groups.Add(group); groups.Add(group);
group.Header.Depth = scrollableContent.Children.Count(); group.Header.Depth = -scrollableContent.Children.Count();
scrollableContent.Add(group.Header); scrollableContent.Add(group.Header);
foreach (BeatmapPanel panel in group.BeatmapPanels) foreach (BeatmapPanel panel in group.BeatmapPanels)
{ {
panel.Depth = scrollableContent.Children.Count(); panel.Depth = -scrollableContent.Children.Count();
scrollableContent.Add(panel); scrollableContent.Add(panel);
} }