@@ -823,17 +823,6 @@ class Monogatari {
823823 }
824824 }
825825
826- // Stop the voice player
827- static shutUp ( ) {
828- if ( ! Monogatari . voicePlayer . paused && typeof Monogatari . voicePlayer . src !== 'undefined' && Monogatari . voicePlayer . src != '' ) {
829- Monogatari . voicePlayer . pause ( ) ;
830- Monogatari . voicePlayer . currentTime = 0 ;
831- }
832- }
833-
834-
835-
836-
837826 static resetGame ( ) {
838827
839828 $_ ( '[data-component="modal"]' ) . removeClass ( 'modal--active' ) ;
@@ -888,29 +877,6 @@ class Monogatari {
888877 }
889878 }
890879
891- static continue ( ) {
892- Monogatari . canProceed ( ) . then ( ( ) => {
893- if ( ! Monogatari . global ( 'finishedTyping' ) && Monogatari . global ( 'textObject' ) !== null ) {
894- const str = Monogatari . global ( 'textObject' ) . strings [ 0 ] ;
895- const element = $_ ( Monogatari . global ( 'textObject' ) . el ) . data ( 'ui' ) ;
896- Monogatari . global ( 'textObject' ) . destroy ( ) ;
897- if ( element == 'centered' ) {
898- $_ ( '[data-ui="centered"]' ) . html ( str ) ;
899- } else {
900- $_ ( '[data-ui="say"]' ) . html ( str ) ;
901- }
902- Monogatari . global ( 'finishedTyping' , true ) ;
903- } else {
904- Monogatari . action ( 'Centered' ) . hide ( ) ;
905- Monogatari . shutUp ( ) ;
906- Monogatari . next ( ) ;
907- }
908- } ) . catch ( ( ) => {
909- // An action waiting for user interaction or something else
910- // is blocking the game.
911- } ) ;
912- }
913-
914880 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
915881 //
916882
@@ -926,8 +892,6 @@ class Monogatari {
926892 // possibly special handling to avoid futile "catch up" run
927893 }
928894 Monogatari . canProceed ( ) . then ( ( ) => {
929- Monogatari . action ( 'Centered' ) . hide ( ) ;
930- Monogatari . shutUp ( ) ;
931895 Monogatari . next ( ) ;
932896 expected += interval ;
933897 setTimeout ( Monogatari . global ( '_AutoPlayTimer' ) , Math . max ( 0 , interval - now ) ) ; // take into account drift
@@ -954,9 +918,6 @@ class Monogatari {
954918 // Function to execute the previous statement in the script.
955919 static revert ( ) {
956920
957- Monogatari . action ( 'Centered' ) . hide ( ) ;
958- Monogatari . shutUp ( ) ;
959-
960921 if ( Monogatari . state ( 'step' ) >= 1 ) {
961922
962923 for ( const action of Monogatari . actions ( ) ) {
@@ -1122,7 +1083,12 @@ class Monogatari {
11221083 } ) ;
11231084
11241085 $_ ( '#game' ) . click ( function ( ) {
1125- Monogatari . continue ( ) ;
1086+ Monogatari . canProceed ( ) . then ( ( ) => {
1087+ Monogatari . next ( ) ;
1088+ } ) . catch ( ( ) => {
1089+ // An action waiting for user interaction or something else
1090+ // is blocking the game.
1091+ } ) ;
11261092 } ) ;
11271093
11281094 $_ ( '[data-action], [data-action] *' ) . click ( function ( ) {
@@ -1243,7 +1209,12 @@ class Monogatari {
12431209 // Spacebar and Right Arrow
12441210 case 32 :
12451211 case 39 :
1246- Monogatari . continue ( ) ;
1212+ Monogatari . canProceed ( ) . then ( ( ) => {
1213+ Monogatari . next ( ) ;
1214+ } ) . catch ( ( ) => {
1215+ // An action waiting for user interaction or something else
1216+ // is blocking the game.
1217+ } ) ;
12471218 break ;
12481219
12491220 // Left Arrow
0 commit comments