@drincs/pixi-vn 0.5.3 → 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 +95 -65
- package/dist/functions/DialogueUtility.js.map +1 -1
- package/dist/functions/DialogueUtility.mjs +95 -65
- 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 +113 -141
- package/dist/functions/SavesUtility.js.map +1 -1
- package/dist/functions/SavesUtility.mjs +113 -141
- 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 +96 -66
- package/dist/functions/index.js.map +1 -1
- package/dist/functions/index.mjs +96 -66
- 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 +359 -325
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +358 -325
- 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 +10 -10
- package/dist/managers/StepManager.d.ts +10 -10
- package/dist/managers/StepManager.js +53 -79
- package/dist/managers/StepManager.js.map +1 -1
- package/dist/managers/StepManager.mjs +53 -79
- 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 +112 -140
- package/dist/managers/index.js.map +1 -1
- package/dist/managers/index.mjs +112 -140
- 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
|
@@ -54,95 +54,6 @@ var __async = (__this, __arguments, generator) => {
|
|
|
54
54
|
});
|
|
55
55
|
};
|
|
56
56
|
|
|
57
|
-
// src/types/PauseType.ts
|
|
58
|
-
var PauseValueType = "pause";
|
|
59
|
-
|
|
60
|
-
// src/types/RepeatType.ts
|
|
61
|
-
var Repeat = "repeat";
|
|
62
|
-
|
|
63
|
-
// src/classes/StoredClassModel.ts
|
|
64
|
-
var StoredClassModel = class {
|
|
65
|
-
/**
|
|
66
|
-
* @param categoryId The id of the category. For example if you are storing a character class, you can use "characters" as categoryId. so all instances of the character class will be stored in the "characters" category.
|
|
67
|
-
* @param id The id of instance of the class. This id must be unique for the category.
|
|
68
|
-
*/
|
|
69
|
-
constructor(categoryId, id) {
|
|
70
|
-
this.categoryId = categoryId;
|
|
71
|
-
this._id = id;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Is id of the stored class. is unique for this class.
|
|
75
|
-
*/
|
|
76
|
-
get id() {
|
|
77
|
-
return this._id;
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Update a property in the storage.
|
|
81
|
-
* @param propertyName The name of the property to set.
|
|
82
|
-
* @param value The value to set. If is undefined, the property will be removed from the storage.
|
|
83
|
-
*/
|
|
84
|
-
setStorageProperty(propertyName, value) {
|
|
85
|
-
let storage = GameStorageManager.getVariable(this.categoryId);
|
|
86
|
-
if (!storage) {
|
|
87
|
-
storage = {};
|
|
88
|
-
}
|
|
89
|
-
if (!storage.hasOwnProperty(this.id)) {
|
|
90
|
-
storage[this.id] = {};
|
|
91
|
-
}
|
|
92
|
-
if (value === void 0 || value === null) {
|
|
93
|
-
if (storage[this.id].hasOwnProperty(propertyName)) {
|
|
94
|
-
delete storage[this.id][propertyName];
|
|
95
|
-
}
|
|
96
|
-
} else {
|
|
97
|
-
storage[this.id] = __spreadProps(__spreadValues({}, storage[this.id]), { [propertyName]: value });
|
|
98
|
-
}
|
|
99
|
-
if (Object.keys(storage[this.id]).length === 0) {
|
|
100
|
-
delete storage[this.id];
|
|
101
|
-
}
|
|
102
|
-
GameStorageManager.setVariable(this.categoryId, storage);
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Get a property from the storage.
|
|
106
|
-
* @param propertyName The name of the property to get.
|
|
107
|
-
* @returns The value of the property. If the property is not found, returns undefined.
|
|
108
|
-
*/
|
|
109
|
-
getStorageProperty(propertyName) {
|
|
110
|
-
let storage = GameStorageManager.getVariable(this.categoryId);
|
|
111
|
-
if (storage && storage.hasOwnProperty(this.id) && storage[this.id].hasOwnProperty(propertyName)) {
|
|
112
|
-
return storage[this.id][propertyName];
|
|
113
|
-
}
|
|
114
|
-
return void 0;
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
// src/decorators/CanvasElementDecorator.ts
|
|
119
|
-
var registeredCanvasElement = {};
|
|
120
|
-
function getCanvasElementInstanceByClassName(canvasName) {
|
|
121
|
-
try {
|
|
122
|
-
let eventType = registeredCanvasElement[canvasName];
|
|
123
|
-
if (!eventType) {
|
|
124
|
-
if (canvasName === "CanvasContainer") {
|
|
125
|
-
eventType = CanvasContainer;
|
|
126
|
-
} else if (canvasName === "CanvasImage") {
|
|
127
|
-
eventType = CanvasImage;
|
|
128
|
-
} else if (canvasName === "CanvasSprite") {
|
|
129
|
-
eventType = CanvasSprite;
|
|
130
|
-
} else if (canvasName === "CanvasText") {
|
|
131
|
-
eventType = CanvasText;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
if (!eventType) {
|
|
135
|
-
console.error(`[Pixi'VN] CanvasElement ${canvasName} not found`);
|
|
136
|
-
return;
|
|
137
|
-
}
|
|
138
|
-
let canvasElement = new eventType();
|
|
139
|
-
return canvasElement;
|
|
140
|
-
} catch (e) {
|
|
141
|
-
console.error(`[Pixi'VN] Error while getting CanvasElement ${canvasName}`, e);
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
57
|
// src/functions/CanvasUtility.ts
|
|
147
58
|
function getTextureMemory(texture) {
|
|
148
59
|
let sourceTexture = texture.source;
|
|
@@ -578,29 +489,33 @@ function setMemoryText(element, memory) {
|
|
|
578
489
|
}
|
|
579
490
|
}
|
|
580
491
|
|
|
581
|
-
// src/
|
|
582
|
-
var
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
492
|
+
// src/decorators/CanvasElementDecorator.ts
|
|
493
|
+
var registeredCanvasElement = {};
|
|
494
|
+
function getCanvasElementInstanceByClassName(canvasName) {
|
|
495
|
+
try {
|
|
496
|
+
let eventType = registeredCanvasElement[canvasName];
|
|
497
|
+
if (!eventType) {
|
|
498
|
+
if (canvasName === "CanvasContainer") {
|
|
499
|
+
eventType = CanvasContainer;
|
|
500
|
+
} else if (canvasName === "CanvasImage") {
|
|
501
|
+
eventType = CanvasImage;
|
|
502
|
+
} else if (canvasName === "CanvasSprite") {
|
|
503
|
+
eventType = CanvasSprite;
|
|
504
|
+
} else if (canvasName === "CanvasText") {
|
|
505
|
+
eventType = CanvasText;
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
if (!eventType) {
|
|
509
|
+
console.error(`[Pixi'VN] CanvasElement ${canvasName} not found`);
|
|
510
|
+
return;
|
|
511
|
+
}
|
|
512
|
+
let canvasElement = new eventType();
|
|
513
|
+
return canvasElement;
|
|
514
|
+
} catch (e) {
|
|
515
|
+
console.error(`[Pixi'VN] Error while getting CanvasElement ${canvasName}`, e);
|
|
516
|
+
return;
|
|
602
517
|
}
|
|
603
|
-
}
|
|
518
|
+
}
|
|
604
519
|
|
|
605
520
|
// src/decorators/TickerDecorator.ts
|
|
606
521
|
var registeredTickers = {};
|
|
@@ -629,7 +544,90 @@ function geTickerInstanceByClassName(tickerName, args, duration, priority) {
|
|
|
629
544
|
}
|
|
630
545
|
}
|
|
631
546
|
|
|
632
|
-
// src/
|
|
547
|
+
// src/types/PauseType.ts
|
|
548
|
+
var PauseValueType = "pause";
|
|
549
|
+
|
|
550
|
+
// src/types/RepeatType.ts
|
|
551
|
+
var Repeat = "repeat";
|
|
552
|
+
|
|
553
|
+
// src/classes/StoredClassModel.ts
|
|
554
|
+
var StoredClassModel = class {
|
|
555
|
+
/**
|
|
556
|
+
* @param categoryId The id of the category. For example if you are storing a character class, you can use "characters" as categoryId. so all instances of the character class will be stored in the "characters" category.
|
|
557
|
+
* @param id The id of instance of the class. This id must be unique for the category.
|
|
558
|
+
*/
|
|
559
|
+
constructor(categoryId, id) {
|
|
560
|
+
this.categoryId = categoryId;
|
|
561
|
+
this._id = id;
|
|
562
|
+
}
|
|
563
|
+
/**
|
|
564
|
+
* Is id of the stored class. is unique for this class.
|
|
565
|
+
*/
|
|
566
|
+
get id() {
|
|
567
|
+
return this._id;
|
|
568
|
+
}
|
|
569
|
+
/**
|
|
570
|
+
* Update a property in the storage.
|
|
571
|
+
* @param propertyName The name of the property to set.
|
|
572
|
+
* @param value The value to set. If is undefined, the property will be removed from the storage.
|
|
573
|
+
*/
|
|
574
|
+
setStorageProperty(propertyName, value) {
|
|
575
|
+
let storage = GameStorageManager.getVariable(this.categoryId);
|
|
576
|
+
if (!storage) {
|
|
577
|
+
storage = {};
|
|
578
|
+
}
|
|
579
|
+
if (!storage.hasOwnProperty(this.id)) {
|
|
580
|
+
storage[this.id] = {};
|
|
581
|
+
}
|
|
582
|
+
if (value === void 0 || value === null) {
|
|
583
|
+
if (storage[this.id].hasOwnProperty(propertyName)) {
|
|
584
|
+
delete storage[this.id][propertyName];
|
|
585
|
+
}
|
|
586
|
+
} else {
|
|
587
|
+
storage[this.id] = __spreadProps(__spreadValues({}, storage[this.id]), { [propertyName]: value });
|
|
588
|
+
}
|
|
589
|
+
if (Object.keys(storage[this.id]).length === 0) {
|
|
590
|
+
delete storage[this.id];
|
|
591
|
+
}
|
|
592
|
+
GameStorageManager.setVariable(this.categoryId, storage);
|
|
593
|
+
}
|
|
594
|
+
/**
|
|
595
|
+
* Get a property from the storage.
|
|
596
|
+
* @param propertyName The name of the property to get.
|
|
597
|
+
* @returns The value of the property. If the property is not found, returns undefined.
|
|
598
|
+
*/
|
|
599
|
+
getStorageProperty(propertyName) {
|
|
600
|
+
let storage = GameStorageManager.getVariable(this.categoryId);
|
|
601
|
+
if (storage && storage.hasOwnProperty(this.id) && storage[this.id].hasOwnProperty(propertyName)) {
|
|
602
|
+
return storage[this.id][propertyName];
|
|
603
|
+
}
|
|
604
|
+
return void 0;
|
|
605
|
+
}
|
|
606
|
+
};
|
|
607
|
+
|
|
608
|
+
// src/classes/ticker/TickerBase.ts
|
|
609
|
+
var TickerBase = class {
|
|
610
|
+
/**
|
|
611
|
+
* @param args The arguments that you want to pass to the ticker.
|
|
612
|
+
* @param duration The duration of the ticker. If is undefined, the ticker will be called every frame.
|
|
613
|
+
* @param priority The priority of the ticker. If is undefined, the priority will be UPDATE_PRIORITY.NORMAL.
|
|
614
|
+
*/
|
|
615
|
+
constructor(args, duration, priority) {
|
|
616
|
+
this.args = args;
|
|
617
|
+
this.duration = duration;
|
|
618
|
+
this.priority = priority;
|
|
619
|
+
}
|
|
620
|
+
/**
|
|
621
|
+
* The method that will be called every frame.
|
|
622
|
+
* This method should be overridden and you can use GameWindowManager.addCanvasElement() to get the canvas element of the canvas, and edit them.
|
|
623
|
+
* @param t The ticker that is calling this method
|
|
624
|
+
* @param args The arguments that you passed when you added the ticker
|
|
625
|
+
* @param tags The tags of the canvas elements that are connected to this ticker
|
|
626
|
+
*/
|
|
627
|
+
fn(_t, _args, _tags) {
|
|
628
|
+
throw new Error("[Pixi'VN] The method TickerBase.fn() must be overridden");
|
|
629
|
+
}
|
|
630
|
+
};
|
|
633
631
|
var TickerFadeAlpha = class extends TickerBase {
|
|
634
632
|
/**
|
|
635
633
|
* The method that will be called every frame to fade the alpha of the canvas element of the canvas.
|