diff --git a/noname/library/element/button.js b/noname/library/element/button.js index 7bce289e9..4fcf2a866 100644 --- a/noname/library/element/button.js +++ b/noname/library/element/button.js @@ -23,7 +23,7 @@ export class Button extends HTMLDivElement { if (typeof type == 'function') button = type(item, type, position, noClick, button); else if (ui.create.buttonPresets[type]) button = ui.create.buttonPresets[type](item, type, position, noClick, button); if (button) { - Object.setPrototypeOf(button, Button.prototype); + Object.setPrototypeOf(button, (lib.element.Button || Button).prototype); if (!noClick) button.addEventListener(lib.config.touchscreen ? 'touchend' : 'click', ui.click.button); else { button.classList.add('noclick'); diff --git a/noname/library/element/card.js b/noname/library/element/card.js index 78d8a554c..02d8bb61e 100644 --- a/noname/library/element/card.js +++ b/noname/library/element/card.js @@ -21,7 +21,7 @@ export class Card extends HTMLDivElement { */ // @ts-ignore const card = ui.create.div('.card', position); - Object.setPrototypeOf(card, Card.prototype); + Object.setPrototypeOf(card, (lib.element.Card || Card).prototype); // @ts-ignore card._args = [position]; return card; diff --git a/noname/library/element/contents.js b/noname/library/element/contents.js index d322eab06..c46269f49 100644 --- a/noname/library/element/contents.js +++ b/noname/library/element/contents.js @@ -6,6 +6,9 @@ import { status as _status } from '../../status/index.js'; import { UI as ui } from '../../ui/index.js'; import { GNC as gnc } from '../../gnc/index.js'; +/** + * @type { SMap<((event: GameEventPromise, trigger: GameEventPromise, player: Player) => Promise)[]> } + */ export const Contents = { phase: [ async (event) => { diff --git a/noname/library/element/control.js b/noname/library/element/control.js index 20e6be099..0b9545620 100644 --- a/noname/library/element/control.js +++ b/noname/library/element/control.js @@ -22,7 +22,7 @@ export class Control extends HTMLDivElement { */ // @ts-ignore const control = ui.create.div('.control'); - Object.setPrototypeOf(control, Control.prototype); + Object.setPrototypeOf(control, (lib.element.Control || Control).prototype); ui.control.insertBefore(control, _status.createControl || ui.confirm); controls.forEach(argument => { if (argument == 'nozoom') return; diff --git a/noname/library/element/dialog.js b/noname/library/element/dialog.js index 5db38f405..5d8bcc999 100644 --- a/noname/library/element/dialog.js +++ b/noname/library/element/dialog.js @@ -38,7 +38,7 @@ export class Dialog extends HTMLDivElement { /** @type { this } */ // @ts-ignore const dialog = ui.create.div('.dialog'); - Object.setPrototypeOf(dialog, Dialog.prototype); + Object.setPrototypeOf(dialog, (lib.element.Dialog || Dialog).prototype); dialog.contentContainer = ui.create.div('.content-container', dialog); dialog.content = ui.create.div('.content', dialog.contentContainer); dialog.bar1 = ui.create.div('.bar.top', dialog); diff --git a/noname/library/element/player.js b/noname/library/element/player.js index 3c84f0a98..7db756764 100644 --- a/noname/library/element/player.js +++ b/noname/library/element/player.js @@ -23,7 +23,7 @@ export class Player extends HTMLDivElement { */ // @ts-ignore const player = ui.create.div('.player', position); - Object.setPrototypeOf(player, Player.prototype); + Object.setPrototypeOf(player, (lib.element.Player || Player).prototype); // @ts-ignore player._args = [position]; return player;