From a69989611653f1f645b9379dc7e32fb42ccae1b1 Mon Sep 17 00:00:00 2001 From: sxg <840309695@qq.com> Date: Wed, 26 Aug 2026 14:27:41 +0800 Subject: [PATCH] LF --- .../src/components/menu-bar/menu-bar.jsx | 2 +- .../stage-cpp-unity/currentLevelChoose.jsx | 2 +- .../components/stage-cpp-unity/stage-unity.jsx | 18 +++++++++++------- .../stage-python-unity/currentLevelChoose.jsx | 2 +- .../stage-python-unity/stage-unity.jsx | 14 +++++++------- .../stage-unity/currentLevelChoose.jsx | 2 +- .../src/components/stage-unity/stage-unity.jsx | 14 +++++++------- scratch-gui/src/playground/config.js | 18 +++++++++++++++--- 8 files changed, 44 insertions(+), 28 deletions(-) diff --git a/scratch-gui/src/components/menu-bar/menu-bar.jsx b/scratch-gui/src/components/menu-bar/menu-bar.jsx index 5ff2ff89..29617a3b 100644 --- a/scratch-gui/src/components/menu-bar/menu-bar.jsx +++ b/scratch-gui/src/components/menu-bar/menu-bar.jsx @@ -843,7 +843,7 @@ class MenuBar extends React.Component { let realLvId_tmp = ''; // 发送消息给 Unity 实例,切换关卡 if (localStorage.getItem('platformMode') === 'normal') { - realLvId_tmp = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber) + window.gamelvdata.currentlv; + realLvId_tmp = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber, window.gamelvdataJson.gamemode) + window.gamelvdata.currentlv; } else { realLvId_tmp = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber); } diff --git a/scratch-gui/src/components/stage-cpp-unity/currentLevelChoose.jsx b/scratch-gui/src/components/stage-cpp-unity/currentLevelChoose.jsx index 767c3a3c..ca9a4b98 100644 --- a/scratch-gui/src/components/stage-cpp-unity/currentLevelChoose.jsx +++ b/scratch-gui/src/components/stage-cpp-unity/currentLevelChoose.jsx @@ -148,7 +148,7 @@ const CurrentLevelChoose = ({ onCancel }) => { console.warn('window.loadCppProject 未定义或不是函数'); } } - const realLvId_tmp = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber); + const realLvId_tmp = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber, window.gamelvdataJson.gamemode); const realLvId = realLvId_tmp + cellIndex window.unityInstance.SendMessage("GameController", "SwitchLevel", realLvId); CONFIG.checkGameStyle(realLvId); diff --git a/scratch-gui/src/components/stage-cpp-unity/stage-unity.jsx b/scratch-gui/src/components/stage-cpp-unity/stage-unity.jsx index c3df0a29..37e94646 100644 --- a/scratch-gui/src/components/stage-cpp-unity/stage-unity.jsx +++ b/scratch-gui/src/components/stage-cpp-unity/stage-unity.jsx @@ -592,7 +592,7 @@ const UnityComponent = function (props) { //计算真实关卡位置 let realLvId = 0; if (localStorage.getItem('platformMode') === 'normal') { - realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber) + window.gamelvdata.currentlv + realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber, window.gamelvdataJson.gamemode) + window.gamelvdata.currentlv } else { realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber) } @@ -702,7 +702,7 @@ const UnityComponent = function (props) { window.iscreate = 1; let realLvId = 0; if (localStorage.getItem('platformMode') === 'normal') { - realLvId = CONFIG.getRealLvId(gamelvdataJson.gamelv, gamelvdataJson.gameid, gamelvdataJson.ismatch, gamelvdataJson.gameNumber) + window.gamelvdata.currentlv + realLvId = CONFIG.getRealLvId(gamelvdataJson.gamelv, gamelvdataJson.gameid, gamelvdataJson.ismatch, gamelvdataJson.gameNumber, gamelvdataJson.gamemode) + window.gamelvdata.currentlv } else { realLvId = CONFIG.getRealLvId(gamelvdataJson.gamelv, gamelvdataJson.gameid, gamelvdataJson.ismatch, gamelvdataJson.gameNumber) } @@ -719,7 +719,8 @@ const UnityComponent = function (props) { // 延迟 500 毫秒后切换关卡,只执行一次 setTimeout(() => { if (localStorage.getItem('platformMode') === 'normal') { - const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber) + window.gamelvdata.currentlv + + const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber, window.gamelvdataJson.gamemode) + window.gamelvdata.currentlv window.unityInstance.SendMessage("GameController", "SwitchLevel", realLvId); } else { const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber) @@ -778,7 +779,8 @@ const UnityComponent = function (props) { const savedProject = window.cppCode; setIsLockNextButton(true); - const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber) + window.gamelvdata.currentlv + + const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber, window.gamelvdataJson.gamemode) + window.gamelvdata.currentlv const trialCount = localStorage.getItem('trial_count'); if (localStorage.getItem('permission') === "0" && (realLvId - CONFIG.BEGINNING_REAL_LVID) >= trialCount && currentlv > 9) { @@ -1161,8 +1163,9 @@ const UnityComponent = function (props) { } else { setIsNextButtonComplete(false); } + window.gamelvdata.currentlv = window.gamelvdata.currentlv + 1 - const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber) + window.gamelvdata.currentlv + const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber, window.gamelvdataJson.gamemode) + window.gamelvdata.currentlv window.unityInstance.SendMessage("GameController", "SwitchLevel", realLvId); CONFIG.checkGameStyle(realLvId); @@ -1219,7 +1222,8 @@ const UnityComponent = function (props) { }; const handleRetry = () => { - const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber) + window.gamelvdata.currentlv + + const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber, window.gamelvdataJson.gamemode) + window.gamelvdata.currentlv window.unityInstance.SendMessage("GameController", "SwitchLevel", realLvId); console.log("Retrying the current level..."); }; @@ -1283,7 +1287,7 @@ const UnityComponent = function (props) { //计算真实关卡位置 let realLvId = 0; if (localStorage.getItem('platformMode') === 'normal') { - realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber) + window.gamelvdata.currentlv + realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber, window.gamelvdataJson.gamemode) + window.gamelvdata.currentlv } else { realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber) } diff --git a/scratch-gui/src/components/stage-python-unity/currentLevelChoose.jsx b/scratch-gui/src/components/stage-python-unity/currentLevelChoose.jsx index 24db794f..2dac343e 100644 --- a/scratch-gui/src/components/stage-python-unity/currentLevelChoose.jsx +++ b/scratch-gui/src/components/stage-python-unity/currentLevelChoose.jsx @@ -144,7 +144,7 @@ const CurrentLevelChoose = ({ onCancel }) => { // 清除所有代码 window.loadPythonProject(`` + `\n`.repeat(50)); } - const realLvId_tmp = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber); + const realLvId_tmp = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber, window.gamelvdataJson.gamemode); const realLvId = realLvId_tmp + cellIndex window.unityInstance.SendMessage("GameController", "SwitchLevel", realLvId); CONFIG.checkGameStyle(realLvId); diff --git a/scratch-gui/src/components/stage-python-unity/stage-unity.jsx b/scratch-gui/src/components/stage-python-unity/stage-unity.jsx index 6ecb214d..ab8754c7 100644 --- a/scratch-gui/src/components/stage-python-unity/stage-unity.jsx +++ b/scratch-gui/src/components/stage-python-unity/stage-unity.jsx @@ -592,7 +592,7 @@ const UnityComponent = function (props) { //计算真实关卡位置 let realLvId = 0; if (localStorage.getItem('platformMode') === 'normal') { - realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber) + window.gamelvdata.currentlv + realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber, window.gamelvdataJson.gamemode) + window.gamelvdata.currentlv } else { realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber) } @@ -702,7 +702,7 @@ const UnityComponent = function (props) { window.iscreate = 1; let realLvId = 0; if (localStorage.getItem('platformMode') === 'normal') { - realLvId = CONFIG.getRealLvId(gamelvdataJson.gamelv, gamelvdataJson.gameid, gamelvdataJson.ismatch, gamelvdataJson.gameNumber) + window.gamelvdata.currentlv + realLvId = CONFIG.getRealLvId(gamelvdataJson.gamelv, gamelvdataJson.gameid, gamelvdataJson.ismatch, gamelvdataJson.gameNumber, gamelvdataJson.gamemode) + window.gamelvdata.currentlv } else { realLvId = CONFIG.getRealLvId(gamelvdataJson.gamelv, gamelvdataJson.gameid, gamelvdataJson.ismatch, gamelvdataJson.gameNumber) } @@ -719,7 +719,7 @@ const UnityComponent = function (props) { // 延迟 500 毫秒后切换关卡,只执行一次 setTimeout(() => { if (localStorage.getItem('platformMode') === 'normal') { - const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber) + window.gamelvdata.currentlv + const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber, window.gamelvdataJson.gamemode) + window.gamelvdata.currentlv window.unityInstance.SendMessage("GameController", "SwitchLevel", realLvId); } else { const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber) @@ -776,7 +776,7 @@ const UnityComponent = function (props) { const savedProject = window.pythonCode; setIsLockNextButton(true); - const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber) + window.gamelvdata.currentlv + const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber, window.gamelvdataJson.gamemode) + window.gamelvdata.currentlv const trialCount = localStorage.getItem('trial_count'); if (localStorage.getItem('permission') === "0" && (realLvId - CONFIG.BEGINNING_REAL_LVID) >= trialCount && currentlv > 9) { @@ -1156,7 +1156,7 @@ const UnityComponent = function (props) { setIsNextButtonComplete(false); } window.gamelvdata.currentlv = window.gamelvdata.currentlv + 1 - const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber) + window.gamelvdata.currentlv + const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber, window.gamelvdataJson.gamemode) + window.gamelvdata.currentlv window.unityInstance.SendMessage("GameController", "SwitchLevel", realLvId); CONFIG.checkGameStyle(realLvId); @@ -1208,7 +1208,7 @@ const UnityComponent = function (props) { }; const handleRetry = () => { - const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber) + window.gamelvdata.currentlv + const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber, window.gamelvdataJson.gamemode) + window.gamelvdata.currentlv window.unityInstance.SendMessage("GameController", "SwitchLevel", realLvId); console.log("Retrying the current level..."); }; @@ -1272,7 +1272,7 @@ const UnityComponent = function (props) { //计算真实关卡位置 let realLvId = 0; if (localStorage.getItem('platformMode') === 'normal') { - realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber) + window.gamelvdata.currentlv + realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber, window.gamelvdataJson.gamemode) + window.gamelvdata.currentlv } else { realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber) } diff --git a/scratch-gui/src/components/stage-unity/currentLevelChoose.jsx b/scratch-gui/src/components/stage-unity/currentLevelChoose.jsx index b1375d4c..b740e135 100644 --- a/scratch-gui/src/components/stage-unity/currentLevelChoose.jsx +++ b/scratch-gui/src/components/stage-unity/currentLevelChoose.jsx @@ -150,7 +150,7 @@ const CurrentLevelChoose = ({ onCancel }) => { } // window.handleClickNewProjectWithUnity(); } - const realLvId_tmp = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber); + const realLvId_tmp = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber, window.gamelvdataJson.gamemode); const realLvId = realLvId_tmp + cellIndex window.unityInstance.SendMessage("GameController", "SwitchLevel", realLvId); CONFIG.checkGameStyle(realLvId); diff --git a/scratch-gui/src/components/stage-unity/stage-unity.jsx b/scratch-gui/src/components/stage-unity/stage-unity.jsx index fb9fb188..14db07c3 100644 --- a/scratch-gui/src/components/stage-unity/stage-unity.jsx +++ b/scratch-gui/src/components/stage-unity/stage-unity.jsx @@ -790,7 +790,7 @@ const UnityComponent = function (props) { //计算真实关卡位置 let realLvId = 0; if (localStorage.getItem('platformMode') === 'normal') { - realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber) + window.gamelvdata.currentlv + realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber, window.gamelvdataJson.gamemode) + window.gamelvdata.currentlv } else { realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber) } @@ -914,7 +914,7 @@ const UnityComponent = function (props) { window.iscreate = 1; let realLvId = 0; if (localStorage.getItem('platformMode') === 'normal') { - realLvId = CONFIG.getRealLvId(gamelvdataJson.gamelv, gamelvdataJson.gameid, gamelvdataJson.ismatch, gamelvdataJson.gameNumber) + window.gamelvdata.currentlv + realLvId = CONFIG.getRealLvId(gamelvdataJson.gamelv, gamelvdataJson.gameid, gamelvdataJson.ismatch, gamelvdataJson.gameNumber, gamelvdataJson.gamemode) + window.gamelvdata.currentlv } else { realLvId = CONFIG.getRealLvId(gamelvdataJson.gamelv, gamelvdataJson.gameid, gamelvdataJson.ismatch, gamelvdataJson.gameNumber) } @@ -931,7 +931,7 @@ const UnityComponent = function (props) { // 延迟 500 毫秒后切换关卡,只执行一次 setTimeout(() => { if (localStorage.getItem('platformMode') === 'normal') { - const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber) + window.gamelvdata.currentlv + const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber, window.gamelvdataJson.gamemode) + window.gamelvdata.currentlv window.unityInstance.SendMessage("GameController", "SwitchLevel", realLvId); } else { const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber) @@ -993,7 +993,7 @@ const UnityComponent = function (props) { } setIsLockNextButton(true); - const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber) + window.gamelvdata.currentlv + const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber, window.gamelvdataJson.gamemode) + window.gamelvdata.currentlv const trialCount = localStorage.getItem('trial_count'); if (localStorage.getItem('permission') === "0" && (realLvId - CONFIG.BEGINNING_REAL_LVID) >= trialCount && currentlv > 9) { @@ -1412,7 +1412,7 @@ const UnityComponent = function (props) { setIsNextButtonComplete(false); } window.gamelvdata.currentlv = window.gamelvdata.currentlv + 1 - const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber) + window.gamelvdata.currentlv + const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber, window.gamelvdataJson.gamemode) + window.gamelvdata.currentlv console.log(window.gamelvdata.currentlv, window.gamelvdataJson.gameNumber) removeGlobalKeyboardShield(); window.unityInstance.SendMessage("GameController", "SwitchLevel", realLvId); @@ -1470,7 +1470,7 @@ const UnityComponent = function (props) { }; const handleRetry = () => { - const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber) + window.gamelvdata.currentlv + const realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber, window.gamelvdataJson.gamemode) + window.gamelvdata.currentlv removeGlobalKeyboardShield(); window.unityInstance.SendMessage("GameController", "SwitchLevel", realLvId); console.log("Retrying the current level...realLvId...", realLvId); @@ -1536,7 +1536,7 @@ const UnityComponent = function (props) { let realLvId = 0; if (localStorage.getItem('platformMode') === 'normal') { - realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber) + window.gamelvdata.currentlv + realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber, window.gamelvdataJson.gamemode) + window.gamelvdata.currentlv } else { realLvId = CONFIG.getRealLvId(window.gamelvdataJson.gamelv, window.gamelvdataJson.gameid, window.gamelvdataJson.ismatch, window.gamelvdataJson.gameNumber) } diff --git a/scratch-gui/src/playground/config.js b/scratch-gui/src/playground/config.js index 3389a75d..cca15ad2 100644 --- a/scratch-gui/src/playground/config.js +++ b/scratch-gui/src/playground/config.js @@ -195,16 +195,28 @@ const CONFIG = { SSN_COMPETITION_ID: [13], NOT_ALLOWED_COMPETITION_ID: [72, 62, 64, 65, 69, 61, 63, 67, 70, 74, 73, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84], BEGINNING_REAL_LVID: 91600, - END_REAL_LVID: 93100, + END_REAL_LVID: 93400, SIMULATE_COMPETITION_ID: [149], // 用于测试的模拟比赛ID HIDE_COMPETITION_TIME_ID: [154, 155, 156], // 需要隐藏比赛时间的比赛ID列表 + MODE_START_OFFSET: { + '1': [0, 0, 0], //Level A + '2': [0, 0, 0], //Level B + '3': [0, 0, 0], //Level C + '4': [0, 0, 0], //Level D + '5': [0, 0, 0], //Level E + '6': [0, 300, 600], //Level F + }, // 计算关卡实际id - getRealLvId(gamelv, gameid, ismatch, gameNumber) { + getRealLvId(gamelv, gameid, ismatch, gameNumber, gamemode) { if (localStorage.getItem('platformMode') === 'competition') { return parseInt(window.unity_game_number, 10) } else { if (!ismatch) { - return ((gamelv - 1) * 30 * gameNumber) + ((gameid - 1) * gameNumber) + this.BEGINNING_REAL_LVID + let modeOffset = 0; + if (this.MODE_START_OFFSET && this.MODE_START_OFFSET[gamelv]) { + modeOffset = this.MODE_START_OFFSET[gamelv][gamemode - 1] || 0; + } + return (modeOffset + (gamelv - 1) * 30 * gameNumber) + ((gameid - 1) * gameNumber) + this.BEGINNING_REAL_LVID } else { //TODO 这里维护一张匹配关卡映射表