mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09:00
Merge remote-tracking branch 'origin/master' into refactor_hitrenderer
Conflicts: osu.Game.Modes.Catch/CatchRuleset.cs osu.Game.Modes.Mania/ManiaRuleset.cs osu.Game.Modes.Osu/OsuRuleset.cs osu.Game.Modes.Taiko/TaikoRuleset.cs
This commit is contained in:
@ -8,7 +8,6 @@ using osu.Framework.Graphics.Sprites;
|
|||||||
using osu.Framework.MathUtils;
|
using osu.Framework.MathUtils;
|
||||||
using osu.Framework.Screens.Testing;
|
using osu.Framework.Screens.Testing;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
using osu.Game.Modes.Osu.UI;
|
|
||||||
using osu.Game.Modes.UI;
|
using osu.Game.Modes.UI;
|
||||||
|
|
||||||
namespace osu.Desktop.VisualTests.Tests
|
namespace osu.Desktop.VisualTests.Tests
|
||||||
@ -35,23 +34,22 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
};
|
};
|
||||||
Add(score);
|
Add(score);
|
||||||
|
|
||||||
ComboCounter standardCombo = new OsuComboCounter
|
ComboCounter comboCounter = new StandardComboCounter
|
||||||
{
|
{
|
||||||
Origin = Anchor.BottomLeft,
|
Origin = Anchor.BottomLeft,
|
||||||
Anchor = Anchor.BottomLeft,
|
Anchor = Anchor.BottomLeft,
|
||||||
Margin = new MarginPadding(10),
|
Margin = new MarginPadding(10),
|
||||||
Count = 0,
|
|
||||||
TextSize = 40,
|
TextSize = 40,
|
||||||
};
|
};
|
||||||
Add(standardCombo);
|
Add(comboCounter);
|
||||||
|
|
||||||
PercentageCounter accuracyCombo = new PercentageCounter
|
PercentageCounter accuracyCounter = new PercentageCounter
|
||||||
{
|
{
|
||||||
Origin = Anchor.TopRight,
|
Origin = Anchor.TopRight,
|
||||||
Anchor = Anchor.TopRight,
|
Anchor = Anchor.TopRight,
|
||||||
Position = new Vector2(-20, 60),
|
Position = new Vector2(-20, 60),
|
||||||
};
|
};
|
||||||
Add(accuracyCombo);
|
Add(accuracyCounter);
|
||||||
|
|
||||||
StarCounter stars = new StarCounter
|
StarCounter stars = new StarCounter
|
||||||
{
|
{
|
||||||
@ -74,26 +72,26 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
AddButton(@"Reset all", delegate
|
AddButton(@"Reset all", delegate
|
||||||
{
|
{
|
||||||
score.Count = 0;
|
score.Count = 0;
|
||||||
standardCombo.Count = 0;
|
comboCounter.Current.Value = 0;
|
||||||
numerator = denominator = 0;
|
numerator = denominator = 0;
|
||||||
accuracyCombo.SetFraction(0, 0);
|
accuracyCounter.SetFraction(0, 0);
|
||||||
stars.Count = 0;
|
stars.Count = 0;
|
||||||
starsLabel.Text = stars.Count.ToString("0.00");
|
starsLabel.Text = stars.Count.ToString("0.00");
|
||||||
});
|
});
|
||||||
|
|
||||||
AddButton(@"Hit! :D", delegate
|
AddButton(@"Hit! :D", delegate
|
||||||
{
|
{
|
||||||
score.Count += 300 + (ulong)(300.0 * (standardCombo.Count > 0 ? standardCombo.Count - 1 : 0) / 25.0);
|
score.Count += 300 + (ulong)(300.0 * (comboCounter.Current > 0 ? comboCounter.Current - 1 : 0) / 25.0);
|
||||||
standardCombo.Count++;
|
comboCounter.Increment();
|
||||||
numerator++; denominator++;
|
numerator++; denominator++;
|
||||||
accuracyCombo.SetFraction(numerator, denominator);
|
accuracyCounter.SetFraction(numerator, denominator);
|
||||||
});
|
});
|
||||||
|
|
||||||
AddButton(@"miss...", delegate
|
AddButton(@"miss...", delegate
|
||||||
{
|
{
|
||||||
standardCombo.Roll();
|
comboCounter.Current.Value = 0;
|
||||||
denominator++;
|
denominator++;
|
||||||
accuracyCombo.SetFraction(numerator, denominator);
|
accuracyCounter.SetFraction(numerator, denominator);
|
||||||
});
|
});
|
||||||
|
|
||||||
AddButton(@"Alter stars", delegate
|
AddButton(@"Alter stars", delegate
|
||||||
@ -105,8 +103,8 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
AddButton(@"Stop counters", delegate
|
AddButton(@"Stop counters", delegate
|
||||||
{
|
{
|
||||||
score.StopRolling();
|
score.StopRolling();
|
||||||
standardCombo.StopRolling();
|
comboCounter.StopRolling();
|
||||||
accuracyCombo.StopRolling();
|
accuracyCounter.StopRolling();
|
||||||
stars.StopAnimation();
|
stars.StopAnimation();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1,20 +1,19 @@
|
|||||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using OpenTK.Input;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Modes.Catch.UI;
|
using osu.Game.Modes.Catch.UI;
|
||||||
using osu.Game.Modes.Objects;
|
using osu.Game.Modes.Objects;
|
||||||
using osu.Game.Modes.Osu.UI;
|
|
||||||
using osu.Game.Modes.UI;
|
using osu.Game.Modes.UI;
|
||||||
|
using osu.Game.Screens.Play;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace osu.Game.Modes.Catch
|
namespace osu.Game.Modes.Catch
|
||||||
{
|
{
|
||||||
public class CatchRuleset : Ruleset
|
public class CatchRuleset : Ruleset
|
||||||
{
|
{
|
||||||
public override ScoreOverlay CreateScoreOverlay() => new OsuScoreOverlay();
|
|
||||||
|
|
||||||
public override HitRenderer CreateHitRendererWith(Beatmap beatmap) => new CatchHitRenderer(beatmap);
|
public override HitRenderer CreateHitRendererWith(Beatmap beatmap) => new CatchHitRenderer(beatmap);
|
||||||
|
|
||||||
public override IEnumerable<Mod> GetModsFor(ModType type)
|
public override IEnumerable<Mod> GetModsFor(ModType type)
|
||||||
@ -80,6 +79,13 @@ namespace osu.Game.Modes.Catch
|
|||||||
|
|
||||||
public override FontAwesome Icon => FontAwesome.fa_osu_fruits_o;
|
public override FontAwesome Icon => FontAwesome.fa_osu_fruits_o;
|
||||||
|
|
||||||
|
public override IEnumerable<KeyCounter> CreateGameplayKeys() => new KeyCounter[]
|
||||||
|
{
|
||||||
|
new KeyCounterKeyboard(Key.ShiftLeft),
|
||||||
|
new KeyCounterMouse(MouseButton.Left),
|
||||||
|
new KeyCounterMouse(MouseButton.Right)
|
||||||
|
};
|
||||||
|
|
||||||
public override ScoreProcessor CreateScoreProcessor(int hitObjectCount = 0) => null;
|
public override ScoreProcessor CreateScoreProcessor(int hitObjectCount = 0) => null;
|
||||||
|
|
||||||
public override HitObjectParser CreateHitObjectParser() => new NullHitObjectParser();
|
public override HitObjectParser CreateHitObjectParser() => new NullHitObjectParser();
|
||||||
|
@ -5,16 +5,14 @@ using osu.Game.Beatmaps;
|
|||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Modes.Mania.UI;
|
using osu.Game.Modes.Mania.UI;
|
||||||
using osu.Game.Modes.Objects;
|
using osu.Game.Modes.Objects;
|
||||||
using osu.Game.Modes.Osu.UI;
|
|
||||||
using osu.Game.Modes.UI;
|
using osu.Game.Modes.UI;
|
||||||
|
using osu.Game.Screens.Play;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace osu.Game.Modes.Mania
|
namespace osu.Game.Modes.Mania
|
||||||
{
|
{
|
||||||
public class ManiaRuleset : Ruleset
|
public class ManiaRuleset : Ruleset
|
||||||
{
|
{
|
||||||
public override ScoreOverlay CreateScoreOverlay() => new OsuScoreOverlay();
|
|
||||||
|
|
||||||
public override HitRenderer CreateHitRendererWith(Beatmap beatmap) => new ManiaHitRenderer(beatmap);
|
public override HitRenderer CreateHitRendererWith(Beatmap beatmap) => new ManiaHitRenderer(beatmap);
|
||||||
|
|
||||||
public override IEnumerable<Mod> GetModsFor(ModType type)
|
public override IEnumerable<Mod> GetModsFor(ModType type)
|
||||||
@ -101,6 +99,8 @@ namespace osu.Game.Modes.Mania
|
|||||||
|
|
||||||
public override FontAwesome Icon => FontAwesome.fa_osu_mania_o;
|
public override FontAwesome Icon => FontAwesome.fa_osu_mania_o;
|
||||||
|
|
||||||
|
public override IEnumerable<KeyCounter> CreateGameplayKeys() => new KeyCounter[] { /* Todo: Should be keymod specific */ };
|
||||||
|
|
||||||
public override ScoreProcessor CreateScoreProcessor(int hitObjectCount = 0) => null;
|
public override ScoreProcessor CreateScoreProcessor(int hitObjectCount = 0) => null;
|
||||||
|
|
||||||
public override HitObjectParser CreateHitObjectParser() => new NullHitObjectParser();
|
public override HitObjectParser CreateHitObjectParser() => new NullHitObjectParser();
|
||||||
|
@ -1,12 +1,14 @@
|
|||||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using OpenTK.Input;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Modes.Objects;
|
using osu.Game.Modes.Objects;
|
||||||
using osu.Game.Modes.Osu.Objects;
|
using osu.Game.Modes.Osu.Objects;
|
||||||
using osu.Game.Modes.Osu.UI;
|
using osu.Game.Modes.Osu.UI;
|
||||||
using osu.Game.Modes.UI;
|
using osu.Game.Modes.UI;
|
||||||
|
using osu.Game.Screens.Play;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
@ -14,8 +16,6 @@ namespace osu.Game.Modes.Osu
|
|||||||
{
|
{
|
||||||
public class OsuRuleset : Ruleset
|
public class OsuRuleset : Ruleset
|
||||||
{
|
{
|
||||||
public override ScoreOverlay CreateScoreOverlay() => new OsuScoreOverlay();
|
|
||||||
|
|
||||||
public override HitRenderer CreateHitRendererWith(Beatmap beatmap) => new OsuHitRenderer(beatmap);
|
public override HitRenderer CreateHitRendererWith(Beatmap beatmap) => new OsuHitRenderer(beatmap);
|
||||||
|
|
||||||
public override IEnumerable<BeatmapStatistic> GetBeatmapStatistics(WorkingBeatmap beatmap) => new[]
|
public override IEnumerable<BeatmapStatistic> GetBeatmapStatistics(WorkingBeatmap beatmap) => new[]
|
||||||
@ -110,5 +110,13 @@ namespace osu.Game.Modes.Osu
|
|||||||
protected override PlayMode PlayMode => PlayMode.Osu;
|
protected override PlayMode PlayMode => PlayMode.Osu;
|
||||||
|
|
||||||
public override string Description => "osu!";
|
public override string Description => "osu!";
|
||||||
|
|
||||||
|
public override IEnumerable<KeyCounter> CreateGameplayKeys() => new KeyCounter[]
|
||||||
|
{
|
||||||
|
new KeyCounterKeyboard(Key.Z),
|
||||||
|
new KeyCounterKeyboard(Key.X),
|
||||||
|
new KeyCounterMouse(MouseButton.Left),
|
||||||
|
new KeyCounterMouse(MouseButton.Right)
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,6 @@
|
|||||||
<Compile Include="OsuDifficultyCalculator.cs" />
|
<Compile Include="OsuDifficultyCalculator.cs" />
|
||||||
<Compile Include="OsuScore.cs" />
|
<Compile Include="OsuScore.cs" />
|
||||||
<Compile Include="OsuScoreProcessor.cs" />
|
<Compile Include="OsuScoreProcessor.cs" />
|
||||||
<Compile Include="UI\OsuComboCounter.cs" />
|
|
||||||
<Compile Include="UI\OsuHitRenderer.cs" />
|
<Compile Include="UI\OsuHitRenderer.cs" />
|
||||||
<Compile Include="UI\OsuPlayfield.cs" />
|
<Compile Include="UI\OsuPlayfield.cs" />
|
||||||
<Compile Include="OsuRuleset.cs" />
|
<Compile Include="OsuRuleset.cs" />
|
||||||
@ -85,7 +84,6 @@
|
|||||||
<Compile Include="Objects\Slider.cs" />
|
<Compile Include="Objects\Slider.cs" />
|
||||||
<Compile Include="Objects\Spinner.cs" />
|
<Compile Include="Objects\Spinner.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="UI\OsuScoreOverlay.cs" />
|
|
||||||
<Compile Include="OsuMod.cs" />
|
<Compile Include="OsuMod.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -1,20 +1,19 @@
|
|||||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using OpenTK.Input;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Modes.Objects;
|
using osu.Game.Modes.Objects;
|
||||||
using osu.Game.Modes.Osu.UI;
|
|
||||||
using osu.Game.Modes.Taiko.UI;
|
using osu.Game.Modes.Taiko.UI;
|
||||||
using osu.Game.Modes.UI;
|
using osu.Game.Modes.UI;
|
||||||
|
using osu.Game.Screens.Play;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace osu.Game.Modes.Taiko
|
namespace osu.Game.Modes.Taiko
|
||||||
{
|
{
|
||||||
public class TaikoRuleset : Ruleset
|
public class TaikoRuleset : Ruleset
|
||||||
{
|
{
|
||||||
public override ScoreOverlay CreateScoreOverlay() => new OsuScoreOverlay();
|
|
||||||
|
|
||||||
public override HitRenderer CreateHitRendererWith(Beatmap beatmap) => new TaikoHitRenderer(beatmap);
|
public override HitRenderer CreateHitRendererWith(Beatmap beatmap) => new TaikoHitRenderer(beatmap);
|
||||||
|
|
||||||
public override IEnumerable<Mod> GetModsFor(ModType type)
|
public override IEnumerable<Mod> GetModsFor(ModType type)
|
||||||
@ -80,6 +79,14 @@ namespace osu.Game.Modes.Taiko
|
|||||||
|
|
||||||
public override FontAwesome Icon => FontAwesome.fa_osu_taiko_o;
|
public override FontAwesome Icon => FontAwesome.fa_osu_taiko_o;
|
||||||
|
|
||||||
|
public override IEnumerable<KeyCounter> CreateGameplayKeys() => new KeyCounter[]
|
||||||
|
{
|
||||||
|
new KeyCounterKeyboard(Key.D),
|
||||||
|
new KeyCounterKeyboard(Key.F),
|
||||||
|
new KeyCounterKeyboard(Key.J),
|
||||||
|
new KeyCounterKeyboard(Key.K)
|
||||||
|
};
|
||||||
|
|
||||||
public override ScoreProcessor CreateScoreProcessor(int hitObjectCount = 0) => null;
|
public override ScoreProcessor CreateScoreProcessor(int hitObjectCount = 0) => null;
|
||||||
|
|
||||||
public override HitObjectParser CreateHitObjectParser() => new NullHitObjectParser();
|
public override HitObjectParser CreateHitObjectParser() => new NullHitObjectParser();
|
||||||
|
@ -1,13 +1,14 @@
|
|||||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using osu.Game.Modes.Objects;
|
|
||||||
using osu.Game.Modes.UI;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Concurrent;
|
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
|
using osu.Game.Modes.Objects;
|
||||||
|
using osu.Game.Modes.UI;
|
||||||
|
using osu.Game.Screens.Play;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace osu.Game.Modes
|
namespace osu.Game.Modes
|
||||||
{
|
{
|
||||||
@ -24,8 +25,6 @@ namespace osu.Game.Modes
|
|||||||
|
|
||||||
public static IEnumerable<PlayMode> PlayModes => availableRulesets.Keys;
|
public static IEnumerable<PlayMode> PlayModes => availableRulesets.Keys;
|
||||||
|
|
||||||
public abstract ScoreOverlay CreateScoreOverlay();
|
|
||||||
|
|
||||||
public virtual IEnumerable<BeatmapStatistic> GetBeatmapStatistics(WorkingBeatmap beatmap) => new BeatmapStatistic[] { };
|
public virtual IEnumerable<BeatmapStatistic> GetBeatmapStatistics(WorkingBeatmap beatmap) => new BeatmapStatistic[] { };
|
||||||
|
|
||||||
public abstract IEnumerable<Mod> GetModsFor(ModType type);
|
public abstract IEnumerable<Mod> GetModsFor(ModType type);
|
||||||
@ -46,6 +45,8 @@ namespace osu.Game.Modes
|
|||||||
|
|
||||||
public abstract string Description { get; }
|
public abstract string Description { get; }
|
||||||
|
|
||||||
|
public abstract IEnumerable<KeyCounter> CreateGameplayKeys();
|
||||||
|
|
||||||
public virtual Score CreateAutoplayScore(Beatmap beatmap) => null;
|
public virtual Score CreateAutoplayScore(Beatmap beatmap) => null;
|
||||||
|
|
||||||
public static Ruleset GetRuleset(PlayMode mode)
|
public static Ruleset GetRuleset(PlayMode mode)
|
||||||
|
@ -9,9 +9,9 @@ namespace osu.Game.Modes
|
|||||||
{
|
{
|
||||||
public double TotalScore { get; set; }
|
public double TotalScore { get; set; }
|
||||||
public double Accuracy { get; set; }
|
public double Accuracy { get; set; }
|
||||||
public double Combo { get; set; }
|
|
||||||
public double MaxCombo { get; set; }
|
|
||||||
public double Health { get; set; }
|
public double Health { get; set; }
|
||||||
|
public int MaxCombo { get; set; }
|
||||||
|
public int Combo { get; set; }
|
||||||
|
|
||||||
public Replay Replay;
|
public Replay Replay;
|
||||||
public BeatmapInfo Beatmap;
|
public BeatmapInfo Beatmap;
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using osu.Framework.Configuration;
|
using osu.Framework.Configuration;
|
||||||
using osu.Game.Modes.Objects.Drawables;
|
using osu.Game.Modes.Objects.Drawables;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace osu.Game.Modes
|
namespace osu.Game.Modes
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using osu.Framework.Configuration;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Primitives;
|
using osu.Framework.Graphics.Primitives;
|
||||||
@ -13,10 +14,12 @@ namespace osu.Game.Modes.UI
|
|||||||
{
|
{
|
||||||
public abstract class ComboCounter : Container
|
public abstract class ComboCounter : Container
|
||||||
{
|
{
|
||||||
public bool IsRolling
|
public BindableInt Current = new BindableInt
|
||||||
{
|
{
|
||||||
get; protected set;
|
MinValue = 0,
|
||||||
}
|
};
|
||||||
|
|
||||||
|
public bool IsRolling { get; protected set; }
|
||||||
|
|
||||||
protected SpriteText PopOutCount;
|
protected SpriteText PopOutCount;
|
||||||
|
|
||||||
@ -37,60 +40,9 @@ namespace osu.Game.Modes.UI
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
protected EasingTypes RollingEasing => EasingTypes.None;
|
protected EasingTypes RollingEasing => EasingTypes.None;
|
||||||
|
|
||||||
private ulong displayedCount;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Value shown at the current moment.
|
|
||||||
/// </summary>
|
|
||||||
public virtual ulong DisplayedCount
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return displayedCount;
|
|
||||||
}
|
|
||||||
protected set
|
|
||||||
{
|
|
||||||
if (displayedCount.Equals(value))
|
|
||||||
return;
|
|
||||||
updateDisplayedCount(displayedCount, value, IsRolling);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private ulong count;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Actual value of counter.
|
|
||||||
/// </summary>
|
|
||||||
public virtual ulong Count
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return count;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
updateCount(value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Increment(ulong amount = 1)
|
|
||||||
{
|
|
||||||
Count = Count + amount;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected SpriteText DisplayedCountSpriteText;
|
protected SpriteText DisplayedCountSpriteText;
|
||||||
|
|
||||||
private float textSize;
|
private int previousValue;
|
||||||
public float TextSize
|
|
||||||
{
|
|
||||||
get { return textSize; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
textSize = value;
|
|
||||||
DisplayedCountSpriteText.TextSize = TextSize;
|
|
||||||
PopOutCount.TextSize = TextSize;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Base of all combo counters.
|
/// Base of all combo counters.
|
||||||
@ -113,73 +65,97 @@ namespace osu.Game.Modes.UI
|
|||||||
};
|
};
|
||||||
|
|
||||||
TextSize = 80;
|
TextSize = 80;
|
||||||
|
|
||||||
|
Current.ValueChanged += comboChanged;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void comboChanged(object sender, System.EventArgs e)
|
||||||
|
{
|
||||||
|
updateCount(Current.Value == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
DisplayedCountSpriteText.Text = FormatCount(Count);
|
DisplayedCountSpriteText.Text = FormatCount(Current);
|
||||||
DisplayedCountSpriteText.Anchor = Anchor;
|
DisplayedCountSpriteText.Anchor = Anchor;
|
||||||
DisplayedCountSpriteText.Origin = Origin;
|
DisplayedCountSpriteText.Origin = Origin;
|
||||||
|
|
||||||
StopRolling();
|
StopRolling();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int displayedCount;
|
||||||
|
/// <summary>
|
||||||
|
/// Value shown at the current moment.
|
||||||
|
/// </summary>
|
||||||
|
public virtual int DisplayedCount
|
||||||
|
{
|
||||||
|
get { return displayedCount; }
|
||||||
|
protected set
|
||||||
|
{
|
||||||
|
if (displayedCount.Equals(value))
|
||||||
|
return;
|
||||||
|
updateDisplayedCount(displayedCount, value, IsRolling);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private float textSize;
|
||||||
|
public float TextSize
|
||||||
|
{
|
||||||
|
get { return textSize; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
textSize = value;
|
||||||
|
DisplayedCountSpriteText.TextSize = TextSize;
|
||||||
|
PopOutCount.TextSize = TextSize;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Increments the combo by an amount.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="amount"></param>
|
||||||
|
public void Increment(int amount = 1)
|
||||||
|
{
|
||||||
|
Current.Value = Current + amount;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Stops rollover animation, forcing the displayed count to be the actual count.
|
/// Stops rollover animation, forcing the displayed count to be the actual count.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void StopRolling()
|
public void StopRolling()
|
||||||
{
|
{
|
||||||
updateCount(Count);
|
updateCount(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
protected virtual string FormatCount(int count)
|
||||||
/// Animates roll-up/roll-back to an specific value.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="newValue">Target value.</param>
|
|
||||||
public virtual void Roll(ulong newValue = 0)
|
|
||||||
{
|
|
||||||
updateCount(newValue, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Resets count to default value.
|
|
||||||
/// </summary>
|
|
||||||
public virtual void ResetCount()
|
|
||||||
{
|
|
||||||
updateCount(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected virtual string FormatCount(ulong count)
|
|
||||||
{
|
{
|
||||||
return count.ToString();
|
return count.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract void OnDisplayedCountRolling(ulong currentValue, ulong newValue);
|
protected virtual void OnCountRolling(int currentValue, int newValue)
|
||||||
protected abstract void OnDisplayedCountIncrement(ulong newValue);
|
|
||||||
protected abstract void OnDisplayedCountChange(ulong newValue);
|
|
||||||
|
|
||||||
protected virtual void OnCountRolling(ulong currentValue, ulong newValue)
|
|
||||||
{
|
{
|
||||||
transformRoll(new TransformComboRoll(), currentValue, newValue);
|
transformRoll(new TransformComboRoll(), currentValue, newValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void OnCountIncrement(ulong currentValue, ulong newValue) {
|
protected virtual void OnCountIncrement(int currentValue, int newValue)
|
||||||
|
{
|
||||||
DisplayedCount = newValue;
|
DisplayedCount = newValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void OnCountChange(ulong currentValue, ulong newValue) {
|
protected virtual void OnCountChange(int currentValue, int newValue)
|
||||||
|
{
|
||||||
DisplayedCount = newValue;
|
DisplayedCount = newValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
private double getProportionalDuration(ulong currentValue, ulong newValue)
|
private double getProportionalDuration(int currentValue, int newValue)
|
||||||
{
|
{
|
||||||
double difference = currentValue > newValue ? currentValue - newValue : newValue - currentValue;
|
double difference = currentValue > newValue ? currentValue - newValue : newValue - currentValue;
|
||||||
return difference * RollingDuration;
|
return difference * RollingDuration;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateDisplayedCount(ulong currentValue, ulong newValue, bool rolling)
|
private void updateDisplayedCount(int currentValue, int newValue, bool rolling)
|
||||||
{
|
{
|
||||||
displayedCount = newValue;
|
displayedCount = newValue;
|
||||||
if (rolling)
|
if (rolling)
|
||||||
@ -190,10 +166,10 @@ namespace osu.Game.Modes.UI
|
|||||||
OnDisplayedCountChange(newValue);
|
OnDisplayedCountChange(newValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateCount(ulong value, bool rolling = false)
|
private void updateCount(bool rolling)
|
||||||
{
|
{
|
||||||
ulong prevCount = count;
|
int prev = previousValue;
|
||||||
count = value;
|
previousValue = Current;
|
||||||
|
|
||||||
if (!IsLoaded)
|
if (!IsLoaded)
|
||||||
return;
|
return;
|
||||||
@ -202,27 +178,27 @@ namespace osu.Game.Modes.UI
|
|||||||
{
|
{
|
||||||
Flush(false, typeof(TransformComboRoll));
|
Flush(false, typeof(TransformComboRoll));
|
||||||
IsRolling = false;
|
IsRolling = false;
|
||||||
DisplayedCount = prevCount;
|
DisplayedCount = prev;
|
||||||
|
|
||||||
if (prevCount + 1 == count)
|
if (prev + 1 == Current)
|
||||||
OnCountIncrement(prevCount, count);
|
OnCountIncrement(prev, Current);
|
||||||
else
|
else
|
||||||
OnCountChange(prevCount, count);
|
OnCountChange(prev, Current);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
OnCountRolling(displayedCount, count);
|
OnCountRolling(displayedCount, Current);
|
||||||
IsRolling = true;
|
IsRolling = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void transformRoll(TransformComboRoll transform, ulong currentValue, ulong newValue)
|
private void transformRoll(TransformComboRoll transform, int currentValue, int newValue)
|
||||||
{
|
{
|
||||||
Flush(false, typeof(TransformComboRoll));
|
Flush(false, typeof(TransformComboRoll));
|
||||||
|
|
||||||
if (RollingDuration < 1)
|
if (RollingDuration < 1)
|
||||||
{
|
{
|
||||||
DisplayedCount = Count;
|
DisplayedCount = Current;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -235,9 +211,9 @@ namespace osu.Game.Modes.UI
|
|||||||
Transforms.Add(transform);
|
Transforms.Add(transform);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected class TransformComboRoll : Transform<ulong>
|
protected class TransformComboRoll : Transform<int>
|
||||||
{
|
{
|
||||||
protected override ulong CurrentValue
|
protected override int CurrentValue
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
@ -245,7 +221,7 @@ namespace osu.Game.Modes.UI
|
|||||||
if (time < StartTime) return StartValue;
|
if (time < StartTime) return StartValue;
|
||||||
if (time >= EndTime) return EndValue;
|
if (time >= EndTime) return EndValue;
|
||||||
|
|
||||||
return (ulong)Interpolation.ValueAt(time, StartValue, EndValue, StartTime, EndTime, Easing);
|
return (int)Interpolation.ValueAt(time, StartValue, EndValue, StartTime, EndTime, Easing);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -256,12 +232,8 @@ namespace osu.Game.Modes.UI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Set(ulong value)
|
protected abstract void OnDisplayedCountRolling(int currentValue, int newValue);
|
||||||
{
|
protected abstract void OnDisplayedCountIncrement(int newValue);
|
||||||
if (value == 0)
|
protected abstract void OnDisplayedCountChange(int newValue);
|
||||||
Roll();
|
|
||||||
else
|
|
||||||
Count = value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,72 +1,24 @@
|
|||||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System;
|
|
||||||
using osu.Framework.Allocation;
|
|
||||||
using osu.Framework.Configuration;
|
using osu.Framework.Configuration;
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
|
||||||
using osu.Framework.Graphics;
|
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Sprites;
|
|
||||||
using osu.Framework.Graphics.Transforms;
|
|
||||||
using osu.Game.Graphics;
|
|
||||||
using OpenTK;
|
|
||||||
using OpenTK.Graphics;
|
|
||||||
|
|
||||||
namespace osu.Game.Modes.UI
|
namespace osu.Game.Modes.UI
|
||||||
{
|
{
|
||||||
public class HealthDisplay : Container
|
public abstract class HealthDisplay : Container
|
||||||
{
|
{
|
||||||
private Container fill;
|
public readonly BindableDouble Current = new BindableDouble
|
||||||
|
|
||||||
public BindableDouble Current = new BindableDouble
|
|
||||||
{
|
{
|
||||||
MinValue = 0,
|
MinValue = 0,
|
||||||
MaxValue = 1
|
MaxValue = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
public HealthDisplay()
|
protected HealthDisplay()
|
||||||
{
|
{
|
||||||
Children = new Drawable[]
|
Current.ValueChanged += (s, e) => SetHealth((float)Current);
|
||||||
{
|
|
||||||
new Box
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
Colour = Color4.Black,
|
|
||||||
},
|
|
||||||
fill = new Container
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
Scale = new Vector2(0, 1),
|
|
||||||
Masking = true,
|
|
||||||
Children = new[]
|
|
||||||
{
|
|
||||||
new Box
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
Current.ValueChanged += current_ValueChanged;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
protected abstract void SetHealth(float value);
|
||||||
private void laod(OsuColour colours)
|
|
||||||
{
|
|
||||||
fill.Colour = colours.BlueLighter;
|
|
||||||
fill.EdgeEffect = new EdgeEffect
|
|
||||||
{
|
|
||||||
Colour = colours.BlueDarker.Opacity(0.6f),
|
|
||||||
Radius = 8,
|
|
||||||
Type= EdgeEffectType.Glow
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
private void current_ValueChanged(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
fill.ScaleTo(new Vector2((float)Current, 1), 200, EasingTypes.OutQuint);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,28 +1,25 @@
|
|||||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System;
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Configuration;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
using osu.Game.Modes.Objects;
|
using osu.Game.Modes.Objects;
|
||||||
using OpenTK;
|
|
||||||
using osu.Framework.Graphics.Primitives;
|
|
||||||
using osu.Game.Screens.Play;
|
using osu.Game.Screens.Play;
|
||||||
using osu.Framework.Allocation;
|
using System;
|
||||||
using osu.Game.Configuration;
|
|
||||||
using osu.Framework.Configuration;
|
|
||||||
|
|
||||||
namespace osu.Game.Modes.UI
|
namespace osu.Game.Modes.UI
|
||||||
{
|
{
|
||||||
public abstract class ScoreOverlay : Container
|
public abstract class HudOverlay : Container
|
||||||
{
|
{
|
||||||
public KeyCounterCollection KeyCounter;
|
public readonly KeyCounterCollection KeyCounter;
|
||||||
public ComboCounter ComboCounter;
|
public readonly ComboCounter ComboCounter;
|
||||||
public ScoreCounter ScoreCounter;
|
public readonly ScoreCounter ScoreCounter;
|
||||||
public PercentageCounter AccuracyCounter;
|
public readonly PercentageCounter AccuracyCounter;
|
||||||
public HealthDisplay HealthDisplay;
|
public readonly HealthDisplay HealthDisplay;
|
||||||
public Score Score { get; set; }
|
|
||||||
|
|
||||||
private Bindable<bool> showKeyCounter;
|
private Bindable<bool> showKeyCounter;
|
||||||
|
|
||||||
@ -30,12 +27,7 @@ namespace osu.Game.Modes.UI
|
|||||||
protected abstract ComboCounter CreateComboCounter();
|
protected abstract ComboCounter CreateComboCounter();
|
||||||
protected abstract PercentageCounter CreateAccuracyCounter();
|
protected abstract PercentageCounter CreateAccuracyCounter();
|
||||||
protected abstract ScoreCounter CreateScoreCounter();
|
protected abstract ScoreCounter CreateScoreCounter();
|
||||||
protected virtual HealthDisplay CreateHealthDisplay() => new HealthDisplay
|
protected abstract HealthDisplay CreateHealthDisplay();
|
||||||
{
|
|
||||||
Size = new Vector2(1, 5),
|
|
||||||
RelativeSizeAxes = Axes.X,
|
|
||||||
Margin = new MarginPadding { Top = 20 }
|
|
||||||
};
|
|
||||||
|
|
||||||
public virtual void OnHit(HitObject h)
|
public virtual void OnHit(HitObject h)
|
||||||
{
|
{
|
||||||
@ -46,15 +38,16 @@ namespace osu.Game.Modes.UI
|
|||||||
|
|
||||||
public virtual void OnMiss(HitObject h)
|
public virtual void OnMiss(HitObject h)
|
||||||
{
|
{
|
||||||
ComboCounter?.Roll();
|
ComboCounter.Current.Value = 0;
|
||||||
AccuracyCounter?.Set(AccuracyCounter.Count - 0.01f);
|
AccuracyCounter?.Set(AccuracyCounter.Count - 0.01f);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ScoreOverlay()
|
protected HudOverlay()
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both;
|
RelativeSizeAxes = Axes.Both;
|
||||||
|
|
||||||
Children = new Drawable[] {
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
KeyCounter = CreateKeyCounter(),
|
KeyCounter = CreateKeyCounter(),
|
||||||
ComboCounter = CreateComboCounter(),
|
ComboCounter = CreateComboCounter(),
|
||||||
ScoreCounter = CreateScoreCounter(),
|
ScoreCounter = CreateScoreCounter(),
|
||||||
@ -85,7 +78,7 @@ namespace osu.Game.Modes.UI
|
|||||||
//TODO: these should be bindable binds, not events!
|
//TODO: these should be bindable binds, not events!
|
||||||
processor.TotalScore.ValueChanged += delegate { ScoreCounter?.Set((ulong)processor.TotalScore.Value); };
|
processor.TotalScore.ValueChanged += delegate { ScoreCounter?.Set((ulong)processor.TotalScore.Value); };
|
||||||
processor.Accuracy.ValueChanged += delegate { AccuracyCounter?.Set((float)processor.Accuracy.Value); };
|
processor.Accuracy.ValueChanged += delegate { AccuracyCounter?.Set((float)processor.Accuracy.Value); };
|
||||||
processor.Combo.ValueChanged += delegate { ComboCounter?.Set((ulong)processor.Combo.Value); };
|
ComboCounter?.Current.BindTo(processor.Combo);
|
||||||
HealthDisplay?.Current.BindTo(processor.Health);
|
HealthDisplay?.Current.BindTo(processor.Health);
|
||||||
}
|
}
|
||||||
|
|
@ -1,15 +1,14 @@
|
|||||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using osu.Game.Modes.UI;
|
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
|
|
||||||
namespace osu.Game.Modes.Osu.UI
|
namespace osu.Game.Modes.UI
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Uses the 'x' symbol and has a pop-out effect while rolling over. Used in osu! standard.
|
/// Uses the 'x' symbol and has a pop-out effect while rolling over.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class OsuComboCounter : ComboCounter
|
public class StandardComboCounter : ComboCounter
|
||||||
{
|
{
|
||||||
protected uint ScheduledPopOutCurrentId;
|
protected uint ScheduledPopOutCurrentId;
|
||||||
|
|
||||||
@ -26,12 +25,12 @@ namespace osu.Game.Modes.Osu.UI
|
|||||||
PopOutCount.Anchor = Anchor;
|
PopOutCount.Anchor = Anchor;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override string FormatCount(ulong count)
|
protected override string FormatCount(int count)
|
||||||
{
|
{
|
||||||
return $@"{count}x";
|
return $@"{count}x";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void TransformPopOut(ulong newValue)
|
protected virtual void TransformPopOut(int newValue)
|
||||||
{
|
{
|
||||||
PopOutCount.Text = FormatCount(newValue);
|
PopOutCount.Text = FormatCount(newValue);
|
||||||
|
|
||||||
@ -44,19 +43,19 @@ namespace osu.Game.Modes.Osu.UI
|
|||||||
PopOutCount.MoveTo(DisplayedCountSpriteText.Position, PopOutDuration, PopOutEasing);
|
PopOutCount.MoveTo(DisplayedCountSpriteText.Position, PopOutDuration, PopOutEasing);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void TransformPopOutRolling(ulong newValue)
|
protected virtual void TransformPopOutRolling(int newValue)
|
||||||
{
|
{
|
||||||
TransformPopOut(newValue);
|
TransformPopOut(newValue);
|
||||||
TransformPopOutSmall(newValue);
|
TransformPopOutSmall(newValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void TransformNoPopOut(ulong newValue)
|
protected virtual void TransformNoPopOut(int newValue)
|
||||||
{
|
{
|
||||||
DisplayedCountSpriteText.Text = FormatCount(newValue);
|
DisplayedCountSpriteText.Text = FormatCount(newValue);
|
||||||
DisplayedCountSpriteText.ScaleTo(1);
|
DisplayedCountSpriteText.ScaleTo(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void TransformPopOutSmall(ulong newValue)
|
protected virtual void TransformPopOutSmall(int newValue)
|
||||||
{
|
{
|
||||||
DisplayedCountSpriteText.Text = FormatCount(newValue);
|
DisplayedCountSpriteText.Text = FormatCount(newValue);
|
||||||
DisplayedCountSpriteText.ScaleTo(PopOutSmallScale);
|
DisplayedCountSpriteText.ScaleTo(PopOutSmallScale);
|
||||||
@ -72,7 +71,7 @@ namespace osu.Game.Modes.Osu.UI
|
|||||||
DisplayedCount++;
|
DisplayedCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnCountRolling(ulong currentValue, ulong newValue)
|
protected override void OnCountRolling(int currentValue, int newValue)
|
||||||
{
|
{
|
||||||
ScheduledPopOutCurrentId++;
|
ScheduledPopOutCurrentId++;
|
||||||
|
|
||||||
@ -83,7 +82,7 @@ namespace osu.Game.Modes.Osu.UI
|
|||||||
base.OnCountRolling(currentValue, newValue);
|
base.OnCountRolling(currentValue, newValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnCountIncrement(ulong currentValue, ulong newValue)
|
protected override void OnCountIncrement(int currentValue, int newValue)
|
||||||
{
|
{
|
||||||
ScheduledPopOutCurrentId++;
|
ScheduledPopOutCurrentId++;
|
||||||
|
|
||||||
@ -93,7 +92,7 @@ namespace osu.Game.Modes.Osu.UI
|
|||||||
DisplayedCountSpriteText.Show();
|
DisplayedCountSpriteText.Show();
|
||||||
|
|
||||||
TransformPopOut(newValue);
|
TransformPopOut(newValue);
|
||||||
|
|
||||||
uint newTaskId = ScheduledPopOutCurrentId;
|
uint newTaskId = ScheduledPopOutCurrentId;
|
||||||
Scheduler.AddDelayed(delegate
|
Scheduler.AddDelayed(delegate
|
||||||
{
|
{
|
||||||
@ -101,7 +100,7 @@ namespace osu.Game.Modes.Osu.UI
|
|||||||
}, PopOutDuration);
|
}, PopOutDuration);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnCountChange(ulong currentValue, ulong newValue)
|
protected override void OnCountChange(int currentValue, int newValue)
|
||||||
{
|
{
|
||||||
ScheduledPopOutCurrentId++;
|
ScheduledPopOutCurrentId++;
|
||||||
|
|
||||||
@ -111,7 +110,7 @@ namespace osu.Game.Modes.Osu.UI
|
|||||||
base.OnCountChange(currentValue, newValue);
|
base.OnCountChange(currentValue, newValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnDisplayedCountRolling(ulong currentValue, ulong newValue)
|
protected override void OnDisplayedCountRolling(int currentValue, int newValue)
|
||||||
{
|
{
|
||||||
if (newValue == 0)
|
if (newValue == 0)
|
||||||
DisplayedCountSpriteText.FadeOut(FadeOutDuration);
|
DisplayedCountSpriteText.FadeOut(FadeOutDuration);
|
||||||
@ -124,14 +123,14 @@ namespace osu.Game.Modes.Osu.UI
|
|||||||
TransformNoPopOut(newValue);
|
TransformNoPopOut(newValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnDisplayedCountChange(ulong newValue)
|
protected override void OnDisplayedCountChange(int newValue)
|
||||||
{
|
{
|
||||||
DisplayedCountSpriteText.FadeTo(newValue == 0 ? 0 : 1);
|
DisplayedCountSpriteText.FadeTo(newValue == 0 ? 0 : 1);
|
||||||
|
|
||||||
TransformNoPopOut(newValue);
|
TransformNoPopOut(newValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnDisplayedCountIncrement(ulong newValue)
|
protected override void OnDisplayedCountIncrement(int newValue)
|
||||||
{
|
{
|
||||||
DisplayedCountSpriteText.Show();
|
DisplayedCountSpriteText.Show();
|
||||||
|
|
60
osu.Game/Modes/UI/StandardHealthDisplay.cs
Normal file
60
osu.Game/Modes/UI/StandardHealthDisplay.cs
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
|
||||||
|
using OpenTK;
|
||||||
|
using OpenTK.Graphics;
|
||||||
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
using osu.Framework.Graphics.Transforms;
|
||||||
|
using osu.Game.Graphics;
|
||||||
|
|
||||||
|
namespace osu.Game.Modes.UI
|
||||||
|
{
|
||||||
|
public class StandardHealthDisplay : HealthDisplay
|
||||||
|
{
|
||||||
|
private Container fill;
|
||||||
|
|
||||||
|
public StandardHealthDisplay()
|
||||||
|
{
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new Box
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Colour = Color4.Black,
|
||||||
|
},
|
||||||
|
fill = new Container
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Scale = new Vector2(0, 1),
|
||||||
|
Masking = true,
|
||||||
|
Children = new[]
|
||||||
|
{
|
||||||
|
new Box
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(OsuColour colours)
|
||||||
|
{
|
||||||
|
fill.Colour = colours.BlueLighter;
|
||||||
|
fill.EdgeEffect = new EdgeEffect
|
||||||
|
{
|
||||||
|
Colour = colours.BlueDarker.Opacity(0.6f),
|
||||||
|
Radius = 8,
|
||||||
|
Type = EdgeEffectType.Glow
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void SetHealth(float value) => fill.ScaleTo(new Vector2(value, 1), 200, EasingTypes.OutQuint);
|
||||||
|
}
|
||||||
|
}
|
@ -1,27 +1,16 @@
|
|||||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using osu.Framework.Graphics;
|
|
||||||
using osu.Game.Graphics.UserInterface;
|
|
||||||
using osu.Game.Modes.UI;
|
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using OpenTK.Input;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Primitives;
|
using osu.Framework.Graphics.Primitives;
|
||||||
|
using osu.Game.Graphics.UserInterface;
|
||||||
using osu.Game.Screens.Play;
|
using osu.Game.Screens.Play;
|
||||||
|
|
||||||
namespace osu.Game.Modes.Osu.UI
|
namespace osu.Game.Modes.UI
|
||||||
{
|
{
|
||||||
public class OsuScoreOverlay : ScoreOverlay
|
public class StandardHudOverlay : HudOverlay
|
||||||
{
|
{
|
||||||
protected override ScoreCounter CreateScoreCounter() => new ScoreCounter(6)
|
|
||||||
{
|
|
||||||
Anchor = Anchor.TopCentre,
|
|
||||||
Origin = Anchor.TopCentre,
|
|
||||||
TextSize = 40,
|
|
||||||
Position = new Vector2(0, 30),
|
|
||||||
Margin = new MarginPadding { Right = 5 },
|
|
||||||
};
|
|
||||||
|
|
||||||
protected override PercentageCounter CreateAccuracyCounter() => new PercentageCounter
|
protected override PercentageCounter CreateAccuracyCounter() => new PercentageCounter
|
||||||
{
|
{
|
||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.TopCentre,
|
||||||
@ -31,12 +20,19 @@ namespace osu.Game.Modes.Osu.UI
|
|||||||
Margin = new MarginPadding { Right = 5 },
|
Margin = new MarginPadding { Right = 5 },
|
||||||
};
|
};
|
||||||
|
|
||||||
protected override ComboCounter CreateComboCounter() => new OsuComboCounter
|
protected override ComboCounter CreateComboCounter() => new StandardComboCounter
|
||||||
{
|
{
|
||||||
Anchor = Anchor.BottomLeft,
|
Anchor = Anchor.BottomLeft,
|
||||||
Origin = Anchor.BottomLeft,
|
Origin = Anchor.BottomLeft,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
protected override HealthDisplay CreateHealthDisplay() => new StandardHealthDisplay
|
||||||
|
{
|
||||||
|
Size = new Vector2(1, 5),
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
|
Margin = new MarginPadding { Top = 20 }
|
||||||
|
};
|
||||||
|
|
||||||
protected override KeyCounterCollection CreateKeyCounter() => new KeyCounterCollection
|
protected override KeyCounterCollection CreateKeyCounter() => new KeyCounterCollection
|
||||||
{
|
{
|
||||||
IsCounting = true,
|
IsCounting = true,
|
||||||
@ -44,13 +40,15 @@ namespace osu.Game.Modes.Osu.UI
|
|||||||
Anchor = Anchor.BottomRight,
|
Anchor = Anchor.BottomRight,
|
||||||
Origin = Anchor.BottomRight,
|
Origin = Anchor.BottomRight,
|
||||||
Margin = new MarginPadding(10),
|
Margin = new MarginPadding(10),
|
||||||
Children = new KeyCounter[]
|
};
|
||||||
{
|
|
||||||
new KeyCounterKeyboard(Key.Z),
|
protected override ScoreCounter CreateScoreCounter() => new ScoreCounter(6)
|
||||||
new KeyCounterKeyboard(Key.X),
|
{
|
||||||
new KeyCounterMouse(MouseButton.Left),
|
Anchor = Anchor.TopCentre,
|
||||||
new KeyCounterMouse(MouseButton.Right),
|
Origin = Anchor.TopCentre,
|
||||||
}
|
TextSize = 40,
|
||||||
|
Position = new Vector2(0, 30),
|
||||||
|
Margin = new MarginPadding { Right = 5 },
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,29 +1,29 @@
|
|||||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using OpenTK;
|
||||||
|
using OpenTK.Graphics;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Audio;
|
using osu.Framework.Audio;
|
||||||
using osu.Framework.Audio.Track;
|
using osu.Framework.Audio.Track;
|
||||||
using osu.Framework.Graphics;
|
|
||||||
using osu.Framework.Timing;
|
|
||||||
using osu.Game.Database;
|
|
||||||
using osu.Game.Modes;
|
|
||||||
using osu.Game.Screens.Backgrounds;
|
|
||||||
using OpenTK;
|
|
||||||
using osu.Framework.Screens;
|
|
||||||
using osu.Game.Modes.UI;
|
|
||||||
using osu.Game.Screens.Ranking;
|
|
||||||
using osu.Game.Configuration;
|
|
||||||
using osu.Framework.Configuration;
|
using osu.Framework.Configuration;
|
||||||
using System;
|
|
||||||
using System.Linq;
|
|
||||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
using osu.Framework.Extensions.IEnumerableExtensions;
|
||||||
using OpenTK.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Transforms;
|
using osu.Framework.Graphics.Transforms;
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
using osu.Framework.Logging;
|
using osu.Framework.Logging;
|
||||||
|
using osu.Framework.Screens;
|
||||||
|
using osu.Framework.Timing;
|
||||||
|
using osu.Game.Configuration;
|
||||||
|
using osu.Game.Database;
|
||||||
using osu.Game.Input.Handlers;
|
using osu.Game.Input.Handlers;
|
||||||
|
using osu.Game.Modes;
|
||||||
|
using osu.Game.Modes.UI;
|
||||||
|
using osu.Game.Screens.Backgrounds;
|
||||||
|
using osu.Game.Screens.Ranking;
|
||||||
|
using System;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Play
|
namespace osu.Game.Screens.Play
|
||||||
{
|
{
|
||||||
@ -54,7 +54,7 @@ namespace osu.Game.Screens.Play
|
|||||||
private Bindable<int> dimLevel;
|
private Bindable<int> dimLevel;
|
||||||
private SkipButton skipButton;
|
private SkipButton skipButton;
|
||||||
|
|
||||||
private ScoreOverlay scoreOverlay;
|
private HudOverlay hudOverlay;
|
||||||
private PauseOverlay pauseOverlay;
|
private PauseOverlay pauseOverlay;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
@ -112,8 +112,9 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
ruleset = Ruleset.GetRuleset(Beatmap.PlayMode);
|
ruleset = Ruleset.GetRuleset(Beatmap.PlayMode);
|
||||||
|
|
||||||
scoreOverlay = ruleset.CreateScoreOverlay();
|
hudOverlay = new StandardHudOverlay();
|
||||||
scoreOverlay.BindProcessor(scoreProcessor = ruleset.CreateScoreProcessor(beatmap.HitObjects.Count));
|
hudOverlay.KeyCounter.Add(ruleset.CreateGameplayKeys());
|
||||||
|
hudOverlay.BindProcessor(scoreProcessor = ruleset.CreateScoreProcessor(beatmap.HitObjects.Count));
|
||||||
|
|
||||||
pauseOverlay = new PauseOverlay
|
pauseOverlay = new PauseOverlay
|
||||||
{
|
{
|
||||||
@ -135,7 +136,7 @@ namespace osu.Game.Screens.Play
|
|||||||
hitRenderer.InputManager.ReplayInputHandler = ReplayInputHandler;
|
hitRenderer.InputManager.ReplayInputHandler = ReplayInputHandler;
|
||||||
}
|
}
|
||||||
|
|
||||||
scoreOverlay.BindHitRenderer(hitRenderer);
|
hudOverlay.BindHitRenderer(hitRenderer);
|
||||||
|
|
||||||
//bind HitRenderer to ScoreProcessor and ourselves (for a pass situation)
|
//bind HitRenderer to ScoreProcessor and ourselves (for a pass situation)
|
||||||
hitRenderer.OnJudgement += scoreProcessor.AddJudgement;
|
hitRenderer.OnJudgement += scoreProcessor.AddJudgement;
|
||||||
@ -159,7 +160,7 @@ namespace osu.Game.Screens.Play
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
scoreOverlay,
|
hudOverlay,
|
||||||
pauseOverlay
|
pauseOverlay
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -196,7 +197,7 @@ namespace osu.Game.Screens.Play
|
|||||||
if (canPause || force)
|
if (canPause || force)
|
||||||
{
|
{
|
||||||
lastPauseActionTime = Time.Current;
|
lastPauseActionTime = Time.Current;
|
||||||
scoreOverlay.KeyCounter.IsCounting = false;
|
hudOverlay.KeyCounter.IsCounting = false;
|
||||||
pauseOverlay.Retries = RestartCount;
|
pauseOverlay.Retries = RestartCount;
|
||||||
pauseOverlay.Show();
|
pauseOverlay.Show();
|
||||||
sourceClock.Stop();
|
sourceClock.Stop();
|
||||||
@ -211,7 +212,7 @@ namespace osu.Game.Screens.Play
|
|||||||
public void Resume()
|
public void Resume()
|
||||||
{
|
{
|
||||||
lastPauseActionTime = Time.Current;
|
lastPauseActionTime = Time.Current;
|
||||||
scoreOverlay.KeyCounter.IsCounting = true;
|
hudOverlay.KeyCounter.IsCounting = true;
|
||||||
pauseOverlay.Hide();
|
pauseOverlay.Hide();
|
||||||
sourceClock.Start();
|
sourceClock.Start();
|
||||||
IsPaused = false;
|
IsPaused = false;
|
||||||
|
@ -97,6 +97,9 @@
|
|||||||
<Compile Include="Modes\Score.cs" />
|
<Compile Include="Modes\Score.cs" />
|
||||||
<Compile Include="Modes\ScoreProcesssor.cs" />
|
<Compile Include="Modes\ScoreProcesssor.cs" />
|
||||||
<Compile Include="Modes\UI\HealthDisplay.cs" />
|
<Compile Include="Modes\UI\HealthDisplay.cs" />
|
||||||
|
<Compile Include="Modes\UI\HudOverlay.cs" />
|
||||||
|
<Compile Include="Modes\UI\StandardHealthDisplay.cs" />
|
||||||
|
<Compile Include="Modes\UI\StandardHudOverlay.cs" />
|
||||||
<Compile Include="Online\API\IOnlineComponent.cs" />
|
<Compile Include="Online\API\IOnlineComponent.cs" />
|
||||||
<Compile Include="Online\API\Requests\GetUserRequest.cs" />
|
<Compile Include="Online\API\Requests\GetUserRequest.cs" />
|
||||||
<Compile Include="Overlays\DragBar.cs" />
|
<Compile Include="Overlays\DragBar.cs" />
|
||||||
@ -167,6 +170,7 @@
|
|||||||
<Compile Include="Screens\Play\PlayerInputManager.cs" />
|
<Compile Include="Screens\Play\PlayerInputManager.cs" />
|
||||||
<Compile Include="Screens\Play\PlayerLoader.cs" />
|
<Compile Include="Screens\Play\PlayerLoader.cs" />
|
||||||
<Compile Include="Screens\Play\SkipButton.cs" />
|
<Compile Include="Screens\Play\SkipButton.cs" />
|
||||||
|
<Compile Include="Modes\UI\StandardComboCounter.cs" />
|
||||||
<Compile Include="Screens\Select\CarouselContainer.cs" />
|
<Compile Include="Screens\Select\CarouselContainer.cs" />
|
||||||
<Compile Include="Screens\Select\MatchSongSelect.cs" />
|
<Compile Include="Screens\Select\MatchSongSelect.cs" />
|
||||||
<Compile Include="Screens\OsuGameScreen.cs" />
|
<Compile Include="Screens\OsuGameScreen.cs" />
|
||||||
@ -181,7 +185,6 @@
|
|||||||
<Compile Include="Screens\Select\PlaySongSelect.cs" />
|
<Compile Include="Screens\Select\PlaySongSelect.cs" />
|
||||||
<Compile Include="Modes\UI\HitRenderer.cs" />
|
<Compile Include="Modes\UI\HitRenderer.cs" />
|
||||||
<Compile Include="Modes\UI\Playfield.cs" />
|
<Compile Include="Modes\UI\Playfield.cs" />
|
||||||
<Compile Include="Modes\UI\ScoreOverlay.cs" />
|
|
||||||
<Compile Include="Screens\Select\EditSongSelect.cs" />
|
<Compile Include="Screens\Select\EditSongSelect.cs" />
|
||||||
<Compile Include="Modes\UI\ComboCounter.cs" />
|
<Compile Include="Modes\UI\ComboCounter.cs" />
|
||||||
<Compile Include="Modes\UI\ComboResultCounter.cs" />
|
<Compile Include="Modes\UI\ComboResultCounter.cs" />
|
||||||
|
Reference in New Issue
Block a user