1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-23 22:57:42 +08:00

Merge remote-tracking branch 'refs/remotes/ppy/master' into comments-buttons

This commit is contained in:
Andrei Zavatski 2020-07-12 12:18:10 +03:00
commit 40aa6c7453
6 changed files with 64 additions and 20 deletions

View File

@ -30,7 +30,7 @@ namespace osu.Game.Rulesets.Catch.Judgements
return 0;
case HitResult.Perfect:
return 0.01;
return DEFAULT_MAX_HEALTH_INCREASE * 0.75;
}
}

View File

@ -157,6 +157,24 @@ namespace osu.Game.Tests.Gameplay
assertHealthNotEqualTo(1);
}
[Test]
public void TestBonusObjectsExcludedFromDrain()
{
var beatmap = new Beatmap
{
BeatmapInfo = { BaseDifficulty = { DrainRate = 10 } },
};
beatmap.HitObjects.Add(new JudgeableHitObject { StartTime = 0 });
for (double time = 0; time < 5000; time += 100)
beatmap.HitObjects.Add(new JudgeableHitObject(false) { StartTime = time });
beatmap.HitObjects.Add(new JudgeableHitObject { StartTime = 5000 });
createProcessor(beatmap);
setTime(4900); // Get close to the second combo-affecting object
assertHealthNotEqualTo(0);
}
private Beatmap createBeatmap(double startTime, double endTime, params BreakPeriod[] breaks)
{
var beatmap = new Beatmap
@ -197,8 +215,25 @@ namespace osu.Game.Tests.Gameplay
private class JudgeableHitObject : HitObject
{
public override Judgement CreateJudgement() => new Judgement();
private readonly bool affectsCombo;
public JudgeableHitObject(bool affectsCombo = true)
{
this.affectsCombo = affectsCombo;
}
public override Judgement CreateJudgement() => new TestJudgement(affectsCombo);
protected override HitWindows CreateHitWindows() => new HitWindows();
private class TestJudgement : Judgement
{
public override bool AffectsCombo { get; }
public TestJudgement(bool affectsCombo)
{
AffectsCombo = affectsCombo;
}
}
}
}
}

View File

@ -21,7 +21,6 @@ namespace osu.Game.Graphics.UserInterface
{
private readonly Box box;
private readonly SpriteText text;
private readonly SpriteIcon icon;
private Color4? accentColour;
@ -32,12 +31,6 @@ namespace osu.Game.Graphics.UserInterface
{
accentColour = value;
if (Current.Value)
{
text.Colour = AccentColour;
icon.Colour = AccentColour;
}
updateFade();
}
}
@ -52,6 +45,8 @@ namespace osu.Game.Graphics.UserInterface
public OsuTabControlCheckbox()
{
SpriteIcon icon;
AutoSizeAxes = Axes.Both;
Children = new Drawable[]
@ -89,6 +84,8 @@ namespace osu.Game.Graphics.UserInterface
{
icon.Icon = selected.NewValue ? FontAwesome.Regular.CheckCircle : FontAwesome.Regular.Circle;
text.Font = text.Font.With(weight: selected.NewValue ? FontWeight.Bold : FontWeight.Medium);
updateFade();
};
}
@ -115,8 +112,8 @@ namespace osu.Game.Graphics.UserInterface
private void updateFade()
{
box.FadeTo(IsHovered ? 1 : 0, transition_length, Easing.OutQuint);
text.FadeColour(IsHovered ? Color4.White : AccentColour, transition_length, Easing.OutQuint);
box.FadeTo(Current.Value || IsHovered ? 1 : 0, transition_length, Easing.OutQuint);
text.FadeColour(Current.Value || IsHovered ? Color4.White : AccentColour, transition_length, Easing.OutQuint);
}
}
}

View File

@ -114,7 +114,9 @@ namespace osu.Game.Rulesets.Scoring
protected override void ApplyResultInternal(JudgementResult result)
{
base.ApplyResultInternal(result);
healthIncreases.Add((result.HitObject.GetEndTime() + result.TimeOffset, GetHealthIncreaseFor(result)));
if (!result.Judgement.IsBonus)
healthIncreases.Add((result.HitObject.GetEndTime() + result.TimeOffset, GetHealthIncreaseFor(result)));
}
protected override void Reset(bool storeResults)

View File

@ -252,6 +252,12 @@ namespace osu.Game.Rulesets.Scoring
HighestCombo.Value = 0;
}
protected override void Dispose(bool isDisposing)
{
base.Dispose(isDisposing);
hitEvents.Clear();
}
/// <summary>
/// Retrieve a score populated with data for the current play this processor is responsible for.
/// </summary>
@ -269,7 +275,7 @@ namespace osu.Game.Rulesets.Scoring
foreach (var result in Enum.GetValues(typeof(HitResult)).OfType<HitResult>().Where(r => r > HitResult.None && hitWindows.IsHitResultAllowed(r)))
score.Statistics[result] = GetStatistic(result);
score.HitEvents = new List<HitEvent>(hitEvents);
score.HitEvents = hitEvents;
}
/// <summary>

View File

@ -4,9 +4,8 @@
using System.Collections.Generic;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.Containers;
using osu.Game.Screens.Multi.Components;
using osuTK;
@ -15,7 +14,7 @@ namespace osu.Game.Screens.Multi.Lounge.Components
public class RoomInfo : MultiplayerComposite
{
private readonly List<Drawable> statusElements = new List<Drawable>();
private readonly SpriteText roomName;
private readonly OsuTextFlowContainer roomName;
public RoomInfo()
{
@ -43,18 +42,23 @@ namespace osu.Game.Screens.Multi.Lounge.Components
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
AutoSizeAxes = Axes.Both,
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Direction = FillDirection.Vertical,
Children = new Drawable[]
{
roomName = new OsuSpriteText { Font = OsuFont.GetFont(size: 30) },
roomName = new OsuTextFlowContainer(t => t.Font = OsuFont.GetFont(size: 30))
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
},
statusInfo = new RoomStatusInfo(),
}
},
typeInfo = new ModeTypeInfo
{
Anchor = Anchor.CentreRight,
Origin = Anchor.CentreRight
Anchor = Anchor.BottomRight,
Origin = Anchor.BottomRight
}
}
},