From e7b18afd1ab41c78b1d65052d852960644398d64 Mon Sep 17 00:00:00 2001 From: Jose Luis Date: Fri, 20 Mar 2026 17:40:09 +0100 Subject: [PATCH] fix: move game buttons into toolbar-right to prevent overlap Save Gadget and Back to World buttons were overlapping Export/Import. Now they are dynamically inserted into .toolbar-right when entering workshop mode, sitting inline with the other toolbar buttons. Co-Authored-By: Claude Opus 4.6 --- index.html | 6 +++--- js/world/gameMode.js | 24 +++++++++++++++++------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/index.html b/index.html index f4a1e80..213b1e9 100644 --- a/index.html +++ b/index.html @@ -7,9 +7,9 @@ - - - + + +
diff --git a/js/world/gameMode.js b/js/world/gameMode.js index c4f25b4..adeb6ed 100644 --- a/js/world/gameMode.js +++ b/js/world/gameMode.js @@ -300,9 +300,11 @@ function showWorldUI() { canvas.style.cursor = 'default'; } - // Show back-to-world button (hidden since we're IN world) + // Hide game buttons (we're IN world, not workshop) const backBtn = document.getElementById('back-to-world-btn'); if (backBtn) backBtn.style.display = 'none'; + const saveBtn = document.getElementById('save-gadget-btn'); + if (saveBtn) saveBtn.style.display = 'none'; } function hideWorldUI() { @@ -319,19 +321,27 @@ function showWorkshopUI() { canvas.style.cursor = 'default'; } - // Show back-to-world button and save-gadget button - const backBtn = document.getElementById('back-to-world-btn'); - if (backBtn) backBtn.style.display = 'flex'; + // Move game buttons into toolbar-right so they sit inline with Export/Import + const toolbarRight = document.querySelector('.toolbar-right'); const saveBtn = document.getElementById('save-gadget-btn'); - if (saveBtn) saveBtn.style.display = 'flex'; + const backBtn = document.getElementById('back-to-world-btn'); + if (toolbarRight && saveBtn) { + toolbarRight.insertBefore(saveBtn, toolbarRight.firstChild); + saveBtn.style.display = 'inline-block'; + } + if (toolbarRight && backBtn) { + toolbarRight.insertBefore(backBtn, toolbarRight.firstChild); + backBtn.style.display = 'inline-block'; + } } function hideWorkshopUI() { const toolbar = document.getElementById('toolbar'); if (toolbar) toolbar.style.display = 'none'; + // Hide game buttons and move them back out of toolbar const backBtn = document.getElementById('back-to-world-btn'); - if (backBtn) backBtn.style.display = 'none'; + if (backBtn) { backBtn.style.display = 'none'; document.body.insertBefore(backBtn, document.body.firstChild); } const saveBtn = document.getElementById('save-gadget-btn'); - if (saveBtn) saveBtn.style.display = 'none'; + if (saveBtn) { saveBtn.style.display = 'none'; document.body.insertBefore(saveBtn, document.body.firstChild); } }