1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-17 00:52:54 +08:00

Merge branch 'taiko_hitobject_drawable' into taiko_hit_drawables

Conflicts:
	osu.Game.Modes.Taiko/osu.Game.Modes.Taiko.csproj
This commit is contained in:
smoogipooo 2017-03-22 01:47:25 +09:00
commit 1bfc4d484d
23 changed files with 91 additions and 38 deletions

View File

@ -215,6 +215,7 @@ namespace osu.Desktop.Overlays
Origin = Anchor.Centre, Origin = Anchor.Centre,
Icon = FontAwesome.fa_upload, Icon = FontAwesome.fa_upload,
Colour = Color4.White, Colour = Color4.White,
TextSize = 20
} }
}); });
} }

View File

@ -3,7 +3,7 @@
namespace osu.Game.Modes.Taiko.Judgements namespace osu.Game.Modes.Taiko.Judgements
{ {
public enum TaikoScoreResult public enum TaikoHitResult
{ {
Good, Good,
Great Great

View File

@ -10,32 +10,32 @@ namespace osu.Game.Modes.Taiko.Judgements
/// <summary> /// <summary>
/// The maximum score value. /// The maximum score value.
/// </summary> /// </summary>
public const TaikoScoreResult MAX_SCORE = TaikoScoreResult.Great; public const TaikoHitResult MAX_HIT_RESULT = TaikoHitResult.Great;
/// <summary> /// <summary>
/// The score value. /// The score value.
/// </summary> /// </summary>
public TaikoScoreResult Score; public TaikoHitResult TaikoResult;
/// <summary> /// <summary>
/// The score value for the combo portion of the score. /// The score value for the combo portion of the score.
/// </summary> /// </summary>
public int ScoreValue => ScoreToInt(Score); public int ScoreValue => NumericResultForScore(TaikoResult);
/// <summary> /// <summary>
/// The score value for the accuracy portion of the score. /// The score value for the accuracy portion of the score.
/// </summary> /// </summary>
public int AccuracyScoreValue => AccuracyScoreToInt(Score); public int AccuracyScoreValue => NumericResultForAccuracy(TaikoResult);
/// <summary> /// <summary>
/// The maximum score value for the combo portion of the score. /// The maximum score value for the combo portion of the score.
/// </summary> /// </summary>
public int MaxScoreValue => ScoreToInt(MAX_SCORE); public int MaxScoreValue => NumericResultForScore(MAX_HIT_RESULT);
/// <summary> /// <summary>
/// The maximum score value for the accuracy portion of the score. /// The maximum score value for the accuracy portion of the score.
/// </summary> /// </summary>
public int MaxAccuracyScoreValue => AccuracyScoreToInt(MAX_SCORE); public int MaxAccuracyScoreValue => NumericResultForAccuracy(MAX_HIT_RESULT);
/// <summary> /// <summary>
/// Whether this Judgement has a secondary hit in the case of finishers. /// 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; public bool SecondHit;
/// <summary> /// <summary>
/// Computes the score value for the combo portion of the score. /// Computes the numeric score value for the combo portion of the score.
/// For the accuracy portion of the score (including accuracy percentage), see <see cref="AccuracyScoreToInt(TaikoScoreResult)"/>. /// For the accuracy portion of the score (including accuracy percentage), see <see cref="NumericResultForAccuracy(TaikoHitResult)"/>.
/// </summary> /// </summary>
/// <param name="result">The result to compute the score value for.</param> /// <param name="result">The result to compute the score value for.</param>
/// <returns>The int score value.</returns> /// <returns>The numeric score value.</returns>
protected virtual int ScoreToInt(TaikoScoreResult result) protected virtual int NumericResultForScore(TaikoHitResult result)
{ {
switch (result) switch (result)
{ {
default: default:
return 0; return 0;
case TaikoScoreResult.Good: case TaikoHitResult.Good:
return 100; return 100;
case TaikoScoreResult.Great: case TaikoHitResult.Great:
return 300; return 300;
} }
} }
/// <summary> /// <summary>
/// Computes the score value for the accurac portion of the score. /// Computes the numeric score value for the accuracy portion of the score.
/// For the combo portion of the score, see <see cref="NumericResultForScore(TaikoHitResult)"/>.
/// </summary> /// </summary>
/// <param name="result">The result to compute the score value for.</param> /// <param name="result">The result to compute the score value for.</param>
/// <returns>The int score value.</returns> /// <returns>The numeric score value.</returns>
protected virtual int AccuracyScoreToInt(TaikoScoreResult result) protected virtual int NumericResultForAccuracy(TaikoHitResult result)
{ {
switch (result) switch (result)
{ {
default: default:
return 0; return 0;
case TaikoScoreResult.Good: case TaikoHitResult.Good:
return 150; return 150;
case TaikoScoreResult.Great: case TaikoHitResult.Great:
return 300; return 300;
} }
} }

View File

@ -41,7 +41,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawable
/// a time value and the HitObject's StartTime. /// a time value and the HitObject's StartTime.
/// </summary> /// </summary>
/// <param name="time"></param> /// <param name="time"></param>
protected void UpdateScrollPosition(double time) protected virtual void UpdateScrollPosition(double time)
{ {
MoveToX((float)((HitObject.StartTime - time) / HitObject.PreEmpt)); MoveToX((float)((HitObject.StartTime - time) / HitObject.PreEmpt));
} }

View File

@ -50,7 +50,7 @@
<Compile Include="Beatmaps\TaikoBeatmapConverter.cs" /> <Compile Include="Beatmaps\TaikoBeatmapConverter.cs" />
<Compile Include="Beatmaps\TaikoBeatmapProcessor.cs" /> <Compile Include="Beatmaps\TaikoBeatmapProcessor.cs" />
<Compile Include="Judgements\TaikoJudgementInfo.cs" /> <Compile Include="Judgements\TaikoJudgementInfo.cs" />
<Compile Include="Judgements\TaikoScoreResult.cs" /> <Compile Include="Judgements\TaikoHitResult.cs" />
<Compile Include="Objects\Drawable\DrawableHit.cs" /> <Compile Include="Objects\Drawable\DrawableHit.cs" />
<Compile Include="Objects\Drawable\DrawableHitFinisher.cs" /> <Compile Include="Objects\Drawable\DrawableHitFinisher.cs" />
<Compile Include="Objects\Drawable\DrawableTaikoHitObject.cs" /> <Compile Include="Objects\Drawable\DrawableTaikoHitObject.cs" />

View File

@ -207,7 +207,8 @@ namespace osu.Game.Beatmaps.Formats
VelocityAdjustment = beatLength < 0 ? -beatLength / 100.0 : 1, VelocityAdjustment = beatLength < 0 ? -beatLength / 100.0 : 1,
TimingChange = split.Length <= 6 || split[6][0] == '1', TimingChange = split.Length <= 6 || split[6][0] == '1',
KiaiMode = (effectFlags & 1) > 0, KiaiMode = (effectFlags & 1) > 0,
OmitFirstBarLine = (effectFlags & 8) > 0 OmitFirstBarLine = (effectFlags & 8) > 0,
TimeSignature = (TimeSignatures)int.Parse(split[2])
}; };
} }

View File

@ -11,18 +11,12 @@ namespace osu.Game.Beatmaps.Timing
TimingChange = true, TimingChange = true,
}; };
public TimeSignatures TimeSignature;
public double Time; public double Time;
public double BeatLength; public double BeatLength;
public double VelocityAdjustment; public double VelocityAdjustment;
public bool TimingChange; public bool TimingChange;
public bool KiaiMode; public bool KiaiMode;
public bool OmitFirstBarLine; public bool OmitFirstBarLine;
}
internal enum TimeSignatures
{
SimpleQuadruple = 4,
SimpleTriple = 3
} }
} }

View File

@ -0,0 +1,11 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// 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
}
}

View File

@ -1,11 +1,11 @@
// 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.Sprites; using osu.Game.Graphics.Sprites;
namespace osu.Game.Graphics namespace osu.Game.Graphics
{ {
public class TextAwesome : SpriteText public class TextAwesome : OsuSpriteText
{ {
//public override FontFace FontFace => (int)Icon < 0xf000 ? FontFace.OsuFont : FontFace.FontAwesome; //public override FontFace FontFace => (int)Icon < 0xf000 ? FontFace.OsuFont : FontFace.FontAwesome;

View File

@ -54,6 +54,7 @@ namespace osu.Game.Graphics.UserInterface
Anchor = Anchor.CentreRight, Anchor = Anchor.CentreRight,
Origin = Anchor.CentreRight, Origin = Anchor.CentreRight,
Margin = new MarginPadding { Right = 4 }, Margin = new MarginPadding { Right = 4 },
TextSize = 20
} }
}; };
} }

View File

@ -66,12 +66,14 @@ namespace osu.Game.Modes.UI
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Icon = FontAwesome.fa_osu_mod_bg, Icon = FontAwesome.fa_osu_mod_bg,
Shadow = true, Shadow = true,
TextSize = 20
}, },
modIcon = new TextAwesome modIcon = new TextAwesome
{ {
Origin = Anchor.Centre, Origin = Anchor.Centre,
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Colour = OsuColour.Gray(84), Colour = OsuColour.Gray(84),
TextSize = 20
}, },
}; };

View File

@ -7,6 +7,7 @@ using osu.Game.Modes.Objects;
using osu.Game.Modes.Objects.Drawables; using osu.Game.Modes.Objects.Drawables;
using OpenTK; using OpenTK;
using osu.Game.Modes.Judgements; using osu.Game.Modes.Judgements;
using osu.Framework.Allocation;
namespace osu.Game.Modes.UI namespace osu.Game.Modes.UI
{ {
@ -45,10 +46,16 @@ namespace osu.Game.Modes.UI
} }
}); });
Add(HitObjects = new HitObjectContainer<DrawableHitObject<TObject, TJudgement>> HitObjects = new HitObjectContainer<DrawableHitObject<TObject, TJudgement>>
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
}); };
}
[BackgroundDependencyLoader]
private void load()
{
Add(HitObjects);
} }
/// <summary> /// <summary>

View File

@ -279,6 +279,7 @@ namespace osu.Game
//central game mode change logic. //central game mode change logic.
if (!currentScreen.ShowOverlays) if (!currentScreen.ShowOverlays)
{ {
options.State = Visibility.Hidden;
Toolbar.State = Visibility.Hidden; Toolbar.State = Visibility.Hidden;
musicController.State = Visibility.Hidden; musicController.State = Visibility.Hidden;
chat.State = Visibility.Hidden; chat.State = Visibility.Hidden;

View File

@ -169,6 +169,7 @@ namespace osu.Game.Overlays.Notifications
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
Icon = FontAwesome.fa_times_circle, Icon = FontAwesome.fa_times_circle,
TextSize = 20
} }
}; };
} }

View File

@ -53,6 +53,7 @@ namespace osu.Game.Overlays.Notifications
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
Icon = icon, Icon = icon,
TextSize = 20
} }
}); });

View File

@ -32,6 +32,7 @@ namespace osu.Game.Overlays.Options
{ {
Icon = Ruleset.GetRuleset(m).Icon, Icon = Ruleset.GetRuleset(m).Icon,
Colour = Color4.Gray, Colour = Color4.Gray,
TextSize = 20
}); });
Children = new Drawable[] Children = new Drawable[]

View File

@ -5,6 +5,7 @@ using osu.Framework.Allocation;
using osu.Framework.Configuration; using osu.Framework.Configuration;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using System;
namespace osu.Game.Overlays.Options.Sections.Graphics namespace osu.Game.Overlays.Options.Sections.Graphics
{ {
@ -12,9 +13,16 @@ namespace osu.Game.Overlays.Options.Sections.Graphics
{ {
protected override string Header => "Layout"; protected override string Header => "Layout";
private OptionSlider<int> letterboxPositionX;
private OptionSlider<int> letterboxPositionY;
private Bindable<bool> letterboxing;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(FrameworkConfigManager config) private void load(FrameworkConfigManager config)
{ {
letterboxing = config.GetBindable<bool>(FrameworkConfig.Letterboxing);
Children = new Drawable[] Children = new Drawable[]
{ {
new OptionLabel { Text = "Resolution: TODO dropdown" }, new OptionLabel { Text = "Resolution: TODO dropdown" },
@ -26,19 +34,36 @@ namespace osu.Game.Overlays.Options.Sections.Graphics
new OsuCheckbox new OsuCheckbox
{ {
LabelText = "Letterboxing", LabelText = "Letterboxing",
Bindable = config.GetBindable<bool>(FrameworkConfig.Letterboxing), Bindable = letterboxing,
}, },
new OptionSlider<int> letterboxPositionX = new OptionSlider<int>
{ {
LabelText = "Horizontal position", LabelText = "Horizontal position",
Bindable = (BindableInt)config.GetBindable<int>(FrameworkConfig.LetterboxPositionX) Bindable = (BindableInt)config.GetBindable<int>(FrameworkConfig.LetterboxPositionX)
}, },
new OptionSlider<int> letterboxPositionY = new OptionSlider<int>
{ {
LabelText = "Vertical position", LabelText = "Vertical position",
Bindable = (BindableInt)config.GetBindable<int>(FrameworkConfig.LetterboxPositionY) Bindable = (BindableInt)config.GetBindable<int>(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();
}
} }
} }
} }

View File

@ -87,6 +87,7 @@ namespace osu.Game.Overlays.Options
{ {
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
TextSize = 20
}, },
} }
}, },

View File

@ -98,6 +98,7 @@ namespace osu.Game.Overlays.Toolbar
{ {
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
TextSize = 20
}, },
DrawableText = new OsuSpriteText DrawableText = new OsuSpriteText
{ {

View File

@ -237,14 +237,16 @@ namespace osu.Game.Screens.Select
Icon = FontAwesome.fa_square, Icon = FontAwesome.fa_square,
Origin = Anchor.Centre, Origin = Anchor.Centre,
Colour = new Color4(68, 17, 136, 255), Colour = new Color4(68, 17, 136, 255),
Rotation = 45 Rotation = 45,
TextSize = 20
}, },
new TextAwesome new TextAwesome
{ {
Icon = statistic.Icon, Icon = statistic.Icon,
Origin = Anchor.Centre, Origin = Anchor.Centre,
Colour = new Color4(255, 221, 85, 255), Colour = new Color4(255, 221, 85, 255),
Scale = new Vector2(0.8f) Scale = new Vector2(0.8f),
TextSize = 20
}, },
new OsuSpriteText new OsuSpriteText
{ {

View File

@ -26,6 +26,7 @@ namespace osu.Game.Screens.Select
Origin = Anchor.CentreRight, Origin = Anchor.CentreRight,
Anchor = Anchor.CentreRight, Anchor = Anchor.CentreRight,
Margin = new MarginPadding { Right = 10 }, Margin = new MarginPadding { Right = 10 },
TextSize = 20
} }
}); });

View File

@ -160,7 +160,7 @@ namespace osu.Game.Screens.Tournament
Text = "Control Panel", Text = "Control Panel",
TextSize = 22f, TextSize = 22f,
Font = "Exo2.0-Boldd" Font = "Exo2.0-Bold"
}, },
new FillFlowContainer new FillFlowContainer
{ {

View File

@ -76,6 +76,7 @@
<Compile Include="Beatmaps\IBeatmapCoverter.cs" /> <Compile Include="Beatmaps\IBeatmapCoverter.cs" />
<Compile Include="Beatmaps\IBeatmapProcessor.cs" /> <Compile Include="Beatmaps\IBeatmapProcessor.cs" />
<Compile Include="Beatmaps\Legacy\LegacyBeatmap.cs" /> <Compile Include="Beatmaps\Legacy\LegacyBeatmap.cs" />
<Compile Include="Beatmaps\Timing\TimeSignatures.cs" />
<Compile Include="Beatmaps\Timing\TimingInfo.cs" /> <Compile Include="Beatmaps\Timing\TimingInfo.cs" />
<Compile Include="Database\ScoreDatabase.cs" /> <Compile Include="Database\ScoreDatabase.cs" />
<Compile Include="Graphics\Backgrounds\Triangles.cs" /> <Compile Include="Graphics\Backgrounds\Triangles.cs" />