mirror of
https://github.com/ppy/osu.git
synced 2025-03-15 01:27:20 +08:00
Merge branch 'master' into chat-focus
This commit is contained in:
commit
78fc36904e
@ -1 +1 @@
|
|||||||
Subproject commit a5199500cc3ba96101fd858e0f78f36e538697b1
|
Subproject commit b348c1e540edbb3325a8da9bca452c9dce2938d6
|
@ -7,21 +7,24 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
using osu.Game.Configuration;
|
using osu.Game.Configuration;
|
||||||
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
using osu.Game.Overlays;
|
using osu.Game.Overlays;
|
||||||
using osu.Game.Overlays.Notifications;
|
using osu.Game.Overlays.Notifications;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
using osu.Game.Rulesets.UI;
|
using osu.Game.Rulesets.UI;
|
||||||
using osu.Game.Screens.Play.HUD;
|
using osu.Game.Screens.Play.HUD;
|
||||||
|
using OpenTK;
|
||||||
using OpenTK.Input;
|
using OpenTK.Input;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Play
|
namespace osu.Game.Screens.Play
|
||||||
{
|
{
|
||||||
public abstract class HUDOverlay : Container
|
public class HUDOverlay : Container
|
||||||
{
|
{
|
||||||
private const int duration = 100;
|
private const int duration = 100;
|
||||||
|
|
||||||
private readonly Container content;
|
private readonly Container content;
|
||||||
|
|
||||||
public readonly KeyCounterCollection KeyCounter;
|
public readonly KeyCounterCollection KeyCounter;
|
||||||
public readonly RollingCounter<int> ComboCounter;
|
public readonly RollingCounter<int> ComboCounter;
|
||||||
public readonly ScoreCounter ScoreCounter;
|
public readonly ScoreCounter ScoreCounter;
|
||||||
@ -35,16 +38,7 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
private static bool hasShownNotificationOnce;
|
private static bool hasShownNotificationOnce;
|
||||||
|
|
||||||
protected abstract KeyCounterCollection CreateKeyCounter();
|
public HUDOverlay()
|
||||||
protected abstract RollingCounter<int> CreateComboCounter();
|
|
||||||
protected abstract RollingCounter<double> CreateAccuracyCounter();
|
|
||||||
protected abstract ScoreCounter CreateScoreCounter();
|
|
||||||
protected abstract HealthDisplay CreateHealthDisplay();
|
|
||||||
protected abstract SongProgress CreateProgress();
|
|
||||||
protected abstract ModDisplay CreateModsContainer();
|
|
||||||
//protected abstract ReplaySettingsOverlay CreateReplaySettingsOverlay();
|
|
||||||
|
|
||||||
protected HUDOverlay()
|
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both;
|
RelativeSizeAxes = Axes.Both;
|
||||||
|
|
||||||
@ -67,7 +61,7 @@ namespace osu.Game.Screens.Play
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader(true)]
|
[BackgroundDependencyLoader(true)]
|
||||||
private void load(OsuConfigManager config, NotificationManager notificationManager)
|
private void load(OsuConfigManager config, NotificationManager notificationManager, OsuColour colours)
|
||||||
{
|
{
|
||||||
showHud = config.GetBindable<bool>(OsuSetting.ShowInterface);
|
showHud = config.GetBindable<bool>(OsuSetting.ShowInterface);
|
||||||
showHud.ValueChanged += hudVisibility => content.FadeTo(hudVisibility ? 1 : 0, duration);
|
showHud.ValueChanged += hudVisibility => content.FadeTo(hudVisibility ? 1 : 0, duration);
|
||||||
@ -82,14 +76,18 @@ namespace osu.Game.Screens.Play
|
|||||||
Text = @"The score overlay is currently disabled. You can toggle this by pressing Shift+Tab."
|
Text = @"The score overlay is currently disabled. You can toggle this by pressing Shift+Tab."
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public virtual void BindProcessor(ScoreProcessor processor)
|
// todo: the stuff below should probably not be in this base implementation, but in each individual class.
|
||||||
{
|
ComboCounter.AccentColour = colours.BlueLighter;
|
||||||
ScoreCounter?.Current.BindTo(processor.TotalScore);
|
AccuracyCounter.AccentColour = colours.BlueLighter;
|
||||||
AccuracyCounter?.Current.BindTo(processor.Accuracy);
|
ScoreCounter.AccentColour = colours.BlueLighter;
|
||||||
ComboCounter?.Current.BindTo(processor.Combo);
|
|
||||||
HealthDisplay?.Current.BindTo(processor.Health);
|
var shd = HealthDisplay as StandardHealthDisplay;
|
||||||
|
if (shd != null)
|
||||||
|
{
|
||||||
|
shd.AccentColour = colours.BlueLighter;
|
||||||
|
shd.GlowColour = colours.BlueDarker;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void BindHitRenderer(HitRenderer hitRenderer)
|
public virtual void BindHitRenderer(HitRenderer hitRenderer)
|
||||||
@ -122,5 +120,82 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
return base.OnKeyDown(state, args);
|
return base.OnKeyDown(state, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected virtual RollingCounter<double> CreateAccuracyCounter() => new PercentageCounter
|
||||||
|
{
|
||||||
|
Anchor = Anchor.TopCentre,
|
||||||
|
Origin = Anchor.TopRight,
|
||||||
|
Position = new Vector2(0, 35),
|
||||||
|
TextSize = 20,
|
||||||
|
Margin = new MarginPadding { Right = 140 },
|
||||||
|
};
|
||||||
|
|
||||||
|
protected virtual RollingCounter<int> CreateComboCounter() => new SimpleComboCounter
|
||||||
|
{
|
||||||
|
Anchor = Anchor.TopCentre,
|
||||||
|
Origin = Anchor.TopLeft,
|
||||||
|
Position = new Vector2(0, 35),
|
||||||
|
Margin = new MarginPadding { Left = 140 },
|
||||||
|
TextSize = 20,
|
||||||
|
};
|
||||||
|
|
||||||
|
protected virtual HealthDisplay CreateHealthDisplay() => new StandardHealthDisplay
|
||||||
|
{
|
||||||
|
Size = new Vector2(1, 5),
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
|
Margin = new MarginPadding { Top = 20 }
|
||||||
|
};
|
||||||
|
|
||||||
|
protected virtual KeyCounterCollection CreateKeyCounter() => new KeyCounterCollection
|
||||||
|
{
|
||||||
|
IsCounting = true,
|
||||||
|
FadeTime = 50,
|
||||||
|
Anchor = Anchor.BottomRight,
|
||||||
|
Origin = Anchor.BottomRight,
|
||||||
|
Margin = new MarginPadding(10),
|
||||||
|
Y = -TwoLayerButton.SIZE_RETRACTED.Y,
|
||||||
|
};
|
||||||
|
|
||||||
|
protected virtual ScoreCounter CreateScoreCounter() => new ScoreCounter(6)
|
||||||
|
{
|
||||||
|
Anchor = Anchor.TopCentre,
|
||||||
|
Origin = Anchor.TopCentre,
|
||||||
|
TextSize = 40,
|
||||||
|
Position = new Vector2(0, 30),
|
||||||
|
};
|
||||||
|
|
||||||
|
protected virtual SongProgress CreateProgress() => new SongProgress
|
||||||
|
{
|
||||||
|
Anchor = Anchor.BottomLeft,
|
||||||
|
Origin = Anchor.BottomLeft,
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
|
};
|
||||||
|
|
||||||
|
protected virtual ModDisplay CreateModsContainer() => new ModDisplay
|
||||||
|
{
|
||||||
|
Anchor = Anchor.TopRight,
|
||||||
|
Origin = Anchor.TopRight,
|
||||||
|
AutoSizeAxes = Axes.Both,
|
||||||
|
Margin = new MarginPadding { Top = 20, Right = 10 },
|
||||||
|
};
|
||||||
|
|
||||||
|
//protected virtual ReplaySettingsOverlay CreateReplaySettingsOverlay() => new ReplaySettingsOverlay
|
||||||
|
//{
|
||||||
|
// Anchor = Anchor.TopRight,
|
||||||
|
// Origin = Anchor.TopRight,
|
||||||
|
// Margin = new MarginPadding { Top = 100, Right = 10 },
|
||||||
|
//};
|
||||||
|
|
||||||
|
public virtual void BindProcessor(ScoreProcessor processor)
|
||||||
|
{
|
||||||
|
ScoreCounter?.Current.BindTo(processor.TotalScore);
|
||||||
|
AccuracyCounter?.Current.BindTo(processor.Accuracy);
|
||||||
|
ComboCounter?.Current.BindTo(processor.Combo);
|
||||||
|
HealthDisplay?.Current.BindTo(processor.Health);
|
||||||
|
|
||||||
|
var shd = HealthDisplay as StandardHealthDisplay;
|
||||||
|
if (shd != null)
|
||||||
|
processor.NewJudgement += shd.Flash;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -170,7 +170,7 @@ namespace osu.Game.Screens.Play
|
|||||||
HitRenderer,
|
HitRenderer,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
hudOverlay = new StandardHUDOverlay
|
hudOverlay = new HUDOverlay
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre
|
Origin = Anchor.Centre
|
||||||
|
@ -1,105 +0,0 @@
|
|||||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
||||||
|
|
||||||
using osu.Framework.Allocation;
|
|
||||||
using osu.Framework.Graphics;
|
|
||||||
using osu.Game.Graphics;
|
|
||||||
using osu.Game.Graphics.UserInterface;
|
|
||||||
using osu.Game.Rulesets.Scoring;
|
|
||||||
using osu.Game.Screens.Play.HUD;
|
|
||||||
using OpenTK;
|
|
||||||
|
|
||||||
namespace osu.Game.Screens.Play
|
|
||||||
{
|
|
||||||
public class StandardHUDOverlay : HUDOverlay
|
|
||||||
{
|
|
||||||
protected override RollingCounter<double> CreateAccuracyCounter() => new PercentageCounter
|
|
||||||
{
|
|
||||||
Anchor = Anchor.TopCentre,
|
|
||||||
Origin = Anchor.TopRight,
|
|
||||||
Position = new Vector2(0, 35),
|
|
||||||
TextSize = 20,
|
|
||||||
Margin = new MarginPadding { Right = 140 },
|
|
||||||
};
|
|
||||||
|
|
||||||
protected override RollingCounter<int> CreateComboCounter() => new SimpleComboCounter
|
|
||||||
{
|
|
||||||
Anchor = Anchor.TopCentre,
|
|
||||||
Origin = Anchor.TopLeft,
|
|
||||||
Position = new Vector2(0, 35),
|
|
||||||
Margin = new MarginPadding { Left = 140 },
|
|
||||||
TextSize = 20,
|
|
||||||
};
|
|
||||||
|
|
||||||
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
|
|
||||||
{
|
|
||||||
IsCounting = true,
|
|
||||||
FadeTime = 50,
|
|
||||||
Anchor = Anchor.BottomRight,
|
|
||||||
Origin = Anchor.BottomRight,
|
|
||||||
Margin = new MarginPadding(10),
|
|
||||||
Y = -TwoLayerButton.SIZE_RETRACTED.Y,
|
|
||||||
};
|
|
||||||
|
|
||||||
protected override ScoreCounter CreateScoreCounter() => new ScoreCounter(6)
|
|
||||||
{
|
|
||||||
Anchor = Anchor.TopCentre,
|
|
||||||
Origin = Anchor.TopCentre,
|
|
||||||
TextSize = 40,
|
|
||||||
Position = new Vector2(0, 30),
|
|
||||||
};
|
|
||||||
|
|
||||||
protected override SongProgress CreateProgress() => new SongProgress
|
|
||||||
{
|
|
||||||
Anchor = Anchor.BottomLeft,
|
|
||||||
Origin = Anchor.BottomLeft,
|
|
||||||
RelativeSizeAxes = Axes.X,
|
|
||||||
};
|
|
||||||
|
|
||||||
protected override ModDisplay CreateModsContainer() => new ModDisplay
|
|
||||||
{
|
|
||||||
Anchor = Anchor.TopRight,
|
|
||||||
Origin = Anchor.TopRight,
|
|
||||||
AutoSizeAxes = Axes.Both,
|
|
||||||
Margin = new MarginPadding { Top = 20, Right = 10 },
|
|
||||||
};
|
|
||||||
|
|
||||||
//protected override ReplaySettingsOverlay CreateReplaySettingsOverlay() => new ReplaySettingsOverlay
|
|
||||||
//{
|
|
||||||
// Anchor = Anchor.TopRight,
|
|
||||||
// Origin = Anchor.TopRight,
|
|
||||||
// Margin = new MarginPadding { Top = 100, Right = 10 },
|
|
||||||
//};
|
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
|
||||||
private void load(OsuColour colours)
|
|
||||||
{
|
|
||||||
ComboCounter.AccentColour = colours.BlueLighter;
|
|
||||||
AccuracyCounter.AccentColour = colours.BlueLighter;
|
|
||||||
ScoreCounter.AccentColour = colours.BlueLighter;
|
|
||||||
|
|
||||||
var shd = HealthDisplay as StandardHealthDisplay;
|
|
||||||
if (shd != null)
|
|
||||||
{
|
|
||||||
shd.AccentColour = colours.BlueLighter;
|
|
||||||
shd.GlowColour = colours.BlueDarker;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void BindProcessor(ScoreProcessor processor)
|
|
||||||
{
|
|
||||||
base.BindProcessor(processor);
|
|
||||||
|
|
||||||
var shd = HealthDisplay as StandardHealthDisplay;
|
|
||||||
if (shd != null)
|
|
||||||
processor.NewJudgement += shd.Flash;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -253,7 +253,6 @@
|
|||||||
<Compile Include="Screens\Play\SongProgressInfo.cs" />
|
<Compile Include="Screens\Play\SongProgressInfo.cs" />
|
||||||
<Compile Include="Screens\Play\HUD\ModDisplay.cs" />
|
<Compile Include="Screens\Play\HUD\ModDisplay.cs" />
|
||||||
<Compile Include="Screens\Play\SquareGraph.cs" />
|
<Compile Include="Screens\Play\SquareGraph.cs" />
|
||||||
<Compile Include="Screens\Play\StandardHUDOverlay.cs" />
|
|
||||||
<Compile Include="Screens\Ranking\ResultsPage.cs" />
|
<Compile Include="Screens\Ranking\ResultsPage.cs" />
|
||||||
<Compile Include="Screens\Ranking\ResultsPageRanking.cs" />
|
<Compile Include="Screens\Ranking\ResultsPageRanking.cs" />
|
||||||
<Compile Include="Screens\Ranking\ResultsPageScore.cs" />
|
<Compile Include="Screens\Ranking\ResultsPageScore.cs" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user