@rb-games/core 0.1.5 → 0.2.0
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/CHANGELOG.md +13 -0
- package/dist/helpers/index.js +1 -1
- package/dist/plugins/index.d.ts +1 -1
- package/dist/plugins/index.d.ts.map +1 -1
- package/dist/plugins/index.js +2 -515
- package/dist/plugins/index.js.map +1 -1
- package/dist/plugins/language/I18NextPlugin.types.d.ts +2 -2
- package/dist/state-machine/StateMachine.d.ts +18 -0
- package/dist/state-machine/StateMachine.d.ts.map +1 -1
- package/dist/state-machine/index.js +37 -10
- package/dist/state-machine/index.js.map +1 -1
- package/dist/utils/index.js +1 -1
- package/package.json +1 -1
- package/dist/plugins/service/ServiceAdapter.d.ts +0 -88
- package/dist/plugins/service/ServiceAdapter.d.ts.map +0 -1
- package/dist/plugins/service/ServiceEventHelper.d.ts +0 -6
- package/dist/plugins/service/ServiceEventHelper.d.ts.map +0 -1
- package/dist/plugins/service/ServicePlugin.d.ts +0 -135
- package/dist/plugins/service/ServicePlugin.d.ts.map +0 -1
- package/dist/plugins/service/ServicePlugin.types.d.ts +0 -14
- package/dist/plugins/service/ServicePlugin.types.d.ts.map +0 -1
- package/dist/plugins/service/adapters/DevAuthAdapter.d.ts +0 -56
- package/dist/plugins/service/adapters/DevAuthAdapter.d.ts.map +0 -1
- package/dist/plugins/service/adapters/RGSAdapter.d.ts +0 -82
- package/dist/plugins/service/adapters/RGSAdapter.d.ts.map +0 -1
- package/dist/plugins/service/adapters/index.d.ts +0 -7
- package/dist/plugins/service/adapters/index.d.ts.map +0 -1
- package/dist/plugins/service/adapters/resolvePublicIp.d.ts +0 -10
- package/dist/plugins/service/adapters/resolvePublicIp.d.ts.map +0 -1
- package/dist/plugins/service/index.d.ts +0 -10
- package/dist/plugins/service/index.d.ts.map +0 -1
- package/dist/plugins/service/types/api.types.d.ts +0 -299
- package/dist/plugins/service/types/api.types.d.ts.map +0 -1
- package/dist/plugins/service/types/index.d.ts +0 -6
- package/dist/plugins/service/types/index.d.ts.map +0 -1
|
@@ -10,8 +10,8 @@ import { PluginConfig } from '../Plugin.types';
|
|
|
10
10
|
*
|
|
11
11
|
* Source files are split and merged at build/dev time by the game's
|
|
12
12
|
* `vite/mergeLocalesPlugin.ts` (wired from `vite.config.ts`):
|
|
13
|
-
* - `packages/modules/slot-svelte-ui/locales` → shared `ui.*`
|
|
14
|
-
* - `packages/modules/slot/locales` →
|
|
13
|
+
* - `packages/modules/slot-svelte-ui/locales` → shared `ui.*` and `info.rules.*`
|
|
14
|
+
* - `packages/modules/slot/locales` → kernel `messages.*` (resume / replay / autoplay)
|
|
15
15
|
* - `games/<game>/locales` → game-specific `{game-id}.info.*` and optional `core.*`
|
|
16
16
|
*
|
|
17
17
|
* @example
|
|
@@ -97,6 +97,24 @@ export declare class StateMachine<TData = any> extends EventEmitter<StateMachine
|
|
|
97
97
|
* ```
|
|
98
98
|
*/
|
|
99
99
|
getAllScopes(): Record<ScopeKey, any>;
|
|
100
|
+
/**
|
|
101
|
+
* Re-resolve current-state scopes and emit `scope:update` / `scope:update:${name}`
|
|
102
|
+
* without transitioning. Use when `data` changed and listeners must refresh
|
|
103
|
+
* (resolvers already read `ctx.data`).
|
|
104
|
+
*
|
|
105
|
+
* @param scopeName - If set, only that scope is emitted. Missing names warn and no-op.
|
|
106
|
+
*
|
|
107
|
+
* @fires scope:update
|
|
108
|
+
* @fires scope:update:${scopeName}
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* ```typescript
|
|
112
|
+
* machine.notifyScopes();
|
|
113
|
+
* machine.notifyScopes();
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
notifyScopes(scopeName?: ScopeKey): void;
|
|
117
|
+
private emitScopeUpdate;
|
|
100
118
|
/**
|
|
101
119
|
* Transition to a new state within the current mode
|
|
102
120
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StateMachine.d.ts","sourceRoot":"","sources":["../../state-machine/StateMachine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"StateMachine.d.ts","sourceRoot":"","sources":["../../state-machine/StateMachine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAGvC,OAAO,KAAK,EACV,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EAIjB,kBAAkB,EACnB,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,qBAAa,YAAY,CAAC,KAAK,GAAG,GAAG,CAAE,SAAQ,YAAY,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;IACpF,OAAO,CAAC,MAAM,CAA4B;IAC1C,OAAO,CAAC,OAAO,CAAsB;IACrC,OAAO,CAAC,eAAe,CAAS;IAChC,OAAO,CAAC,kBAAkB,CAA6C;gBAE3D,MAAM,EAAE,kBAAkB,CAAC,KAAK,CAAC;IA0B7C;;OAEG;IACH,IAAI,KAAK,IAAI,QAAQ,CAEpB;IAED;;OAEG;IACH,IAAI,IAAI,IAAI,OAAO,CAElB;IAED;;OAEG;IACH,IAAI,IAAI,IAAI,KAAK,CAEhB;IAED;;;;OAIG;IACH,UAAU,IAAI,QAAQ,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAI3C;;;;;;;;;;;;OAYG;IACH,UAAU,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,KAAK,GAAG,IAAI,GAAG,IAAI;IAOxD,OAAO,CAAC,sBAAsB;IA0D9B,OAAO,CAAC,gBAAgB;IAoBxB,OAAO,CAAC,YAAY;IAOpB;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,SAAS,EAAE,QAAQ,GAAG,GAAG;IAMlC;;;;;;;;;;;OAWG;IACH,YAAY,IAAI,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC;IAKrC;;;;;;;;;;;;;;;OAeG;IACH,YAAY,CAAC,SAAS,CAAC,EAAE,QAAQ,GAAG,IAAI;IAiBxC,OAAO,CAAC,eAAe;IAKvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkCG;IACG,UAAU,CAAC,WAAW,EAAE,QAAQ,EAAE,OAAO,GAAE,iBAAsB,GAAG,OAAO,CAAC,OAAO,CAAC;IAkF1F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACG,UAAU,CAAC,UAAU,EAAE,OAAO,EAAE,YAAY,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;IAqEhF;;;;;;;;;;;;OAYG;IACH,GAAG,CAAC,WAAW,EAAE,QAAQ,GAAG,OAAO;IAKnC;;;;;;;;;;;;;;OAcG;IACG,QAAQ,CAAC,WAAW,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;YAKzC,WAAW;IAwBzB;;;;;;;;;;;;OAYG;IACH,EAAE,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO;IAI5B;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO;IAI9B;;;;;;;;;;;OAWG;IACH,KAAK,IAAI,IAAI;IAab;;;;;;;;;OASG;IACH,OAAO,IAAI,IAAI;CAIhB"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getLogger } from '../chunk-C45KDREE.js';
|
|
1
2
|
import { __commonJS, __toESM } from '../chunk-G3PMV62Z.js';
|
|
2
3
|
import { EventEmitter } from 'pixi.js';
|
|
3
4
|
|
|
@@ -1746,6 +1747,40 @@ var StateMachine = class extends EventEmitter {
|
|
|
1746
1747
|
const resolvedState = this.resolveStateDefinition(this.context.currentState);
|
|
1747
1748
|
return this.resolveScopeData(resolvedState.scopes);
|
|
1748
1749
|
}
|
|
1750
|
+
/**
|
|
1751
|
+
* Re-resolve current-state scopes and emit `scope:update` / `scope:update:${name}`
|
|
1752
|
+
* without transitioning. Use when `data` changed and listeners must refresh
|
|
1753
|
+
* (resolvers already read `ctx.data`).
|
|
1754
|
+
*
|
|
1755
|
+
* @param scopeName - If set, only that scope is emitted. Missing names warn and no-op.
|
|
1756
|
+
*
|
|
1757
|
+
* @fires scope:update
|
|
1758
|
+
* @fires scope:update:${scopeName}
|
|
1759
|
+
*
|
|
1760
|
+
* @example
|
|
1761
|
+
* ```typescript
|
|
1762
|
+
* machine.notifyScopes();
|
|
1763
|
+
* machine.notifyScopes();
|
|
1764
|
+
* ```
|
|
1765
|
+
*/
|
|
1766
|
+
notifyScopes(scopeName) {
|
|
1767
|
+
const scopes = this.getAllScopes();
|
|
1768
|
+
if (scopeName != null) {
|
|
1769
|
+
if (!(scopeName in scopes)) {
|
|
1770
|
+
getLogger("StateMachine").warn(`notifyScopes: scope "${scopeName}" not found`);
|
|
1771
|
+
return;
|
|
1772
|
+
}
|
|
1773
|
+
this.emitScopeUpdate(scopeName, scopes[scopeName]);
|
|
1774
|
+
return;
|
|
1775
|
+
}
|
|
1776
|
+
for (const [name, scopeData] of Object.entries(scopes)) {
|
|
1777
|
+
this.emitScopeUpdate(name, scopeData);
|
|
1778
|
+
}
|
|
1779
|
+
}
|
|
1780
|
+
emitScopeUpdate(scopeName, scopeData) {
|
|
1781
|
+
this.emit("scope:update", scopeName, scopeData, this.context);
|
|
1782
|
+
this.emit(`scope:update:${scopeName}`, scopeData, this.context);
|
|
1783
|
+
}
|
|
1749
1784
|
/**
|
|
1750
1785
|
* Transition to a new state within the current mode
|
|
1751
1786
|
*
|
|
@@ -1840,11 +1875,7 @@ var StateMachine = class extends EventEmitter {
|
|
|
1840
1875
|
if (!options.silent) {
|
|
1841
1876
|
this.emit("state:enter", targetState, this.context);
|
|
1842
1877
|
this.emit("state:change", fromState, targetState, this.context);
|
|
1843
|
-
|
|
1844
|
-
for (const [scopeName, scopeData] of Object.entries(scopes)) {
|
|
1845
|
-
this.emit("scope:update", scopeName, scopeData, this.context);
|
|
1846
|
-
this.emit(`scope:update:${scopeName}`, scopeData, this.context);
|
|
1847
|
-
}
|
|
1878
|
+
this.notifyScopes();
|
|
1848
1879
|
this.emit("transition:complete", fromState, targetState, this.context);
|
|
1849
1880
|
}
|
|
1850
1881
|
return true;
|
|
@@ -1934,11 +1965,7 @@ var StateMachine = class extends EventEmitter {
|
|
|
1934
1965
|
await toStateDef.onEnter(this.context);
|
|
1935
1966
|
}
|
|
1936
1967
|
this.emit("state:enter", targetState, this.context);
|
|
1937
|
-
|
|
1938
|
-
for (const [scopeName, scopeData] of Object.entries(scopes)) {
|
|
1939
|
-
this.emit("scope:update", scopeName, scopeData, this.context);
|
|
1940
|
-
this.emit(`scope:update:${scopeName}`, scopeData, this.context);
|
|
1941
|
-
}
|
|
1968
|
+
this.notifyScopes();
|
|
1942
1969
|
return true;
|
|
1943
1970
|
} catch (error) {
|
|
1944
1971
|
this.emit("error", error, this.context);
|