1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 21:43:04 +08:00

Merge pull request #3079 from smoogipoo/centralise-judgement-display

Centralise method of disabling playfield judgements
This commit is contained in:
Dean Herbert 2018-07-23 05:34:50 +09:00 committed by GitHub
commit 9f1d37e052
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 20 additions and 25 deletions

View File

@ -138,7 +138,7 @@ namespace osu.Game.Rulesets.Mania.UI
internal void OnJudgement(DrawableHitObject judgedObject, Judgement judgement)
{
if (!judgement.IsHit || !judgedObject.DisplayJudgement)
if (!judgement.IsHit || !judgedObject.DisplayJudgement || !DisplayJudgements)
return;
explosionContainer.Add(new HitExplosion(judgedObject)

View File

@ -8,7 +8,6 @@ using System;
using System.Collections.Generic;
using System.Linq;
using osu.Framework.Allocation;
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Mania.Beatmaps;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Mania.Configuration;
@ -74,10 +73,5 @@ namespace osu.Game.Rulesets.Mania.UI
{
maniaConfig.BindWith(ManiaSetting.ScrollTime, VisibleTimeRange);
}
internal void OnJudgement(DrawableHitObject judgedObject, Judgement judgement)
{
getStageByColumn(((ManiaHitObject)judgedObject.HitObject).Column).OnJudgement(judgedObject, judgement);
}
}
}

View File

@ -163,7 +163,7 @@ namespace osu.Game.Rulesets.Mania.UI
internal void OnJudgement(DrawableHitObject judgedObject, Judgement judgement)
{
if (!judgedObject.DisplayJudgement)
if (!judgedObject.DisplayJudgement || !DisplayJudgements)
return;
judgements.Clear();

View File

@ -1,12 +0,0 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Game.Rulesets.Osu.UI;
namespace osu.Game.Rulesets.Osu.Edit
{
public class OsuEditPlayfield : OsuPlayfield
{
protected override bool DisplayJudgements => false;
}
}

View File

@ -4,7 +4,6 @@
using osu.Framework.Graphics.Cursor;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Osu.UI;
using osu.Game.Rulesets.UI;
using OpenTK;
namespace osu.Game.Rulesets.Osu.Edit
@ -16,8 +15,6 @@ namespace osu.Game.Rulesets.Osu.Edit
{
}
protected override Playfield CreatePlayfield() => new OsuEditPlayfield();
protected override Vector2 PlayfieldArea => Vector2.One;
protected override CursorContainer CreateCursor() => null;

View File

@ -20,8 +20,6 @@ namespace osu.Game.Rulesets.Osu.UI
private readonly JudgementContainer<DrawableOsuJudgement> judgementLayer;
private readonly ConnectionRenderer<OsuHitObject> connectionLayer;
protected virtual bool DisplayJudgements => true;
public static readonly Vector2 BASE_SIZE = new Vector2(512, 384);
public OsuPlayfield()

View File

@ -226,6 +226,9 @@ namespace osu.Game.Rulesets.Taiko.UI
internal void OnJudgement(DrawableHitObject judgedObject, Judgement judgement)
{
if (!DisplayJudgements)
return;
if (judgedObject.DisplayJudgement && judgementContainer.FirstOrDefault(j => j.JudgedObject == judgedObject) == null)
{
judgementContainer.Add(new DrawableTaikoJudgement(judgement, judgedObject)

View File

@ -110,6 +110,13 @@ namespace osu.Game.Rulesets.Edit
toolboxCollection.Items[0].Select();
}
protected override void LoadComplete()
{
base.LoadComplete();
rulesetContainer.Playfield.DisplayJudgements.Value = false;
}
protected override void UpdateAfterChildren()
{
base.UpdateAfterChildren();

View File

@ -5,6 +5,7 @@ using System.Collections.Generic;
using osu.Framework.Graphics;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Framework.Allocation;
using osu.Framework.Configuration;
namespace osu.Game.Rulesets.UI
{
@ -21,6 +22,11 @@ namespace osu.Game.Rulesets.UI
public IReadOnlyList<Playfield> NestedPlayfields => nestedPlayfields;
private List<Playfield> nestedPlayfields;
/// <summary>
/// Whether judgements should be displayed by this and and all nested <see cref="Playfield"/>s.
/// </summary>
public readonly BindableBool DisplayJudgements = new BindableBool(true);
/// <summary>
/// A container for keeping track of DrawableHitObjects.
/// </summary>
@ -73,6 +79,8 @@ namespace osu.Game.Rulesets.UI
nestedPlayfields = new List<Playfield>();
nestedPlayfields.Add(otherPlayfield);
otherPlayfield.DisplayJudgements.BindTo(DisplayJudgements);
}
/// <summary>