@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
package/dist/functions/index.mjs
CHANGED
|
@@ -61,13 +61,31 @@ function checkIfStepsIsEqual(step1, step2) {
|
|
|
61
61
|
|
|
62
62
|
// src/classes/Label.ts
|
|
63
63
|
var Label = class {
|
|
64
|
+
/**
|
|
65
|
+
* @param id is the id of the label
|
|
66
|
+
* @param steps is the list of steps that the label will perform
|
|
67
|
+
* @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
|
|
68
|
+
* @param choiseIndex is the index of the choice that the label will perform
|
|
69
|
+
*/
|
|
70
|
+
constructor(id, steps, onStepRun, choiseIndex) {
|
|
71
|
+
this._id = id;
|
|
72
|
+
this._steps = steps;
|
|
73
|
+
this._onStepRun = onStepRun;
|
|
74
|
+
this._choiseIndex = choiseIndex;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Get the id of the label
|
|
78
|
+
*/
|
|
79
|
+
get id() {
|
|
80
|
+
return this._id;
|
|
81
|
+
}
|
|
64
82
|
/**
|
|
65
83
|
* Get the steps of the label.
|
|
66
84
|
* This class should be extended and the steps method should be overridden.
|
|
67
85
|
* Every time you update this list will also be updated when the other game versions load.
|
|
68
86
|
*/
|
|
69
87
|
get steps() {
|
|
70
|
-
|
|
88
|
+
return this._steps;
|
|
71
89
|
}
|
|
72
90
|
/**
|
|
73
91
|
* Get the corresponding steps number
|
|
@@ -86,45 +104,42 @@ var Label = class {
|
|
|
86
104
|
});
|
|
87
105
|
return res;
|
|
88
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* 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
|
|
109
|
+
* @returns Promise<void> or void
|
|
110
|
+
* @example
|
|
111
|
+
* ```typescript
|
|
112
|
+
* newLabel("id", [], () => {
|
|
113
|
+
* Assets.load('path/to/image1.png')
|
|
114
|
+
* Assets.load('path/to/image2.png')
|
|
115
|
+
* })
|
|
116
|
+
* ```
|
|
117
|
+
*/
|
|
118
|
+
get onStepRun() {
|
|
119
|
+
return this._onStepRun;
|
|
120
|
+
}
|
|
121
|
+
get choiseIndex() {
|
|
122
|
+
return this._choiseIndex;
|
|
123
|
+
}
|
|
89
124
|
};
|
|
90
125
|
|
|
91
126
|
// src/classes/CloseLabel.ts
|
|
127
|
+
var CLOSE_LABEL_ID = "__close-label-id__";
|
|
92
128
|
var CloseLabel = class extends Label {
|
|
129
|
+
constructor(choiseIndex) {
|
|
130
|
+
super(CLOSE_LABEL_ID, [], void 0, choiseIndex);
|
|
131
|
+
}
|
|
93
132
|
};
|
|
94
133
|
|
|
95
134
|
// src/decorators/LabelDecorator.ts
|
|
96
135
|
var registeredLabels = {};
|
|
97
|
-
function
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
console.error(`[Pixi'VN] Label ${labelName} not found`);
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
new labelType();
|
|
105
|
-
return labelType;
|
|
106
|
-
} catch (e) {
|
|
107
|
-
console.error(`[Pixi'VN] Error while getting Label ${labelName}`, e);
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
function getLabelInstanceByClassName(labelName) {
|
|
112
|
-
try {
|
|
113
|
-
let labelType = registeredLabels[labelName];
|
|
114
|
-
if (!labelType) {
|
|
115
|
-
console.error(`[Pixi'VN] Label ${labelName} not found`);
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
let label = new labelType();
|
|
119
|
-
let step = label.steps;
|
|
120
|
-
if (step.length = 0) {
|
|
121
|
-
console.warn(`[Pixi'VN] Label ${labelName} has no steps`);
|
|
122
|
-
}
|
|
123
|
-
return label;
|
|
124
|
-
} catch (e) {
|
|
125
|
-
console.error(`[Pixi'VN] Error while getting Label ${labelName}`, e);
|
|
136
|
+
function getLabelById(id) {
|
|
137
|
+
let label = registeredLabels[id];
|
|
138
|
+
if (!label) {
|
|
139
|
+
console.error(`[Pixi'VN] Label ${id} not found`);
|
|
126
140
|
return;
|
|
127
141
|
}
|
|
142
|
+
return label;
|
|
128
143
|
}
|
|
129
144
|
|
|
130
145
|
// src/functions/ExportUtility.ts
|
|
@@ -1396,7 +1411,7 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1396
1411
|
*/
|
|
1397
1412
|
static get currentLabel() {
|
|
1398
1413
|
if (_GameStepManager.currentLabelId) {
|
|
1399
|
-
return
|
|
1414
|
+
return getLabelById(_GameStepManager.currentLabelId);
|
|
1400
1415
|
}
|
|
1401
1416
|
}
|
|
1402
1417
|
static get currentLabelStepIndex() {
|
|
@@ -1417,7 +1432,7 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1417
1432
|
return true;
|
|
1418
1433
|
} else {
|
|
1419
1434
|
this.openedLabels.forEach((item) => {
|
|
1420
|
-
let label =
|
|
1435
|
+
let label = getLabelById(item.label);
|
|
1421
1436
|
if (label && label.steps.length > item.currentStepIndex) {
|
|
1422
1437
|
return false;
|
|
1423
1438
|
}
|
|
@@ -1510,9 +1525,9 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1510
1525
|
* @param label The label to add to the history.
|
|
1511
1526
|
*/
|
|
1512
1527
|
static pushNewLabel(label) {
|
|
1513
|
-
let currentLabel =
|
|
1528
|
+
let currentLabel = getLabelById(label);
|
|
1514
1529
|
if (!currentLabel) {
|
|
1515
|
-
throw new Error(
|
|
1530
|
+
throw new Error(`[Pixi'VN] Label ${label} not found`);
|
|
1516
1531
|
}
|
|
1517
1532
|
_GameStepManager._openedLabels.push({
|
|
1518
1533
|
label,
|
|
@@ -1529,7 +1544,7 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1529
1544
|
return;
|
|
1530
1545
|
}
|
|
1531
1546
|
if (!_GameStepManager.currentLabel) {
|
|
1532
|
-
console.error("[Pixi'VN]
|
|
1547
|
+
console.error("[Pixi'VN] currentLabel not found");
|
|
1533
1548
|
return;
|
|
1534
1549
|
}
|
|
1535
1550
|
_GameStepManager._openedLabels.pop();
|
|
@@ -1601,7 +1616,7 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1601
1616
|
}
|
|
1602
1617
|
let currentLabel = _GameStepManager.currentLabel;
|
|
1603
1618
|
if (!currentLabel) {
|
|
1604
|
-
console.error("[Pixi'VN]
|
|
1619
|
+
console.error("[Pixi'VN] currentLabel not found");
|
|
1605
1620
|
return;
|
|
1606
1621
|
}
|
|
1607
1622
|
let n = currentLabel.steps.length;
|
|
@@ -1622,12 +1637,12 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1622
1637
|
/**
|
|
1623
1638
|
* Execute the label and add it to the history.
|
|
1624
1639
|
* Is a call function in Ren'Py.
|
|
1625
|
-
* @param label The label to execute
|
|
1640
|
+
* @param label The label to execute or the id of the label
|
|
1626
1641
|
* @param props The props to pass to the label.
|
|
1627
1642
|
* @returns StepLabelResultType or undefined.
|
|
1628
1643
|
* @example
|
|
1629
1644
|
* ```typescript
|
|
1630
|
-
* GameStepManager.callLabel(
|
|
1645
|
+
* GameStepManager.callLabel(startLabel, yourParams).then((result) => {
|
|
1631
1646
|
* if (result) {
|
|
1632
1647
|
* // your code
|
|
1633
1648
|
* }
|
|
@@ -1636,7 +1651,7 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1636
1651
|
* @example
|
|
1637
1652
|
* ```typescript
|
|
1638
1653
|
* // if you use it in a step label you should return the result.
|
|
1639
|
-
* return GameStepManager.callLabel(
|
|
1654
|
+
* return GameStepManager.callLabel(startLabel).then((result) => {
|
|
1640
1655
|
* return result
|
|
1641
1656
|
* })
|
|
1642
1657
|
* ```
|
|
@@ -1644,16 +1659,24 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1644
1659
|
static callLabel(label, props) {
|
|
1645
1660
|
return __async(this, null, function* () {
|
|
1646
1661
|
let choiseMade = void 0;
|
|
1662
|
+
let labelId;
|
|
1663
|
+
if (typeof label === "string") {
|
|
1664
|
+
labelId = label;
|
|
1665
|
+
} else {
|
|
1666
|
+
labelId = label.id;
|
|
1667
|
+
if (typeof label.choiseIndex === "number") {
|
|
1668
|
+
choiseMade = label.choiseIndex;
|
|
1669
|
+
}
|
|
1670
|
+
}
|
|
1647
1671
|
try {
|
|
1648
|
-
if (
|
|
1672
|
+
if (labelId === CLOSE_LABEL_ID) {
|
|
1649
1673
|
return _GameStepManager.runNextStep(props);
|
|
1650
1674
|
}
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1675
|
+
let tempLabel = getLabelById(labelId);
|
|
1676
|
+
if (!tempLabel) {
|
|
1677
|
+
throw new Error(`[Pixi'VN] Label ${labelId} not found`);
|
|
1654
1678
|
}
|
|
1655
|
-
|
|
1656
|
-
_GameStepManager.pushNewLabel(labelName);
|
|
1679
|
+
_GameStepManager.pushNewLabel(tempLabel.id);
|
|
1657
1680
|
} catch (e) {
|
|
1658
1681
|
console.error("[Pixi'VN] Error calling label", e);
|
|
1659
1682
|
return;
|
|
@@ -1665,11 +1688,11 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1665
1688
|
* Execute the label, close all labels and add them to the history.
|
|
1666
1689
|
* Is a jump function in Ren'Py.
|
|
1667
1690
|
* @param label The label to execute.
|
|
1668
|
-
* @param props The props to pass to the label
|
|
1691
|
+
* @param props The props to pass to the label or the id of the label
|
|
1669
1692
|
* @returns StepLabelResultType or undefined.
|
|
1670
1693
|
* @example
|
|
1671
1694
|
* ```typescript
|
|
1672
|
-
* GameStepManager.jumpLabel(
|
|
1695
|
+
* GameStepManager.jumpLabel(startLabel, yourParams).then((result) => {
|
|
1673
1696
|
* if (result) {
|
|
1674
1697
|
* // your code
|
|
1675
1698
|
* }
|
|
@@ -1678,7 +1701,7 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1678
1701
|
* @example
|
|
1679
1702
|
* ```typescript
|
|
1680
1703
|
* // if you use it in a step label you should return the result.
|
|
1681
|
-
* return GameStepManager.jumpLabel(
|
|
1704
|
+
* return GameStepManager.jumpLabel(startLabel).then((result) => {
|
|
1682
1705
|
* return result
|
|
1683
1706
|
* })
|
|
1684
1707
|
* ```
|
|
@@ -1686,15 +1709,24 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1686
1709
|
static jumpLabel(label, props) {
|
|
1687
1710
|
return __async(this, null, function* () {
|
|
1688
1711
|
_GameStepManager.closeAllLabels();
|
|
1712
|
+
let labelId;
|
|
1713
|
+
if (typeof label === "string") {
|
|
1714
|
+
labelId = label;
|
|
1715
|
+
} else {
|
|
1716
|
+
labelId = label.id;
|
|
1717
|
+
if (typeof label.choiseIndex === "number") {
|
|
1718
|
+
label.choiseIndex;
|
|
1719
|
+
}
|
|
1720
|
+
}
|
|
1689
1721
|
try {
|
|
1690
|
-
if (
|
|
1722
|
+
if (labelId === CLOSE_LABEL_ID) {
|
|
1691
1723
|
return _GameStepManager.runNextStep(props);
|
|
1692
1724
|
}
|
|
1693
|
-
|
|
1694
|
-
|
|
1725
|
+
let tempLabel = getLabelById(labelId);
|
|
1726
|
+
if (!tempLabel) {
|
|
1727
|
+
throw new Error(`[Pixi'VN] Label ${labelId} not found`);
|
|
1695
1728
|
}
|
|
1696
|
-
|
|
1697
|
-
_GameStepManager.pushNewLabel(labelName);
|
|
1729
|
+
_GameStepManager.pushNewLabel(tempLabel.id);
|
|
1698
1730
|
} catch (e) {
|
|
1699
1731
|
console.error("[Pixi'VN] Error jumping label", e);
|
|
1700
1732
|
return;
|
|
@@ -1708,14 +1740,14 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1708
1740
|
* @returns StepLabelResultType or undefined.
|
|
1709
1741
|
* @example
|
|
1710
1742
|
* ```typescript
|
|
1711
|
-
* GameStepManager.
|
|
1743
|
+
* GameStepManager.closeChoiceMenu(yourParams).then((result) => {
|
|
1712
1744
|
* if (result) {
|
|
1713
1745
|
* // your code
|
|
1714
1746
|
* }
|
|
1715
1747
|
* })
|
|
1716
1748
|
* ```
|
|
1717
1749
|
*/
|
|
1718
|
-
static
|
|
1750
|
+
static closeChoiceMenu(props) {
|
|
1719
1751
|
return __async(this, null, function* () {
|
|
1720
1752
|
return _GameStepManager.runNextStep(props);
|
|
1721
1753
|
});
|
|
@@ -1938,7 +1970,7 @@ var ChoiceMenuOptionClose = class {
|
|
|
1938
1970
|
};
|
|
1939
1971
|
|
|
1940
1972
|
// src/classes/DialogueBaseModel.ts
|
|
1941
|
-
var
|
|
1973
|
+
var DialogueBaseModel = class {
|
|
1942
1974
|
/**
|
|
1943
1975
|
* @param text The text of the dialogue.
|
|
1944
1976
|
* @param character The id of the character that is speaking.
|
|
@@ -1990,8 +2022,8 @@ function setDialogue(props) {
|
|
|
1990
2022
|
let dialogue;
|
|
1991
2023
|
if (typeof props === "string") {
|
|
1992
2024
|
text = props;
|
|
1993
|
-
dialogue = new
|
|
1994
|
-
} else if (!(props instanceof
|
|
2025
|
+
dialogue = new DialogueBaseModel(text, characterId);
|
|
2026
|
+
} else if (!(props instanceof DialogueBaseModel)) {
|
|
1995
2027
|
text = props.text;
|
|
1996
2028
|
if (props.character) {
|
|
1997
2029
|
if (typeof props.character === "string") {
|
|
@@ -2000,7 +2032,7 @@ function setDialogue(props) {
|
|
|
2000
2032
|
characterId = props.character.id;
|
|
2001
2033
|
}
|
|
2002
2034
|
}
|
|
2003
|
-
dialogue = new
|
|
2035
|
+
dialogue = new DialogueBaseModel(text, characterId);
|
|
2004
2036
|
} else {
|
|
2005
2037
|
dialogue = props;
|
|
2006
2038
|
}
|
|
@@ -2022,7 +2054,7 @@ function setChoiceMenuOptions(options) {
|
|
|
2022
2054
|
};
|
|
2023
2055
|
}
|
|
2024
2056
|
return __spreadProps(__spreadValues({}, option), {
|
|
2025
|
-
label: option.label.
|
|
2057
|
+
label: option.label.id
|
|
2026
2058
|
});
|
|
2027
2059
|
});
|
|
2028
2060
|
GameStorageManager.setVariable(GameStorageManager.keysSystem.CURRENT_MENU_OPTIONS_MEMORY_KEY, value);
|
|
@@ -2034,8 +2066,7 @@ function getChoiceMenuOptions() {
|
|
|
2034
2066
|
let options = [];
|
|
2035
2067
|
d.forEach((option, index) => {
|
|
2036
2068
|
if (option.type === Close) {
|
|
2037
|
-
let itemLabel = new CloseLabel();
|
|
2038
|
-
itemLabel.choiseIndex = index;
|
|
2069
|
+
let itemLabel = new CloseLabel(index);
|
|
2039
2070
|
options.push({
|
|
2040
2071
|
text: option.text,
|
|
2041
2072
|
label: itemLabel,
|
|
@@ -2044,10 +2075,9 @@ function getChoiceMenuOptions() {
|
|
|
2044
2075
|
});
|
|
2045
2076
|
return;
|
|
2046
2077
|
}
|
|
2047
|
-
let label =
|
|
2078
|
+
let label = getLabelById(option.label);
|
|
2048
2079
|
if (label) {
|
|
2049
|
-
let itemLabel = new label
|
|
2050
|
-
itemLabel.choiseIndex = index;
|
|
2080
|
+
let itemLabel = new Label(label.id, label.steps, label.onStepRun, index);
|
|
2051
2081
|
options.push(__spreadProps(__spreadValues({}, option), {
|
|
2052
2082
|
label: itemLabel
|
|
2053
2083
|
}));
|
|
@@ -2070,7 +2100,7 @@ function getDialogueHistory() {
|
|
|
2070
2100
|
if (oldChoices) {
|
|
2071
2101
|
let choiceMade = false;
|
|
2072
2102
|
if (step.choiceIndexMade !== void 0 && oldChoices.length > step.choiceIndexMade) {
|
|
2073
|
-
oldChoices[step.choiceIndexMade].
|
|
2103
|
+
oldChoices[step.choiceIndexMade].isResponse = true;
|
|
2074
2104
|
choiceMade = true;
|
|
2075
2105
|
}
|
|
2076
2106
|
list[list.length - 1].playerMadeChoice = choiceMade;
|
|
@@ -2082,7 +2112,7 @@ function getDialogueHistory() {
|
|
|
2082
2112
|
return {
|
|
2083
2113
|
text: choice.text,
|
|
2084
2114
|
type: choice.type,
|
|
2085
|
-
|
|
2115
|
+
isResponse: false
|
|
2086
2116
|
};
|
|
2087
2117
|
});
|
|
2088
2118
|
list.push({
|
|
@@ -2344,7 +2374,7 @@ function showWithDissolveTransition(tag, image, speed, priority) {
|
|
|
2344
2374
|
}
|
|
2345
2375
|
|
|
2346
2376
|
// src/constants.ts
|
|
2347
|
-
var PIXIVN_VERSION = "0.5.
|
|
2377
|
+
var PIXIVN_VERSION = "0.5.4";
|
|
2348
2378
|
|
|
2349
2379
|
// src/functions/SavesUtility.ts
|
|
2350
2380
|
function getSaveData() {
|