ppy / osu-framework

A game framework written with osu! in mind.
MIT License
1.67k stars 419 forks source link

Add attribute to hide arbitrary drawables from draw visualiser #6411

Closed smoogipoo closed 3 weeks ago

smoogipoo commented 3 weeks ago

When trying to use the draw visualiser during gameplay, you can't target anything other than the cursor trail.

diff --git a/osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs b/osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs
index a4bccb0aff..5132dc2859 100644
--- a/osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs
+++ b/osu.Game.Rulesets.Osu/UI/Cursor/CursorTrail.cs
@@ -14,6 +14,7 @@
 using osu.Framework.Graphics.Shaders;
 using osu.Framework.Graphics.Shaders.Types;
 using osu.Framework.Graphics.Textures;
+using osu.Framework.Graphics.Visualisation;
 using osu.Framework.Input;
 using osu.Framework.Input.Events;
 using osu.Framework.Timing;
@@ -23,6 +24,7 @@

 namespace osu.Game.Rulesets.Osu.UI.Cursor
 {
+    [DrawVisualiserHidden]
     public partial class CursorTrail : Drawable, IRequireHighFrequencyMousePosition
     {
         private const int max_sprites = 2048;