mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 15:03:13 +08:00
Tidy up comments and simplify bounding box centre logic
This commit is contained in:
parent
1fd9c64803
commit
a03abc747b
@ -471,12 +471,11 @@ namespace osu.Game.Overlays.Mods
|
||||
var channel = columnAppearSample?.GetChannel();
|
||||
if (channel == null) return;
|
||||
|
||||
// don't play sample if column isn't visible, but try to play it at least 5 times (assuming there's at least 5 visible columns in `columnFlow`)
|
||||
// Still play sound effects for off-screen columns up to a certain point.
|
||||
if (columnNumber > 5 && !column.Active.Value) return;
|
||||
|
||||
// use X position of the column on screen as a basis for panning the sample
|
||||
var bounds = column.Parent.BoundingBox;
|
||||
float balance = (bounds.TopLeft.X + bounds.Width / 2) / RelativeToAbsoluteFactor.X;
|
||||
float balance = column.Parent.BoundingBox.Centre.X / RelativeToAbsoluteFactor.X;
|
||||
|
||||
// dip frequency and ramp volume of sample over the first 5 displayed columns
|
||||
float progress = Math.Min(1, columnNumber / 5f);
|
||||
|
@ -4,19 +4,18 @@
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Input.Bindings;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Framework.Localisation;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Input.Bindings;
|
||||
using osu.Framework.Input.Bindings;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Screens.Select
|
||||
{
|
||||
@ -68,7 +67,6 @@ namespace osu.Game.Screens.Select
|
||||
private readonly Box light;
|
||||
|
||||
public FooterButton()
|
||||
: base(HoverSampleSet.Default)
|
||||
{
|
||||
AutoSizeAxes = Axes.Both;
|
||||
Shear = SHEAR;
|
||||
|
Loading…
Reference in New Issue
Block a user