From d0afb1676efd017e0b70837472bae751714638e6 Mon Sep 17 00:00:00 2001 From: tmalahie Date: Mon, 29 Jul 2024 23:50:08 +0200 Subject: [PATCH] Don't apply override for sections --- php/includes/mk/map.php | 2 +- scripts/editor.js | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/php/includes/mk/map.php b/php/includes/mk/map.php index ea302dd5..afb7a6fe 100755 --- a/php/includes/mk/map.php +++ b/php/includes/mk/map.php @@ -8,7 +8,7 @@ $circuitMainData = $circuitPayload->main; echo '{'; printCircuitPart($circuit, 0,$circuitPayload); - if (isset($circuitPayload->lapOverrides)) { + if (isset($circuitPayload->lapOverrides) && !isset($circuitMainData->sections)) { echo ',"lapOverrides":{'; $v = ''; foreach ($circuitPayload->lapOverrides as $lapKey => $lapData) { diff --git a/scripts/editor.js b/scripts/editor.js index 438755f5..42036c84 100755 --- a/scripts/editor.js +++ b/scripts/editor.js @@ -3415,6 +3415,10 @@ function applyColorSelector() { document.getElementById("button-bgcolor").style.backgroundColor = "rgb("+bgColor.r+","+bgColor.g+","+bgColor.b+")"; document.body.style.backgroundColor = "rgb("+bgColor.r+","+bgColor.g+","+bgColor.b+")"; } +function initOverrideSelector() { + var editorTool = editorTools.checkpoints; + document.getElementById("lapoverride-opener").style.display = editorTool && !editorTool.data.type ? "block":"none"; +} function showMusicSelector() { var $music = document.getElementById("music-selector"); document.body.removeChild($music); @@ -6098,6 +6102,7 @@ var commonTools = { applyMusicSelector(); document.body.classList.add("setting-preview"); applyColorSelector(); + initOverrideSelector(); }, "click" : function() { },