@@ -9,6 +9,7 @@ describe('EventsTree/TextRenderer', () => {
99 it ( 'renders events as text' , ( ) => {
1010 const { project } = makeTestProject ( gd ) ;
1111 try {
12+ const longCommentText = 'A' . repeat ( 450 ) ;
1213 const serializedEvents = [
1314 {
1415 type : 'BuiltinCommonInstructions::Standard' ,
@@ -331,6 +332,51 @@ describe('EventsTree/TextRenderer', () => {
331332 } ,
332333 ] ,
333334 } ,
335+ // Disabled event with conditions/actions - should get disabled="true"
336+ {
337+ type : 'BuiltinCommonInstructions::Standard' ,
338+ disabled : true ,
339+ conditions : [
340+ {
341+ type : { value : 'PlatformBehavior::IsFalling' } ,
342+ parameters : [
343+ 'GroupOfSpriteObjectsWithBehaviors' ,
344+ 'PlatformerObject' ,
345+ ] ,
346+ } ,
347+ ] ,
348+ actions : [
349+ {
350+ type : { value : 'Show' } ,
351+ parameters : [ 'GroupOfObjects' , '' ] ,
352+ } ,
353+ ] ,
354+ events : [
355+ // Sub-event of disabled parent - should get disabled-because-of-ancestor="true"
356+ {
357+ type : 'BuiltinCommonInstructions::Standard' ,
358+ conditions : [ ] ,
359+ actions : [
360+ {
361+ type : { value : 'Show' } ,
362+ parameters : [ 'GroupOfObjects' , '' ] ,
363+ } ,
364+ ] ,
365+ } ,
366+ ] ,
367+ } ,
368+ // Short comment
369+ {
370+ type : 'BuiltinCommonInstructions::Comment' ,
371+ comment : 'This is a short comment' ,
372+ color : { r : 255 , g : 230 , b : 109 , textR : 0 , textG : 0 , textB : 0 } ,
373+ } ,
374+ // Long comment (>400 chars) - should be truncated
375+ {
376+ type : 'BuiltinCommonInstructions::Comment' ,
377+ comment : longCommentText ,
378+ color : { r : 255 , g : 230 , b : 109 , textR : 0 , textG : 0 , textB : 0 } ,
379+ } ,
334380 ] ;
335381
336382 const eventsList = new gd . EventsList ( ) ;
@@ -361,7 +407,7 @@ describe('EventsTree/TextRenderer', () => {
361407 Actions:
362408 - Show GroupOfObjects
363409 </event-0.0>
364- <event-0.1>
410+ <event-0.1 type=\\"repeat\\" >
365411 Repeat \`1\` times these:
366412 Conditions:
367413 (no conditions)
@@ -392,7 +438,7 @@ describe('EventsTree/TextRenderer', () => {
392438 - Hide GroupOfObjects
393439 - Unknown or unsupported instruction
394440 </event-0.3>
395- <event-0.4>
441+ <event-0.4 type=\\"while\\" >
396442 While these conditions are true:
397443 - GroupOfSpriteObjectsWithBehaviors is falling
398444 Then do:
@@ -402,15 +448,15 @@ describe('EventsTree/TextRenderer', () => {
402448 - Change the number of the animation of MySpriteObject: = 1
403449 - Show GroupOfObjects
404450 </event-0.4>
405- <event-0.5>
451+ <event-0.5 type=\\"repeat\\" >
406452 Repeat \`3 + 4\` times these:
407453 Conditions:
408454 - GroupOfSpriteObjectsWithBehaviors is falling
409455 Actions:
410456 - Change the number of the animation of MySpriteObject: = 1
411457 - Show GroupOfObjects
412458 </event-0.5>
413- <event-0.6>
459+ <event-0.6 type=\\"group\\" >
414460 Group called \\"My super group\\":
415461 Sub-events:
416462 <event-0.6.0>
@@ -458,7 +504,26 @@ describe('EventsTree/TextRenderer', () => {
458504 Actions:
459505 - Hide GroupOfObjects
460506 </event-0.10>
461- </event-0>"
507+ </event-0>
508+ <event-1 disabled=\\"true\\">
509+ Conditions:
510+ - GroupOfSpriteObjectsWithBehaviors is falling
511+ Actions:
512+ - Show GroupOfObjects
513+ Sub-events:
514+ <event-1.0 disabled-because-of-ancestor=\\"true\\">
515+ Conditions:
516+ (no conditions)
517+ Actions:
518+ - Show GroupOfObjects
519+ </event-1.0>
520+ </event-1>
521+ <event-2 type=\\"comment\\">
522+ This is a short comment
523+ </event-2>
524+ <event-3 type=\\"comment\\">
525+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA[cut - 50 more characters]
526+ </event-3>"
462527 ` ) ;
463528 } finally {
464529 project . delete ( ) ;
0 commit comments