Update in-line with framework changes.

This commit is contained in:
smoogipooo
2017-09-04 09:10:04 +09:00
parent 9a4cff8813
commit 57678a13d9
23 changed files with 97 additions and 38 deletions

View File

@ -11,6 +11,8 @@ namespace osu.Game.Beatmaps.Drawables
{
public class BeatmapGroup : IStateful<BeatmapGroupState>
{
public event Action<BeatmapGroupState> StateChanged;
public BeatmapPanel SelectedPanel;
/// <summary>
@ -42,6 +44,10 @@ namespace osu.Game.Beatmaps.Drawables
get { return state; }
set
{
if (state == value)
return;
state = value;
switch (value)
{
case BeatmapGroupState.Expanded:
@ -60,7 +66,8 @@ namespace osu.Game.Beatmaps.Drawables
panel.State = PanelSelectedState.Hidden;
break;
}
state = value;
StateChanged?.Invoke(state);
}
}

View File

@ -1,6 +1,7 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using osu.Framework;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
@ -15,6 +16,8 @@ namespace osu.Game.Beatmaps.Drawables
{
public const float MAX_HEIGHT = 80;
public event Action<PanelSelectedState> StateChanged;
public override bool RemoveWhenNotAlive => false;
private readonly Container nestedContainer;
@ -77,11 +80,15 @@ namespace osu.Game.Beatmaps.Drawables
set
{
if (state == value) return;
if (state == value)
return;
var last = state;
state = value;
ApplyState(last);
StateChanged?.Invoke(State);
}
}