@drincs/pixi-vn 0.6.3 → 0.6.5
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/README.md +8 -5
- package/dist/LabelProps-CFV-zRjG.d.ts +113 -0
- package/dist/LabelProps-CmRpvUJm.d.mts +113 -0
- package/dist/classes/CharacterBaseModel.js +42 -33
- package/dist/classes/CharacterBaseModel.js.map +1 -1
- package/dist/classes/CharacterBaseModel.mjs +42 -33
- package/dist/classes/CharacterBaseModel.mjs.map +1 -1
- package/dist/classes/ChoiceMenuOption.d.mts +68 -8
- package/dist/classes/ChoiceMenuOption.d.ts +68 -8
- package/dist/classes/ChoiceMenuOption.js +119 -53
- package/dist/classes/ChoiceMenuOption.js.map +1 -1
- package/dist/classes/ChoiceMenuOption.mjs +119 -53
- package/dist/classes/ChoiceMenuOption.mjs.map +1 -1
- package/dist/classes/CloseLabel.d.mts +2 -2
- package/dist/classes/CloseLabel.d.ts +2 -2
- package/dist/classes/CloseLabel.js +53 -17
- package/dist/classes/CloseLabel.js.map +1 -1
- package/dist/classes/CloseLabel.mjs +53 -17
- package/dist/classes/CloseLabel.mjs.map +1 -1
- package/dist/classes/Label.d.mts +4 -72
- package/dist/classes/Label.d.ts +4 -72
- package/dist/classes/Label.js +50 -16
- package/dist/classes/Label.js.map +1 -1
- package/dist/classes/Label.mjs +50 -16
- package/dist/classes/Label.mjs.map +1 -1
- package/dist/classes/StoredClassModel.js +42 -33
- package/dist/classes/StoredClassModel.js.map +1 -1
- package/dist/classes/StoredClassModel.mjs +42 -33
- package/dist/classes/StoredClassModel.mjs.map +1 -1
- package/dist/classes/canvas/CanvasContainer.js +2 -2
- package/dist/classes/canvas/CanvasContainer.js.map +1 -1
- package/dist/classes/canvas/CanvasContainer.mjs +2 -2
- package/dist/classes/canvas/CanvasContainer.mjs.map +1 -1
- package/dist/classes/canvas/CanvasImage.js +2 -2
- package/dist/classes/canvas/CanvasImage.js.map +1 -1
- package/dist/classes/canvas/CanvasImage.mjs +2 -2
- package/dist/classes/canvas/CanvasImage.mjs.map +1 -1
- package/dist/classes/canvas/CanvasSprite.js +2 -2
- package/dist/classes/canvas/CanvasSprite.js.map +1 -1
- package/dist/classes/canvas/CanvasSprite.mjs +2 -2
- package/dist/classes/canvas/CanvasSprite.mjs.map +1 -1
- package/dist/classes/canvas/CanvasText.js +2 -2
- package/dist/classes/canvas/CanvasText.js.map +1 -1
- package/dist/classes/canvas/CanvasText.mjs +2 -2
- package/dist/classes/canvas/CanvasText.mjs.map +1 -1
- package/dist/classes/canvas/index.js +2 -2
- package/dist/classes/canvas/index.js.map +1 -1
- package/dist/classes/canvas/index.mjs +2 -2
- package/dist/classes/canvas/index.mjs.map +1 -1
- package/dist/classes/index.d.mts +2 -2
- package/dist/classes/index.d.ts +2 -2
- package/dist/classes/index.js +119 -53
- package/dist/classes/index.js.map +1 -1
- package/dist/classes/index.mjs +119 -53
- package/dist/classes/index.mjs.map +1 -1
- package/dist/classes/ticker/FadeAlphaTicker.js +42 -33
- package/dist/classes/ticker/FadeAlphaTicker.js.map +1 -1
- package/dist/classes/ticker/FadeAlphaTicker.mjs +42 -33
- package/dist/classes/ticker/FadeAlphaTicker.mjs.map +1 -1
- package/dist/classes/ticker/MoveTicker.d.mts +1 -0
- package/dist/classes/ticker/MoveTicker.d.ts +1 -0
- package/dist/classes/ticker/MoveTicker.js +42 -33
- package/dist/classes/ticker/MoveTicker.js.map +1 -1
- package/dist/classes/ticker/MoveTicker.mjs +42 -33
- package/dist/classes/ticker/MoveTicker.mjs.map +1 -1
- package/dist/classes/ticker/RotateTicker.d.mts +1 -0
- package/dist/classes/ticker/RotateTicker.d.ts +1 -0
- package/dist/classes/ticker/RotateTicker.js +42 -33
- package/dist/classes/ticker/RotateTicker.js.map +1 -1
- package/dist/classes/ticker/RotateTicker.mjs +42 -33
- package/dist/classes/ticker/RotateTicker.mjs.map +1 -1
- package/dist/classes/ticker/ZoomTicker.d.mts +1 -0
- package/dist/classes/ticker/ZoomTicker.d.ts +1 -0
- package/dist/classes/ticker/ZoomTicker.js +42 -33
- package/dist/classes/ticker/ZoomTicker.js.map +1 -1
- package/dist/classes/ticker/ZoomTicker.mjs +42 -33
- package/dist/classes/ticker/ZoomTicker.mjs.map +1 -1
- package/dist/classes/ticker/index.js +42 -33
- package/dist/classes/ticker/index.js.map +1 -1
- package/dist/classes/ticker/index.mjs +42 -33
- package/dist/classes/ticker/index.mjs.map +1 -1
- package/dist/constants.d.mts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/constants.js.map +1 -1
- package/dist/constants.mjs +1 -1
- package/dist/constants.mjs.map +1 -1
- package/dist/decorators/CanvasElementDecorator.js +2 -2
- package/dist/decorators/CanvasElementDecorator.js.map +1 -1
- package/dist/decorators/CanvasElementDecorator.mjs +2 -2
- package/dist/decorators/CanvasElementDecorator.mjs.map +1 -1
- package/dist/decorators/LabelDecorator.d.mts +3 -3
- package/dist/decorators/LabelDecorator.d.ts +3 -3
- package/dist/decorators/LabelDecorator.js +74 -50
- package/dist/decorators/LabelDecorator.js.map +1 -1
- package/dist/decorators/LabelDecorator.mjs +74 -50
- package/dist/decorators/LabelDecorator.mjs.map +1 -1
- package/dist/decorators/index.d.mts +2 -2
- package/dist/decorators/index.d.ts +2 -2
- package/dist/decorators/index.js +74 -50
- package/dist/decorators/index.js.map +1 -1
- package/dist/decorators/index.mjs +74 -50
- package/dist/decorators/index.mjs.map +1 -1
- package/dist/functions/CanvasUtility.js +2 -2
- package/dist/functions/CanvasUtility.js.map +1 -1
- package/dist/functions/CanvasUtility.mjs +2 -2
- package/dist/functions/CanvasUtility.mjs.map +1 -1
- package/dist/functions/DialogueUtility.d.mts +9 -9
- package/dist/functions/DialogueUtility.d.ts +9 -9
- package/dist/functions/DialogueUtility.js +184 -106
- package/dist/functions/DialogueUtility.js.map +1 -1
- package/dist/functions/DialogueUtility.mjs +184 -106
- package/dist/functions/DialogueUtility.mjs.map +1 -1
- package/dist/functions/FlagsUtility.js +42 -33
- package/dist/functions/FlagsUtility.js.map +1 -1
- package/dist/functions/FlagsUtility.mjs +42 -33
- package/dist/functions/FlagsUtility.mjs.map +1 -1
- package/dist/functions/GameUtility.js +42 -33
- package/dist/functions/GameUtility.js.map +1 -1
- package/dist/functions/GameUtility.mjs +42 -33
- package/dist/functions/GameUtility.mjs.map +1 -1
- package/dist/functions/ImageUtility.js +45 -36
- package/dist/functions/ImageUtility.js.map +1 -1
- package/dist/functions/ImageUtility.mjs +45 -36
- package/dist/functions/ImageUtility.mjs.map +1 -1
- package/dist/functions/SavesUtility.d.mts +4 -4
- package/dist/functions/SavesUtility.d.ts +4 -4
- package/dist/functions/SavesUtility.js +173 -111
- package/dist/functions/SavesUtility.js.map +1 -1
- package/dist/functions/SavesUtility.mjs +173 -111
- package/dist/functions/SavesUtility.mjs.map +1 -1
- package/dist/functions/TickerUtility.d.mts +2 -1
- package/dist/functions/TickerUtility.d.ts +2 -1
- package/dist/functions/TickerUtility.js +19 -15
- package/dist/functions/TickerUtility.js.map +1 -1
- package/dist/functions/TickerUtility.mjs +19 -15
- package/dist/functions/TickerUtility.mjs.map +1 -1
- package/dist/functions/index.d.mts +3 -3
- package/dist/functions/index.d.ts +3 -3
- package/dist/functions/index.js +197 -115
- package/dist/functions/index.js.map +1 -1
- package/dist/functions/index.mjs +197 -115
- package/dist/functions/index.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +325 -190
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +326 -191
- package/dist/index.mjs.map +1 -1
- package/dist/interface/IHistoryStep.d.mts +1 -1
- package/dist/interface/IHistoryStep.d.ts +1 -1
- package/dist/interface/ISaveData.d.mts +2 -2
- package/dist/interface/ISaveData.d.ts +2 -2
- package/dist/interface/LabelProps.d.mts +5 -0
- package/dist/interface/LabelProps.d.ts +5 -0
- package/dist/interface/LabelProps.js +4 -0
- package/dist/interface/LabelProps.js.map +1 -0
- package/dist/interface/LabelProps.mjs +3 -0
- package/dist/interface/LabelProps.mjs.map +1 -0
- package/dist/interface/export/ExportedStep.d.mts +2 -2
- package/dist/interface/export/ExportedStep.d.ts +2 -2
- package/dist/interface/export/index.d.mts +2 -2
- package/dist/interface/export/index.d.ts +2 -2
- package/dist/interface/index.d.mts +4 -4
- package/dist/interface/index.d.ts +4 -4
- package/dist/labels/BaseCanvasElementTestLabel.d.mts +2 -2
- package/dist/labels/BaseCanvasElementTestLabel.d.ts +2 -2
- package/dist/labels/BaseCanvasElementTestLabel.js +175 -111
- package/dist/labels/BaseCanvasElementTestLabel.js.map +1 -1
- package/dist/labels/BaseCanvasElementTestLabel.mjs +176 -112
- package/dist/labels/BaseCanvasElementTestLabel.mjs.map +1 -1
- package/dist/labels/CanvasEventsTestLabel.d.mts +3 -6
- package/dist/labels/CanvasEventsTestLabel.d.ts +3 -6
- package/dist/labels/CanvasEventsTestLabel.js +186 -128
- package/dist/labels/CanvasEventsTestLabel.js.map +1 -1
- package/dist/labels/CanvasEventsTestLabel.mjs +187 -129
- package/dist/labels/CanvasEventsTestLabel.mjs.map +1 -1
- package/dist/labels/CustomTickerCanvasElementTestLabel.d.mts +2 -2
- package/dist/labels/CustomTickerCanvasElementTestLabel.d.ts +2 -2
- package/dist/labels/CustomTickerCanvasElementTestLabel.js +166 -108
- package/dist/labels/CustomTickerCanvasElementTestLabel.js.map +1 -1
- package/dist/labels/CustomTickerCanvasElementTestLabel.mjs +166 -108
- package/dist/labels/CustomTickerCanvasElementTestLabel.mjs.map +1 -1
- package/dist/labels/ImagesAnimationsTestLabel.d.mts +2 -2
- package/dist/labels/ImagesAnimationsTestLabel.d.ts +2 -2
- package/dist/labels/ImagesAnimationsTestLabel.js +253 -147
- package/dist/labels/ImagesAnimationsTestLabel.js.map +1 -1
- package/dist/labels/ImagesAnimationsTestLabel.mjs +253 -147
- package/dist/labels/ImagesAnimationsTestLabel.mjs.map +1 -1
- package/dist/labels/MarkdownTest.d.mts +2 -2
- package/dist/labels/MarkdownTest.d.ts +2 -2
- package/dist/labels/MarkdownTest.js +166 -108
- package/dist/labels/MarkdownTest.js.map +1 -1
- package/dist/labels/MarkdownTest.mjs +166 -108
- package/dist/labels/MarkdownTest.mjs.map +1 -1
- package/dist/labels/StartLabel.d.mts +2 -2
- package/dist/labels/StartLabel.d.ts +2 -2
- package/dist/labels/StartLabel.js +316 -184
- package/dist/labels/StartLabel.js.map +1 -1
- package/dist/labels/StartLabel.mjs +317 -185
- package/dist/labels/StartLabel.mjs.map +1 -1
- package/dist/labels/StepLabelTest.d.mts +9 -0
- package/dist/labels/StepLabelTest.d.ts +9 -0
- package/dist/labels/StepLabelTest.js +2758 -0
- package/dist/labels/StepLabelTest.js.map +1 -0
- package/dist/labels/StepLabelTest.mjs +2752 -0
- package/dist/labels/StepLabelTest.mjs.map +1 -0
- package/dist/labels/TestConstant.js +43 -34
- package/dist/labels/TestConstant.js.map +1 -1
- package/dist/labels/TestConstant.mjs +43 -34
- package/dist/labels/TestConstant.mjs.map +1 -1
- package/dist/labels/index.d.mts +2 -2
- package/dist/labels/index.d.ts +2 -2
- package/dist/labels/index.js +316 -184
- package/dist/labels/index.js.map +1 -1
- package/dist/labels/index.mjs +317 -185
- package/dist/labels/index.mjs.map +1 -1
- package/dist/managers/StepManager.d.mts +6 -5
- package/dist/managers/StepManager.d.ts +6 -5
- package/dist/managers/StepManager.js +163 -105
- package/dist/managers/StepManager.js.map +1 -1
- package/dist/managers/StepManager.mjs +163 -105
- package/dist/managers/StepManager.mjs.map +1 -1
- package/dist/managers/WindowManager.js +2 -2
- package/dist/managers/WindowManager.js.map +1 -1
- package/dist/managers/WindowManager.mjs +2 -2
- package/dist/managers/WindowManager.mjs.map +1 -1
- package/dist/managers/index.d.mts +2 -2
- package/dist/managers/index.d.ts +2 -2
- package/dist/managers/index.js +163 -105
- package/dist/managers/index.js.map +1 -1
- package/dist/managers/index.mjs +163 -105
- package/dist/managers/index.mjs.map +1 -1
- package/dist/types/ChoiceMenuOptionsType.d.mts +2 -2
- package/dist/types/ChoiceMenuOptionsType.d.ts +2 -2
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +6 -6
package/dist/classes/Label.mjs
CHANGED
|
@@ -1,6 +1,25 @@
|
|
|
1
1
|
import 'crypto-js/sha1';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
var __async = (__this, __arguments, generator) => {
|
|
4
|
+
return new Promise((resolve, reject) => {
|
|
5
|
+
var fulfilled = (value) => {
|
|
6
|
+
try {
|
|
7
|
+
step(generator.next(value));
|
|
8
|
+
} catch (e) {
|
|
9
|
+
reject(e);
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
var rejected = (value) => {
|
|
13
|
+
try {
|
|
14
|
+
step(generator.throw(value));
|
|
15
|
+
} catch (e) {
|
|
16
|
+
reject(e);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
20
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
21
|
+
});
|
|
22
|
+
};
|
|
4
23
|
function checkIfStepsIsEqual(step1, step2) {
|
|
5
24
|
return step1 === step2;
|
|
6
25
|
}
|
|
@@ -10,14 +29,15 @@ var Label = class {
|
|
|
10
29
|
/**
|
|
11
30
|
* @param id is the id of the label
|
|
12
31
|
* @param steps is the list of steps that the label will perform
|
|
13
|
-
* @param
|
|
14
|
-
* @param choiseIndex is the index of the choice that the label will perform
|
|
32
|
+
* @param props is the properties of the label
|
|
15
33
|
*/
|
|
16
|
-
constructor(id, steps,
|
|
34
|
+
constructor(id, steps, props) {
|
|
17
35
|
this._id = id;
|
|
18
36
|
this._steps = steps;
|
|
19
|
-
this.
|
|
20
|
-
this.
|
|
37
|
+
this._onStepStart = props == null ? void 0 : props.onStepStart;
|
|
38
|
+
this._onLoadStep = props == null ? void 0 : props.onLoadStep;
|
|
39
|
+
this._onStepEnd = props == null ? void 0 : props.onStepEnd;
|
|
40
|
+
this._choiseIndex = props == null ? void 0 : props.choiseIndex;
|
|
21
41
|
}
|
|
22
42
|
/**
|
|
23
43
|
* Get the id of the label. This variable is used in the system to get the label by id, {@link getLabelById}
|
|
@@ -54,18 +74,32 @@ var Label = class {
|
|
|
54
74
|
return res;
|
|
55
75
|
}
|
|
56
76
|
/**
|
|
57
|
-
*
|
|
77
|
+
* Is a function that will be executed in {@link Label#onStepStart} and when the user goes back to it or when the user laods a save file.
|
|
78
|
+
* @returns Promise<void> or void
|
|
79
|
+
*/
|
|
80
|
+
get onStepStart() {
|
|
81
|
+
return (stepIndex, label) => __async(this, null, function* () {
|
|
82
|
+
if (this._onLoadStep) {
|
|
83
|
+
yield this._onLoadStep(stepIndex, label);
|
|
84
|
+
}
|
|
85
|
+
if (this._onStepStart) {
|
|
86
|
+
return yield this._onStepStart(stepIndex, label);
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Get the function that will be executed a old step is reloaded. A step is reloaded when the user goes back to it or when the user laods a save file.
|
|
92
|
+
* @returns Promise<void> or void
|
|
93
|
+
*/
|
|
94
|
+
get onLoadStep() {
|
|
95
|
+
return this._onLoadStep;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Is a function that will be executed when the step ends.
|
|
58
99
|
* @returns Promise<void> or void
|
|
59
|
-
* @example
|
|
60
|
-
* ```typescript
|
|
61
|
-
* newLabel("id", [], () => {
|
|
62
|
-
* Assets.load('path/to/image1.png')
|
|
63
|
-
* Assets.load('path/to/image2.png')
|
|
64
|
-
* })
|
|
65
|
-
* ```
|
|
66
100
|
*/
|
|
67
|
-
get
|
|
68
|
-
return this.
|
|
101
|
+
get onStepEnd() {
|
|
102
|
+
return this._onStepEnd;
|
|
69
103
|
}
|
|
70
104
|
get choiseIndex() {
|
|
71
105
|
return this._choiseIndex;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/functions/StepLabelUtility.ts","../../src/classes/Label.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/functions/StepLabelUtility.ts","../../src/classes/Label.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAmBO,SAAS,mBAAA,CAAoB,OAAiD,KAA0D,EAAA;AAC3I,EAAA,OAAO,KAAU,KAAA,KAAA,CAAA;AACrB,CAAA;;;ACUA,IAAqB,QAArB,MAA8C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAM1C,WAAA,CAAY,EAAiB,EAAA,KAAA,EAAwD,KAAuB,EAAA;AACxG,IAAA,IAAA,CAAK,GAAM,GAAA,EAAA,CAAA;AACX,IAAA,IAAA,CAAK,MAAS,GAAA,KAAA,CAAA;AACd,IAAA,IAAA,CAAK,eAAe,KAAO,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,KAAA,CAAA,WAAA,CAAA;AAC3B,IAAA,IAAA,CAAK,cAAc,KAAO,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,KAAA,CAAA,UAAA,CAAA;AAC1B,IAAA,IAAA,CAAK,aAAa,KAAO,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,KAAA,CAAA,SAAA,CAAA;AACzB,IAAA,IAAA,CAAK,eAAe,KAAO,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,KAAA,CAAA,WAAA,CAAA;AAAA,GAC/B;AAAA;AAAA;AAAA;AAAA,EAMA,IAAW,EAAkB,GAAA;AACzB,IAAA,OAAO,IAAK,CAAA,GAAA,CAAA;AAAA,GAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,IAAW,KAA4B,GAAA;AACnC,IAAI,IAAA,OAAO,IAAK,CAAA,MAAA,KAAW,UAAY,EAAA;AACnC,MAAA,OAAO,KAAK,MAAO,EAAA,CAAA;AAAA,KACvB;AACA,IAAA,OAAO,IAAK,CAAA,MAAA,CAAA;AAAA,GAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOO,4BAA4B,aAAgE,EAAA;AAC/F,IAAI,IAAA,aAAA,CAAc,WAAW,CAAG,EAAA;AAC5B,MAAO,OAAA,CAAA,CAAA;AAAA,KACX;AACA,IAAA,IAAI,GAAc,GAAA,CAAA,CAAA;AAClB,IAAc,aAAA,CAAA,OAAA,CAAQ,CAAC,IAAA,EAAM,KAAU,KAAA;AACnC,MAAA,IAAI,oBAAoB,IAAM,EAAA,IAAA,CAAK,KAAM,CAAA,KAAK,CAAC,CAAG,EAAA;AAC9C,QAAM,GAAA,GAAA,KAAA,CAAA;AAAA,OACV;AAAA,KACH,CAAA,CAAA;AACD,IAAO,OAAA,GAAA,CAAA;AAAA,GACX;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,IAAW,WAA0F,GAAA;AACjG,IAAO,OAAA,CAAO,WAAmB,KAAoB,KAAA,OAAA,CAAA,IAAA,EAAA,IAAA,EAAA,aAAA;AACjD,MAAA,IAAI,KAAK,WAAa,EAAA;AAClB,QAAM,MAAA,IAAA,CAAK,WAAY,CAAA,SAAA,EAAW,KAAK,CAAA,CAAA;AAAA,OAC3C;AACA,MAAA,IAAI,KAAK,YAAc,EAAA;AACnB,QAAA,OAAO,MAAM,IAAA,CAAK,YAAa,CAAA,SAAA,EAAW,KAAK,CAAA,CAAA;AAAA,OACnD;AAAA,KACJ,CAAA,CAAA;AAAA,GACJ;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,IAAW,UAAyF,GAAA;AAChG,IAAA,OAAO,IAAK,CAAA,WAAA,CAAA;AAAA,GAChB;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,IAAW,SAAwF,GAAA;AAC/F,IAAA,OAAO,IAAK,CAAA,UAAA,CAAA;AAAA,GAChB;AAAA,EAGA,IAAW,WAAkC,GAAA;AACzC,IAAA,OAAO,IAAK,CAAA,YAAA,CAAA;AAAA,GAChB;AACJ","file":"Label.mjs","sourcesContent":["import sha1 from 'crypto-js/sha1';\nimport { StepHistoryDataType } from \"../types/StepHistoryDataType\";\nimport { StepLabelType } from \"../types/StepLabelType\";\n\n/**\n * Convert StepLabel to StepHistoryData\n * @param step\n * @returns\n */\nexport function getStepSha1(step: StepLabelType): StepHistoryDataType {\n let sha1String = sha1(step.toString().toLocaleLowerCase())\n return sha1String.toString()\n}\n/**\n * Check if two steps are equal\n * @param step1\n * @param step2\n * @returns\n */\nexport function checkIfStepsIsEqual(step1: StepHistoryDataType | StepLabelType<any>, step2: StepHistoryDataType | StepLabelType<any>): boolean {\n return step1 === step2\n}\n","import { getLabelById } from \"../decorators\"\nimport { checkIfStepsIsEqual } from \"../functions/StepLabelUtility\"\nimport { LabelProps } from \"../interface\"\nimport { LabelIdType } from \"../types/LabelIdType\"\nimport { StepHistoryDataType } from \"../types/StepHistoryDataType\"\nimport { StepLabelType } from \"../types/StepLabelType\"\n\n/**\n * Label is a class that contains a list of steps, which will be performed as the game continues.\n * For Ren'py this is the equivalent of a label.\n * @example\n * ```typescript\n * const START_LABEL_ID = \"StartLabel\"\n * \n * export const startLabel = newLabel(START_LABEL_ID,\n * [\n * (props) => {\n * GameWindowManager.clear()\n * setDialogue({ character: liam, text: \"Which test do you want to perform?\" })\n * setChoiceMenuOptions([\n * new ChoiceMenuOption(\"Events Test\", eventsTestLabel),\n * new ChoiceMenuOption(\"Show Image Test\", showImageTest),\n * ])\n * },\n * (props) => GameStepManager.jumpLabel(START_LABEL_ID, props),\n * ]\n * )\n * \n * GameStepManager.callLabel(StartLabel)\n * ```\n */\nexport default class Label<T extends {} = {}> {\n /**\n * @param id is the id of the label\n * @param steps is the list of steps that the label will perform\n * @param props is the properties of the label\n */\n constructor(id: LabelIdType, steps: StepLabelType<T>[] | (() => StepLabelType<T>[]), props?: LabelProps<T>) {\n this._id = id\n this._steps = steps\n this._onStepStart = props?.onStepStart\n this._onLoadStep = props?.onLoadStep\n this._onStepEnd = props?.onStepEnd\n this._choiseIndex = props?.choiseIndex\n }\n\n private _id: LabelIdType\n /**\n * Get the id of the label. This variable is used in the system to get the label by id, {@link getLabelById}\n */\n public get id(): LabelIdType {\n return this._id\n }\n\n private _steps: StepLabelType<T>[] | (() => StepLabelType<T>[])\n /**\n * Get the steps of the label.\n * This class should be extended and the steps method should be overridden.\n * Every time you update this list will also be updated when the other game versions load.\n */\n public get steps(): StepLabelType<T>[] {\n if (typeof this._steps === \"function\") {\n return this._steps()\n }\n return this._steps\n }\n\n /**\n * Get the corresponding steps number\n * @param externalSteps\n * @returns Numer of corresponding steps, for example, if externalSteps is [ABC, DEF, GHI] and the steps of the label is [ABC, GHT], the result will be 1\n */\n public getCorrespondingStepsNumber(externalSteps: StepHistoryDataType[] | StepLabelType[]): number {\n if (externalSteps.length === 0) {\n return 0\n }\n let res: number = 0\n externalSteps.forEach((step, index) => {\n if (checkIfStepsIsEqual(step, this.steps[index])) {\n res = index\n }\n })\n return res\n }\n\n private _onStepStart: ((stepIndex: number, label: Label<T>) => void | Promise<void>) | undefined\n /**\n * Is a function that will be executed in {@link Label#onStepStart} and when the user goes back to it or when the user laods a save file.\n * @returns Promise<void> or void\n */\n public get onStepStart(): ((stepIndex: number, label: Label<T>) => void | Promise<void>) | undefined {\n return async (stepIndex: number, label: Label<T>) => {\n if (this._onLoadStep) {\n await this._onLoadStep(stepIndex, label)\n }\n if (this._onStepStart) {\n return await this._onStepStart(stepIndex, label)\n }\n }\n }\n\n private _onLoadStep: ((stepIndex: number, label: Label<T>) => void | Promise<void>) | undefined\n /**\n * Get the function that will be executed a old step is reloaded. A step is reloaded when the user goes back to it or when the user laods a save file.\n * @returns Promise<void> or void\n */\n public get onLoadStep(): ((stepIndex: number, label: Label<T>) => void | Promise<void>) | undefined {\n return this._onLoadStep\n }\n\n private _onStepEnd: ((stepIndex: number, label: Label<T>) => void | Promise<void>) | undefined\n /**\n * Is a function that will be executed when the step ends.\n * @returns Promise<void> or void\n */\n public get onStepEnd(): ((stepIndex: number, label: Label<T>) => void | Promise<void>) | undefined {\n return this._onStepEnd\n }\n\n private _choiseIndex: number | undefined\n public get choiseIndex(): number | undefined {\n return this._choiseIndex\n }\n}\n"]}
|
|
@@ -133,8 +133,6 @@ function getMemoryContainer(element) {
|
|
|
133
133
|
};
|
|
134
134
|
}
|
|
135
135
|
function setMemoryContainer(element, memory) {
|
|
136
|
-
memory.width && (element.width = memory.width);
|
|
137
|
-
memory.height && (element.height = memory.height);
|
|
138
136
|
memory.isRenderGroup && (element.isRenderGroup = memory.isRenderGroup);
|
|
139
137
|
memory.blendMode && (element.blendMode = memory.blendMode);
|
|
140
138
|
memory.tint && (element.tint = memory.tint);
|
|
@@ -167,6 +165,8 @@ function setMemoryContainer(element, memory) {
|
|
|
167
165
|
memory.interactive && (element.interactive = memory.interactive);
|
|
168
166
|
memory.interactiveChildren && (element.interactiveChildren = memory.interactiveChildren);
|
|
169
167
|
memory.hitArea && (element.hitArea = memory.hitArea);
|
|
168
|
+
memory.width && (element.width = memory.width);
|
|
169
|
+
memory.height && (element.height = memory.height);
|
|
170
170
|
}
|
|
171
171
|
function getTexture(imageUrl) {
|
|
172
172
|
return __async(this, null, function* () {
|
|
@@ -647,8 +647,9 @@ FadeAlphaTicker = __decorateClass([
|
|
|
647
647
|
], FadeAlphaTicker);
|
|
648
648
|
|
|
649
649
|
// src/functions/TickerUtility.ts
|
|
650
|
-
function updateTickerProgression(args, propertyName, progression) {
|
|
651
|
-
|
|
650
|
+
function updateTickerProgression(args, propertyName, progression, valueConvert) {
|
|
651
|
+
let limit = valueConvert && progression.limit ? valueConvert(progression.limit) : progression.limit;
|
|
652
|
+
if (args[propertyName] === void 0 || !progression || args[propertyName] === limit) {
|
|
652
653
|
return;
|
|
653
654
|
}
|
|
654
655
|
if (typeof args[propertyName] === "number") {
|
|
@@ -667,22 +668,25 @@ function updateTickerProgression(args, propertyName, progression) {
|
|
|
667
668
|
}
|
|
668
669
|
}
|
|
669
670
|
}
|
|
670
|
-
function getLinearProgression(number, progression) {
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
return
|
|
671
|
+
function getLinearProgression(number, progression, valueConvert) {
|
|
672
|
+
let limit = valueConvert && progression.limit ? valueConvert(progression.limit) : progression.limit;
|
|
673
|
+
let amt = valueConvert ? valueConvert(progression.amt) : progression.amt;
|
|
674
|
+
if (limit !== void 0) {
|
|
675
|
+
if (number > limit && amt > 0) {
|
|
676
|
+
return limit;
|
|
677
|
+
} else if (number < limit && amt < 0) {
|
|
678
|
+
return limit;
|
|
676
679
|
}
|
|
677
680
|
}
|
|
678
|
-
return number +
|
|
681
|
+
return number + amt;
|
|
679
682
|
}
|
|
680
|
-
function getExponentialProgression(number, progression) {
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
683
|
+
function getExponentialProgression(number, progression, valueConvert) {
|
|
684
|
+
let limit = valueConvert && progression.limit ? valueConvert(progression.limit) : progression.limit;
|
|
685
|
+
if (limit !== void 0) {
|
|
686
|
+
if (number > limit && progression.percentage > 0) {
|
|
687
|
+
return limit;
|
|
688
|
+
} else if (number < limit && progression.percentage < 0) {
|
|
689
|
+
return limit;
|
|
686
690
|
}
|
|
687
691
|
}
|
|
688
692
|
return number + number * progression.percentage;
|
|
@@ -695,15 +699,13 @@ var MoveTicker = class extends TickerBase {
|
|
|
695
699
|
let ySpeed = 1;
|
|
696
700
|
if (args.speed) {
|
|
697
701
|
if (typeof args.speed === "number") {
|
|
698
|
-
xSpeed = args.speed;
|
|
699
|
-
ySpeed = args.speed;
|
|
702
|
+
xSpeed = this.speedConvert(args.speed);
|
|
703
|
+
ySpeed = this.speedConvert(args.speed);
|
|
700
704
|
} else {
|
|
701
|
-
xSpeed = args.speed.x;
|
|
702
|
-
ySpeed = args.speed.y;
|
|
705
|
+
xSpeed = this.speedConvert(args.speed.x);
|
|
706
|
+
ySpeed = this.speedConvert(args.speed.y);
|
|
703
707
|
}
|
|
704
708
|
}
|
|
705
|
-
xSpeed /= 60;
|
|
706
|
-
ySpeed /= 60;
|
|
707
709
|
let destination = args.destination;
|
|
708
710
|
let tagToRemoveAfter2 = args.tagToRemoveAfter || [];
|
|
709
711
|
if (typeof tagToRemoveAfter2 === "string") {
|
|
@@ -743,7 +745,10 @@ var MoveTicker = class extends TickerBase {
|
|
|
743
745
|
}
|
|
744
746
|
});
|
|
745
747
|
if (args.speedProgression)
|
|
746
|
-
updateTickerProgression(args, "speed", args.speedProgression);
|
|
748
|
+
updateTickerProgression(args, "speed", args.speedProgression, this.speedConvert);
|
|
749
|
+
}
|
|
750
|
+
speedConvert(speed) {
|
|
751
|
+
return speed / 6;
|
|
747
752
|
}
|
|
748
753
|
};
|
|
749
754
|
MoveTicker = __decorateClass([
|
|
@@ -751,7 +756,7 @@ MoveTicker = __decorateClass([
|
|
|
751
756
|
], MoveTicker);
|
|
752
757
|
var RotateTicker = class extends TickerBase {
|
|
753
758
|
fn(ticker, args, tags, tickerId) {
|
|
754
|
-
let speed = (args.speed === void 0 ? 1 : args.speed)
|
|
759
|
+
let speed = this.speedConvert(args.speed === void 0 ? 1 : args.speed);
|
|
755
760
|
let clockwise = args.clockwise === void 0 ? true : args.clockwise;
|
|
756
761
|
let tagToRemoveAfter2 = args.tagToRemoveAfter || [];
|
|
757
762
|
if (typeof tagToRemoveAfter2 === "string") {
|
|
@@ -779,7 +784,10 @@ var RotateTicker = class extends TickerBase {
|
|
|
779
784
|
}
|
|
780
785
|
});
|
|
781
786
|
if (args.speedProgression)
|
|
782
|
-
updateTickerProgression(args, "speed", args.speedProgression);
|
|
787
|
+
updateTickerProgression(args, "speed", args.speedProgression, this.speedConvert);
|
|
788
|
+
}
|
|
789
|
+
speedConvert(speed) {
|
|
790
|
+
return speed / 60;
|
|
783
791
|
}
|
|
784
792
|
};
|
|
785
793
|
RotateTicker = __decorateClass([
|
|
@@ -791,15 +799,13 @@ var ZoomTicker = class extends TickerBase {
|
|
|
791
799
|
let ySpeed = 0.1;
|
|
792
800
|
if (args.speed) {
|
|
793
801
|
if (typeof args.speed === "number") {
|
|
794
|
-
xSpeed = args.speed;
|
|
795
|
-
ySpeed = args.speed;
|
|
802
|
+
xSpeed = this.speedConvert(args.speed);
|
|
803
|
+
ySpeed = this.speedConvert(args.speed);
|
|
796
804
|
} else {
|
|
797
|
-
xSpeed = args.speed.x;
|
|
798
|
-
ySpeed = args.speed.y;
|
|
805
|
+
xSpeed = this.speedConvert(args.speed.x);
|
|
806
|
+
ySpeed = this.speedConvert(args.speed.y);
|
|
799
807
|
}
|
|
800
808
|
}
|
|
801
|
-
xSpeed /= 60;
|
|
802
|
-
ySpeed /= 60;
|
|
803
809
|
let tagToRemoveAfter2 = args.tagToRemoveAfter || [];
|
|
804
810
|
if (typeof tagToRemoveAfter2 === "string") {
|
|
805
811
|
tagToRemoveAfter2 = [tagToRemoveAfter2];
|
|
@@ -866,7 +872,10 @@ var ZoomTicker = class extends TickerBase {
|
|
|
866
872
|
}
|
|
867
873
|
});
|
|
868
874
|
if (args.speedProgression)
|
|
869
|
-
updateTickerProgression(args, "speed", args.speedProgression);
|
|
875
|
+
updateTickerProgression(args, "speed", args.speedProgression, this.speedConvert);
|
|
876
|
+
}
|
|
877
|
+
speedConvert(speed) {
|
|
878
|
+
return speed / 60;
|
|
870
879
|
}
|
|
871
880
|
onEndOfTicker(tag, tickerId, _element, tagToRemoveAfter2) {
|
|
872
881
|
GameWindowManager.onEndOfTicker(tag, this, tagToRemoveAfter2, tickerId);
|