@energy8platform/game-engine 0.14.3 → 0.14.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +24 -0
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.esm.js +24 -0
- package/dist/index.esm.js.map +1 -1
- package/dist/react.cjs.js +24 -0
- package/dist/react.cjs.js.map +1 -1
- package/dist/react.esm.js +24 -0
- package/dist/react.esm.js.map +1 -1
- package/dist/ui.cjs.js +24 -0
- package/dist/ui.cjs.js.map +1 -1
- package/dist/ui.d.ts +7 -0
- package/dist/ui.esm.js +24 -0
- package/dist/ui.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/ui/Modal.ts +29 -3
package/dist/index.cjs.js
CHANGED
|
@@ -4403,6 +4403,7 @@ class Modal extends pixi_js.Container {
|
|
|
4403
4403
|
_contentContainer;
|
|
4404
4404
|
_config;
|
|
4405
4405
|
_showing = false;
|
|
4406
|
+
_internalSetup = true;
|
|
4406
4407
|
/** Called when the modal is closed */
|
|
4407
4408
|
onClose;
|
|
4408
4409
|
constructor(config = {}) {
|
|
@@ -4424,11 +4425,34 @@ class Modal extends pixi_js.Container {
|
|
|
4424
4425
|
this._contentContainer = new pixi_js.Container();
|
|
4425
4426
|
this.addChild(this._contentContainer);
|
|
4426
4427
|
this.visible = false;
|
|
4428
|
+
this._internalSetup = false;
|
|
4427
4429
|
}
|
|
4428
4430
|
/** Content container — add your UI here */
|
|
4429
4431
|
get content() {
|
|
4430
4432
|
return this._contentContainer;
|
|
4431
4433
|
}
|
|
4434
|
+
/**
|
|
4435
|
+
* Override addChild so external children are routed to _contentContainer.
|
|
4436
|
+
* Enables `<modal><flexContainer>...</flexContainer></modal>` in React JSX.
|
|
4437
|
+
*/
|
|
4438
|
+
addChild(...children) {
|
|
4439
|
+
if (this._internalSetup) {
|
|
4440
|
+
return super.addChild(...children);
|
|
4441
|
+
}
|
|
4442
|
+
for (const child of children) {
|
|
4443
|
+
this._contentContainer.addChild(child);
|
|
4444
|
+
}
|
|
4445
|
+
return children[0];
|
|
4446
|
+
}
|
|
4447
|
+
removeChild(...children) {
|
|
4448
|
+
if (this._internalSetup) {
|
|
4449
|
+
return super.removeChild(...children);
|
|
4450
|
+
}
|
|
4451
|
+
for (const child of children) {
|
|
4452
|
+
this._contentContainer.removeChild(child);
|
|
4453
|
+
}
|
|
4454
|
+
return children[0];
|
|
4455
|
+
}
|
|
4432
4456
|
/** Whether the modal is currently showing */
|
|
4433
4457
|
get isShowing() {
|
|
4434
4458
|
return this._showing;
|