From e477d652f67c88a829cb0c8a16bbc1997cfc9f11 Mon Sep 17 00:00:00 2001 From: min Date: Sat, 6 Jun 2026 12:17:43 +0300 Subject: [PATCH] =?UTF-8?q?fix(studio):=20mainMenu.show=20=D0=BF=D0=BE?= =?UTF-8?q?=D0=B4=D1=85=D0=B2=D0=B0=D1=82=D1=8B=D0=B2=D0=B0=D0=B5=D1=82=20?= =?UTF-8?q?opts.onPlay/onShow/onHide=20(=D0=BF=D0=BE=D1=80=D1=82)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.8 --- src/editor/engine/ScriptSandboxWorker.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/editor/engine/ScriptSandboxWorker.js b/src/editor/engine/ScriptSandboxWorker.js index 067b2b9..298ea6d 100644 --- a/src/editor/engine/ScriptSandboxWorker.js +++ b/src/editor/engine/ScriptSandboxWorker.js @@ -2593,6 +2593,10 @@ const game = { opts = opts && typeof opts === 'object' ? opts : {}; this._opts = opts; this._active = true; + // Колбэки можно передавать прямо в опциях show({ onPlay, onShow, onHide }). + if (typeof opts.onPlay === 'function') this._onPlay.push(opts.onPlay); + if (typeof opts.onShow === 'function') this._onShow.push(opts.onShow); + if (typeof opts.onHide === 'function') this._onHide.push(opts.onHide); // 1) Заблокировать управление игроком (наблюдатель). _send('player.setInputBlocked', { blocked: true }); game.hud.setVisible(false);