@drincs/pixi-vn 0.3.4 → 0.3.6
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 +9 -5
- package/dist/index.d.mts +200 -142
- package/dist/index.d.ts +200 -142
- package/dist/index.js +36 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +36 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1946,15 +1946,18 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1946
1946
|
/* Run Methods */
|
|
1947
1947
|
/**
|
|
1948
1948
|
* Execute the next step and add it to the history.
|
|
1949
|
-
* @returns
|
|
1949
|
+
* @returns StepLabelResultType or undefined.
|
|
1950
1950
|
* @example
|
|
1951
1951
|
* ```typescript
|
|
1952
1952
|
* function nextOnClick() {
|
|
1953
1953
|
* setLoading(true)
|
|
1954
1954
|
* GameStepManager.runNextStep()
|
|
1955
|
-
* .then(() => {
|
|
1955
|
+
* .then((result) => {
|
|
1956
1956
|
* setUpdate((p) => p + 1)
|
|
1957
1957
|
* setLoading(false)
|
|
1958
|
+
* if (result) {
|
|
1959
|
+
* // your code
|
|
1960
|
+
* }
|
|
1958
1961
|
* })
|
|
1959
1962
|
* .catch((e) => {
|
|
1960
1963
|
* setLoading(false)
|
|
@@ -1975,7 +1978,7 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1975
1978
|
}
|
|
1976
1979
|
/**
|
|
1977
1980
|
* Execute the current step and add it to the history.
|
|
1978
|
-
* @returns
|
|
1981
|
+
* @returns StepLabelResultType or undefined.
|
|
1979
1982
|
*/
|
|
1980
1983
|
static runCurrentStep() {
|
|
1981
1984
|
return __async(this, null, function* () {
|
|
@@ -1993,11 +1996,12 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1993
1996
|
let n = currentLabel.steps.length;
|
|
1994
1997
|
if (n > lasteStepsLength) {
|
|
1995
1998
|
let nextStep = currentLabel.steps[lasteStepsLength];
|
|
1996
|
-
yield nextStep();
|
|
1999
|
+
let result = yield nextStep();
|
|
1997
2000
|
_GameStepManager.addStepHistory(nextStep);
|
|
2001
|
+
return result;
|
|
1998
2002
|
} else if (n === lasteStepsLength) {
|
|
1999
2003
|
_GameStepManager.closeCurrentLabel();
|
|
2000
|
-
yield _GameStepManager.runNextStep();
|
|
2004
|
+
return yield _GameStepManager.runNextStep();
|
|
2001
2005
|
} else {
|
|
2002
2006
|
console.warn("[Pixi'VN] There are no steps to run");
|
|
2003
2007
|
}
|
|
@@ -2008,10 +2012,21 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2008
2012
|
* Execute the label and add it to the history.
|
|
2009
2013
|
* Is a call function in Ren'Py.
|
|
2010
2014
|
* @param label The label to execute.
|
|
2011
|
-
* @returns
|
|
2015
|
+
* @returns StepLabelResultType or undefined.
|
|
2012
2016
|
* @example
|
|
2013
2017
|
* ```typescript
|
|
2014
|
-
* GameStepManager.callLabel(StartLabel)
|
|
2018
|
+
* GameStepManager.callLabel(StartLabel).then((result) => {
|
|
2019
|
+
* if (result) {
|
|
2020
|
+
* // your code
|
|
2021
|
+
* }
|
|
2022
|
+
* })
|
|
2023
|
+
* ```
|
|
2024
|
+
* @example
|
|
2025
|
+
* ```typescript
|
|
2026
|
+
* // if you use it in a step label you should return the result.
|
|
2027
|
+
* return GameStepManager.callLabel(StartLabel).then((result) => {
|
|
2028
|
+
* return result
|
|
2029
|
+
* })
|
|
2015
2030
|
* ```
|
|
2016
2031
|
*/
|
|
2017
2032
|
static callLabel(label) {
|
|
@@ -2032,11 +2047,22 @@ var _GameStepManager = class _GameStepManager {
|
|
|
2032
2047
|
/**
|
|
2033
2048
|
* Execute the label, close all labels and add them to the history.
|
|
2034
2049
|
* Is a jump function in Ren'Py.
|
|
2035
|
-
* @param label
|
|
2036
|
-
* @returns
|
|
2050
|
+
* @param label The label to execute.
|
|
2051
|
+
* @returns StepLabelResultType or undefined.
|
|
2052
|
+
* @example
|
|
2053
|
+
* ```typescript
|
|
2054
|
+
* GameStepManager.jumpLabel(StartLabel).then((result) => {
|
|
2055
|
+
* if (result) {
|
|
2056
|
+
* // your code
|
|
2057
|
+
* }
|
|
2058
|
+
* })
|
|
2059
|
+
* ```
|
|
2037
2060
|
* @example
|
|
2038
2061
|
* ```typescript
|
|
2039
|
-
*
|
|
2062
|
+
* // if you use it in a step label you should return the result.
|
|
2063
|
+
* return GameStepManager.jumpLabel(StartLabel).then((result) => {
|
|
2064
|
+
* return result
|
|
2065
|
+
* })
|
|
2040
2066
|
* ```
|
|
2041
2067
|
*/
|
|
2042
2068
|
static jumpLabel(label) {
|