diff --git a/src/engine/ScriptSandboxWorker.js b/src/engine/ScriptSandboxWorker.js index 093f1c5..d09333a 100644 --- a/src/engine/ScriptSandboxWorker.js +++ b/src/engine/ScriptSandboxWorker.js @@ -2305,6 +2305,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); _send('player.setInputBlocked', { blocked: true }); game.hud.setVisible(false); this._camCfg = opts.camera || { mode: 'orbit', center: { x: 0, y: 1, z: 0 }, radius: 6, height: 2, duration: 12 };