fix(player): mainMenu.show подхватывает opts.onPlay/onShow/onHide (кнопка ИГРАТЬ не запускала игру)
show() игнорировал колбэки из опций — onPlay из mainMenu.show({onPlay}) не
регистрировался, кнопка ИГРАТЬ ничего не делала. Теперь опции-колбэки пушатся
в _onPlay/_onShow/_onHide.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
d08497ef3b
commit
3eee24ff48
@ -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 };
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user