From 977b5065876bfcbd5e12843484238b418a87a494 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Fri, 17 Mar 2017 17:06:34 +0900 Subject: [PATCH 01/12] Add TaikoJudgementInfo. --- .../Judgements/TaikoJudgementInfo.cs | 71 +++++++++++++++++++ .../Judgements/TaikoScoreResult.cs | 11 +++ .../osu.Game.Modes.Taiko.csproj | 1 + 3 files changed, 83 insertions(+) create mode 100644 osu.Game.Modes.Taiko/Judgements/TaikoScoreResult.cs diff --git a/osu.Game.Modes.Taiko/Judgements/TaikoJudgementInfo.cs b/osu.Game.Modes.Taiko/Judgements/TaikoJudgementInfo.cs index 38b9d784dd..8c42023648 100644 --- a/osu.Game.Modes.Taiko/Judgements/TaikoJudgementInfo.cs +++ b/osu.Game.Modes.Taiko/Judgements/TaikoJudgementInfo.cs @@ -7,5 +7,76 @@ namespace osu.Game.Modes.Taiko.Judgements { public class TaikoJudgementInfo : JudgementInfo { + /// + /// The maximum score value. + /// + public const TaikoScoreResult MAX_SCORE = TaikoScoreResult.Great; + + /// + /// The score value. + /// + public TaikoScoreResult Score; + + /// + /// The score value for the combo portion of the score. + /// + public int ScoreValue => ScoreToInt(Score); + + /// + /// The score value for the accuracy portion of the score. + /// + public int AccuracyScoreValue => AccuracyScoreToInt(Score); + + /// + /// The maximum score value for the combo portion of the score. + /// + public int MaxScoreValue => ScoreToInt(MAX_SCORE); + + /// + /// The maximum score value for the accuracy portion of the score. + /// + public int MaxAccuracyScoreValue => AccuracyScoreToInt(MAX_SCORE); + + /// + /// Whether this Judgement has a secondary hit in the case of finishers. + /// + public bool SecondHit; + + /// + /// Computes the score value for the combo portion of the score. + /// For the accuracy portion of the score (including accuracy percentage), see . + /// + /// The result to compute the score value for. + /// The int score value. + protected virtual int ScoreToInt(TaikoScoreResult result) + { + switch (result) + { + default: + return 0; + case TaikoScoreResult.Good: + return 100; + case TaikoScoreResult.Great: + return 300; + } + } + + /// + /// Computes the score value for the accurac portion of the score. + /// + /// The result to compute the score value for. + /// The int score value. + protected virtual int AccuracyScoreToInt(TaikoScoreResult result) + { + switch (result) + { + default: + return 0; + case TaikoScoreResult.Good: + return 150; + case TaikoScoreResult.Great: + return 300; + } + } } } diff --git a/osu.Game.Modes.Taiko/Judgements/TaikoScoreResult.cs b/osu.Game.Modes.Taiko/Judgements/TaikoScoreResult.cs new file mode 100644 index 0000000000..004b9c4973 --- /dev/null +++ b/osu.Game.Modes.Taiko/Judgements/TaikoScoreResult.cs @@ -0,0 +1,11 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +namespace osu.Game.Modes.Taiko.Judgements +{ + public enum TaikoScoreResult + { + Good, + Great + } +} diff --git a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj index bc38781b01..f008594509 100644 --- a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj +++ b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj @@ -50,6 +50,7 @@ + From dde2ac7f4aeded50426cab429423fb969ea6b5e3 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Fri, 17 Mar 2017 22:03:47 +0900 Subject: [PATCH 02/12] Make TextAwesome have a shadow. --- osu.Game/Graphics/TextAwesome.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Graphics/TextAwesome.cs b/osu.Game/Graphics/TextAwesome.cs index 45f9ddeec9..1bae165e45 100644 --- a/osu.Game/Graphics/TextAwesome.cs +++ b/osu.Game/Graphics/TextAwesome.cs @@ -1,11 +1,11 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Graphics.Sprites; +using osu.Game.Graphics.Sprites; namespace osu.Game.Graphics { - public class TextAwesome : SpriteText + public class TextAwesome : OsuSpriteText { //public override FontFace FontFace => (int)Icon < 0xf000 ? FontFace.OsuFont : FontFace.FontAwesome; From 090e8bbb795656741fb5699700ce623343defe7c Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Mon, 20 Mar 2017 13:10:24 +0900 Subject: [PATCH 03/12] Remove hit object types solution-wide. --- .../Tests/TestCaseHitObjects.cs | 7 +++++++ osu.Game.Modes.Osu/Objects/HitCircle.cs | 1 - osu.Game.Modes.Osu/Objects/HitObjectType.cs | 13 ------------ osu.Game.Modes.Osu/Objects/OsuHitObject.cs | 2 -- .../Objects/OsuHitObjectDifficulty.cs | 6 +++--- osu.Game.Modes.Osu/Objects/Slider.cs | 2 -- osu.Game.Modes.Osu/Objects/SliderTick.cs | 2 -- osu.Game.Modes.Osu/Objects/Spinner.cs | 2 -- osu.Game.Modes.Osu/OsuDifficultyCalculator.cs | 4 ++-- osu.Game.Modes.Osu/osu.Game.Modes.Osu.csproj | 1 - osu.Game.Modes.Taiko/Objects/TaikoHitType.cs | 21 ------------------- .../osu.Game.Modes.Taiko.csproj | 1 - 12 files changed, 12 insertions(+), 50 deletions(-) delete mode 100644 osu.Game.Modes.Osu/Objects/HitObjectType.cs delete mode 100644 osu.Game.Modes.Taiko/Objects/TaikoHitType.cs diff --git a/osu.Desktop.VisualTests/Tests/TestCaseHitObjects.cs b/osu.Desktop.VisualTests/Tests/TestCaseHitObjects.cs index 8462de92cd..eeebc7faa8 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseHitObjects.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseHitObjects.cs @@ -144,5 +144,12 @@ namespace osu.Desktop.VisualTests.Tests if (proxyable != null) approachContainer.Add(proxyable.ProxiedLayer.CreateProxy()); } + + private enum HitObjectType + { + Circle, + Slider, + Spinner + } } } diff --git a/osu.Game.Modes.Osu/Objects/HitCircle.cs b/osu.Game.Modes.Osu/Objects/HitCircle.cs index 2d86f0225f..aa45ac7fb9 100644 --- a/osu.Game.Modes.Osu/Objects/HitCircle.cs +++ b/osu.Game.Modes.Osu/Objects/HitCircle.cs @@ -5,6 +5,5 @@ namespace osu.Game.Modes.Osu.Objects { public class HitCircle : OsuHitObject { - public override HitObjectType Type => HitObjectType.Circle; } } diff --git a/osu.Game.Modes.Osu/Objects/HitObjectType.cs b/osu.Game.Modes.Osu/Objects/HitObjectType.cs deleted file mode 100644 index 7d2d84c94c..0000000000 --- a/osu.Game.Modes.Osu/Objects/HitObjectType.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -namespace osu.Game.Modes.Osu.Objects -{ - public enum HitObjectType - { - Circle, - Slider, - Spinner, - SliderTick - } -} diff --git a/osu.Game.Modes.Osu/Objects/OsuHitObject.cs b/osu.Game.Modes.Osu/Objects/OsuHitObject.cs index bedde7a763..2af669b4ef 100644 --- a/osu.Game.Modes.Osu/Objects/OsuHitObject.cs +++ b/osu.Game.Modes.Osu/Objects/OsuHitObject.cs @@ -36,8 +36,6 @@ namespace osu.Game.Modes.Osu.Objects public float Scale { get; set; } = 1; - public abstract HitObjectType Type { get; } - public Color4 ComboColour { get; set; } public virtual bool NewCombo { get; set; } public int ComboIndex { get; set; } diff --git a/osu.Game.Modes.Osu/Objects/OsuHitObjectDifficulty.cs b/osu.Game.Modes.Osu/Objects/OsuHitObjectDifficulty.cs index c67c28b526..926e5132bd 100644 --- a/osu.Game.Modes.Osu/Objects/OsuHitObjectDifficulty.cs +++ b/osu.Game.Modes.Osu/Objects/OsuHitObjectDifficulty.cs @@ -148,11 +148,11 @@ namespace osu.Game.Modes.Osu.Objects double timeElapsed = (BaseHitObject.StartTime - previousHitObject.BaseHitObject.StartTime) / timeRate; double decay = Math.Pow(DECAY_BASE[(int)type], timeElapsed / 1000); - if (BaseHitObject.Type == HitObjectType.Spinner) + if (BaseHitObject is Spinner) { // Do nothing for spinners } - else if (BaseHitObject.Type == HitObjectType.Slider) + else if (BaseHitObject is Slider) { switch (type) { @@ -180,7 +180,7 @@ namespace osu.Game.Modes.Osu.Objects break; } } - else if (BaseHitObject.Type == HitObjectType.Circle) + else if (BaseHitObject is HitCircle) { addition = spacingWeight(DistanceTo(previousHitObject), type) * spacing_weight_scaling[(int)type]; } diff --git a/osu.Game.Modes.Osu/Objects/Slider.cs b/osu.Game.Modes.Osu/Objects/Slider.cs index d94b6534ed..213a4a7bee 100644 --- a/osu.Game.Modes.Osu/Objects/Slider.cs +++ b/osu.Game.Modes.Osu/Objects/Slider.cs @@ -103,7 +103,5 @@ namespace osu.Game.Modes.Osu.Objects } } } - - public override HitObjectType Type => HitObjectType.Slider; } } diff --git a/osu.Game.Modes.Osu/Objects/SliderTick.cs b/osu.Game.Modes.Osu/Objects/SliderTick.cs index 4492af86f9..67f393b126 100644 --- a/osu.Game.Modes.Osu/Objects/SliderTick.cs +++ b/osu.Game.Modes.Osu/Objects/SliderTick.cs @@ -6,7 +6,5 @@ namespace osu.Game.Modes.Osu.Objects public class SliderTick : OsuHitObject { public int RepeatIndex { get; set; } - - public override HitObjectType Type => HitObjectType.SliderTick; } } diff --git a/osu.Game.Modes.Osu/Objects/Spinner.cs b/osu.Game.Modes.Osu/Objects/Spinner.cs index 65e39f30ed..dd9a6c386a 100644 --- a/osu.Game.Modes.Osu/Objects/Spinner.cs +++ b/osu.Game.Modes.Osu/Objects/Spinner.cs @@ -10,8 +10,6 @@ namespace osu.Game.Modes.Osu.Objects public double EndTime { get; set; } public double Duration => EndTime - StartTime; - public override HitObjectType Type => HitObjectType.Spinner; - public override bool NewCombo => true; } } diff --git a/osu.Game.Modes.Osu/OsuDifficultyCalculator.cs b/osu.Game.Modes.Osu/OsuDifficultyCalculator.cs index 5ef0f0059d..7696638082 100644 --- a/osu.Game.Modes.Osu/OsuDifficultyCalculator.cs +++ b/osu.Game.Modes.Osu/OsuDifficultyCalculator.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps; +using osu.Game.Modes.Objects.Types; using osu.Game.Modes.Osu.Beatmaps; using osu.Game.Modes.Osu.Objects; using System; @@ -26,8 +27,7 @@ namespace osu.Game.Modes.Osu protected override void PreprocessHitObjects() { foreach (var h in Objects) - if (h.Type == HitObjectType.Slider) - ((Slider)h).Curve.Calculate(); + (h as IHasCurve)?.Curve?.Calculate(); } protected override double CalculateInternal(Dictionary categoryDifficulty) diff --git a/osu.Game.Modes.Osu/osu.Game.Modes.Osu.csproj b/osu.Game.Modes.Osu/osu.Game.Modes.Osu.csproj index 2c7f3a0916..12135a38fb 100644 --- a/osu.Game.Modes.Osu/osu.Game.Modes.Osu.csproj +++ b/osu.Game.Modes.Osu/osu.Game.Modes.Osu.csproj @@ -67,7 +67,6 @@ - diff --git a/osu.Game.Modes.Taiko/Objects/TaikoHitType.cs b/osu.Game.Modes.Taiko/Objects/TaikoHitType.cs deleted file mode 100644 index adf3a67246..0000000000 --- a/osu.Game.Modes.Taiko/Objects/TaikoHitType.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using System; - -namespace osu.Game.Modes.Taiko.Objects -{ - [Flags] - public enum TaikoHitType - { - None = 0, - CentreHit = 1 << 0, - RimHit = 1 << 1, - DrumRoll = 1 << 2, - DrumRollTick = 1 << 3, - Bash = 1 << 4, - Finisher = 1 << 5, - - Hit = CentreHit | RimHit - } -} \ No newline at end of file diff --git a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj index 0e9e6a56b4..7ea6dfeadb 100644 --- a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj +++ b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj @@ -50,7 +50,6 @@ - From d27f37beb5fe9f923b9e6028b94242c48653f3a2 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Mon, 20 Mar 2017 13:48:06 +0900 Subject: [PATCH 04/12] Hard-code text size in cases it wasn't set. --- osu.Desktop/Overlays/VersionManager.cs | 1 + osu.Game/Graphics/UserInterface/OsuDropDownHeader.cs | 1 + osu.Game/Modes/UI/ModIcon.cs | 2 ++ osu.Game/Overlays/Notifications/Notification.cs | 1 + osu.Game/Overlays/Notifications/SimpleNotification.cs | 1 + osu.Game/Overlays/Options/OptionsFooter.cs | 1 + osu.Game/Overlays/Options/SidebarButton.cs | 1 + osu.Game/Overlays/Toolbar/ToolbarButton.cs | 1 + osu.Game/Screens/Select/BeatmapInfoWedge.cs | 6 ++++-- osu.Game/Screens/Select/SearchTextBox.cs | 1 + 10 files changed, 14 insertions(+), 2 deletions(-) diff --git a/osu.Desktop/Overlays/VersionManager.cs b/osu.Desktop/Overlays/VersionManager.cs index b93636331a..70925f6cf4 100644 --- a/osu.Desktop/Overlays/VersionManager.cs +++ b/osu.Desktop/Overlays/VersionManager.cs @@ -215,6 +215,7 @@ namespace osu.Desktop.Overlays Origin = Anchor.Centre, Icon = FontAwesome.fa_upload, Colour = Color4.White, + TextSize = 20 } }); } diff --git a/osu.Game/Graphics/UserInterface/OsuDropDownHeader.cs b/osu.Game/Graphics/UserInterface/OsuDropDownHeader.cs index 00dc510338..559ffca283 100644 --- a/osu.Game/Graphics/UserInterface/OsuDropDownHeader.cs +++ b/osu.Game/Graphics/UserInterface/OsuDropDownHeader.cs @@ -54,6 +54,7 @@ namespace osu.Game.Graphics.UserInterface Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, Margin = new MarginPadding { Right = 4 }, + TextSize = 20 } }; } diff --git a/osu.Game/Modes/UI/ModIcon.cs b/osu.Game/Modes/UI/ModIcon.cs index b1017a670e..65a570fea7 100644 --- a/osu.Game/Modes/UI/ModIcon.cs +++ b/osu.Game/Modes/UI/ModIcon.cs @@ -66,12 +66,14 @@ namespace osu.Game.Modes.UI Anchor = Anchor.Centre, Icon = FontAwesome.fa_osu_mod_bg, Shadow = true, + TextSize = 20 }, modIcon = new TextAwesome { Origin = Anchor.Centre, Anchor = Anchor.Centre, Colour = OsuColour.Gray(84), + TextSize = 20 }, }; diff --git a/osu.Game/Overlays/Notifications/Notification.cs b/osu.Game/Overlays/Notifications/Notification.cs index ea07d7806a..e003a0e9dd 100644 --- a/osu.Game/Overlays/Notifications/Notification.cs +++ b/osu.Game/Overlays/Notifications/Notification.cs @@ -169,6 +169,7 @@ namespace osu.Game.Overlays.Notifications Anchor = Anchor.Centre, Origin = Anchor.Centre, Icon = FontAwesome.fa_times_circle, + TextSize = 20 } }; } diff --git a/osu.Game/Overlays/Notifications/SimpleNotification.cs b/osu.Game/Overlays/Notifications/SimpleNotification.cs index b06994d61a..19034d6d1c 100644 --- a/osu.Game/Overlays/Notifications/SimpleNotification.cs +++ b/osu.Game/Overlays/Notifications/SimpleNotification.cs @@ -53,6 +53,7 @@ namespace osu.Game.Overlays.Notifications Anchor = Anchor.Centre, Origin = Anchor.Centre, Icon = icon, + TextSize = 20 } }); diff --git a/osu.Game/Overlays/Options/OptionsFooter.cs b/osu.Game/Overlays/Options/OptionsFooter.cs index 23622aef08..c42fe42428 100644 --- a/osu.Game/Overlays/Options/OptionsFooter.cs +++ b/osu.Game/Overlays/Options/OptionsFooter.cs @@ -32,6 +32,7 @@ namespace osu.Game.Overlays.Options { Icon = Ruleset.GetRuleset(m).Icon, Colour = Color4.Gray, + TextSize = 20 }); Children = new Drawable[] diff --git a/osu.Game/Overlays/Options/SidebarButton.cs b/osu.Game/Overlays/Options/SidebarButton.cs index 83c2227763..729a9be326 100644 --- a/osu.Game/Overlays/Options/SidebarButton.cs +++ b/osu.Game/Overlays/Options/SidebarButton.cs @@ -87,6 +87,7 @@ namespace osu.Game.Overlays.Options { Anchor = Anchor.Centre, Origin = Anchor.Centre, + TextSize = 20 }, } }, diff --git a/osu.Game/Overlays/Toolbar/ToolbarButton.cs b/osu.Game/Overlays/Toolbar/ToolbarButton.cs index 17cef48f38..be4a23722f 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarButton.cs @@ -98,6 +98,7 @@ namespace osu.Game.Overlays.Toolbar { Anchor = Anchor.Centre, Origin = Anchor.Centre, + TextSize = 20 }, DrawableText = new OsuSpriteText { diff --git a/osu.Game/Screens/Select/BeatmapInfoWedge.cs b/osu.Game/Screens/Select/BeatmapInfoWedge.cs index 5285d26264..d0805c19bd 100644 --- a/osu.Game/Screens/Select/BeatmapInfoWedge.cs +++ b/osu.Game/Screens/Select/BeatmapInfoWedge.cs @@ -237,14 +237,16 @@ namespace osu.Game.Screens.Select Icon = FontAwesome.fa_square, Origin = Anchor.Centre, Colour = new Color4(68, 17, 136, 255), - Rotation = 45 + Rotation = 45, + TextSize = 20 }, new TextAwesome { Icon = statistic.Icon, Origin = Anchor.Centre, Colour = new Color4(255, 221, 85, 255), - Scale = new Vector2(0.8f) + Scale = new Vector2(0.8f), + TextSize = 20 }, new OsuSpriteText { diff --git a/osu.Game/Screens/Select/SearchTextBox.cs b/osu.Game/Screens/Select/SearchTextBox.cs index bb1edfd0d7..4f2ab221cb 100644 --- a/osu.Game/Screens/Select/SearchTextBox.cs +++ b/osu.Game/Screens/Select/SearchTextBox.cs @@ -26,6 +26,7 @@ namespace osu.Game.Screens.Select Origin = Anchor.CentreRight, Anchor = Anchor.CentreRight, Margin = new MarginPadding { Right = 10 }, + TextSize = 20 } }); From 66752af81ff40699347b9dd1c6050827ebbd846c Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 21 Mar 2017 14:53:55 +0900 Subject: [PATCH 05/12] Late-add the HitObjects container in the Playfield. Allows derivers to define the Content container in the constructor, to redirect the positioning of the HitObjects container. --- osu.Game/Modes/UI/Playfield.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/osu.Game/Modes/UI/Playfield.cs b/osu.Game/Modes/UI/Playfield.cs index bff461f649..e5babecad9 100644 --- a/osu.Game/Modes/UI/Playfield.cs +++ b/osu.Game/Modes/UI/Playfield.cs @@ -7,6 +7,7 @@ using osu.Game.Modes.Objects; using osu.Game.Modes.Objects.Drawables; using OpenTK; using osu.Game.Modes.Judgements; +using osu.Framework.Allocation; namespace osu.Game.Modes.UI { @@ -45,10 +46,16 @@ namespace osu.Game.Modes.UI } }); - Add(HitObjects = new HitObjectContainer> + HitObjects = new HitObjectContainer> { RelativeSizeAxes = Axes.Both, - }); + }; + } + + [BackgroundDependencyLoader] + private void load() + { + Add(HitObjects); } /// From a272675705e40330c25ed63c32971b500d929298 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 21 Mar 2017 21:18:08 +0900 Subject: [PATCH 06/12] Parse time signature from legacy beatmap control points. --- osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs | 3 ++- osu.Game/Beatmaps/Timing/ControlPoint.cs | 8 +------- osu.Game/Beatmaps/Timing/TimeSignatures.cs | 11 +++++++++++ osu.Game/osu.Game.csproj | 1 + 4 files changed, 15 insertions(+), 8 deletions(-) create mode 100644 osu.Game/Beatmaps/Timing/TimeSignatures.cs diff --git a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs index af90e35da7..20b977499e 100644 --- a/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs +++ b/osu.Game/Beatmaps/Formats/OsuLegacyDecoder.cs @@ -207,7 +207,8 @@ namespace osu.Game.Beatmaps.Formats VelocityAdjustment = beatLength < 0 ? -beatLength / 100.0 : 1, TimingChange = split.Length <= 6 || split[6][0] == '1', KiaiMode = (effectFlags & 1) > 0, - OmitFirstBarLine = (effectFlags & 8) > 0 + OmitFirstBarLine = (effectFlags & 8) > 0, + TimeSignature = (TimeSignatures)int.Parse(split[2]) }; } diff --git a/osu.Game/Beatmaps/Timing/ControlPoint.cs b/osu.Game/Beatmaps/Timing/ControlPoint.cs index e323412f81..40320a88d7 100644 --- a/osu.Game/Beatmaps/Timing/ControlPoint.cs +++ b/osu.Game/Beatmaps/Timing/ControlPoint.cs @@ -11,18 +11,12 @@ namespace osu.Game.Beatmaps.Timing TimingChange = true, }; + public TimeSignatures TimeSignature; public double Time; public double BeatLength; public double VelocityAdjustment; public bool TimingChange; public bool KiaiMode; public bool OmitFirstBarLine; - - } - - internal enum TimeSignatures - { - SimpleQuadruple = 4, - SimpleTriple = 3 } } diff --git a/osu.Game/Beatmaps/Timing/TimeSignatures.cs b/osu.Game/Beatmaps/Timing/TimeSignatures.cs new file mode 100644 index 0000000000..94b36591f5 --- /dev/null +++ b/osu.Game/Beatmaps/Timing/TimeSignatures.cs @@ -0,0 +1,11 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +namespace osu.Game.Beatmaps.Timing +{ + public enum TimeSignatures + { + SimpleQuadruple = 4, + SimpleTriple = 3 + } +} \ No newline at end of file diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 188d929888..50809cddf7 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -76,6 +76,7 @@ + From ad74797cd48eba7398f7953c32a90adcd9b448f6 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 21 Mar 2017 21:31:31 +0900 Subject: [PATCH 07/12] End letter oppression. --- osu.Game.Modes.Taiko/Judgements/TaikoJudgementInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Modes.Taiko/Judgements/TaikoJudgementInfo.cs b/osu.Game.Modes.Taiko/Judgements/TaikoJudgementInfo.cs index 8c42023648..aa6901c2f5 100644 --- a/osu.Game.Modes.Taiko/Judgements/TaikoJudgementInfo.cs +++ b/osu.Game.Modes.Taiko/Judgements/TaikoJudgementInfo.cs @@ -62,7 +62,7 @@ namespace osu.Game.Modes.Taiko.Judgements } /// - /// Computes the score value for the accurac portion of the score. + /// Computes the score value for the accuracy portion of the score. /// /// The result to compute the score value for. /// The int score value. From d9524f692d2d92bc468a6bf3fe448a3224a913f2 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 21 Mar 2017 21:36:05 +0900 Subject: [PATCH 08/12] Renamings. --- ...{TaikoScoreResult.cs => TaikoHitResult.cs} | 2 +- .../Judgements/TaikoJudgementInfo.cs | 35 ++++++++++--------- .../osu.Game.Modes.Taiko.csproj | 2 +- 3 files changed, 20 insertions(+), 19 deletions(-) rename osu.Game.Modes.Taiko/Judgements/{TaikoScoreResult.cs => TaikoHitResult.cs} (84%) diff --git a/osu.Game.Modes.Taiko/Judgements/TaikoScoreResult.cs b/osu.Game.Modes.Taiko/Judgements/TaikoHitResult.cs similarity index 84% rename from osu.Game.Modes.Taiko/Judgements/TaikoScoreResult.cs rename to osu.Game.Modes.Taiko/Judgements/TaikoHitResult.cs index 004b9c4973..d425616b66 100644 --- a/osu.Game.Modes.Taiko/Judgements/TaikoScoreResult.cs +++ b/osu.Game.Modes.Taiko/Judgements/TaikoHitResult.cs @@ -3,7 +3,7 @@ namespace osu.Game.Modes.Taiko.Judgements { - public enum TaikoScoreResult + public enum TaikoHitResult { Good, Great diff --git a/osu.Game.Modes.Taiko/Judgements/TaikoJudgementInfo.cs b/osu.Game.Modes.Taiko/Judgements/TaikoJudgementInfo.cs index aa6901c2f5..0448ee5367 100644 --- a/osu.Game.Modes.Taiko/Judgements/TaikoJudgementInfo.cs +++ b/osu.Game.Modes.Taiko/Judgements/TaikoJudgementInfo.cs @@ -10,32 +10,32 @@ namespace osu.Game.Modes.Taiko.Judgements /// /// The maximum score value. /// - public const TaikoScoreResult MAX_SCORE = TaikoScoreResult.Great; + public const TaikoHitResult MAX_SCORE = TaikoHitResult.Great; /// /// The score value. /// - public TaikoScoreResult Score; + public TaikoHitResult TaikoResult; /// /// The score value for the combo portion of the score. /// - public int ScoreValue => ScoreToInt(Score); + public int ScoreValue => NumericResultForScore(TaikoResult); /// /// The score value for the accuracy portion of the score. /// - public int AccuracyScoreValue => AccuracyScoreToInt(Score); + public int AccuracyScoreValue => NumericResultForAccuracy(TaikoResult); /// /// The maximum score value for the combo portion of the score. /// - public int MaxScoreValue => ScoreToInt(MAX_SCORE); + public int MaxScoreValue => NumericResultForScore(MAX_SCORE); /// /// The maximum score value for the accuracy portion of the score. /// - public int MaxAccuracyScoreValue => AccuracyScoreToInt(MAX_SCORE); + public int MaxAccuracyScoreValue => NumericResultForAccuracy(MAX_SCORE); /// /// Whether this Judgement has a secondary hit in the case of finishers. @@ -43,38 +43,39 @@ namespace osu.Game.Modes.Taiko.Judgements public bool SecondHit; /// - /// Computes the score value for the combo portion of the score. - /// For the accuracy portion of the score (including accuracy percentage), see . + /// Computes the numeric score value for the combo portion of the score. + /// For the accuracy portion of the score (including accuracy percentage), see . /// /// The result to compute the score value for. - /// The int score value. - protected virtual int ScoreToInt(TaikoScoreResult result) + /// The numeric score value. + protected virtual int NumericResultForScore(TaikoHitResult result) { switch (result) { default: return 0; - case TaikoScoreResult.Good: + case TaikoHitResult.Good: return 100; - case TaikoScoreResult.Great: + case TaikoHitResult.Great: return 300; } } /// - /// Computes the score value for the accuracy portion of the score. + /// Computes the numeric score value for the accuracy portion of the score. + /// For the combo portion of the score, see . /// /// The result to compute the score value for. - /// The int score value. - protected virtual int AccuracyScoreToInt(TaikoScoreResult result) + /// The numeric score value. + protected virtual int NumericResultForAccuracy(TaikoHitResult result) { switch (result) { default: return 0; - case TaikoScoreResult.Good: + case TaikoHitResult.Good: return 150; - case TaikoScoreResult.Great: + case TaikoHitResult.Great: return 300; } } diff --git a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj index cd73566ab3..65ee442d33 100644 --- a/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj +++ b/osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj @@ -50,7 +50,7 @@ - + From 863f49c2bd20daa354f4c95bbf3c20b86d562468 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Tue, 21 Mar 2017 21:38:39 +0900 Subject: [PATCH 09/12] Rename MAX_SCORE -> MAX_HIT_RESULT. --- osu.Game.Modes.Taiko/Judgements/TaikoJudgementInfo.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game.Modes.Taiko/Judgements/TaikoJudgementInfo.cs b/osu.Game.Modes.Taiko/Judgements/TaikoJudgementInfo.cs index 0448ee5367..d9e81d4d77 100644 --- a/osu.Game.Modes.Taiko/Judgements/TaikoJudgementInfo.cs +++ b/osu.Game.Modes.Taiko/Judgements/TaikoJudgementInfo.cs @@ -10,7 +10,7 @@ namespace osu.Game.Modes.Taiko.Judgements /// /// The maximum score value. /// - public const TaikoHitResult MAX_SCORE = TaikoHitResult.Great; + public const TaikoHitResult MAX_HIT_RESULT = TaikoHitResult.Great; /// /// The score value. @@ -30,12 +30,12 @@ namespace osu.Game.Modes.Taiko.Judgements /// /// The maximum score value for the combo portion of the score. /// - public int MaxScoreValue => NumericResultForScore(MAX_SCORE); + public int MaxScoreValue => NumericResultForScore(MAX_HIT_RESULT); /// /// The maximum score value for the accuracy portion of the score. /// - public int MaxAccuracyScoreValue => NumericResultForAccuracy(MAX_SCORE); + public int MaxAccuracyScoreValue => NumericResultForAccuracy(MAX_HIT_RESULT); /// /// Whether this Judgement has a secondary hit in the case of finishers. From 0b2bb2ea0e8c2c56cddb83cd129b1de274c94f80 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 21 Mar 2017 22:51:49 +0900 Subject: [PATCH 10/12] Fix typo in font name declaration. --- osu.Game/Screens/Tournament/Drawings.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Tournament/Drawings.cs b/osu.Game/Screens/Tournament/Drawings.cs index 61f75021dc..b31a73b230 100644 --- a/osu.Game/Screens/Tournament/Drawings.cs +++ b/osu.Game/Screens/Tournament/Drawings.cs @@ -160,7 +160,7 @@ namespace osu.Game.Screens.Tournament Text = "Control Panel", TextSize = 22f, - Font = "Exo2.0-Boldd" + Font = "Exo2.0-Bold" }, new FillFlowContainer { From 4fa6db6cfa3aba15c3b63947a6e628a98068c6ce Mon Sep 17 00:00:00 2001 From: Andrey Zavadskiy Date: Tue, 21 Mar 2017 18:20:15 +0300 Subject: [PATCH 11/12] Hide options when entering the game --- osu.Game/OsuGame.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 9bd2ef9f75..5e7c47c9a9 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -279,6 +279,7 @@ namespace osu.Game //central game mode change logic. if (!currentScreen.ShowOverlays) { + options.State = Visibility.Hidden; Toolbar.State = Visibility.Hidden; musicController.State = Visibility.Hidden; chat.State = Visibility.Hidden; From 943bd737c4bd33d8cce06b24c5721c6a6cfa9e51 Mon Sep 17 00:00:00 2001 From: Andrey Zavadskiy Date: Tue, 21 Mar 2017 18:24:19 +0300 Subject: [PATCH 12/12] Hide letterbox position sliders --- .../Sections/Graphics/LayoutOptions.cs | 31 +++++++++++++++++-- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/osu.Game/Overlays/Options/Sections/Graphics/LayoutOptions.cs b/osu.Game/Overlays/Options/Sections/Graphics/LayoutOptions.cs index a3dbb9c76f..0a2e8f91a4 100644 --- a/osu.Game/Overlays/Options/Sections/Graphics/LayoutOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Graphics/LayoutOptions.cs @@ -5,6 +5,7 @@ using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Game.Graphics.UserInterface; +using System; namespace osu.Game.Overlays.Options.Sections.Graphics { @@ -12,9 +13,16 @@ namespace osu.Game.Overlays.Options.Sections.Graphics { protected override string Header => "Layout"; + private OptionSlider letterboxPositionX; + private OptionSlider letterboxPositionY; + + private Bindable letterboxing; + [BackgroundDependencyLoader] private void load(FrameworkConfigManager config) { + letterboxing = config.GetBindable(FrameworkConfig.Letterboxing); + Children = new Drawable[] { new OptionLabel { Text = "Resolution: TODO dropdown" }, @@ -26,19 +34,36 @@ namespace osu.Game.Overlays.Options.Sections.Graphics new OsuCheckbox { LabelText = "Letterboxing", - Bindable = config.GetBindable(FrameworkConfig.Letterboxing), + Bindable = letterboxing, }, - new OptionSlider + letterboxPositionX = new OptionSlider { LabelText = "Horizontal position", Bindable = (BindableInt)config.GetBindable(FrameworkConfig.LetterboxPositionX) }, - new OptionSlider + letterboxPositionY = new OptionSlider { LabelText = "Vertical position", Bindable = (BindableInt)config.GetBindable(FrameworkConfig.LetterboxPositionY) }, }; + + letterboxing.ValueChanged += visibilityChanged; + letterboxing.TriggerChange(); + } + + private void visibilityChanged(object sender, EventArgs e) + { + if (letterboxing) + { + letterboxPositionX.Show(); + letterboxPositionY.Show(); + } + else + { + letterboxPositionX.Hide(); + letterboxPositionY.Hide(); + } } } } \ No newline at end of file