@@ -15,13 +15,13 @@ namespace microgui {
1515 * Util function used within this file, useful for ensuring that prior bindings are not kept when using a new component.
1616 */
1717 function unbindShieldButtons ( ) {
18- control . onEvent ( ControllerButtonEvent . Pressed , controller . A . id , ( ) => { } )
19- control . onEvent ( ControllerButtonEvent . Pressed , controller . A . id + keymap . PLAYER_OFFSET , ( ) => { } )
20- control . onEvent ( ControllerButtonEvent . Pressed , controller . B . id , ( ) => { } )
21- control . onEvent ( ControllerButtonEvent . Pressed , controller . up . id , ( ) => { } )
22- control . onEvent ( ControllerButtonEvent . Pressed , controller . down . id , ( ) => { } )
23- control . onEvent ( ControllerButtonEvent . Pressed , controller . left . id , ( ) => { } )
24- control . onEvent ( ControllerButtonEvent . Pressed , controller . right . id , ( ) => { } )
18+ context . onEvent ( ControllerButtonEvent . Pressed , controller . A . id , ( ) => { } )
19+ context . onEvent ( ControllerButtonEvent . Pressed , controller . A . id + keymap . PLAYER_OFFSET , ( ) => { } )
20+ context . onEvent ( ControllerButtonEvent . Pressed , controller . B . id , ( ) => { } )
21+ context . onEvent ( ControllerButtonEvent . Pressed , controller . up . id , ( ) => { } )
22+ context . onEvent ( ControllerButtonEvent . Pressed , controller . down . id , ( ) => { } )
23+ context . onEvent ( ControllerButtonEvent . Pressed , controller . left . id , ( ) => { } )
24+ context . onEvent ( ControllerButtonEvent . Pressed , controller . right . id , ( ) => { } )
2525 }
2626
2727 /**
@@ -459,12 +459,12 @@ namespace microgui {
459459
460460 this . context = [ ( Math . abs ( this . maximum ) + Math . abs ( this . minimum ) ) / 2 ]
461461
462- control . onEvent (
462+ context . onEvent (
463463 ControllerButtonEvent . Pressed ,
464464 controller . up . id ,
465465 ( ) => {
466466 let tick = true ;
467- control . onEvent (
467+ context . onEvent (
468468 ControllerButtonEvent . Released ,
469469 controller . up . id ,
470470 ( ) => tick = false
@@ -475,16 +475,16 @@ namespace microgui {
475475 this . context [ 0 ] = Math . min ( this . context [ 0 ] + 10 , this . maximum )
476476 basic . pause ( 100 )
477477 }
478- control . onEvent ( ControllerButtonEvent . Released , controller . up . id , ( ) => { } )
478+ context . onEvent ( ControllerButtonEvent . Released , controller . up . id , ( ) => { } )
479479 }
480480 )
481481
482- control . onEvent (
482+ context . onEvent (
483483 ControllerButtonEvent . Pressed ,
484484 controller . down . id ,
485485 ( ) => {
486486 let tick = true ;
487- control . onEvent (
487+ context . onEvent (
488488 ControllerButtonEvent . Released ,
489489 controller . down . id ,
490490 ( ) => tick = false
@@ -495,7 +495,7 @@ namespace microgui {
495495 this . context [ 0 ] = Math . max ( this . context [ 0 ] - 10 , this . minimum )
496496 basic . pause ( 100 )
497497 }
498- control . onEvent ( ControllerButtonEvent . Released , controller . down . id , ( ) => { } )
498+ context . onEvent ( ControllerButtonEvent . Released , controller . down . id , ( ) => { } )
499499 }
500500 )
501501 }
@@ -1066,15 +1066,15 @@ namespace microgui {
10661066 setupButtonBindings ( ) {
10671067 unbindShieldButtons ( ) ;
10681068
1069- control . onEvent ( ControllerButtonEvent . Pressed , controller . A . id , ( ) => {
1069+ context . onEvent ( ControllerButtonEvent . Pressed , controller . A . id , ( ) => {
10701070 if ( this . textBtns . length > 0 ) {
10711071 this . textBtns [ this . selectedTextBtnIndex ] . callback ( ) ;
10721072 }
10731073 } )
10741074
1075- control . onEvent ( ControllerButtonEvent . Pressed , controller . up . id , ( ) => {
1075+ context . onEvent ( ControllerButtonEvent . Pressed , controller . up . id , ( ) => {
10761076 let tick = true ;
1077- control . onEvent (
1077+ context . onEvent (
10781078 ControllerButtonEvent . Released ,
10791079 controller . up . id ,
10801080 ( ) => tick = false
@@ -1099,12 +1099,12 @@ namespace microgui {
10991099 }
11001100
11011101 // Reset binding
1102- control . onEvent ( ControllerButtonEvent . Released , controller . up . id , ( ) => { } ) ;
1102+ context . onEvent ( ControllerButtonEvent . Released , controller . up . id , ( ) => { } ) ;
11031103 } )
11041104
1105- control . onEvent ( ControllerButtonEvent . Pressed , controller . down . id , ( ) => {
1105+ context . onEvent ( ControllerButtonEvent . Pressed , controller . down . id , ( ) => {
11061106 let tick = true ;
1107- control . onEvent (
1107+ context . onEvent (
11081108 ControllerButtonEvent . Released ,
11091109 controller . down . id ,
11101110 ( ) => tick = false
@@ -1127,7 +1127,7 @@ namespace microgui {
11271127 }
11281128
11291129 // Reset binding
1130- control . onEvent ( ControllerButtonEvent . Released , controller . down . id , ( ) => { } ) ;
1130+ context . onEvent ( ControllerButtonEvent . Released , controller . down . id , ( ) => { } ) ;
11311131 } )
11321132 }
11331133
@@ -1298,13 +1298,13 @@ namespace microgui {
12981298 setupButtonBindings ( ) {
12991299 unbindShieldButtons ( ) ;
13001300
1301- control . onEvent ( ControllerButtonEvent . Pressed , controller . A . id , ( ) => {
1301+ context . onEvent ( ControllerButtonEvent . Pressed , controller . A . id , ( ) => {
13021302 this . btns [ this . selectedTextBtnIndex ] . click ( ) ;
13031303 } )
13041304
1305- control . onEvent ( ControllerButtonEvent . Pressed , controller . up . id , ( ) => {
1305+ context . onEvent ( ControllerButtonEvent . Pressed , controller . up . id , ( ) => {
13061306 let tick = true ;
1307- control . onEvent (
1307+ context . onEvent (
13081308 ControllerButtonEvent . Released ,
13091309 controller . up . id ,
13101310 ( ) => tick = false
@@ -1321,12 +1321,12 @@ namespace microgui {
13211321 }
13221322
13231323 // Reset binding
1324- control . onEvent ( ControllerButtonEvent . Released , controller . up . id , ( ) => { } ) ;
1324+ context . onEvent ( ControllerButtonEvent . Released , controller . up . id , ( ) => { } ) ;
13251325 } ) ;
13261326
1327- control . onEvent ( ControllerButtonEvent . Pressed , controller . down . id , ( ) => {
1327+ context . onEvent ( ControllerButtonEvent . Pressed , controller . down . id , ( ) => {
13281328 let tick = true ;
1329- control . onEvent (
1329+ context . onEvent (
13301330 ControllerButtonEvent . Released ,
13311331 controller . down . id ,
13321332 ( ) => tick = false
@@ -1341,7 +1341,7 @@ namespace microgui {
13411341 }
13421342
13431343 // Reset binding
1344- control . onEvent ( ControllerButtonEvent . Released , controller . down . id , ( ) => { } ) ;
1344+ context . onEvent ( ControllerButtonEvent . Released , controller . down . id , ( ) => { } ) ;
13451345 } ) ;
13461346 }
13471347
@@ -1569,12 +1569,12 @@ namespace microgui {
15691569 }
15701570
15711571 bindShieldButtons ( ) {
1572- control . onEvent (
1572+ context . onEvent (
15731573 ControllerButtonEvent . Pressed ,
15741574 controller . up . id ,
15751575 ( ) => {
15761576 let tick = true ;
1577- control . onEvent (
1577+ context . onEvent (
15781578 ControllerButtonEvent . Released ,
15791579 controller . up . id ,
15801580 ( ) => tick = false
@@ -1593,16 +1593,16 @@ namespace microgui {
15931593 }
15941594
15951595 // Reset binding
1596- control . onEvent ( ControllerButtonEvent . Released , controller . up . id , ( ) => { } ) ;
1596+ context . onEvent ( ControllerButtonEvent . Released , controller . up . id , ( ) => { } ) ;
15971597 }
15981598 )
15991599
1600- control . onEvent (
1600+ context . onEvent (
16011601 ControllerButtonEvent . Pressed ,
16021602 controller . down . id ,
16031603 ( ) => {
16041604 let tick = true ;
1605- control . onEvent (
1605+ context . onEvent (
16061606 ControllerButtonEvent . Released ,
16071607 controller . down . id ,
16081608 ( ) => tick = false
@@ -1621,16 +1621,16 @@ namespace microgui {
16211621 }
16221622
16231623 // Reset binding
1624- control . onEvent ( ControllerButtonEvent . Released , controller . down . id , ( ) => { } ) ;
1624+ context . onEvent ( ControllerButtonEvent . Released , controller . down . id , ( ) => { } ) ;
16251625 }
16261626 )
16271627
1628- control . onEvent (
1628+ context . onEvent (
16291629 ControllerButtonEvent . Pressed ,
16301630 controller . left . id ,
16311631 ( ) => {
16321632 let tick = true ;
1633- control . onEvent (
1633+ context . onEvent (
16341634 ControllerButtonEvent . Released ,
16351635 controller . left . id ,
16361636 ( ) => tick = false
@@ -1648,16 +1648,16 @@ namespace microgui {
16481648 }
16491649
16501650 // Reset binding
1651- control . onEvent ( ControllerButtonEvent . Released , controller . left . id , ( ) => { } ) ;
1651+ context . onEvent ( ControllerButtonEvent . Released , controller . left . id , ( ) => { } ) ;
16521652 }
16531653 )
16541654
1655- control . onEvent (
1655+ context . onEvent (
16561656 ControllerButtonEvent . Pressed ,
16571657 controller . right . id ,
16581658 ( ) => {
16591659 let tick = true ;
1660- control . onEvent (
1660+ context . onEvent (
16611661 ControllerButtonEvent . Released ,
16621662 controller . right . id ,
16631663 ( ) => tick = false
@@ -1675,23 +1675,23 @@ namespace microgui {
16751675 }
16761676
16771677 // Reset binding
1678- control . onEvent ( ControllerButtonEvent . Released , controller . right . id , ( ) => { } ) ;
1678+ context . onEvent ( ControllerButtonEvent . Released , controller . right . id , ( ) => { } ) ;
16791679 }
16801680 )
16811681
16821682 // click
16831683 const click = ( ) => this . click ( )
1684- control . onEvent (
1684+ context . onEvent (
16851685 ControllerButtonEvent . Pressed ,
16861686 controller . A . id ,
16871687 click
16881688 )
1689- control . onEvent (
1689+ context . onEvent (
16901690 ControllerButtonEvent . Pressed ,
16911691 controller . A . id + keymap . PLAYER_OFFSET ,
16921692 click
16931693 )
1694- control . onEvent (
1694+ context . onEvent (
16951695 ControllerButtonEvent . Pressed ,
16961696 controller . B . id ,
16971697 ( ) => this . back ( )
0 commit comments