@drincs/pixi-vn 0.5.7 → 0.5.9
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.map +1 -1
- package/dist/classes/CharacterBaseModel.mjs.map +1 -1
- package/dist/classes/ChoiceMenuOption.js.map +1 -1
- package/dist/classes/ChoiceMenuOption.mjs.map +1 -1
- package/dist/classes/StoredClassModel.js.map +1 -1
- package/dist/classes/StoredClassModel.mjs.map +1 -1
- package/dist/classes/index.js.map +1 -1
- package/dist/classes/index.mjs.map +1 -1
- package/dist/classes/ticker/TickerFadeAlpha.js.map +1 -1
- package/dist/classes/ticker/TickerFadeAlpha.mjs.map +1 -1
- package/dist/classes/ticker/TickerMove.js.map +1 -1
- package/dist/classes/ticker/TickerMove.mjs.map +1 -1
- package/dist/classes/ticker/TickerRotate.js.map +1 -1
- package/dist/classes/ticker/TickerRotate.mjs.map +1 -1
- package/dist/classes/ticker/index.js.map +1 -1
- 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.js.map +1 -1
- package/dist/decorators/LabelDecorator.mjs.map +1 -1
- package/dist/decorators/index.js.map +1 -1
- package/dist/decorators/index.mjs.map +1 -1
- package/dist/functions/DialogueUtility.d.mts +4 -2
- package/dist/functions/DialogueUtility.d.ts +4 -2
- package/dist/functions/DialogueUtility.js +21 -12
- package/dist/functions/DialogueUtility.js.map +1 -1
- package/dist/functions/DialogueUtility.mjs +21 -12
- package/dist/functions/DialogueUtility.mjs.map +1 -1
- package/dist/functions/FlagsUtility.js.map +1 -1
- package/dist/functions/FlagsUtility.mjs.map +1 -1
- package/dist/functions/GameUtility.js.map +1 -1
- package/dist/functions/GameUtility.mjs.map +1 -1
- package/dist/functions/ImageUtility.js.map +1 -1
- package/dist/functions/ImageUtility.mjs.map +1 -1
- package/dist/functions/SavesUtility.js +92 -13
- package/dist/functions/SavesUtility.js.map +1 -1
- package/dist/functions/SavesUtility.mjs +92 -13
- package/dist/functions/SavesUtility.mjs.map +1 -1
- package/dist/functions/index.js +22 -13
- package/dist/functions/index.js.map +1 -1
- package/dist/functions/index.mjs +22 -13
- package/dist/functions/index.mjs.map +1 -1
- package/dist/index.js +22 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -13
- package/dist/index.mjs.map +1 -1
- package/dist/managers/StepManager.d.mts +1 -1
- package/dist/managers/StepManager.d.ts +1 -1
- package/dist/managers/StepManager.js +91 -12
- package/dist/managers/StepManager.js.map +1 -1
- package/dist/managers/StepManager.mjs +91 -12
- package/dist/managers/StepManager.mjs.map +1 -1
- package/dist/managers/index.js +91 -12
- package/dist/managers/index.js.map +1 -1
- package/dist/managers/index.mjs +91 -12
- package/dist/managers/index.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -53,12 +53,14 @@ declare function clearDialogue(): void;
|
|
|
53
53
|
* ])
|
|
54
54
|
* ```
|
|
55
55
|
*/
|
|
56
|
-
declare function setChoiceMenuOptions(options: ChoiceMenuOptionsType): void;
|
|
56
|
+
declare function setChoiceMenuOptions<T extends {} = {}>(options: ChoiceMenuOptionsType<T>): void;
|
|
57
57
|
/**
|
|
58
58
|
* Get the options to be shown in the game
|
|
59
59
|
* @returns Options to be shown in the game
|
|
60
60
|
*/
|
|
61
|
-
declare function getChoiceMenuOptions<TChoice extends ChoiceMenuOptionsType = ChoiceMenuOptionsType
|
|
61
|
+
declare function getChoiceMenuOptions<TChoice extends ChoiceMenuOptionsType = ChoiceMenuOptionsType<{
|
|
62
|
+
[key: string | number | symbol]: any;
|
|
63
|
+
}>>(): TChoice | undefined;
|
|
62
64
|
/**
|
|
63
65
|
* Clear the options to be shown in the game
|
|
64
66
|
*/
|
|
@@ -53,12 +53,14 @@ declare function clearDialogue(): void;
|
|
|
53
53
|
* ])
|
|
54
54
|
* ```
|
|
55
55
|
*/
|
|
56
|
-
declare function setChoiceMenuOptions(options: ChoiceMenuOptionsType): void;
|
|
56
|
+
declare function setChoiceMenuOptions<T extends {} = {}>(options: ChoiceMenuOptionsType<T>): void;
|
|
57
57
|
/**
|
|
58
58
|
* Get the options to be shown in the game
|
|
59
59
|
* @returns Options to be shown in the game
|
|
60
60
|
*/
|
|
61
|
-
declare function getChoiceMenuOptions<TChoice extends ChoiceMenuOptionsType = ChoiceMenuOptionsType
|
|
61
|
+
declare function getChoiceMenuOptions<TChoice extends ChoiceMenuOptionsType = ChoiceMenuOptionsType<{
|
|
62
|
+
[key: string | number | symbol]: any;
|
|
63
|
+
}>>(): TChoice | undefined;
|
|
62
64
|
/**
|
|
63
65
|
* Clear the options to be shown in the game
|
|
64
66
|
*/
|
|
@@ -1778,8 +1778,8 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1778
1778
|
static runCurrentStep(props, choiseMade) {
|
|
1779
1779
|
return __async(this, null, function* () {
|
|
1780
1780
|
if (_GameStepManager.currentLabelId) {
|
|
1781
|
-
let
|
|
1782
|
-
if (
|
|
1781
|
+
let lastStepsLength = _GameStepManager.currentLabelStepIndex;
|
|
1782
|
+
if (lastStepsLength === null) {
|
|
1783
1783
|
console.error("[Pixi'VN] currentLabelStepIndex is null");
|
|
1784
1784
|
return;
|
|
1785
1785
|
}
|
|
@@ -1789,12 +1789,12 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1789
1789
|
return;
|
|
1790
1790
|
}
|
|
1791
1791
|
let n = currentLabel.steps.length;
|
|
1792
|
-
if (n >
|
|
1793
|
-
let
|
|
1794
|
-
let result = yield
|
|
1795
|
-
_GameStepManager.addStepHistory(
|
|
1792
|
+
if (n > lastStepsLength) {
|
|
1793
|
+
let step = currentLabel.steps[lastStepsLength];
|
|
1794
|
+
let result = yield step(props);
|
|
1795
|
+
_GameStepManager.addStepHistory(step, choiseMade);
|
|
1796
1796
|
return result;
|
|
1797
|
-
} else if (n ===
|
|
1797
|
+
} else if (n === lastStepsLength) {
|
|
1798
1798
|
_GameStepManager.closeCurrentLabel();
|
|
1799
1799
|
return yield _GameStepManager.runNextStep(props);
|
|
1800
1800
|
} else {
|
|
@@ -1839,7 +1839,8 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1839
1839
|
}
|
|
1840
1840
|
try {
|
|
1841
1841
|
if (labelId === CLOSE_LABEL_ID) {
|
|
1842
|
-
|
|
1842
|
+
let closeLabel = newCloseLabel(choiseMade);
|
|
1843
|
+
return _GameStepManager.closeChoiceMenu(closeLabel, props);
|
|
1843
1844
|
}
|
|
1844
1845
|
let tempLabel = getLabelById(labelId);
|
|
1845
1846
|
if (!tempLabel) {
|
|
@@ -1878,18 +1879,20 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1878
1879
|
static jumpLabel(label, props) {
|
|
1879
1880
|
return __async(this, null, function* () {
|
|
1880
1881
|
_GameStepManager.closeAllLabels();
|
|
1882
|
+
let choiseMade = void 0;
|
|
1881
1883
|
let labelId;
|
|
1882
1884
|
if (typeof label === "string") {
|
|
1883
1885
|
labelId = label;
|
|
1884
1886
|
} else {
|
|
1885
1887
|
labelId = label.id;
|
|
1886
1888
|
if (typeof label.choiseIndex === "number") {
|
|
1887
|
-
label.choiseIndex;
|
|
1889
|
+
choiseMade = label.choiseIndex;
|
|
1888
1890
|
}
|
|
1889
1891
|
}
|
|
1890
1892
|
try {
|
|
1891
1893
|
if (labelId === CLOSE_LABEL_ID) {
|
|
1892
|
-
|
|
1894
|
+
let closeLabel = newCloseLabel(choiseMade);
|
|
1895
|
+
return _GameStepManager.closeChoiceMenu(closeLabel, props);
|
|
1893
1896
|
}
|
|
1894
1897
|
let tempLabel = getLabelById(labelId);
|
|
1895
1898
|
if (!tempLabel) {
|
|
@@ -1900,7 +1903,7 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1900
1903
|
console.error("[Pixi'VN] Error jumping label", e);
|
|
1901
1904
|
return;
|
|
1902
1905
|
}
|
|
1903
|
-
return yield _GameStepManager.runCurrentStep(props);
|
|
1906
|
+
return yield _GameStepManager.runCurrentStep(props, choiseMade);
|
|
1904
1907
|
});
|
|
1905
1908
|
}
|
|
1906
1909
|
/**
|
|
@@ -1916,8 +1919,14 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1916
1919
|
* })
|
|
1917
1920
|
* ```
|
|
1918
1921
|
*/
|
|
1919
|
-
static closeChoiceMenu(props) {
|
|
1922
|
+
static closeChoiceMenu(label, props) {
|
|
1920
1923
|
return __async(this, null, function* () {
|
|
1924
|
+
let choiseMade = void 0;
|
|
1925
|
+
if (typeof label.choiseIndex === "number") {
|
|
1926
|
+
choiseMade = label.choiseIndex;
|
|
1927
|
+
}
|
|
1928
|
+
_GameStepManager.addStepHistory(() => {
|
|
1929
|
+
}, choiseMade);
|
|
1921
1930
|
return _GameStepManager.runNextStep(props);
|
|
1922
1931
|
});
|
|
1923
1932
|
}
|