1
0
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:
Dean Herbert 2022-07-02 12:58:34 +09:00
parent 1fd9c64803
commit a03abc747b
2 changed files with 6 additions and 9 deletions

View File

@ -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);

View File

@ -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;