6
6
using System ;
7
7
using System . Linq ;
8
8
using JetBrains . Annotations ;
9
- using osu . Framework . Allocation ;
10
- using osu . Framework . Extensions . Color4Extensions ;
11
9
using osu . Framework . Graphics ;
12
10
using osu . Framework . Graphics . Containers ;
13
- using osu . Game . Graphics ;
14
11
using osu . Game . Rulesets . Objects . Drawables ;
15
- using osuTK . Graphics ;
16
- using osu . Framework . Graphics . Shapes ;
17
12
using osu . Framework . Input . Events ;
18
13
using osu . Game . Rulesets . Objects ;
19
14
using osu . Game . Rulesets . Taiko . Skinning . Default ;
@@ -25,11 +20,6 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
25
20
{
26
21
public partial class DrawableSwell : DrawableTaikoHitObject < Swell >
27
22
{
28
- private const float target_ring_thick_border = 1.4f ;
29
- private const float target_ring_thin_border = 1f ;
30
- private const float target_ring_scale = 5f ;
31
- private const float inner_ring_alpha = 0.65f ;
32
-
33
23
/// <summary>
34
24
/// Offset away from the start time of the swell at which the ring starts appearing.
35
25
/// </summary>
@@ -38,9 +28,6 @@ public partial class DrawableSwell : DrawableTaikoHitObject<Swell>
38
28
private Vector2 baseSize ;
39
29
40
30
private readonly Container < DrawableSwellTick > ticks ;
41
- private readonly Container bodyContainer ;
42
- private readonly CircularContainer targetRing ;
43
- private readonly CircularContainer expandingRing ;
44
31
45
32
private double ? lastPressHandleTime ;
46
33
@@ -51,6 +38,8 @@ public partial class DrawableSwell : DrawableTaikoHitObject<Swell>
51
38
/// </summary>
52
39
public bool MustAlternate { get ; internal set ; } = true ;
53
40
41
+ public event Action < int > UpdateHitProgress ;
42
+
54
43
public DrawableSwell ( )
55
44
: this ( null )
56
45
{
@@ -61,87 +50,15 @@ public DrawableSwell([CanBeNull] Swell swell)
61
50
{
62
51
FillMode = FillMode . Fit ;
63
52
64
- Content . Add ( bodyContainer = new Container
65
- {
66
- RelativeSizeAxes = Axes . Both ,
67
- Depth = 1 ,
68
- Children = new Drawable [ ]
69
- {
70
- expandingRing = new CircularContainer
71
- {
72
- Name = "Expanding ring" ,
73
- Anchor = Anchor . Centre ,
74
- Origin = Anchor . Centre ,
75
- Alpha = 0 ,
76
- RelativeSizeAxes = Axes . Both ,
77
- Blending = BlendingParameters . Additive ,
78
- Masking = true ,
79
- Children = new [ ]
80
- {
81
- new Box
82
- {
83
- RelativeSizeAxes = Axes . Both ,
84
- Alpha = inner_ring_alpha ,
85
- }
86
- }
87
- } ,
88
- targetRing = new CircularContainer
89
- {
90
- Name = "Target ring (thick border)" ,
91
- Anchor = Anchor . Centre ,
92
- Origin = Anchor . Centre ,
93
- RelativeSizeAxes = Axes . Both ,
94
- Masking = true ,
95
- BorderThickness = target_ring_thick_border ,
96
- Blending = BlendingParameters . Additive ,
97
- Children = new Drawable [ ]
98
- {
99
- new Box
100
- {
101
- RelativeSizeAxes = Axes . Both ,
102
- Alpha = 0 ,
103
- AlwaysPresent = true
104
- } ,
105
- new CircularContainer
106
- {
107
- Name = "Target ring (thin border)" ,
108
- Anchor = Anchor . Centre ,
109
- Origin = Anchor . Centre ,
110
- RelativeSizeAxes = Axes . Both ,
111
- Masking = true ,
112
- BorderThickness = target_ring_thin_border ,
113
- BorderColour = Color4 . White ,
114
- Children = new [ ]
115
- {
116
- new Box
117
- {
118
- RelativeSizeAxes = Axes . Both ,
119
- Alpha = 0 ,
120
- AlwaysPresent = true
121
- }
122
- }
123
- }
124
- }
125
- }
126
- }
127
- } ) ;
128
-
129
53
AddInternal ( ticks = new Container < DrawableSwellTick > { RelativeSizeAxes = Axes . Both } ) ;
130
54
}
131
55
132
- [ BackgroundDependencyLoader ]
133
- private void load ( OsuColour colours )
134
- {
135
- expandingRing . Colour = colours . YellowLight ;
136
- targetRing . BorderColour = colours . YellowDark . Opacity ( 0.25f ) ;
137
- }
138
-
139
56
protected override SkinnableDrawable CreateMainPiece ( ) => new SkinnableDrawable ( new TaikoSkinComponentLookup ( TaikoSkinComponents . Swell ) ,
140
- _ => new SwellCirclePiece
57
+ _ => new DefaultSwell
141
58
{
142
- // to allow for rotation transform
143
59
Anchor = Anchor . Centre ,
144
60
Origin = Anchor . Centre ,
61
+ RelativeSizeAxes = Axes . Both ,
145
62
} ) ;
146
63
147
64
protected override void RecreatePieces ( )
@@ -208,16 +125,7 @@ protected override void CheckForResult(bool userTriggered, double timeOffset)
208
125
209
126
int numHits = ticks . Count ( r => r . IsHit ) ;
210
127
211
- float completion = ( float ) numHits / HitObject . RequiredHits ;
212
-
213
- expandingRing
214
- . FadeTo ( expandingRing . Alpha + Math . Clamp ( completion / 16 , 0.1f , 0.6f ) , 50 )
215
- . Then ( )
216
- . FadeTo ( completion / 8 , 2000 , Easing . OutQuint ) ;
217
-
218
- MainPiece . Drawable . RotateTo ( ( float ) ( completion * HitObject . Duration / 8 ) , 4000 , Easing . OutQuint ) ;
219
-
220
- expandingRing . ScaleTo ( 1f + Math . Min ( target_ring_scale - 1f , ( target_ring_scale - 1f ) * completion * 1.3f ) , 260 , Easing . OutQuint ) ;
128
+ UpdateHitProgress ? . Invoke ( numHits ) ;
221
129
222
130
if ( numHits == HitObject . RequiredHits )
223
131
ApplyMaxResult ( ) ;
@@ -248,28 +156,21 @@ protected override void CheckForResult(bool userTriggered, double timeOffset)
248
156
}
249
157
}
250
158
251
- protected override void UpdateStartTimeStateTransforms ( )
252
- {
253
- base . UpdateStartTimeStateTransforms ( ) ;
254
-
255
- using ( BeginDelayedSequence ( - ring_appear_offset ) )
256
- targetRing . ScaleTo ( target_ring_scale , 400 , Easing . OutQuint ) ;
257
- }
258
-
259
159
protected override void UpdateHitStateTransforms ( ArmedState state )
260
160
{
261
- const double transition_duration = 300 ;
161
+ base . UpdateHitStateTransforms ( state ) ;
262
162
263
163
switch ( state )
264
164
{
265
165
case ArmedState . Idle :
266
- expandingRing . FadeTo ( 0 ) ;
267
166
break ;
268
167
269
168
case ArmedState . Miss :
169
+ this . Delay ( 300 ) . FadeOut ( ) ;
170
+ break ;
171
+
270
172
case ArmedState . Hit :
271
- this . FadeOut ( transition_duration , Easing . Out ) ;
272
- bodyContainer . ScaleTo ( 1.4f , transition_duration ) ;
173
+ this . Delay ( 660 ) . FadeOut ( ) ;
273
174
break ;
274
175
}
275
176
}
0 commit comments