@@ -80,6 +80,8 @@ export class Core {
8080 this . drawer . isSkip = drawerSkip
8181 this . isNext = coreNext
8282 } ,
83+ toggleAuto : ( ) => { this . isAuto = ! this . isAuto } ,
84+ toggleSkip : ( ) => { this . isSkip = ! this . isSkip } ,
8385 } )
8486
8587 await this . textHandler ( 'タップでスタート' )
@@ -225,7 +227,7 @@ export class Core {
225227 await this . eventBus . emit ( 'text:show' , {
226228 name : scenarioObject . name || '' ,
227229 content : scenarioObject . content ,
228- speed : scenarioObject . speed || 25 ,
230+ speed : this . isSkip ? 1 : scenarioObject . speed || 25 ,
229231 expandVariable : this . expandVariable . bind ( this ) ,
230232 waitFn : this . waitHandler . bind ( this ) ,
231233 } )
@@ -254,15 +256,26 @@ export class Core {
254256 if ( typeof line . wait === 'string' && ! isNaN ( Number ( line . wait ) ) ) {
255257 line . wait = Number ( line . wait )
256258 }
259+
260+ // スキップモードが有効な場合は全ての待機をスキップする
261+ if ( this . isSkip ) {
262+ return
263+ }
264+
257265 if ( typeof line . wait === 'number' ) {
258266 if ( line . wait > 0 || this . isAuto ) {
259267 const waitTime = line . wait || 1500
260268 // 指定された時間だけ待機
261269 await sleep ( waitTime )
262270 }
263271 } else {
264- // 改行ごとに入力待ち
265- await this . clickWait ( )
272+ if ( this . isAuto ) {
273+ // オートモードが有効な場合はデフォルト時間後に自動進行する
274+ await sleep ( 1500 )
275+ } else {
276+ // 改行ごとに入力待ち
277+ await this . clickWait ( )
278+ }
266279 }
267280 }
268281
@@ -271,7 +284,7 @@ export class Core {
271284 this . drawer . setVisibility ( '#waitCircle' , true )
272285 return new Promise ( ( resolve ) => {
273286 const intervalId = setInterval ( ( ) => {
274- if ( this . isNext ) {
287+ if ( this . isNext || this . isAuto || this . isSkip ) {
275288 this . drawer . setVisibility ( '#waitCircle' , false )
276289 clearInterval ( intervalId )
277290 this . isNext = false
@@ -750,6 +763,15 @@ export class Core {
750763 getSaveList : ( ) => this . getSaveList ( ) ,
751764 deleteSave : ( slot ) => this . deleteSave ( slot ) ,
752765 } ,
766+ store : this . store ,
767+ playback : {
768+ toggleAuto : ( ) => { this . isAuto = ! this . isAuto } ,
769+ setAuto : ( value ) => { this . isAuto = value } ,
770+ getAuto : ( ) => this . isAuto ,
771+ toggleSkip : ( ) => { this . isSkip = ! this . isSkip } ,
772+ setSkip : ( value ) => { this . isSkip = value } ,
773+ getSkip : ( ) => this . isSkip ,
774+ } ,
753775 sandbox : {
754776 execute : this . executeScenario . bind ( this ) ,
755777 } ,
@@ -803,7 +825,7 @@ export class Core {
803825 async loadHandler ( line ) {
804826 const slot = line . slot || 'auto'
805827
806- const saveDataRaw = this . store . get ? this . store . get ( `save_${ slot } ` ) : this . store [ `save_ ${ slot } ` ]
828+ const saveDataRaw = this . store . get ( `save_${ slot } ` )
807829 if ( ! saveDataRaw ) {
808830 throw new Error ( `セーブデータが見つかりません: スロット${ slot } ` )
809831 }
@@ -882,6 +904,6 @@ export class Core {
882904 }
883905
884906 deleteSave ( slot ) {
885- delete this . store [ `save_${ slot } ` ]
907+ this . store . remove ( `save_${ slot } ` )
886908 }
887909}
0 commit comments