@drincs/pixi-vn 0.5.2 → 0.5.4
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/classes/CharacterBaseModel.js +110 -112
- package/dist/classes/CharacterBaseModel.js.map +1 -1
- package/dist/classes/CharacterBaseModel.mjs +110 -112
- package/dist/classes/CharacterBaseModel.mjs.map +1 -1
- package/dist/classes/ChoiceMenuOption.d.mts +19 -7
- package/dist/classes/ChoiceMenuOption.d.ts +19 -7
- package/dist/classes/ChoiceMenuOption.js +1386 -7
- package/dist/classes/ChoiceMenuOption.js.map +1 -1
- package/dist/classes/ChoiceMenuOption.mjs +1386 -7
- package/dist/classes/ChoiceMenuOption.mjs.map +1 -1
- package/dist/classes/CloseLabel.d.mts +8 -3
- package/dist/classes/CloseLabel.d.ts +8 -3
- package/dist/classes/CloseLabel.js +44 -2
- package/dist/classes/CloseLabel.js.map +1 -1
- package/dist/classes/CloseLabel.mjs +41 -2
- package/dist/classes/CloseLabel.mjs.map +1 -1
- package/dist/classes/Label.d.mts +47 -21
- package/dist/classes/Label.d.ts +47 -21
- package/dist/classes/Label.js +36 -1
- package/dist/classes/Label.js.map +1 -1
- package/dist/classes/Label.mjs +36 -1
- package/dist/classes/Label.mjs.map +1 -1
- package/dist/classes/StoredClassModel.js +55 -57
- package/dist/classes/StoredClassModel.js.map +1 -1
- package/dist/classes/StoredClassModel.mjs +55 -57
- package/dist/classes/StoredClassModel.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 +125 -73
- package/dist/classes/index.js.map +1 -1
- package/dist/classes/index.mjs +125 -73
- package/dist/classes/index.mjs.map +1 -1
- package/dist/classes/ticker/TickerFadeAlpha.js +27 -27
- package/dist/classes/ticker/TickerFadeAlpha.js.map +1 -1
- package/dist/classes/ticker/TickerFadeAlpha.mjs +27 -27
- package/dist/classes/ticker/TickerFadeAlpha.mjs.map +1 -1
- package/dist/classes/ticker/TickerMove.js +57 -55
- package/dist/classes/ticker/TickerMove.js.map +1 -1
- package/dist/classes/ticker/TickerMove.mjs +57 -55
- package/dist/classes/ticker/TickerMove.mjs.map +1 -1
- package/dist/classes/ticker/TickerRotate.js +57 -55
- package/dist/classes/ticker/TickerRotate.js.map +1 -1
- package/dist/classes/ticker/TickerRotate.mjs +57 -55
- package/dist/classes/ticker/TickerRotate.mjs.map +1 -1
- package/dist/classes/ticker/index.js +17 -17
- package/dist/classes/ticker/index.js.map +1 -1
- package/dist/classes/ticker/index.mjs +17 -17
- 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/LabelDecorator.d.mts +13 -20
- package/dist/decorators/LabelDecorator.d.ts +13 -20
- package/dist/decorators/LabelDecorator.js +1388 -28
- package/dist/decorators/LabelDecorator.js.map +1 -1
- package/dist/decorators/LabelDecorator.mjs +1388 -25
- package/dist/decorators/LabelDecorator.mjs.map +1 -1
- package/dist/decorators/index.d.mts +4 -4
- package/dist/decorators/index.d.ts +4 -4
- package/dist/decorators/index.js +1385 -13
- package/dist/decorators/index.js.map +1 -1
- package/dist/decorators/index.mjs +1384 -13
- package/dist/decorators/index.mjs.map +1 -1
- package/dist/functions/DialogueUtility.d.mts +7 -7
- package/dist/functions/DialogueUtility.d.ts +7 -7
- package/dist/functions/DialogueUtility.js +97 -67
- package/dist/functions/DialogueUtility.js.map +1 -1
- package/dist/functions/DialogueUtility.mjs +97 -67
- package/dist/functions/DialogueUtility.mjs.map +1 -1
- package/dist/functions/FlagsUtility.js +55 -57
- package/dist/functions/FlagsUtility.js.map +1 -1
- package/dist/functions/FlagsUtility.mjs +55 -57
- package/dist/functions/FlagsUtility.mjs.map +1 -1
- package/dist/functions/GameUtility.js +55 -57
- package/dist/functions/GameUtility.js.map +1 -1
- package/dist/functions/GameUtility.mjs +55 -57
- package/dist/functions/GameUtility.mjs.map +1 -1
- package/dist/functions/ImageUtility.js +17 -17
- package/dist/functions/ImageUtility.js.map +1 -1
- package/dist/functions/ImageUtility.mjs +17 -17
- package/dist/functions/ImageUtility.mjs.map +1 -1
- package/dist/functions/SavesUtility.d.mts +2 -2
- package/dist/functions/SavesUtility.d.ts +2 -2
- package/dist/functions/SavesUtility.js +115 -143
- package/dist/functions/SavesUtility.js.map +1 -1
- package/dist/functions/SavesUtility.mjs +115 -143
- package/dist/functions/SavesUtility.mjs.map +1 -1
- package/dist/functions/StepLabelUtility.d.mts +0 -1
- package/dist/functions/StepLabelUtility.d.ts +0 -1
- package/dist/functions/index.d.mts +4 -4
- package/dist/functions/index.d.ts +4 -4
- package/dist/functions/index.js +98 -68
- package/dist/functions/index.js.map +1 -1
- package/dist/functions/index.mjs +98 -68
- package/dist/functions/index.mjs.map +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +361 -327
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +360 -327
- package/dist/index.mjs.map +1 -1
- package/dist/interface/{IDialogueHistory.d.mts → DialogueHistory.d.mts} +5 -5
- package/dist/interface/{IDialogueHistory.d.ts → DialogueHistory.d.ts} +5 -5
- package/dist/interface/{IDialogueHistory.js → DialogueHistory.js} +1 -1
- package/dist/interface/DialogueHistory.mjs +3 -0
- package/dist/interface/IHistoryStep.d.mts +2 -2
- package/dist/interface/IHistoryStep.d.ts +2 -2
- package/dist/interface/ISaveData.d.mts +2 -2
- package/dist/interface/ISaveData.d.ts +2 -2
- 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 +6 -6
- package/dist/interface/index.d.ts +6 -6
- package/dist/managers/StepManager.d.mts +12 -12
- package/dist/managers/StepManager.d.ts +12 -12
- package/dist/managers/StepManager.js +55 -81
- package/dist/managers/StepManager.js.map +1 -1
- package/dist/managers/StepManager.mjs +55 -81
- package/dist/managers/StepManager.mjs.map +1 -1
- package/dist/managers/WindowManager.d.mts +1 -1
- package/dist/managers/WindowManager.d.ts +1 -1
- package/dist/managers/index.d.mts +2 -2
- package/dist/managers/index.d.ts +2 -2
- package/dist/managers/index.js +114 -142
- package/dist/managers/index.js.map +1 -1
- package/dist/managers/index.mjs +114 -142
- package/dist/managers/index.mjs.map +1 -1
- package/dist/types/ChoiceMenuOptionsType.d.mts +3 -3
- package/dist/types/ChoiceMenuOptionsType.d.ts +3 -3
- package/dist/types/StepLabelType.d.mts +2 -3
- package/dist/types/StepLabelType.d.ts +2 -3
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +2 -2
- package/dist/interface/IDialogueHistory.mjs +0 -3
- /package/dist/interface/{IDialogueHistory.js.map → DialogueHistory.js.map} +0 -0
- /package/dist/interface/{IDialogueHistory.mjs.map → DialogueHistory.mjs.map} +0 -0
|
@@ -67,13 +67,31 @@ function checkIfStepsIsEqual(step1, step2) {
|
|
|
67
67
|
|
|
68
68
|
// src/classes/Label.ts
|
|
69
69
|
var Label = class {
|
|
70
|
+
/**
|
|
71
|
+
* @param id is the id of the label
|
|
72
|
+
* @param steps is the list of steps that the label will perform
|
|
73
|
+
* @param onStepRun is a function that will be executed before any step is executed, is useful for example to make sure all images used have been cached
|
|
74
|
+
* @param choiseIndex is the index of the choice that the label will perform
|
|
75
|
+
*/
|
|
76
|
+
constructor(id, steps, onStepRun, choiseIndex) {
|
|
77
|
+
this._id = id;
|
|
78
|
+
this._steps = steps;
|
|
79
|
+
this._onStepRun = onStepRun;
|
|
80
|
+
this._choiseIndex = choiseIndex;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Get the id of the label
|
|
84
|
+
*/
|
|
85
|
+
get id() {
|
|
86
|
+
return this._id;
|
|
87
|
+
}
|
|
70
88
|
/**
|
|
71
89
|
* Get the steps of the label.
|
|
72
90
|
* This class should be extended and the steps method should be overridden.
|
|
73
91
|
* Every time you update this list will also be updated when the other game versions load.
|
|
74
92
|
*/
|
|
75
93
|
get steps() {
|
|
76
|
-
|
|
94
|
+
return this._steps;
|
|
77
95
|
}
|
|
78
96
|
/**
|
|
79
97
|
* Get the corresponding steps number
|
|
@@ -92,45 +110,42 @@ var Label = class {
|
|
|
92
110
|
});
|
|
93
111
|
return res;
|
|
94
112
|
}
|
|
113
|
+
/**
|
|
114
|
+
* Get the function that will be executed before any step is executed, is useful for example to make sure all images used have been cached
|
|
115
|
+
* @returns Promise<void> or void
|
|
116
|
+
* @example
|
|
117
|
+
* ```typescript
|
|
118
|
+
* newLabel("id", [], () => {
|
|
119
|
+
* Assets.load('path/to/image1.png')
|
|
120
|
+
* Assets.load('path/to/image2.png')
|
|
121
|
+
* })
|
|
122
|
+
* ```
|
|
123
|
+
*/
|
|
124
|
+
get onStepRun() {
|
|
125
|
+
return this._onStepRun;
|
|
126
|
+
}
|
|
127
|
+
get choiseIndex() {
|
|
128
|
+
return this._choiseIndex;
|
|
129
|
+
}
|
|
95
130
|
};
|
|
96
131
|
|
|
97
132
|
// src/classes/CloseLabel.ts
|
|
133
|
+
var CLOSE_LABEL_ID = "__close-label-id__";
|
|
98
134
|
var CloseLabel = class extends Label {
|
|
135
|
+
constructor(choiseIndex) {
|
|
136
|
+
super(CLOSE_LABEL_ID, [], void 0, choiseIndex);
|
|
137
|
+
}
|
|
99
138
|
};
|
|
100
139
|
|
|
101
140
|
// src/decorators/LabelDecorator.ts
|
|
102
141
|
var registeredLabels = {};
|
|
103
|
-
function
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
console.error(`[Pixi'VN] Label ${labelName} not found`);
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
new labelType();
|
|
111
|
-
return labelType;
|
|
112
|
-
} catch (e) {
|
|
113
|
-
console.error(`[Pixi'VN] Error while getting Label ${labelName}`, e);
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
function getLabelInstanceByClassName(labelName) {
|
|
118
|
-
try {
|
|
119
|
-
let labelType = registeredLabels[labelName];
|
|
120
|
-
if (!labelType) {
|
|
121
|
-
console.error(`[Pixi'VN] Label ${labelName} not found`);
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
|
-
let label = new labelType();
|
|
125
|
-
let step = label.steps;
|
|
126
|
-
if (step.length = 0) {
|
|
127
|
-
console.warn(`[Pixi'VN] Label ${labelName} has no steps`);
|
|
128
|
-
}
|
|
129
|
-
return label;
|
|
130
|
-
} catch (e) {
|
|
131
|
-
console.error(`[Pixi'VN] Error while getting Label ${labelName}`, e);
|
|
142
|
+
function getLabelById(id) {
|
|
143
|
+
let label = registeredLabels[id];
|
|
144
|
+
if (!label) {
|
|
145
|
+
console.error(`[Pixi'VN] Label ${id} not found`);
|
|
132
146
|
return;
|
|
133
147
|
}
|
|
148
|
+
return label;
|
|
134
149
|
}
|
|
135
150
|
|
|
136
151
|
// src/decorators/CanvasElementDecorator.ts
|
|
@@ -1567,7 +1582,7 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1567
1582
|
*/
|
|
1568
1583
|
static get currentLabel() {
|
|
1569
1584
|
if (_GameStepManager.currentLabelId) {
|
|
1570
|
-
return
|
|
1585
|
+
return getLabelById(_GameStepManager.currentLabelId);
|
|
1571
1586
|
}
|
|
1572
1587
|
}
|
|
1573
1588
|
static get currentLabelStepIndex() {
|
|
@@ -1588,7 +1603,7 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1588
1603
|
return true;
|
|
1589
1604
|
} else {
|
|
1590
1605
|
this.openedLabels.forEach((item) => {
|
|
1591
|
-
let label =
|
|
1606
|
+
let label = getLabelById(item.label);
|
|
1592
1607
|
if (label && label.steps.length > item.currentStepIndex) {
|
|
1593
1608
|
return false;
|
|
1594
1609
|
}
|
|
@@ -1681,9 +1696,9 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1681
1696
|
* @param label The label to add to the history.
|
|
1682
1697
|
*/
|
|
1683
1698
|
static pushNewLabel(label) {
|
|
1684
|
-
let currentLabel =
|
|
1699
|
+
let currentLabel = getLabelById(label);
|
|
1685
1700
|
if (!currentLabel) {
|
|
1686
|
-
throw new Error(
|
|
1701
|
+
throw new Error(`[Pixi'VN] Label ${label} not found`);
|
|
1687
1702
|
}
|
|
1688
1703
|
_GameStepManager._openedLabels.push({
|
|
1689
1704
|
label,
|
|
@@ -1700,7 +1715,7 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1700
1715
|
return;
|
|
1701
1716
|
}
|
|
1702
1717
|
if (!_GameStepManager.currentLabel) {
|
|
1703
|
-
console.error("[Pixi'VN]
|
|
1718
|
+
console.error("[Pixi'VN] currentLabel not found");
|
|
1704
1719
|
return;
|
|
1705
1720
|
}
|
|
1706
1721
|
_GameStepManager._openedLabels.pop();
|
|
@@ -1772,7 +1787,7 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1772
1787
|
}
|
|
1773
1788
|
let currentLabel = _GameStepManager.currentLabel;
|
|
1774
1789
|
if (!currentLabel) {
|
|
1775
|
-
console.error("[Pixi'VN]
|
|
1790
|
+
console.error("[Pixi'VN] currentLabel not found");
|
|
1776
1791
|
return;
|
|
1777
1792
|
}
|
|
1778
1793
|
let n = currentLabel.steps.length;
|
|
@@ -1793,12 +1808,12 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1793
1808
|
/**
|
|
1794
1809
|
* Execute the label and add it to the history.
|
|
1795
1810
|
* Is a call function in Ren'Py.
|
|
1796
|
-
* @param label The label to execute
|
|
1811
|
+
* @param label The label to execute or the id of the label
|
|
1797
1812
|
* @param props The props to pass to the label.
|
|
1798
1813
|
* @returns StepLabelResultType or undefined.
|
|
1799
1814
|
* @example
|
|
1800
1815
|
* ```typescript
|
|
1801
|
-
* GameStepManager.callLabel(
|
|
1816
|
+
* GameStepManager.callLabel(startLabel, yourParams).then((result) => {
|
|
1802
1817
|
* if (result) {
|
|
1803
1818
|
* // your code
|
|
1804
1819
|
* }
|
|
@@ -1807,7 +1822,7 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1807
1822
|
* @example
|
|
1808
1823
|
* ```typescript
|
|
1809
1824
|
* // if you use it in a step label you should return the result.
|
|
1810
|
-
* return GameStepManager.callLabel(
|
|
1825
|
+
* return GameStepManager.callLabel(startLabel).then((result) => {
|
|
1811
1826
|
* return result
|
|
1812
1827
|
* })
|
|
1813
1828
|
* ```
|
|
@@ -1815,16 +1830,24 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1815
1830
|
static callLabel(label, props) {
|
|
1816
1831
|
return __async(this, null, function* () {
|
|
1817
1832
|
let choiseMade = void 0;
|
|
1833
|
+
let labelId;
|
|
1834
|
+
if (typeof label === "string") {
|
|
1835
|
+
labelId = label;
|
|
1836
|
+
} else {
|
|
1837
|
+
labelId = label.id;
|
|
1838
|
+
if (typeof label.choiseIndex === "number") {
|
|
1839
|
+
choiseMade = label.choiseIndex;
|
|
1840
|
+
}
|
|
1841
|
+
}
|
|
1818
1842
|
try {
|
|
1819
|
-
if (
|
|
1843
|
+
if (labelId === CLOSE_LABEL_ID) {
|
|
1820
1844
|
return _GameStepManager.runNextStep(props);
|
|
1821
1845
|
}
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1846
|
+
let tempLabel = getLabelById(labelId);
|
|
1847
|
+
if (!tempLabel) {
|
|
1848
|
+
throw new Error(`[Pixi'VN] Label ${labelId} not found`);
|
|
1825
1849
|
}
|
|
1826
|
-
|
|
1827
|
-
_GameStepManager.pushNewLabel(labelName);
|
|
1850
|
+
_GameStepManager.pushNewLabel(tempLabel.id);
|
|
1828
1851
|
} catch (e) {
|
|
1829
1852
|
console.error("[Pixi'VN] Error calling label", e);
|
|
1830
1853
|
return;
|
|
@@ -1836,11 +1859,11 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1836
1859
|
* Execute the label, close all labels and add them to the history.
|
|
1837
1860
|
* Is a jump function in Ren'Py.
|
|
1838
1861
|
* @param label The label to execute.
|
|
1839
|
-
* @param props The props to pass to the label
|
|
1862
|
+
* @param props The props to pass to the label or the id of the label
|
|
1840
1863
|
* @returns StepLabelResultType or undefined.
|
|
1841
1864
|
* @example
|
|
1842
1865
|
* ```typescript
|
|
1843
|
-
* GameStepManager.jumpLabel(
|
|
1866
|
+
* GameStepManager.jumpLabel(startLabel, yourParams).then((result) => {
|
|
1844
1867
|
* if (result) {
|
|
1845
1868
|
* // your code
|
|
1846
1869
|
* }
|
|
@@ -1849,7 +1872,7 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1849
1872
|
* @example
|
|
1850
1873
|
* ```typescript
|
|
1851
1874
|
* // if you use it in a step label you should return the result.
|
|
1852
|
-
* return GameStepManager.jumpLabel(
|
|
1875
|
+
* return GameStepManager.jumpLabel(startLabel).then((result) => {
|
|
1853
1876
|
* return result
|
|
1854
1877
|
* })
|
|
1855
1878
|
* ```
|
|
@@ -1857,15 +1880,24 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1857
1880
|
static jumpLabel(label, props) {
|
|
1858
1881
|
return __async(this, null, function* () {
|
|
1859
1882
|
_GameStepManager.closeAllLabels();
|
|
1883
|
+
let labelId;
|
|
1884
|
+
if (typeof label === "string") {
|
|
1885
|
+
labelId = label;
|
|
1886
|
+
} else {
|
|
1887
|
+
labelId = label.id;
|
|
1888
|
+
if (typeof label.choiseIndex === "number") {
|
|
1889
|
+
label.choiseIndex;
|
|
1890
|
+
}
|
|
1891
|
+
}
|
|
1860
1892
|
try {
|
|
1861
|
-
if (
|
|
1893
|
+
if (labelId === CLOSE_LABEL_ID) {
|
|
1862
1894
|
return _GameStepManager.runNextStep(props);
|
|
1863
1895
|
}
|
|
1864
|
-
|
|
1865
|
-
|
|
1896
|
+
let tempLabel = getLabelById(labelId);
|
|
1897
|
+
if (!tempLabel) {
|
|
1898
|
+
throw new Error(`[Pixi'VN] Label ${labelId} not found`);
|
|
1866
1899
|
}
|
|
1867
|
-
|
|
1868
|
-
_GameStepManager.pushNewLabel(labelName);
|
|
1900
|
+
_GameStepManager.pushNewLabel(tempLabel.id);
|
|
1869
1901
|
} catch (e) {
|
|
1870
1902
|
console.error("[Pixi'VN] Error jumping label", e);
|
|
1871
1903
|
return;
|
|
@@ -1879,14 +1911,14 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1879
1911
|
* @returns StepLabelResultType or undefined.
|
|
1880
1912
|
* @example
|
|
1881
1913
|
* ```typescript
|
|
1882
|
-
* GameStepManager.
|
|
1914
|
+
* GameStepManager.closeChoiceMenu(yourParams).then((result) => {
|
|
1883
1915
|
* if (result) {
|
|
1884
1916
|
* // your code
|
|
1885
1917
|
* }
|
|
1886
1918
|
* })
|
|
1887
1919
|
* ```
|
|
1888
1920
|
*/
|
|
1889
|
-
static
|
|
1921
|
+
static closeChoiceMenu(props) {
|
|
1890
1922
|
return __async(this, null, function* () {
|
|
1891
1923
|
return _GameStepManager.runNextStep(props);
|
|
1892
1924
|
});
|
|
@@ -2109,7 +2141,7 @@ var ChoiceMenuOptionClose = class {
|
|
|
2109
2141
|
};
|
|
2110
2142
|
|
|
2111
2143
|
// src/classes/DialogueBaseModel.ts
|
|
2112
|
-
var
|
|
2144
|
+
var DialogueBaseModel = class {
|
|
2113
2145
|
/**
|
|
2114
2146
|
* @param text The text of the dialogue.
|
|
2115
2147
|
* @param character The id of the character that is speaking.
|
|
@@ -2161,8 +2193,8 @@ function setDialogue(props) {
|
|
|
2161
2193
|
let dialogue;
|
|
2162
2194
|
if (typeof props === "string") {
|
|
2163
2195
|
text = props;
|
|
2164
|
-
dialogue = new
|
|
2165
|
-
} else if (!(props instanceof
|
|
2196
|
+
dialogue = new DialogueBaseModel(text, characterId);
|
|
2197
|
+
} else if (!(props instanceof DialogueBaseModel)) {
|
|
2166
2198
|
text = props.text;
|
|
2167
2199
|
if (props.character) {
|
|
2168
2200
|
if (typeof props.character === "string") {
|
|
@@ -2171,7 +2203,7 @@ function setDialogue(props) {
|
|
|
2171
2203
|
characterId = props.character.id;
|
|
2172
2204
|
}
|
|
2173
2205
|
}
|
|
2174
|
-
dialogue = new
|
|
2206
|
+
dialogue = new DialogueBaseModel(text, characterId);
|
|
2175
2207
|
} else {
|
|
2176
2208
|
dialogue = props;
|
|
2177
2209
|
}
|
|
@@ -2193,7 +2225,7 @@ function setChoiceMenuOptions(options) {
|
|
|
2193
2225
|
};
|
|
2194
2226
|
}
|
|
2195
2227
|
return __spreadProps(__spreadValues({}, option), {
|
|
2196
|
-
label: option.label.
|
|
2228
|
+
label: option.label.id
|
|
2197
2229
|
});
|
|
2198
2230
|
});
|
|
2199
2231
|
GameStorageManager.setVariable(GameStorageManager.keysSystem.CURRENT_MENU_OPTIONS_MEMORY_KEY, value);
|
|
@@ -2205,8 +2237,7 @@ function getChoiceMenuOptions() {
|
|
|
2205
2237
|
let options = [];
|
|
2206
2238
|
d.forEach((option, index) => {
|
|
2207
2239
|
if (option.type === Close) {
|
|
2208
|
-
let itemLabel = new CloseLabel();
|
|
2209
|
-
itemLabel.choiseIndex = index;
|
|
2240
|
+
let itemLabel = new CloseLabel(index);
|
|
2210
2241
|
options.push({
|
|
2211
2242
|
text: option.text,
|
|
2212
2243
|
label: itemLabel,
|
|
@@ -2215,10 +2246,9 @@ function getChoiceMenuOptions() {
|
|
|
2215
2246
|
});
|
|
2216
2247
|
return;
|
|
2217
2248
|
}
|
|
2218
|
-
let label =
|
|
2249
|
+
let label = getLabelById(option.label);
|
|
2219
2250
|
if (label) {
|
|
2220
|
-
let itemLabel = new label
|
|
2221
|
-
itemLabel.choiseIndex = index;
|
|
2251
|
+
let itemLabel = new Label(label.id, label.steps, label.onStepRun, index);
|
|
2222
2252
|
options.push(__spreadProps(__spreadValues({}, option), {
|
|
2223
2253
|
label: itemLabel
|
|
2224
2254
|
}));
|
|
@@ -2241,7 +2271,7 @@ function getDialogueHistory() {
|
|
|
2241
2271
|
if (oldChoices) {
|
|
2242
2272
|
let choiceMade = false;
|
|
2243
2273
|
if (step.choiceIndexMade !== void 0 && oldChoices.length > step.choiceIndexMade) {
|
|
2244
|
-
oldChoices[step.choiceIndexMade].
|
|
2274
|
+
oldChoices[step.choiceIndexMade].isResponse = true;
|
|
2245
2275
|
choiceMade = true;
|
|
2246
2276
|
}
|
|
2247
2277
|
list[list.length - 1].playerMadeChoice = choiceMade;
|
|
@@ -2253,7 +2283,7 @@ function getDialogueHistory() {
|
|
|
2253
2283
|
return {
|
|
2254
2284
|
text: choice.text,
|
|
2255
2285
|
type: choice.type,
|
|
2256
|
-
|
|
2286
|
+
isResponse: false
|
|
2257
2287
|
};
|
|
2258
2288
|
});
|
|
2259
2289
|
list.push({
|