@@ -76,6 +76,230 @@ class Note extends NoteObject
7676 public var autoGenerated : Bool = false ;
7777 public static var pixelNotesDivisionValue : Array <Int > = [4 , 18 ];
7878
79+ public var noteReflection (get , set ): Dynamic ;
80+
81+ private function get_noteReflection (): Dynamic {
82+ return {
83+ strumTime : this .strumTime ,
84+ mustPress : this .mustPress ,
85+ canBeHit : this .canBeHit ,
86+ tooLate : this .tooLate ,
87+ wasGoodHit : this .wasGoodHit ,
88+ missed : this .missed ,
89+ ignoreNote : this .ignoreNote ,
90+ hitByOpponent : this .hitByOpponent ,
91+ noteType : this .noteType ,
92+ alpha : this .alpha ,
93+ x : this .x ,
94+ y : this .y ,
95+ rgb : {
96+ r : this .rgbShader .r ,
97+ g : this .rgbShader .g ,
98+ b : this .rgbShader .b
99+ },
100+ texture : this .texture
101+ };
102+ }
103+
104+ private function set_noteReflection (value : Dynamic ): Dynamic {
105+ try {
106+ if (value .strumTime != null ) this .strumTime = value .strumTime ;
107+ } catch (e : Dynamic ) {
108+ if (Std .is (value .strumTime , Float )) {
109+ trace (" An error occurred while setting the value of strumTime." );
110+ } else {
111+ trace (" Cannot set strumTime to " + value .strumTime + " , because strumTime is Float and your value is " + Type .typeof (value .strumTime ) + " ." );
112+ }
113+ }
114+
115+ try {
116+ if (value .mustPress != null ) this .mustPress = value .mustPress ;
117+ } catch (e : Dynamic ) {
118+ if (Std .is (value .mustPress , Bool )) {
119+ trace (" An error occurred while setting the value of mustPress." );
120+ } else {
121+ trace (" Cannot set mustPress to " + value .mustPress + " , because mustPress is Bool and your value is " + Type .typeof (value .mustPress ) + " ." );
122+ }
123+ }
124+
125+ try {
126+ if (value .canBeHit != null ) this .canBeHit = value .canBeHit ;
127+ } catch (e : Dynamic ) {
128+ if (Std .is (value .canBeHit , Bool )) {
129+ trace (" An error occurred while setting the value of canBeHit." );
130+ } else {
131+ trace (" Cannot set canBeHit to " + value .canBeHit + " , because canBeHit is Bool and your value is " + Type .typeof (value .canBeHit ) + " ." );
132+ }
133+ }
134+
135+ try {
136+ if (value .tooLate != null ) this .tooLate = value .tooLate ;
137+ } catch (e : Dynamic ) {
138+ if (Std .is (value .tooLate , Bool )) {
139+ trace (" An error occurred while setting the value of tooLate." );
140+ } else {
141+ trace (" Cannot set tooLate to " + value .tooLate + " , because tooLate is Bool and your value is " + Type .typeof (value .tooLate ) + " ." );
142+ }
143+ }
144+
145+ try {
146+ if (value .wasGoodHit != null ) this .wasGoodHit = value .wasGoodHit ;
147+ } catch (e : Dynamic ) {
148+ if (Std .is (value .wasGoodHit , Bool )) {
149+ trace (" An error occurred while setting the value of wasGoodHit." );
150+ } else {
151+ trace (" Cannot set wasGoodHit to " + value .wasGoodHit + " , because wasGoodHit is Bool and your value is " + Type .typeof (value .wasGoodHit ) + " ." );
152+ }
153+ }
154+
155+ try {
156+ if (value .missed != null ) this .missed = value .missed ;
157+ } catch (e : Dynamic ) {
158+ if (Std .is (value .missed , Bool )) {
159+ trace (" An error occurred while setting the value of missed." );
160+ } else {
161+ trace (" Cannot set missed to " + value .missed + " , because missed is Bool and your value is " + Type .typeof (value .missed ) + " ." );
162+ }
163+ }
164+
165+ try {
166+ if (value .ignoreNote != null ) this .ignoreNote = value .ignoreNote ;
167+ } catch (e : Dynamic ) {
168+ if (Std .is (value .ignoreNote , Bool )) {
169+ trace (" An error occurred while setting the value of ignoreNote." );
170+ } else {
171+ trace (" Cannot set ignoreNote to " + value .ignoreNote + " , because ignoreNote is Bool and your value is " + Type .typeof (value .ignoreNote ) + " ." );
172+ }
173+ }
174+
175+ try {
176+ if (value .hitByOpponent != null ) this .hitByOpponent = value .hitByOpponent ;
177+ } catch (e : Dynamic ) {
178+ if (Std .is (value .hitByOpponent , Bool )) {
179+ trace (" An error occurred while setting the value of hitByOpponent." );
180+ } else {
181+ trace (" Cannot set hitByOpponent to " + value .hitByOpponent + " , because hitByOpponent is Bool and your value is " + Type .typeof (value .hitByOpponent ) + " ." );
182+ }
183+ }
184+
185+ try {
186+ if (value .noteType != null ) this .noteType = value .noteType ;
187+ } catch (e : Dynamic ) {
188+ if (Std .is (value .noteType , String )) {
189+ trace (" An error occurred while setting the value of noteType." );
190+ } else {
191+ trace (" Cannot set noteType to " + value .noteType + " , because noteType is String and your value is " + Type .typeof (value .noteType ) + " ." );
192+ }
193+ }
194+
195+ try {
196+ if (value .alpha != null ) this .alpha = value .alpha ;
197+ } catch (e : Dynamic ) {
198+ if (Std .is (value .alpha , Float )) {
199+ trace (" An error occurred while setting the value of alpha." );
200+ } else {
201+ trace (" Cannot set alpha to " + value .alpha + " , because alpha is Float and your value is " + Type .typeof (value .alpha ) + " ." );
202+ }
203+ }
204+
205+ try {
206+ if (value .x != null ) this .x = value .x ;
207+ } catch (e : Dynamic ) {
208+ if (Std .is (value .x , Float )) {
209+ trace (" An error occurred while setting the value of x." );
210+ } else {
211+ trace (" Cannot set x to " + value .x + " , because x is Float and your value is " + Type .typeof (value .x ) + " ." );
212+ }
213+ }
214+
215+ try {
216+ if (value .y != null ) this .y = value .y ;
217+ } catch (e : Dynamic ) {
218+ if (Std .is (value .y , Float )) {
219+ trace (" An error occurred while setting the value of y." );
220+ } else {
221+ trace (" Cannot set y to " + value .y + " , because y is Float and your value is " + Type .typeof (value .y ) + " ." );
222+ }
223+ }
224+
225+ try {
226+ if (value .rgb != null ) {
227+ if (value .rgb .r != null ) {
228+ try {
229+ this .rgbShader .r = value .rgb .r ;
230+ } catch (e : Dynamic ) {
231+ if (Std .is (value .rgb .r , Int )) {
232+ trace (" An error occurred while setting the value of rgb.r." );
233+ } else {
234+ trace (" Cannot set rgb.r to " + value .rgb .r + " , because rgb.r is Int and your value is " + Type .typeof (value .rgb .r ) + " ." );
235+ }
236+ }
237+ }
238+ if (value .rgb .g != null ) {
239+ try {
240+ this .rgbShader .g = value .rgb .g ;
241+ } catch (e : Dynamic ) {
242+ if (Std .is (value .rgb .g , Int )) {
243+ trace (" An error occurred while setting the value of rgb.g." );
244+ } else {
245+ trace (" Cannot set rgb.g to " + value .rgb .g + " , because rgb.g is Int and your value is " + Type .typeof (value .rgb .g ) + " ." );
246+ }
247+ }
248+ }
249+ if (value .rgb .b != null ) {
250+ try {
251+ this .rgbShader .b = value .rgb .b ;
252+ } catch (e : Dynamic ) {
253+ if (Std .is (value .rgb .b , Int )) {
254+ trace (" An error occurred while setting the value of rgb.b." );
255+ } else {
256+ trace (" Cannot set rgb.b to " + value .rgb .b + " , because rgb.b is Int and your value is " + Type .typeof (value .rgb .b ) + " ." );
257+ }
258+ }
259+ }
260+ }
261+ } catch (e : Dynamic ) {
262+ trace (" An error occurred while setting the value of rgb." );
263+ }
264+
265+ try {
266+ if (value .texture != null ) this .texture = value .texture ;
267+ } catch (e : Dynamic ) {
268+ if (Std .is (value .texture , String )) {
269+ trace (" An error occurred while setting the value of texture." );
270+ } else {
271+ trace (" Cannot set texture to " + value .texture + " , because texture is String and your value is " + Type .typeof (value .texture ) + " ." );
272+ }
273+ }
274+
275+ // Handle extra variables
276+ if (value != null ) {
277+ for (field in Reflect .fields (value )) {
278+ if (! Reflect .hasField (this , field ) && ! Reflect .hasField (value , field )) {
279+ if (extraData == null ) extraData = new Map <String , Dynamic >();
280+ extraData .set (field , Reflect .field (value , field ));
281+ trace (" This variable '" + field + " ' of type '" + Type .typeof (Reflect .field (value , field )) + " ' doesn't exist." );
282+ } else {
283+ try {
284+ Reflect .setField (this , field , Reflect .field (value , field ));
285+ } catch (e : Dynamic ) {
286+ if (Type .typeof (Reflect .field (this , field )) == Type .typeof (Reflect .field (value , field ))) {
287+ trace (" An error occurred while setting the value of " + field + " ." );
288+ } else {
289+ trace (" Cannot set " + field + " to " + Reflect .field (value , field ) + " , because " + field + " is " + Type .typeof (Reflect .field (this , field )) + " and your value is " + Type .typeof (Reflect .field (value , field )) + " ." );
290+ }
291+ }
292+ }
293+ }
294+ // Remove the map from the object
295+ extraData = null ;
296+ }
297+
298+ return value ;
299+ }
300+
301+
302+
79303 public static var minManiaUI_integer : Int = minMania + 1 ;
80304 public static var maxManiaUI_integer : Int = maxMania + 1 ;
81305
0 commit comments