@drincs/pixi-vn 0.5.0 → 0.5.2
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 +6 -6
- package/dist/classes/CharacterBaseModel.js.map +1 -1
- package/dist/classes/CharacterBaseModel.mjs +6 -6
- package/dist/classes/CharacterBaseModel.mjs.map +1 -1
- package/dist/classes/ChoiceMenuOption.d.mts +17 -4
- package/dist/classes/ChoiceMenuOption.d.ts +17 -4
- package/dist/classes/ChoiceMenuOption.js +10 -1
- package/dist/classes/ChoiceMenuOption.js.map +1 -1
- package/dist/classes/ChoiceMenuOption.mjs +10 -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 +6 -6
- package/dist/classes/index.js.map +1 -1
- package/dist/classes/index.mjs +6 -6
- 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/functions/DialogueUtility.js +47 -17
- package/dist/functions/DialogueUtility.js.map +1 -1
- package/dist/functions/DialogueUtility.mjs +47 -17
- 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 +25 -7
- package/dist/functions/SavesUtility.js.map +1 -1
- package/dist/functions/SavesUtility.mjs +25 -7
- package/dist/functions/SavesUtility.mjs.map +1 -1
- package/dist/functions/index.js +48 -18
- package/dist/functions/index.js.map +1 -1
- package/dist/functions/index.mjs +48 -18
- package/dist/functions/index.mjs.map +1 -1
- package/dist/index.js +60 -30
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +60 -30
- package/dist/index.mjs.map +1 -1
- package/dist/interface/IDialogueHistory.d.mts +4 -4
- package/dist/interface/IDialogueHistory.d.ts +4 -4
- package/dist/interface/IHistoryStep.d.mts +2 -2
- package/dist/interface/IHistoryStep.d.ts +2 -2
- package/dist/managers/StepManager.d.mts +14 -0
- package/dist/managers/StepManager.d.ts +14 -0
- package/dist/managers/StepManager.js +18 -0
- package/dist/managers/StepManager.js.map +1 -1
- package/dist/managers/StepManager.mjs +18 -0
- package/dist/managers/StepManager.mjs.map +1 -1
- package/dist/managers/index.js +24 -6
- package/dist/managers/index.js.map +1 -1
- package/dist/managers/index.mjs +24 -6
- package/dist/managers/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/constants.d.mts
CHANGED
package/dist/constants.d.ts
CHANGED
package/dist/constants.js
CHANGED
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/constants.ts"],"names":[],"mappings":";AAAO,IAAM,iBAAiB","sourcesContent":["export const PIXIVN_VERSION = '0.5.
|
|
1
|
+
{"version":3,"sources":["../src/constants.ts"],"names":[],"mappings":";AAAO,IAAM,iBAAiB","sourcesContent":["export const PIXIVN_VERSION = '0.5.2'"]}
|
package/dist/constants.mjs
CHANGED
package/dist/constants.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/constants.ts"],"names":[],"mappings":";AAAO,IAAM,iBAAiB","sourcesContent":["export const PIXIVN_VERSION = '0.5.
|
|
1
|
+
{"version":3,"sources":["../src/constants.ts"],"names":[],"mappings":";AAAO,IAAM,iBAAiB","sourcesContent":["export const PIXIVN_VERSION = '0.5.2'"]}
|
|
@@ -1873,6 +1873,24 @@ var _GameStepManager = class _GameStepManager {
|
|
|
1873
1873
|
return yield _GameStepManager.runCurrentStep(props);
|
|
1874
1874
|
});
|
|
1875
1875
|
}
|
|
1876
|
+
/**
|
|
1877
|
+
* When the player is in a choice menu, can use this function to exit to the choice menu.
|
|
1878
|
+
* @param props The props to pass to the step.
|
|
1879
|
+
* @returns StepLabelResultType or undefined.
|
|
1880
|
+
* @example
|
|
1881
|
+
* ```typescript
|
|
1882
|
+
* GameStepManager.exitToChoiceMenu(yourParams).then((result) => {
|
|
1883
|
+
* if (result) {
|
|
1884
|
+
* // your code
|
|
1885
|
+
* }
|
|
1886
|
+
* })
|
|
1887
|
+
* ```
|
|
1888
|
+
*/
|
|
1889
|
+
static exitToChoiceMenu(props) {
|
|
1890
|
+
return __async(this, null, function* () {
|
|
1891
|
+
return _GameStepManager.runNextStep(props);
|
|
1892
|
+
});
|
|
1893
|
+
}
|
|
1876
1894
|
/* After Update Methods */
|
|
1877
1895
|
// /**
|
|
1878
1896
|
// * After the update or code edit, some steps or labels may no longer match.
|
|
@@ -2065,6 +2083,9 @@ _GameStepManager._openedLabels = [];
|
|
|
2065
2083
|
_GameStepManager._originalStepData = void 0;
|
|
2066
2084
|
var GameStepManager = _GameStepManager;
|
|
2067
2085
|
|
|
2086
|
+
// src/types/CloseType.ts
|
|
2087
|
+
var Close = "close";
|
|
2088
|
+
|
|
2068
2089
|
// src/classes/ChoiceMenuOption.ts
|
|
2069
2090
|
var ChoiceMenuOptionClose = class {
|
|
2070
2091
|
/**
|
|
@@ -2075,6 +2096,14 @@ var ChoiceMenuOptionClose = class {
|
|
|
2075
2096
|
* Label to be opened when the option is selected
|
|
2076
2097
|
*/
|
|
2077
2098
|
this.label = new CloseLabel();
|
|
2099
|
+
/**
|
|
2100
|
+
* Type of the label to be opened
|
|
2101
|
+
*/
|
|
2102
|
+
this.type = Close;
|
|
2103
|
+
/**
|
|
2104
|
+
* Properties to be passed to the label
|
|
2105
|
+
*/
|
|
2106
|
+
this.props = {};
|
|
2078
2107
|
this.text = text;
|
|
2079
2108
|
}
|
|
2080
2109
|
};
|
|
@@ -2125,9 +2154,6 @@ var DialogueBaseModel2 = class {
|
|
|
2125
2154
|
}
|
|
2126
2155
|
};
|
|
2127
2156
|
|
|
2128
|
-
// src/types/CloseType.ts
|
|
2129
|
-
var Close = "close";
|
|
2130
|
-
|
|
2131
2157
|
// src/functions/DialogueUtility.ts
|
|
2132
2158
|
function setDialogue(props) {
|
|
2133
2159
|
let text = "";
|
|
@@ -2183,7 +2209,9 @@ function getChoiceMenuOptions() {
|
|
|
2183
2209
|
itemLabel.choiseIndex = index;
|
|
2184
2210
|
options.push({
|
|
2185
2211
|
text: option.text,
|
|
2186
|
-
label: itemLabel
|
|
2212
|
+
label: itemLabel,
|
|
2213
|
+
type: Close,
|
|
2214
|
+
props: {}
|
|
2187
2215
|
});
|
|
2188
2216
|
return;
|
|
2189
2217
|
}
|
|
@@ -2208,28 +2236,30 @@ function getDialogueHistory() {
|
|
|
2208
2236
|
GameStepManager.stepsHistory.forEach((step) => {
|
|
2209
2237
|
let dialoge = step.dialoge;
|
|
2210
2238
|
let requiredChoices = step.choices;
|
|
2211
|
-
if (list.length > 0 && list[list.length - 1].choices && !list[list.length - 1].
|
|
2239
|
+
if (list.length > 0 && list[list.length - 1].choices && !list[list.length - 1].playerMadeChoice && step.currentLabel) {
|
|
2212
2240
|
let oldChoices = list[list.length - 1].choices;
|
|
2213
2241
|
if (oldChoices) {
|
|
2214
|
-
let choiceMade =
|
|
2242
|
+
let choiceMade = false;
|
|
2215
2243
|
if (step.choiceIndexMade !== void 0 && oldChoices.length > step.choiceIndexMade) {
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
choiceMade = oldChoices.find((choice) => {
|
|
2219
|
-
if (choice.type === Close) {
|
|
2220
|
-
return false;
|
|
2221
|
-
}
|
|
2222
|
-
return choice.label === step.currentLabel;
|
|
2223
|
-
});
|
|
2244
|
+
oldChoices[step.choiceIndexMade].isMadeChoice = true;
|
|
2245
|
+
choiceMade = true;
|
|
2224
2246
|
}
|
|
2225
|
-
list[list.length - 1].
|
|
2247
|
+
list[list.length - 1].playerMadeChoice = choiceMade;
|
|
2248
|
+
list[list.length - 1].choices = oldChoices;
|
|
2226
2249
|
}
|
|
2227
2250
|
}
|
|
2228
2251
|
if (dialoge || requiredChoices) {
|
|
2252
|
+
let choices = requiredChoices == null ? void 0 : requiredChoices.map((choice) => {
|
|
2253
|
+
return {
|
|
2254
|
+
text: choice.text,
|
|
2255
|
+
type: choice.type,
|
|
2256
|
+
isMadeChoice: false
|
|
2257
|
+
};
|
|
2258
|
+
});
|
|
2229
2259
|
list.push({
|
|
2230
2260
|
dialoge,
|
|
2231
|
-
|
|
2232
|
-
choices
|
|
2261
|
+
playerMadeChoice: false,
|
|
2262
|
+
choices,
|
|
2233
2263
|
stepIndex: step.index
|
|
2234
2264
|
});
|
|
2235
2265
|
}
|