@energy8platform/shell 0.7.0 → 0.7.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/html.cjs.js +9 -5
- package/dist/html.cjs.js.map +1 -1
- package/dist/html.d.ts +5 -2
- package/dist/html.esm.js +9 -5
- package/dist/html.esm.js.map +1 -1
- package/dist/index.cjs.js +9 -5
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.esm.js +9 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/pixi.cjs.js +9 -5
- package/dist/pixi.cjs.js.map +1 -1
- package/dist/pixi.d.ts +5 -2
- package/dist/pixi.esm.js +9 -5
- package/dist/pixi.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/core/format.ts +8 -4
- package/src/core/types.ts +3 -0
- package/src/core/version.ts +1 -1
package/dist/pixi.d.ts
CHANGED
|
@@ -140,6 +140,9 @@ interface CurrencyConfig {
|
|
|
140
140
|
* trimmed down to this many places so small wins keep their significant digits (e.g. 0.0673)
|
|
141
141
|
* while round amounts stay compact (e.g. 0.30). Everything else is shown at exactly this many. */
|
|
142
142
|
minDecimals?: number;
|
|
143
|
+
/** Defaults to the platform convention: `{ thousands: ',', decimal: '.' }` → `€1,234.50`.
|
|
144
|
+
* Override only for a jurisdiction that requires another convention — a comma decimal reads
|
|
145
|
+
* as a thousands group to most players and inflates the perceived payout. */
|
|
143
146
|
separator?: {
|
|
144
147
|
thousands?: string;
|
|
145
148
|
decimal?: string;
|
|
@@ -630,7 +633,7 @@ declare class ShellController extends EventEmitter<ShellEvents> implements Shell
|
|
|
630
633
|
tokens: ShellTokens;
|
|
631
634
|
layout: ShellLayoutMode;
|
|
632
635
|
soundOn: boolean;
|
|
633
|
-
readonly engineVersion = "0.7.
|
|
636
|
+
readonly engineVersion = "0.7.1";
|
|
634
637
|
readonly actions: ShellActions;
|
|
635
638
|
private renderer;
|
|
636
639
|
private i18n;
|
|
@@ -775,7 +778,7 @@ interface I18n {
|
|
|
775
778
|
declare function createI18n(opts: I18nOptions): I18n;
|
|
776
779
|
|
|
777
780
|
/** The @energy8platform/shell package version, stamped into the game-info footer. */
|
|
778
|
-
declare const PACKAGE_VERSION = "0.7.
|
|
781
|
+
declare const PACKAGE_VERSION = "0.7.1";
|
|
779
782
|
|
|
780
783
|
/** A shell: the renderer-agnostic controller plus the surface facade (safeArea/barHeight/setVisible)
|
|
781
784
|
* an embedding host reads. `createShell`, `createGameShell` and `createPixiShell` all return this. */
|
package/dist/pixi.esm.js
CHANGED
|
@@ -402,15 +402,19 @@ function resolveTheme(theme = {}) {
|
|
|
402
402
|
* trailing zeros are trimmed down to (but never past) `minDecimals`, so small wins keep their
|
|
403
403
|
* significant digits. Balance / bet / prices stay fixed at `minDecimals`.
|
|
404
404
|
*
|
|
405
|
+
* Separators default to the platform convention — `.` decimal, `,` thousands (`€1,234.50`).
|
|
406
|
+
* A comma decimal is NOT safe as a default: players read "2,50" as 250 and believe they were
|
|
407
|
+
* paid far more than they were. Games that need another convention pass `currency.separator`.
|
|
408
|
+
*
|
|
405
409
|
* Example with `maxDecimals: 4, minDecimals: 2`:
|
|
406
|
-
* fixed → 0.0673 → 0
|
|
407
|
-
* variable → 0.0673 → 0
|
|
410
|
+
* fixed → 0.0673 → 0.07 0.3 → 0.30
|
|
411
|
+
* variable → 0.0673 → 0.0673 0.067 → 0.067 0.3 → 0.30 0 → 0.00
|
|
408
412
|
*/
|
|
409
413
|
function formatCurrency(value, currency, variableDecimals = false) {
|
|
410
414
|
const maxDecimals = currency.maxDecimals ?? 2;
|
|
411
415
|
const minDecimals = Math.max(0, Math.min(maxDecimals, currency.minDecimals ?? maxDecimals));
|
|
412
|
-
const thousands = currency.separator?.thousands ?? '
|
|
413
|
-
const decimal = currency.separator?.decimal ?? '
|
|
416
|
+
const thousands = currency.separator?.thousands ?? ',';
|
|
417
|
+
const decimal = currency.separator?.decimal ?? '.';
|
|
414
418
|
const safe = Number.isFinite(value) ? value : 0;
|
|
415
419
|
// fixed callers round at minDecimals; variable callers round at maxDecimals then trim back down.
|
|
416
420
|
const places = variableDecimals ? maxDecimals : minDecimals;
|
|
@@ -1688,7 +1692,7 @@ class KeyboardController {
|
|
|
1688
1692
|
|
|
1689
1693
|
// AUTO-GENERATED by scripts/gen-version.mjs — do not edit. Mirrors package.json "version".
|
|
1690
1694
|
/** The @energy8platform/shell package version, stamped into the game-info footer. */
|
|
1691
|
-
const PACKAGE_VERSION = '0.7.
|
|
1695
|
+
const PACKAGE_VERSION = '0.7.1';
|
|
1692
1696
|
|
|
1693
1697
|
/** Apply defaults to the raw config (the mount target lives on the renderer, not here). */
|
|
1694
1698
|
function resolveConfig(config) {
|