1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 21:23:04 +08:00

Merge pull request #369 from peppy/general-fixes

General fixes.
This commit is contained in:
Thomas Müller 2017-02-18 09:50:48 +01:00 committed by GitHub
commit b92726c8ee
18 changed files with 30 additions and 30 deletions

@ -1 +1 @@
Subproject commit b62e49ecb06c4a5b6fb304568e03b0689a8bdac3 Subproject commit 28c4acbb818d7be0ff66c600daacde9d91a99c6e

View File

@ -53,7 +53,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
}; };
} }
private AudioSample sample; private SampleChannel sample;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(AudioManager audio) private void load(AudioManager audio)

View File

@ -13,7 +13,7 @@ namespace osu.Game.Modes.Osu.UI
{ {
public class OsuScoreOverlay : ScoreOverlay public class OsuScoreOverlay : ScoreOverlay
{ {
protected override ScoreCounter CreateScoreCounter() => new ScoreCounter() protected override ScoreCounter CreateScoreCounter() => new ScoreCounter(6)
{ {
Anchor = Anchor.TopCentre, Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre, Origin = Anchor.TopCentre,

View File

@ -83,9 +83,9 @@ namespace osu.Game.Beatmaps
} }
private ArchiveReader trackReader; private ArchiveReader trackReader;
private AudioTrack track; private Track track;
private object trackLock = new object(); private object trackLock = new object();
public AudioTrack Track public Track Track
{ {
get get
{ {
@ -99,7 +99,7 @@ namespace osu.Game.Beatmaps
trackReader = getReader(); trackReader = getReader();
var trackData = trackReader?.GetStream(BeatmapInfo.Metadata.AudioFile); var trackData = trackReader?.GetStream(BeatmapInfo.Metadata.AudioFile);
if (trackData != null) if (trackData != null)
track = new AudioTrackBass(trackData); track = new TrackBass(trackData);
} }
catch { } catch { }

View File

@ -71,8 +71,8 @@ namespace osu.Game.Graphics.UserInterface
private Nub nub; private Nub nub;
private SpriteText labelSpriteText; private SpriteText labelSpriteText;
private AudioSample sampleChecked; private SampleChannel sampleChecked;
private AudioSample sampleUnchecked; private SampleChannel sampleUnchecked;
public OsuCheckbox() public OsuCheckbox()
{ {

View File

@ -16,7 +16,7 @@ namespace osu.Game.Graphics.UserInterface
{ {
public class OsuSliderBar<U> : SliderBar<U> where U : struct public class OsuSliderBar<U> : SliderBar<U> where U : struct
{ {
private AudioSample sample; private SampleChannel sample;
private double lastSampleTime; private double lastSampleTime;
private Nub nub; private Nub nub;

View File

@ -20,8 +20,7 @@ namespace osu.Game.Graphics.UserInterface
{ {
protected override Type TransformType => typeof(TransformAccuracy); protected override Type TransformType => typeof(TransformAccuracy);
protected override double RollingDuration => 150; protected override double RollingDuration => 750;
protected override bool IsRollingProportional => true;
private float epsilon => 1e-10f; private float epsilon => 1e-10f;
@ -32,6 +31,7 @@ namespace osu.Game.Graphics.UserInterface
public PercentageCounter() public PercentageCounter()
{ {
DisplayedCountSpriteText.FixedWidth = true;
Count = 1.0f; Count = 1.0f;
} }

View File

@ -38,7 +38,7 @@ namespace osu.Game.Graphics.UserInterface
/// <summary> /// <summary>
/// Easing for the counter rollover animation. /// Easing for the counter rollover animation.
/// </summary> /// </summary>
protected virtual EasingTypes RollingEasing => EasingTypes.Out; protected virtual EasingTypes RollingEasing => EasingTypes.OutQuint;
private T displayedCount; private T displayedCount;
@ -117,10 +117,6 @@ namespace osu.Game.Graphics.UserInterface
AutoSizeAxes = Axes.Both; AutoSizeAxes = Axes.Both;
DisplayedCount = Count; DisplayedCount = Count;
DisplayedCountSpriteText.Text = FormatCount(count);
DisplayedCountSpriteText.Anchor = Anchor;
DisplayedCountSpriteText.Origin = Origin;
} }
protected override void LoadComplete() protected override void LoadComplete()
@ -128,6 +124,10 @@ namespace osu.Game.Graphics.UserInterface
base.LoadComplete(); base.LoadComplete();
Flush(false, TransformType); Flush(false, TransformType);
DisplayedCountSpriteText.Text = FormatCount(count);
DisplayedCountSpriteText.Anchor = Anchor;
DisplayedCountSpriteText.Origin = Origin;
} }
/// <summary> /// <summary>

View File

@ -28,7 +28,7 @@ namespace osu.Game.Graphics.UserInterface
public static readonly Vector2 SIZE_EXTENDED = new Vector2(140, 50); public static readonly Vector2 SIZE_EXTENDED = new Vector2(140, 50);
public static readonly Vector2 SIZE_RETRACTED = new Vector2(100, 50); public static readonly Vector2 SIZE_RETRACTED = new Vector2(100, 50);
public AudioSample ActivationSound; public SampleChannel ActivationSound;
private SpriteText text; private SpriteText text;
public Color4 HoverColour; public Color4 HoverColour;

View File

@ -54,7 +54,7 @@ namespace osu.Game.Modes.Objects.Drawables
} }
} }
AudioSample sample; SampleChannel sample;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(AudioManager audio) private void load(AudioManager audio)

View File

@ -55,7 +55,7 @@ namespace osu.Game.Overlays.Pause
} }
} }
public AudioSample SampleClick, SampleHover; public SampleChannel SampleClick, SampleHover;
private Container backgroundContainer, colourContainer, glowContainer; private Container backgroundContainer, colourContainer, glowContainer;
private Box leftGlow, centerGlow, rightGlow; private Box leftGlow, centerGlow, rightGlow;

View File

@ -66,7 +66,7 @@ namespace osu.Game.Overlays.Toolbar
private SpriteText tooltip1; private SpriteText tooltip1;
private SpriteText tooltip2; private SpriteText tooltip2;
protected FlowContainer Flow; protected FlowContainer Flow;
private AudioSample sampleClick; private SampleChannel sampleClick;
public ToolbarButton() public ToolbarButton()
{ {

View File

@ -37,7 +37,7 @@ namespace osu.Game.Screens.Menu
private readonly float extraWidth; private readonly float extraWidth;
private Key triggerKey; private Key triggerKey;
private string text; private string text;
private AudioSample sampleClick; private SampleChannel sampleClick;
public override bool Contains(Vector2 screenSpacePos) public override bool Contains(Vector2 screenSpacePos)
{ {

View File

@ -32,7 +32,7 @@ namespace osu.Game.Screens.Menu
public Action OnChart; public Action OnChart;
public Action OnTest; public Action OnTest;
private AudioSample sampleOsuClick; private SampleChannel sampleOsuClick;
private Toolbar toolbar; private Toolbar toolbar;

View File

@ -24,9 +24,9 @@ namespace osu.Game.Screens.Menu
internal bool DidLoadMenu; internal bool DidLoadMenu;
MainMenu mainMenu; MainMenu mainMenu;
private AudioSample welcome; private SampleChannel welcome;
private AudioSample seeya; private SampleChannel seeya;
private AudioTrack bgm; private Track bgm;
internal override bool ShowOverlays => false; internal override bool ShowOverlays => false;

View File

@ -33,7 +33,7 @@ namespace osu.Game.Screens.Menu
private Container logoBounceContainer; private Container logoBounceContainer;
private Container logoHoverContainer; private Container logoHoverContainer;
private AudioSample sampleClick; private SampleChannel sampleClick;
private Container colourAndTriangles; private Container colourAndTriangles;

View File

@ -89,7 +89,7 @@ namespace osu.Game.Screens.Play
return; return;
} }
AudioTrack track = Beatmap.Track; Track track = Beatmap.Track;
if (track != null) if (track != null)
{ {

View File

@ -47,8 +47,8 @@ namespace osu.Game.Screens.Select
private static readonly Vector2 background_blur = new Vector2(20); private static readonly Vector2 background_blur = new Vector2(20);
private CancellationTokenSource initialAddSetsTask; private CancellationTokenSource initialAddSetsTask;
private AudioSample sampleChangeDifficulty; private SampleChannel sampleChangeDifficulty;
private AudioSample sampleChangeBeatmap; private SampleChannel sampleChangeBeatmap;
private List<BeatmapGroup> beatmapGroups; private List<BeatmapGroup> beatmapGroups;
@ -317,7 +317,7 @@ namespace osu.Game.Screens.Select
private void ensurePlayingSelected(bool preview = false) private void ensurePlayingSelected(bool preview = false)
{ {
AudioTrack track = Beatmap?.Track; Track track = Beatmap?.Track;
if (track != null) if (track != null)
{ {