create-pixi-vn 1.5.1 → 1.5.2

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "create-pixi-vn",
3
3
  "description": "Create a new Pixi’VN project",
4
- "version": "1.5.1",
4
+ "version": "1.5.2",
5
5
  "type": "module",
6
6
  "license": "GPL-3.0",
7
7
  "author": "DRincs-Productions",
@@ -16,16 +16,16 @@
16
16
  "dependencies": {
17
17
  "@pixi/devtools": "^2.0.1",
18
18
  "@pixi/sound": "^6.0.1",
19
- "pixi.js": "^8.9.2"
19
+ "pixi.js": "^8.10.1"
20
20
  },
21
21
  "devDependencies": {
22
- "@drincs/pixi-vn": "^1.1.0",
22
+ "@drincs/pixi-vn": "^1.2.15",
23
23
  "@types/crypto-js": "^4.2.2",
24
24
  "crypto-js": "^4.2.0",
25
25
  "ts-node": "^10.9.2",
26
- "tsup": "^8.4.0",
26
+ "tsup": "^8.5.0",
27
27
  "typescript": "^5.8.3",
28
- "vitest": "^3.1.2"
28
+ "vitest": "^3.2.2"
29
29
  },
30
30
  "keywords": [
31
31
  "engine",
@@ -5,6 +5,7 @@ import PIXIVN, {
5
5
  HistoryManagerStatic,
6
6
  narration,
7
7
  NarrationManagerStatic,
8
+ RegisteredCharacters,
8
9
  sound,
9
10
  stepHistory,
10
11
  storage,
@@ -71,10 +72,13 @@ export namespace Game {
71
72
  NarrationManagerStatic._stepCounter = value;
72
73
  },
73
74
  getOpenedLabels: () => narration.openedLabels.length,
74
- addHistoryItem: (historyInfo, opstions) => {
75
- return stepHistory.add(historyInfo, opstions);
75
+ addHistoryItem: (historyInfo, options) => {
76
+ return stepHistory.add(historyInfo, options);
76
77
  },
77
78
  getCurrentStepsRunningNumber: () => NarrationManagerStatic.stepsRunning,
79
+ getCharacter: (id: string) => {
80
+ return RegisteredCharacters.get(id);
81
+ },
78
82
  // canvas
79
83
  onGoNextEnd: async () => {
80
84
  CanvasManagerStatic._tickersToCompleteOnStepEnd.tikersIds.forEach(({ id }) => {
@@ -130,7 +134,11 @@ export namespace Game {
130
134
  */
131
135
  export async function restoreGameState(data: GameState, navigate: (path: string) => void) {
132
136
  stepHistory.restore(data.historyData);
133
- await narration.restore(data.stepData, HistoryManagerStatic.lastHistoryStep);
137
+ const lastHistoryKey = stepHistory.lastKey;
138
+ if (typeof lastHistoryKey === "number") {
139
+ const historyItem = stepHistory.stepsInfoMap.get(lastHistoryKey) || null;
140
+ await narration.restore(data.stepData, historyItem);
141
+ }
134
142
  storage.restore(data.storageData);
135
143
  await canvas.restore(data.canvasData);
136
144
  sound.restore(data.soundData);