From a197b02fdf36e282ff3180caab0d4248eb8f2b40 Mon Sep 17 00:00:00 2001 From: StageGuard <1355416608@qq.com> Date: Wed, 2 Dec 2020 23:39:13 +0800 Subject: [PATCH] fix --- source/SkyAutoplayer.js | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/source/SkyAutoplayer.js b/source/SkyAutoplayer.js index 61cc795..f437400 100644 --- a/source/SkyAutoplayer.js +++ b/source/SkyAutoplayer.js @@ -286,22 +286,27 @@ sheetplayer = { sheetplayer.currentNote ++; } // 播放完自动下一首 - if(config.values.autoPlay && !(sheetplayer.currentNote < sheetplayer.noteCount) && gui.player_panel.isShowing) { - gui.player_panel.__internal_dismiss(); - sheetplayer.stop(); - // gui.main.show(0); - if(sheetmgr.cachedLocalSheetList.length>0){ - setTimeout(function(){ - let sheet = sheetmgr.cachedLocalSheetList[random(0, sheetmgr.cachedLocalSheetList.length-1)] - if(!sheet.keyCount){ - sheet.keyCount = 15 //默认键位 - } - gui.player_panel.__internal_showPanel(sheet); - // sheetplayer.stop(); + + if(!(sheetplayer.currentNote < sheetplayer.noteCount)) { + if(config.values.autoPlay && gui.player_panel.isShowing) { + gui.player_panel.__internal_dismiss(); + sheetplayer.stop(); + // gui.main.show(0); + if(sheetmgr.cachedLocalSheetList.length>0){ setTimeout(function(){ - sheetplayer.play(gui.player_panel.refreshStatus); - }, 1500) - }, 500) + let sheet = sheetmgr.cachedLocalSheetList[random(0, sheetmgr.cachedLocalSheetList.length-1)] + if(!sheet.keyCount){ + sheet.keyCount = 15 //默认键位 + } + gui.player_panel.__internal_showPanel(sheet); + // sheetplayer.stop(); + setTimeout(function(){ + sheetplayer.play(gui.player_panel.refreshStatus); + }, 1500) + }, 500) + } + } else { + sheetplayer.stop(); } } }); @@ -2031,7 +2036,6 @@ gui = { }; - gui.run(function(){ ui.setContentView((function(){ var layout = new android.widget.LinearLayout(ctx);