mirror of
https://github.com/osukey/osukey.git
synced 2025-08-06 16:13:57 +09:00
Move BeatmapGroupState to outside class definition.
This commit is contained in:
@ -14,14 +14,8 @@ using OpenTK.Graphics;
|
|||||||
|
|
||||||
namespace osu.Game.Beatmaps.Drawable
|
namespace osu.Game.Beatmaps.Drawable
|
||||||
{
|
{
|
||||||
class BeatmapGroup : Container, IStateful<BeatmapGroup.GroupState>
|
class BeatmapGroup : Container, IStateful<BeatmapGroupState>
|
||||||
{
|
{
|
||||||
public enum GroupState
|
|
||||||
{
|
|
||||||
Collapsed,
|
|
||||||
Expanded,
|
|
||||||
}
|
|
||||||
|
|
||||||
private const float collapsedAlpha = 0.5f;
|
private const float collapsedAlpha = 0.5f;
|
||||||
private const float collapsedWidth = 0.8f;
|
private const float collapsedWidth = 0.8f;
|
||||||
|
|
||||||
@ -36,9 +30,9 @@ namespace osu.Game.Beatmaps.Drawable
|
|||||||
private BeatmapSetHeader header;
|
private BeatmapSetHeader header;
|
||||||
private FlowContainer difficulties;
|
private FlowContainer difficulties;
|
||||||
|
|
||||||
private GroupState state;
|
private BeatmapGroupState state;
|
||||||
|
|
||||||
public GroupState State
|
public BeatmapGroupState State
|
||||||
{
|
{
|
||||||
get { return state; }
|
get { return state; }
|
||||||
set
|
set
|
||||||
@ -46,7 +40,7 @@ namespace osu.Game.Beatmaps.Drawable
|
|||||||
state = value;
|
state = value;
|
||||||
switch (state)
|
switch (state)
|
||||||
{
|
{
|
||||||
case GroupState.Expanded:
|
case BeatmapGroupState.Expanded:
|
||||||
FadeTo(1, 250);
|
FadeTo(1, 250);
|
||||||
difficulties.Show();
|
difficulties.Show();
|
||||||
|
|
||||||
@ -59,7 +53,7 @@ namespace osu.Game.Beatmaps.Drawable
|
|||||||
(difficulties.Children.FirstOrDefault() as BeatmapPanel).Selected = true;
|
(difficulties.Children.FirstOrDefault() as BeatmapPanel).Selected = true;
|
||||||
SelectionChanged?.Invoke(this, selectedPanel?.Beatmap);
|
SelectionChanged?.Invoke(this, selectedPanel?.Beatmap);
|
||||||
break;
|
break;
|
||||||
case GroupState.Collapsed:
|
case BeatmapGroupState.Collapsed:
|
||||||
FadeTo(collapsedAlpha, 250);
|
FadeTo(collapsedAlpha, 250);
|
||||||
difficulties.Hide();
|
difficulties.Hide();
|
||||||
|
|
||||||
@ -121,7 +115,7 @@ namespace osu.Game.Beatmaps.Drawable
|
|||||||
public override void Load(BaseGame game)
|
public override void Load(BaseGame game)
|
||||||
{
|
{
|
||||||
base.Load(game);
|
base.Load(game);
|
||||||
State = GroupState.Collapsed;
|
State = BeatmapGroupState.Collapsed;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void panelGainedSelection(BeatmapPanel panel)
|
private void panelGainedSelection(BeatmapPanel panel)
|
||||||
@ -134,8 +128,14 @@ namespace osu.Game.Beatmaps.Drawable
|
|||||||
|
|
||||||
protected override bool OnClick(InputState state)
|
protected override bool OnClick(InputState state)
|
||||||
{
|
{
|
||||||
State = GroupState.Expanded;
|
State = BeatmapGroupState.Expanded;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum BeatmapGroupState
|
||||||
|
{
|
||||||
|
Collapsed,
|
||||||
|
Expanded,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -143,7 +143,7 @@ namespace osu.Game.GameModes.Play
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (selectedBeatmapGroup != null)
|
if (selectedBeatmapGroup != null)
|
||||||
selectedBeatmapGroup.State = BeatmapGroup.GroupState.Collapsed;
|
selectedBeatmapGroup.State = BeatmapGroupState.Collapsed;
|
||||||
|
|
||||||
selectedBeatmapGroup = group;
|
selectedBeatmapGroup = group;
|
||||||
selectedBeatmap = beatmap;
|
selectedBeatmap = beatmap;
|
||||||
@ -160,7 +160,7 @@ namespace osu.Game.GameModes.Play
|
|||||||
setList.Add(group);
|
setList.Add(group);
|
||||||
if (setList.Children.Count() == 1)
|
if (setList.Children.Count() == 1)
|
||||||
{
|
{
|
||||||
group.State = BeatmapGroup.GroupState.Expanded;
|
group.State = BeatmapGroupState.Expanded;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user