Merge pull request #206 from Tom94/fix-depth

Fix depth values.
This commit is contained in:
Dean Herbert 2016-11-30 12:28:10 +09:00 committed by GitHub
commit 19897013a0
15 changed files with 19 additions and 19 deletions

@ -1 +1 @@
Subproject commit e125c03d8c39fd86e02e872a8d46654d2ea2759f
Subproject commit 4fd477755a640a497c04fc8e540e8641278aa056

View File

@ -32,7 +32,7 @@ public override void Reset()
Clock.ProcessFrame();
Container approachContainer = new Container { Depth = float.MaxValue, };
Container approachContainer = new Container { Depth = float.MinValue, };
Add(approachContainer);
@ -50,7 +50,7 @@ public override void Reset()
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Depth = -i,
Depth = i,
State = ArmedState.Hit,
};

View File

@ -44,7 +44,7 @@ public DrawableSlider(Slider s) : base(s)
Colour = s.Colour,
})
{
Depth = 1 //override time-based depth.
Depth = -1 //override time-based depth.
},
};
}

View File

@ -119,7 +119,7 @@ public PanelBackground(WorkingBeatmap working)
{
new FlowContainer
{
Depth = 1,
Depth = -1,
Direction = FlowDirection.HorizontalOnly,
RelativeSizeAxes = Axes.Both,
// This makes the gradient not be perfectly horizontal, but diagonal at a ~40° angle

View File

@ -22,7 +22,7 @@ public Background(string textureName = @"")
{
this.textureName = textureName;
RelativeSizeAxes = Axes.Both;
Depth = float.MinValue;
Depth = float.MaxValue;
Add(Sprite = new Sprite
{

View File

@ -19,7 +19,7 @@ class OsuCursorContainer : CursorContainer
public OsuCursorContainer()
{
Add(new CursorTrail { Depth = -1 });
Add(new CursorTrail { Depth = 1 });
}
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)

View File

@ -26,7 +26,7 @@ public abstract class DrawableHitObject : Container, IStateful<ArmedState>
public DrawableHitObject(HitObject hitObject)
{
HitObject = hitObject;
Depth = -(float)hitObject.StartTime;
Depth = (float)hitObject.StartTime;
}
private ArmedState state;

View File

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

View File

@ -83,7 +83,7 @@ protected override void LoadComplete()
{
Children = new[]
{
Cursor = new OsuCursorContainer { Depth = float.MaxValue }
Cursor = new OsuCursorContainer { Depth = float.MinValue }
}
});
}

View File

@ -45,7 +45,7 @@ public ChatConsole(APIAccess api)
{
new Box
{
Depth = float.MinValue,
Depth = float.MaxValue,
RelativeSizeAxes = Axes.Both,
Colour = new Color4(0.1f, 0.1f, 0.1f, 0.4f),
},

View File

@ -386,7 +386,7 @@ public MusicControllerBackground(WorkingBeatmap beatmap = null)
this.beatmap = beatmap;
CacheDrawnFrameBuffer = true;
RelativeSizeAxes = Axes.Both;
Depth = float.MinValue;
Depth = float.MaxValue;
Children = new Drawable[]
{

View File

@ -39,7 +39,7 @@ public WorkingBeatmap Beatmap
float newDepth = 0;
if (background != null)
{
newDepth = background.Depth - 1;
newDepth = background.Depth + 1;
background.Flush();
background.FadeOut(250);
background.Expire();

View File

@ -111,7 +111,7 @@ protected override void OnEntering(GameMode last)
{
AddInternal(new ParallaxContainer
{
Depth = float.MinValue,
Depth = float.MaxValue,
Children = new[]
{
Background = bg

View File

@ -50,7 +50,7 @@ public void UpdateBeatmap(WorkingBeatmap beatmap)
var lastContainer = beatmapInfoContainer;
float newDepth = lastContainer?.Depth - 1 ?? 0;
float newDepth = lastContainer?.Depth + 1 ?? 0;
BeatmapSetInfo beatmapSetInfo = beatmap.BeatmapSetInfo;
BeatmapInfo beatmapInfo = beatmap.BeatmapInfo;

View File

@ -81,12 +81,12 @@ public void AddGroup(BeatmapGroup group)
group.State = BeatmapGroupState.Collapsed;
groups.Add(group);
group.Header.Depth = scrollableContent.Children.Count();
group.Header.Depth = -scrollableContent.Children.Count();
scrollableContent.Add(group.Header);
foreach (BeatmapPanel panel in group.BeatmapPanels)
{
panel.Depth = scrollableContent.Children.Count();
panel.Depth = -scrollableContent.Children.Count();
scrollableContent.Add(panel);
}