@open-slot-ui/pixi 0.5.1 → 0.6.1
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 +19 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +17 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -4061,6 +4061,25 @@ function mountHud(app, spec = {}, opts = {}) {
|
|
|
4061
4061
|
]
|
|
4062
4062
|
);
|
|
4063
4063
|
},
|
|
4064
|
+
shouldConfirmBuy: (cost) => ui.shouldConfirmBuy(cost),
|
|
4065
|
+
requestBuyFeature: (o) => {
|
|
4066
|
+
if (ui.isDisabled("buyFeature")) return;
|
|
4067
|
+
if (!ui.shouldConfirmBuy(o.cost)) {
|
|
4068
|
+
o.onConfirm();
|
|
4069
|
+
return;
|
|
4070
|
+
}
|
|
4071
|
+
const message = o.message ?? (o.name ? ui.t("openui.buyFeature.confirm", { name: ui.t(o.name), price: o.price ?? "" }) : "openui.buyFeature.message");
|
|
4072
|
+
ui.showNotice(
|
|
4073
|
+
[
|
|
4074
|
+
{ kind: "heading", id: "buy-title", text: o.title ?? "openui.buyFeature.title" },
|
|
4075
|
+
{ kind: "text", id: "buy-body", text: message }
|
|
4076
|
+
],
|
|
4077
|
+
[
|
|
4078
|
+
{ label: o.cancelLabel ?? "openui.cancel", variant: "secondary" },
|
|
4079
|
+
{ label: o.confirmLabel ?? "openui.confirm", variant: "primary", onSelect: o.onConfirm }
|
|
4080
|
+
]
|
|
4081
|
+
);
|
|
4082
|
+
},
|
|
4064
4083
|
showControls: () => pixi.setControlsVisible(true),
|
|
4065
4084
|
hideControls: () => pixi.setControlsVisible(false),
|
|
4066
4085
|
setControlsVisible: (v) => pixi.setControlsVisible(v),
|