Added toggling the progress bar, added buttons to the visual test

This commit is contained in:
DrabWeb
2017-02-09 20:12:15 -04:00
parent 0327c46d36
commit c61052d62e
2 changed files with 23 additions and 6 deletions

View File

@ -24,11 +24,6 @@ namespace osu.Desktop.VisualTests
{
base.Reset();
Add(new Box
{
Colour = Color4.Gray,
RelativeSizeAxes = Axes.Both
});
Add(progress = new SongProgress
{
Anchor = Anchor.BottomCentre,
@ -36,6 +31,14 @@ namespace osu.Desktop.VisualTests
RelativeSizeAxes = Axes.X
});
AddButton("Toggle Bar", progress.ToggleVisibility);
AddButton("New Values", displayNewValues);
displayNewValues();
}
private void displayNewValues()
{
var random = new Random();
List<int> newValues = new List<int>();

View File

@ -13,15 +13,17 @@ using osu.Framework.Graphics.Primitives;
using osu.Game.Overlays;
using System.Collections.Generic;
using System;
using osu.Framework.Graphics.Transformations;
namespace osu.Game.Screens.Play
{
public class SongProgress : Container
public class SongProgress : OverlayContainer
{
public static readonly int BAR_HEIGHT = 5;
public static readonly int GRAPH_HEIGHT = 34;
public static readonly Color4 FILL_COLOUR = new Color4(221, 255, 255, 255);
public static readonly Color4 GLOW_COLOUR = new Color4(221, 255, 255, 150);
private float progress_transition_duration = 100;
private SongProgressBar progress;
private SongProgressGraph graph;
@ -56,6 +58,18 @@ namespace osu.Game.Screens.Play
graph.Values = values;
}
protected override void PopIn()
{
progress.FadeTo(1f, progress_transition_duration, EasingTypes.In);
MoveTo(Vector2.Zero, progress_transition_duration, EasingTypes.In);
}
protected override void PopOut()
{
progress.FadeTo(0f, progress_transition_duration, EasingTypes.In);
MoveTo(new Vector2(0f, BAR_HEIGHT), progress_transition_duration, EasingTypes.In);
}
public SongProgress()
{
RelativeSizeAxes = Axes.X;