@drincs/pixi-vn 0.6.1 → 0.6.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.
Files changed (289) hide show
  1. package/dist/{TickerBase-BAUiHet_.d.ts → TickerBase-3rLpDpmb.d.ts} +9 -0
  2. package/dist/{TickerBase-BctFf13y.d.mts → TickerBase-DKYzbzro.d.mts} +9 -0
  3. package/dist/classes/CanvasEvent.d.mts +6 -0
  4. package/dist/classes/CanvasEvent.d.ts +6 -0
  5. package/dist/classes/CanvasEvent.js +7 -0
  6. package/dist/classes/CanvasEvent.js.map +1 -1
  7. package/dist/classes/CanvasEvent.mjs +7 -0
  8. package/dist/classes/CanvasEvent.mjs.map +1 -1
  9. package/dist/classes/CharacterBaseModel.js +93 -65
  10. package/dist/classes/CharacterBaseModel.js.map +1 -1
  11. package/dist/classes/CharacterBaseModel.mjs +93 -65
  12. package/dist/classes/CharacterBaseModel.mjs.map +1 -1
  13. package/dist/classes/ChoiceMenuOption.js +94 -66
  14. package/dist/classes/ChoiceMenuOption.js.map +1 -1
  15. package/dist/classes/ChoiceMenuOption.mjs +94 -66
  16. package/dist/classes/ChoiceMenuOption.mjs.map +1 -1
  17. package/dist/classes/CloseLabel.js +1 -1
  18. package/dist/classes/CloseLabel.js.map +1 -1
  19. package/dist/classes/CloseLabel.mjs +1 -1
  20. package/dist/classes/CloseLabel.mjs.map +1 -1
  21. package/dist/classes/DialogueBaseModel.d.mts +2 -2
  22. package/dist/classes/DialogueBaseModel.d.ts +2 -2
  23. package/dist/classes/DialogueBaseModel.js +5 -5
  24. package/dist/classes/DialogueBaseModel.js.map +1 -1
  25. package/dist/classes/DialogueBaseModel.mjs +5 -5
  26. package/dist/classes/DialogueBaseModel.mjs.map +1 -1
  27. package/dist/classes/Label.d.mts +1 -1
  28. package/dist/classes/Label.d.ts +1 -1
  29. package/dist/classes/Label.js +1 -1
  30. package/dist/classes/Label.js.map +1 -1
  31. package/dist/classes/Label.mjs +1 -1
  32. package/dist/classes/Label.mjs.map +1 -1
  33. package/dist/classes/StoredClassModel.js +93 -65
  34. package/dist/classes/StoredClassModel.js.map +1 -1
  35. package/dist/classes/StoredClassModel.mjs +93 -65
  36. package/dist/classes/StoredClassModel.mjs.map +1 -1
  37. package/dist/classes/canvas/CanvasBase.d.mts +5 -1
  38. package/dist/classes/canvas/CanvasBase.d.ts +5 -1
  39. package/dist/classes/canvas/CanvasBase.js +7 -0
  40. package/dist/classes/canvas/CanvasBase.js.map +1 -1
  41. package/dist/classes/canvas/CanvasBase.mjs +7 -0
  42. package/dist/classes/canvas/CanvasBase.mjs.map +1 -1
  43. package/dist/classes/canvas/CanvasContainer.d.mts +4 -1
  44. package/dist/classes/canvas/CanvasContainer.d.ts +4 -1
  45. package/dist/classes/canvas/CanvasContainer.js +57 -37
  46. package/dist/classes/canvas/CanvasContainer.js.map +1 -1
  47. package/dist/classes/canvas/CanvasContainer.mjs +57 -38
  48. package/dist/classes/canvas/CanvasContainer.mjs.map +1 -1
  49. package/dist/classes/canvas/CanvasImage.d.mts +4 -2
  50. package/dist/classes/canvas/CanvasImage.d.ts +4 -2
  51. package/dist/classes/canvas/CanvasImage.js +33 -20
  52. package/dist/classes/canvas/CanvasImage.js.map +1 -1
  53. package/dist/classes/canvas/CanvasImage.mjs +30 -20
  54. package/dist/classes/canvas/CanvasImage.mjs.map +1 -1
  55. package/dist/classes/canvas/CanvasSprite.d.mts +5 -2
  56. package/dist/classes/canvas/CanvasSprite.d.ts +5 -2
  57. package/dist/classes/canvas/CanvasSprite.js +25 -17
  58. package/dist/classes/canvas/CanvasSprite.js.map +1 -1
  59. package/dist/classes/canvas/CanvasSprite.mjs +25 -18
  60. package/dist/classes/canvas/CanvasSprite.mjs.map +1 -1
  61. package/dist/classes/canvas/CanvasText.d.mts +6 -3
  62. package/dist/classes/canvas/CanvasText.d.ts +6 -3
  63. package/dist/classes/canvas/CanvasText.js +25 -17
  64. package/dist/classes/canvas/CanvasText.js.map +1 -1
  65. package/dist/classes/canvas/CanvasText.mjs +25 -18
  66. package/dist/classes/canvas/CanvasText.mjs.map +1 -1
  67. package/dist/classes/canvas/index.js +184 -158
  68. package/dist/classes/canvas/index.js.map +1 -1
  69. package/dist/classes/canvas/index.mjs +184 -158
  70. package/dist/classes/canvas/index.mjs.map +1 -1
  71. package/dist/classes/index.d.mts +1 -0
  72. package/dist/classes/index.d.ts +1 -0
  73. package/dist/classes/index.js +106 -71
  74. package/dist/classes/index.js.map +1 -1
  75. package/dist/classes/index.mjs +106 -71
  76. package/dist/classes/index.mjs.map +1 -1
  77. package/dist/classes/ticker/FadeAlphaTicker.d.mts +2 -1
  78. package/dist/classes/ticker/FadeAlphaTicker.d.ts +2 -1
  79. package/dist/classes/ticker/FadeAlphaTicker.js +93 -65
  80. package/dist/classes/ticker/FadeAlphaTicker.js.map +1 -1
  81. package/dist/classes/ticker/FadeAlphaTicker.mjs +93 -65
  82. package/dist/classes/ticker/FadeAlphaTicker.mjs.map +1 -1
  83. package/dist/classes/ticker/MoveTicker.d.mts +2 -1
  84. package/dist/classes/ticker/MoveTicker.d.ts +2 -1
  85. package/dist/classes/ticker/MoveTicker.js +93 -65
  86. package/dist/classes/ticker/MoveTicker.js.map +1 -1
  87. package/dist/classes/ticker/MoveTicker.mjs +93 -65
  88. package/dist/classes/ticker/MoveTicker.mjs.map +1 -1
  89. package/dist/classes/ticker/RotateTicker.d.mts +2 -1
  90. package/dist/classes/ticker/RotateTicker.d.ts +2 -1
  91. package/dist/classes/ticker/RotateTicker.js +93 -65
  92. package/dist/classes/ticker/RotateTicker.js.map +1 -1
  93. package/dist/classes/ticker/RotateTicker.mjs +93 -65
  94. package/dist/classes/ticker/RotateTicker.mjs.map +1 -1
  95. package/dist/classes/ticker/TickerBase.d.mts +2 -1
  96. package/dist/classes/ticker/TickerBase.d.ts +2 -1
  97. package/dist/classes/ticker/TickerBase.js +5 -0
  98. package/dist/classes/ticker/TickerBase.js.map +1 -1
  99. package/dist/classes/ticker/TickerBase.mjs +5 -0
  100. package/dist/classes/ticker/TickerBase.mjs.map +1 -1
  101. package/dist/classes/ticker/ZoomTicker.d.mts +9 -3
  102. package/dist/classes/ticker/ZoomTicker.d.ts +9 -3
  103. package/dist/classes/ticker/ZoomTicker.js +108 -66
  104. package/dist/classes/ticker/ZoomTicker.js.map +1 -1
  105. package/dist/classes/ticker/ZoomTicker.mjs +106 -66
  106. package/dist/classes/ticker/ZoomTicker.mjs.map +1 -1
  107. package/dist/classes/ticker/index.d.mts +2 -1
  108. package/dist/classes/ticker/index.d.ts +2 -1
  109. package/dist/classes/ticker/index.js +230 -202
  110. package/dist/classes/ticker/index.js.map +1 -1
  111. package/dist/classes/ticker/index.mjs +230 -202
  112. package/dist/classes/ticker/index.mjs.map +1 -1
  113. package/dist/constants.d.mts +1 -1
  114. package/dist/constants.d.ts +1 -1
  115. package/dist/constants.js +1 -1
  116. package/dist/constants.js.map +1 -1
  117. package/dist/constants.mjs +1 -1
  118. package/dist/constants.mjs.map +1 -1
  119. package/dist/decorators/CanvasElementDecorator.d.mts +3 -3
  120. package/dist/decorators/CanvasElementDecorator.d.ts +3 -3
  121. package/dist/decorators/CanvasElementDecorator.js +63 -43
  122. package/dist/decorators/CanvasElementDecorator.js.map +1 -1
  123. package/dist/decorators/CanvasElementDecorator.mjs +62 -42
  124. package/dist/decorators/CanvasElementDecorator.mjs.map +1 -1
  125. package/dist/decorators/EventDecorator.d.mts +7 -7
  126. package/dist/decorators/EventDecorator.d.ts +7 -7
  127. package/dist/decorators/EventDecorator.js +11 -10
  128. package/dist/decorators/EventDecorator.js.map +1 -1
  129. package/dist/decorators/EventDecorator.mjs +10 -9
  130. package/dist/decorators/EventDecorator.mjs.map +1 -1
  131. package/dist/decorators/LabelDecorator.js +94 -66
  132. package/dist/decorators/LabelDecorator.js.map +1 -1
  133. package/dist/decorators/LabelDecorator.mjs +94 -66
  134. package/dist/decorators/LabelDecorator.mjs.map +1 -1
  135. package/dist/decorators/TickerDecorator.d.mts +5 -5
  136. package/dist/decorators/TickerDecorator.d.ts +5 -5
  137. package/dist/decorators/TickerDecorator.js +6 -5
  138. package/dist/decorators/TickerDecorator.js.map +1 -1
  139. package/dist/decorators/TickerDecorator.mjs +6 -5
  140. package/dist/decorators/TickerDecorator.mjs.map +1 -1
  141. package/dist/decorators/index.d.mts +1 -1
  142. package/dist/decorators/index.d.ts +1 -1
  143. package/dist/decorators/index.js +96 -66
  144. package/dist/decorators/index.js.map +1 -1
  145. package/dist/decorators/index.mjs +96 -66
  146. package/dist/decorators/index.mjs.map +1 -1
  147. package/dist/functions/CanvasUtility.js +56 -37
  148. package/dist/functions/CanvasUtility.js.map +1 -1
  149. package/dist/functions/CanvasUtility.mjs +56 -37
  150. package/dist/functions/CanvasUtility.mjs.map +1 -1
  151. package/dist/functions/DialogueUtility.d.mts +1 -1
  152. package/dist/functions/DialogueUtility.d.ts +1 -1
  153. package/dist/functions/DialogueUtility.js +240 -201
  154. package/dist/functions/DialogueUtility.js.map +1 -1
  155. package/dist/functions/DialogueUtility.mjs +240 -201
  156. package/dist/functions/DialogueUtility.mjs.map +1 -1
  157. package/dist/functions/FlagsUtility.js +93 -65
  158. package/dist/functions/FlagsUtility.js.map +1 -1
  159. package/dist/functions/FlagsUtility.mjs +93 -65
  160. package/dist/functions/FlagsUtility.mjs.map +1 -1
  161. package/dist/functions/GameUtility.js +93 -65
  162. package/dist/functions/GameUtility.js.map +1 -1
  163. package/dist/functions/GameUtility.mjs +93 -65
  164. package/dist/functions/GameUtility.mjs.map +1 -1
  165. package/dist/functions/ImageUtility.d.mts +35 -2
  166. package/dist/functions/ImageUtility.d.ts +35 -2
  167. package/dist/functions/ImageUtility.js +371 -186
  168. package/dist/functions/ImageUtility.js.map +1 -1
  169. package/dist/functions/ImageUtility.mjs +368 -187
  170. package/dist/functions/ImageUtility.mjs.map +1 -1
  171. package/dist/functions/SavesUtility.d.mts +2 -2
  172. package/dist/functions/SavesUtility.d.ts +2 -2
  173. package/dist/functions/SavesUtility.js +141 -71
  174. package/dist/functions/SavesUtility.js.map +1 -1
  175. package/dist/functions/SavesUtility.mjs +141 -71
  176. package/dist/functions/SavesUtility.mjs.map +1 -1
  177. package/dist/functions/index.d.mts +6 -3
  178. package/dist/functions/index.d.ts +6 -3
  179. package/dist/functions/index.js +277 -81
  180. package/dist/functions/index.js.map +1 -1
  181. package/dist/functions/index.mjs +275 -83
  182. package/dist/functions/index.mjs.map +1 -1
  183. package/dist/index.d.mts +4 -4
  184. package/dist/index.d.ts +4 -4
  185. package/dist/index.js +644 -153
  186. package/dist/index.js.map +1 -1
  187. package/dist/index.mjs +642 -155
  188. package/dist/index.mjs.map +1 -1
  189. package/dist/interface/IHistoryStep.d.mts +2 -2
  190. package/dist/interface/IHistoryStep.d.ts +2 -2
  191. package/dist/interface/ISaveData.d.mts +2 -2
  192. package/dist/interface/ISaveData.d.ts +2 -2
  193. package/dist/interface/ITicker.d.mts +2 -1
  194. package/dist/interface/ITicker.d.ts +2 -1
  195. package/dist/interface/ITickersSteps.d.mts +12 -3
  196. package/dist/interface/ITickersSteps.d.ts +12 -3
  197. package/dist/interface/TickerHistory.d.mts +3 -3
  198. package/dist/interface/TickerHistory.d.ts +3 -3
  199. package/dist/interface/canvas/ICanvasBaseMemory.d.mts +1 -1
  200. package/dist/interface/canvas/ICanvasBaseMemory.d.ts +1 -1
  201. package/dist/interface/canvas/ICanvasImageMemory.d.mts +2 -2
  202. package/dist/interface/canvas/ICanvasImageMemory.d.ts +2 -2
  203. package/dist/interface/canvas/ICanvasSpriteMemory.d.mts +1 -2
  204. package/dist/interface/canvas/ICanvasSpriteMemory.d.ts +1 -2
  205. package/dist/interface/canvas/ICanvasTextTextMemory.d.mts +1 -2
  206. package/dist/interface/canvas/ICanvasTextTextMemory.d.ts +1 -2
  207. package/dist/interface/export/ExportedCanvas.d.mts +2 -2
  208. package/dist/interface/export/ExportedCanvas.d.ts +2 -2
  209. package/dist/interface/export/ExportedStep.d.mts +2 -2
  210. package/dist/interface/export/ExportedStep.d.ts +2 -2
  211. package/dist/interface/export/index.d.mts +2 -2
  212. package/dist/interface/export/index.d.ts +2 -2
  213. package/dist/interface/index.d.mts +2 -2
  214. package/dist/interface/index.d.ts +2 -2
  215. package/dist/labels/BaseCanvasElementTestLabel.js +400 -372
  216. package/dist/labels/BaseCanvasElementTestLabel.js.map +1 -1
  217. package/dist/labels/BaseCanvasElementTestLabel.mjs +401 -373
  218. package/dist/labels/BaseCanvasElementTestLabel.mjs.map +1 -1
  219. package/dist/labels/{EventsTestLabel.d.mts → CanvasEventsTestLabel.d.mts} +4 -7
  220. package/dist/labels/{EventsTestLabel.d.ts → CanvasEventsTestLabel.d.ts} +4 -7
  221. package/dist/labels/{EventsTestLabel.js → CanvasEventsTestLabel.js} +320 -98
  222. package/dist/labels/CanvasEventsTestLabel.js.map +1 -0
  223. package/dist/labels/{EventsTestLabel.mjs → CanvasEventsTestLabel.mjs} +320 -98
  224. package/dist/labels/CanvasEventsTestLabel.mjs.map +1 -0
  225. package/dist/labels/{TintingTestLabel.d.mts → CustomTickerCanvasElementTestLabel.d.mts} +5 -4
  226. package/dist/labels/{TintingTestLabel.d.ts → CustomTickerCanvasElementTestLabel.d.ts} +5 -4
  227. package/dist/labels/CustomTickerCanvasElementTestLabel.js +2792 -0
  228. package/dist/labels/CustomTickerCanvasElementTestLabel.js.map +1 -0
  229. package/dist/labels/CustomTickerCanvasElementTestLabel.mjs +2786 -0
  230. package/dist/labels/CustomTickerCanvasElementTestLabel.mjs.map +1 -0
  231. package/dist/labels/{ShowImageTest.js → ImagesAnimationsTestLabel.js} +373 -82
  232. package/dist/labels/ImagesAnimationsTestLabel.js.map +1 -0
  233. package/dist/labels/{ShowImageTest.mjs → ImagesAnimationsTestLabel.mjs} +373 -82
  234. package/dist/labels/ImagesAnimationsTestLabel.mjs.map +1 -0
  235. package/dist/labels/MarkdownTest.js +150 -80
  236. package/dist/labels/MarkdownTest.js.map +1 -1
  237. package/dist/labels/MarkdownTest.mjs +150 -80
  238. package/dist/labels/MarkdownTest.mjs.map +1 -1
  239. package/dist/labels/StartLabel.js +689 -152
  240. package/dist/labels/StartLabel.js.map +1 -1
  241. package/dist/labels/StartLabel.mjs +690 -153
  242. package/dist/labels/StartLabel.mjs.map +1 -1
  243. package/dist/labels/TestConstant.d.mts +3 -1
  244. package/dist/labels/TestConstant.d.ts +3 -1
  245. package/dist/labels/TestConstant.js +97 -65
  246. package/dist/labels/TestConstant.js.map +1 -1
  247. package/dist/labels/TestConstant.mjs +96 -66
  248. package/dist/labels/TestConstant.mjs.map +1 -1
  249. package/dist/labels/TickerTestLabel.js +472 -402
  250. package/dist/labels/TickerTestLabel.js.map +1 -1
  251. package/dist/labels/TickerTestLabel.mjs +473 -403
  252. package/dist/labels/TickerTestLabel.mjs.map +1 -1
  253. package/dist/labels/index.js +689 -152
  254. package/dist/labels/index.js.map +1 -1
  255. package/dist/labels/index.mjs +690 -153
  256. package/dist/labels/index.mjs.map +1 -1
  257. package/dist/managers/StepManager.d.mts +5 -4
  258. package/dist/managers/StepManager.d.ts +5 -4
  259. package/dist/managers/StepManager.js +140 -70
  260. package/dist/managers/StepManager.js.map +1 -1
  261. package/dist/managers/StepManager.mjs +140 -70
  262. package/dist/managers/StepManager.mjs.map +1 -1
  263. package/dist/managers/WindowManager.d.mts +1 -1
  264. package/dist/managers/WindowManager.d.ts +1 -1
  265. package/dist/managers/WindowManager.js +84 -60
  266. package/dist/managers/WindowManager.js.map +1 -1
  267. package/dist/managers/WindowManager.mjs +84 -60
  268. package/dist/managers/WindowManager.mjs.map +1 -1
  269. package/dist/managers/index.d.mts +2 -2
  270. package/dist/managers/index.d.ts +2 -2
  271. package/dist/managers/index.js +140 -70
  272. package/dist/managers/index.js.map +1 -1
  273. package/dist/managers/index.mjs +140 -70
  274. package/dist/managers/index.mjs.map +1 -1
  275. package/dist/types/ticker/MoveTickerProps.d.mts +1 -1
  276. package/dist/types/ticker/MoveTickerProps.d.ts +1 -1
  277. package/dist/types/ticker/RotateTickerProps.d.mts +1 -1
  278. package/dist/types/ticker/RotateTickerProps.d.ts +1 -1
  279. package/package.json +1 -1
  280. package/dist/labels/EventsTestLabel.js.map +0 -1
  281. package/dist/labels/EventsTestLabel.mjs.map +0 -1
  282. package/dist/labels/ShowImageTest.js.map +0 -1
  283. package/dist/labels/ShowImageTest.mjs.map +0 -1
  284. package/dist/labels/TintingTestLabel.js +0 -1786
  285. package/dist/labels/TintingTestLabel.js.map +0 -1
  286. package/dist/labels/TintingTestLabel.mjs +0 -1780
  287. package/dist/labels/TintingTestLabel.mjs.map +0 -1
  288. /package/dist/labels/{ShowImageTest.d.mts → ImagesAnimationsTestLabel.d.mts} +0 -0
  289. /package/dist/labels/{ShowImageTest.d.ts → ImagesAnimationsTestLabel.d.ts} +0 -0
@@ -24,7 +24,7 @@ var Label = class {
24
24
  this._choiseIndex = choiseIndex;
25
25
  }
26
26
  /**
27
- * Get the id of the label
27
+ * Get the id of the label. This variable is used in the system to get the label by id, {@link getLabelById}
28
28
  */
29
29
  get id() {
30
30
  return this._id;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/functions/StepLabelUtility.ts","../../src/classes/Label.ts","../../src/classes/CloseLabel.ts"],"names":[],"mappings":";AAAA,OAAO,UAAU;AAmBV,SAAS,oBAAoB,OAAiD,OAA0D;AAC3I,SAAO,UAAU;AACrB;;;ACQA,IAAqB,QAArB,MAA8C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO1C,YAAY,IAAiB,OAAwD,WAAwC,aAAsB;AAC/I,SAAK,MAAM;AACX,SAAK,SAAS;AACd,SAAK,aAAa;AAClB,SAAK,eAAe;AAAA,EACxB;AAAA;AAAA;AAAA;AAAA,EAMA,IAAW,KAAkB;AACzB,WAAO,KAAK;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,IAAW,QAA4B;AACnC,QAAI,OAAO,KAAK,WAAW,YAAY;AACnC,aAAO,KAAK,OAAO;AAAA,IACvB;AACA,WAAO,KAAK;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOO,4BAA4B,eAAgE;AAC/F,QAAI,cAAc,WAAW,GAAG;AAC5B,aAAO;AAAA,IACX;AACA,QAAI,MAAc;AAClB,kBAAc,QAAQ,CAAC,MAAM,UAAU;AACnC,UAAI,oBAAoB,MAAM,KAAK,MAAM,KAAK,CAAC,GAAG;AAC9C,cAAM;AAAA,MACV;AAAA,IACJ,CAAC;AACD,WAAO;AAAA,EACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcA,IAAW,YAAsD;AAC7D,WAAO,KAAK;AAAA,EAChB;AAAA,EAGA,IAAW,cAAkC;AACzC,WAAO,KAAK;AAAA,EAChB;AACJ;;;ACpGO,IAAM,iBAAiB;AAKf,SAAR,cAAkD,aAAsB;AAAE,SAAO,IAAI,MAAS,gBAAgB,CAAC,GAAG,QAAW,WAAW;AAAE","sourcesContent":["import sha1 from 'crypto-js/sha1';\nimport { StepHistoryDataType } from \"../types/StepHistoryDataType\";\nimport { StepLabelType } from \"../types/StepLabelType\";\n\n/**\n * Convert StepLabel to StepHistoryData\n * @param step\n * @returns\n */\nexport function getStepSha1(step: StepLabelType): StepHistoryDataType {\n let sha1String = sha1(step.toString().toLocaleLowerCase())\n return sha1String.toString()\n}\n/**\n * Check if two steps are equal\n * @param step1\n * @param step2\n * @returns\n */\nexport function checkIfStepsIsEqual(step1: StepHistoryDataType | StepLabelType<any>, step2: StepHistoryDataType | StepLabelType<any>): boolean {\n return step1 === step2\n}\n","import { checkIfStepsIsEqual } from \"../functions/StepLabelUtility\"\nimport { LabelIdType } from \"../types/LabelIdType\"\nimport { StepHistoryDataType } from \"../types/StepHistoryDataType\"\nimport { StepLabelType } from \"../types/StepLabelType\"\n\n/**\n * Label is a class that contains a list of steps, which will be performed as the game continues.\n * For Ren'py this is the equivalent of a label.\n * @example\n * ```typescript\n * const START_LABEL_ID = \"StartLabel\"\n * \n * export const startLabel = newLabel(START_LABEL_ID,\n * [\n * (props) => {\n * GameWindowManager.clear()\n * setDialogue({ character: liam, text: \"Which test do you want to perform?\" })\n * setChoiceMenuOptions([\n * new ChoiceMenuOption(\"Events Test\", eventsTestLabel),\n * new ChoiceMenuOption(\"Show Image Test\", showImageTest),\n * ])\n * },\n * (props) => GameStepManager.jumpLabel(START_LABEL_ID, props),\n * ]\n * )\n * \n * GameStepManager.callLabel(StartLabel)\n * ```\n */\nexport default class Label<T extends {} = {}> {\n /**\n * @param id is the id of the label\n * @param steps is the list of steps that the label will perform\n * @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\n * @param choiseIndex is the index of the choice that the label will perform\n */\n constructor(id: LabelIdType, steps: StepLabelType<T>[] | (() => StepLabelType<T>[]), onStepRun?: () => void | Promise<void>, choiseIndex?: number) {\n this._id = id\n this._steps = steps\n this._onStepRun = onStepRun\n this._choiseIndex = choiseIndex\n }\n\n private _id: LabelIdType\n /**\n * Get the id of the label\n */\n public get id(): LabelIdType {\n return this._id\n }\n\n private _steps: StepLabelType<T>[] | (() => StepLabelType<T>[])\n /**\n * Get the steps of the label.\n * This class should be extended and the steps method should be overridden.\n * Every time you update this list will also be updated when the other game versions load.\n */\n public get steps(): StepLabelType<T>[] {\n if (typeof this._steps === \"function\") {\n return this._steps()\n }\n return this._steps\n }\n\n /**\n * Get the corresponding steps number\n * @param externalSteps\n * @returns Numer of corresponding steps, for example, if externalSteps is [ABC, DEF, GHI] and the steps of the label is [ABC, GHT], the result will be 1\n */\n public getCorrespondingStepsNumber(externalSteps: StepHistoryDataType[] | StepLabelType[]): number {\n if (externalSteps.length === 0) {\n return 0\n }\n let res: number = 0\n externalSteps.forEach((step, index) => {\n if (checkIfStepsIsEqual(step, this.steps[index])) {\n res = index\n }\n })\n return res\n }\n\n private _onStepRun: (() => void | Promise<void>) | undefined\n /**\n * 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\n * @returns Promise<void> or void\n * @example\n * ```typescript\n * newLabel(\"id\", [], () => {\n * Assets.load('path/to/image1.png')\n * Assets.load('path/to/image2.png')\n * })\n * ```\n */\n public get onStepRun(): (() => void | Promise<void>) | undefined {\n return this._onStepRun\n }\n\n private _choiseIndex: number | undefined\n public get choiseIndex(): number | undefined {\n return this._choiseIndex\n }\n}\n","import Label from \"./Label\"\n\nexport const CLOSE_LABEL_ID = \"__close-label-id__\"\n\n/**\n * CloseLabel is a label used for closing the menu.\n */\nexport default function newCloseLabel<T extends {} = {}>(choiseIndex?: number) { return new Label<T>(CLOSE_LABEL_ID, [], undefined, choiseIndex) }\n"]}
1
+ {"version":3,"sources":["../../src/functions/StepLabelUtility.ts","../../src/classes/Label.ts","../../src/classes/CloseLabel.ts"],"names":[],"mappings":";AAAA,OAAO,UAAU;AAmBV,SAAS,oBAAoB,OAAiD,OAA0D;AAC3I,SAAO,UAAU;AACrB;;;ACSA,IAAqB,QAArB,MAA8C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO1C,YAAY,IAAiB,OAAwD,WAAwC,aAAsB;AAC/I,SAAK,MAAM;AACX,SAAK,SAAS;AACd,SAAK,aAAa;AAClB,SAAK,eAAe;AAAA,EACxB;AAAA;AAAA;AAAA;AAAA,EAMA,IAAW,KAAkB;AACzB,WAAO,KAAK;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,IAAW,QAA4B;AACnC,QAAI,OAAO,KAAK,WAAW,YAAY;AACnC,aAAO,KAAK,OAAO;AAAA,IACvB;AACA,WAAO,KAAK;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOO,4BAA4B,eAAgE;AAC/F,QAAI,cAAc,WAAW,GAAG;AAC5B,aAAO;AAAA,IACX;AACA,QAAI,MAAc;AAClB,kBAAc,QAAQ,CAAC,MAAM,UAAU;AACnC,UAAI,oBAAoB,MAAM,KAAK,MAAM,KAAK,CAAC,GAAG;AAC9C,cAAM;AAAA,MACV;AAAA,IACJ,CAAC;AACD,WAAO;AAAA,EACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcA,IAAW,YAAsD;AAC7D,WAAO,KAAK;AAAA,EAChB;AAAA,EAGA,IAAW,cAAkC;AACzC,WAAO,KAAK;AAAA,EAChB;AACJ;;;ACrGO,IAAM,iBAAiB;AAKf,SAAR,cAAkD,aAAsB;AAAE,SAAO,IAAI,MAAS,gBAAgB,CAAC,GAAG,QAAW,WAAW;AAAE","sourcesContent":["import sha1 from 'crypto-js/sha1';\nimport { StepHistoryDataType } from \"../types/StepHistoryDataType\";\nimport { StepLabelType } from \"../types/StepLabelType\";\n\n/**\n * Convert StepLabel to StepHistoryData\n * @param step\n * @returns\n */\nexport function getStepSha1(step: StepLabelType): StepHistoryDataType {\n let sha1String = sha1(step.toString().toLocaleLowerCase())\n return sha1String.toString()\n}\n/**\n * Check if two steps are equal\n * @param step1\n * @param step2\n * @returns\n */\nexport function checkIfStepsIsEqual(step1: StepHistoryDataType | StepLabelType<any>, step2: StepHistoryDataType | StepLabelType<any>): boolean {\n return step1 === step2\n}\n","import { getLabelById } from \"../decorators\"\nimport { checkIfStepsIsEqual } from \"../functions/StepLabelUtility\"\nimport { LabelIdType } from \"../types/LabelIdType\"\nimport { StepHistoryDataType } from \"../types/StepHistoryDataType\"\nimport { StepLabelType } from \"../types/StepLabelType\"\n\n/**\n * Label is a class that contains a list of steps, which will be performed as the game continues.\n * For Ren'py this is the equivalent of a label.\n * @example\n * ```typescript\n * const START_LABEL_ID = \"StartLabel\"\n * \n * export const startLabel = newLabel(START_LABEL_ID,\n * [\n * (props) => {\n * GameWindowManager.clear()\n * setDialogue({ character: liam, text: \"Which test do you want to perform?\" })\n * setChoiceMenuOptions([\n * new ChoiceMenuOption(\"Events Test\", eventsTestLabel),\n * new ChoiceMenuOption(\"Show Image Test\", showImageTest),\n * ])\n * },\n * (props) => GameStepManager.jumpLabel(START_LABEL_ID, props),\n * ]\n * )\n * \n * GameStepManager.callLabel(StartLabel)\n * ```\n */\nexport default class Label<T extends {} = {}> {\n /**\n * @param id is the id of the label\n * @param steps is the list of steps that the label will perform\n * @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\n * @param choiseIndex is the index of the choice that the label will perform\n */\n constructor(id: LabelIdType, steps: StepLabelType<T>[] | (() => StepLabelType<T>[]), onStepRun?: () => void | Promise<void>, choiseIndex?: number) {\n this._id = id\n this._steps = steps\n this._onStepRun = onStepRun\n this._choiseIndex = choiseIndex\n }\n\n private _id: LabelIdType\n /**\n * Get the id of the label. This variable is used in the system to get the label by id, {@link getLabelById}\n */\n public get id(): LabelIdType {\n return this._id\n }\n\n private _steps: StepLabelType<T>[] | (() => StepLabelType<T>[])\n /**\n * Get the steps of the label.\n * This class should be extended and the steps method should be overridden.\n * Every time you update this list will also be updated when the other game versions load.\n */\n public get steps(): StepLabelType<T>[] {\n if (typeof this._steps === \"function\") {\n return this._steps()\n }\n return this._steps\n }\n\n /**\n * Get the corresponding steps number\n * @param externalSteps\n * @returns Numer of corresponding steps, for example, if externalSteps is [ABC, DEF, GHI] and the steps of the label is [ABC, GHT], the result will be 1\n */\n public getCorrespondingStepsNumber(externalSteps: StepHistoryDataType[] | StepLabelType[]): number {\n if (externalSteps.length === 0) {\n return 0\n }\n let res: number = 0\n externalSteps.forEach((step, index) => {\n if (checkIfStepsIsEqual(step, this.steps[index])) {\n res = index\n }\n })\n return res\n }\n\n private _onStepRun: (() => void | Promise<void>) | undefined\n /**\n * 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\n * @returns Promise<void> or void\n * @example\n * ```typescript\n * newLabel(\"id\", [], () => {\n * Assets.load('path/to/image1.png')\n * Assets.load('path/to/image2.png')\n * })\n * ```\n */\n public get onStepRun(): (() => void | Promise<void>) | undefined {\n return this._onStepRun\n }\n\n private _choiseIndex: number | undefined\n public get choiseIndex(): number | undefined {\n return this._choiseIndex\n }\n}\n","import Label from \"./Label\"\n\nexport const CLOSE_LABEL_ID = \"__close-label-id__\"\n\n/**\n * CloseLabel is a label used for closing the menu.\n */\nexport default function newCloseLabel<T extends {} = {}>(choiseIndex?: number) { return new Label<T>(CLOSE_LABEL_ID, [], undefined, choiseIndex) }\n"]}
@@ -20,7 +20,7 @@ var Label = class {
20
20
  this._choiseIndex = choiseIndex;
21
21
  }
22
22
  /**
23
- * Get the id of the label
23
+ * Get the id of the label. This variable is used in the system to get the label by id, {@link getLabelById}
24
24
  */
25
25
  get id() {
26
26
  return this._id;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/functions/StepLabelUtility.ts","../../src/classes/Label.ts","../../src/classes/CloseLabel.ts"],"names":[],"mappings":";AAAA,OAAO,UAAU;AAmBV,SAAS,oBAAoB,OAAiD,OAA0D;AAC3I,SAAO,UAAU;AACrB;;;ACQA,IAAqB,QAArB,MAA8C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO1C,YAAY,IAAiB,OAAwD,WAAwC,aAAsB;AAC/I,SAAK,MAAM;AACX,SAAK,SAAS;AACd,SAAK,aAAa;AAClB,SAAK,eAAe;AAAA,EACxB;AAAA;AAAA;AAAA;AAAA,EAMA,IAAW,KAAkB;AACzB,WAAO,KAAK;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,IAAW,QAA4B;AACnC,QAAI,OAAO,KAAK,WAAW,YAAY;AACnC,aAAO,KAAK,OAAO;AAAA,IACvB;AACA,WAAO,KAAK;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOO,4BAA4B,eAAgE;AAC/F,QAAI,cAAc,WAAW,GAAG;AAC5B,aAAO;AAAA,IACX;AACA,QAAI,MAAc;AAClB,kBAAc,QAAQ,CAAC,MAAM,UAAU;AACnC,UAAI,oBAAoB,MAAM,KAAK,MAAM,KAAK,CAAC,GAAG;AAC9C,cAAM;AAAA,MACV;AAAA,IACJ,CAAC;AACD,WAAO;AAAA,EACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcA,IAAW,YAAsD;AAC7D,WAAO,KAAK;AAAA,EAChB;AAAA,EAGA,IAAW,cAAkC;AACzC,WAAO,KAAK;AAAA,EAChB;AACJ;;;ACpGO,IAAM,iBAAiB;AAKf,SAAR,cAAkD,aAAsB;AAAE,SAAO,IAAI,MAAS,gBAAgB,CAAC,GAAG,QAAW,WAAW;AAAE","sourcesContent":["import sha1 from 'crypto-js/sha1';\nimport { StepHistoryDataType } from \"../types/StepHistoryDataType\";\nimport { StepLabelType } from \"../types/StepLabelType\";\n\n/**\n * Convert StepLabel to StepHistoryData\n * @param step\n * @returns\n */\nexport function getStepSha1(step: StepLabelType): StepHistoryDataType {\n let sha1String = sha1(step.toString().toLocaleLowerCase())\n return sha1String.toString()\n}\n/**\n * Check if two steps are equal\n * @param step1\n * @param step2\n * @returns\n */\nexport function checkIfStepsIsEqual(step1: StepHistoryDataType | StepLabelType<any>, step2: StepHistoryDataType | StepLabelType<any>): boolean {\n return step1 === step2\n}\n","import { checkIfStepsIsEqual } from \"../functions/StepLabelUtility\"\nimport { LabelIdType } from \"../types/LabelIdType\"\nimport { StepHistoryDataType } from \"../types/StepHistoryDataType\"\nimport { StepLabelType } from \"../types/StepLabelType\"\n\n/**\n * Label is a class that contains a list of steps, which will be performed as the game continues.\n * For Ren'py this is the equivalent of a label.\n * @example\n * ```typescript\n * const START_LABEL_ID = \"StartLabel\"\n * \n * export const startLabel = newLabel(START_LABEL_ID,\n * [\n * (props) => {\n * GameWindowManager.clear()\n * setDialogue({ character: liam, text: \"Which test do you want to perform?\" })\n * setChoiceMenuOptions([\n * new ChoiceMenuOption(\"Events Test\", eventsTestLabel),\n * new ChoiceMenuOption(\"Show Image Test\", showImageTest),\n * ])\n * },\n * (props) => GameStepManager.jumpLabel(START_LABEL_ID, props),\n * ]\n * )\n * \n * GameStepManager.callLabel(StartLabel)\n * ```\n */\nexport default class Label<T extends {} = {}> {\n /**\n * @param id is the id of the label\n * @param steps is the list of steps that the label will perform\n * @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\n * @param choiseIndex is the index of the choice that the label will perform\n */\n constructor(id: LabelIdType, steps: StepLabelType<T>[] | (() => StepLabelType<T>[]), onStepRun?: () => void | Promise<void>, choiseIndex?: number) {\n this._id = id\n this._steps = steps\n this._onStepRun = onStepRun\n this._choiseIndex = choiseIndex\n }\n\n private _id: LabelIdType\n /**\n * Get the id of the label\n */\n public get id(): LabelIdType {\n return this._id\n }\n\n private _steps: StepLabelType<T>[] | (() => StepLabelType<T>[])\n /**\n * Get the steps of the label.\n * This class should be extended and the steps method should be overridden.\n * Every time you update this list will also be updated when the other game versions load.\n */\n public get steps(): StepLabelType<T>[] {\n if (typeof this._steps === \"function\") {\n return this._steps()\n }\n return this._steps\n }\n\n /**\n * Get the corresponding steps number\n * @param externalSteps\n * @returns Numer of corresponding steps, for example, if externalSteps is [ABC, DEF, GHI] and the steps of the label is [ABC, GHT], the result will be 1\n */\n public getCorrespondingStepsNumber(externalSteps: StepHistoryDataType[] | StepLabelType[]): number {\n if (externalSteps.length === 0) {\n return 0\n }\n let res: number = 0\n externalSteps.forEach((step, index) => {\n if (checkIfStepsIsEqual(step, this.steps[index])) {\n res = index\n }\n })\n return res\n }\n\n private _onStepRun: (() => void | Promise<void>) | undefined\n /**\n * 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\n * @returns Promise<void> or void\n * @example\n * ```typescript\n * newLabel(\"id\", [], () => {\n * Assets.load('path/to/image1.png')\n * Assets.load('path/to/image2.png')\n * })\n * ```\n */\n public get onStepRun(): (() => void | Promise<void>) | undefined {\n return this._onStepRun\n }\n\n private _choiseIndex: number | undefined\n public get choiseIndex(): number | undefined {\n return this._choiseIndex\n }\n}\n","import Label from \"./Label\"\n\nexport const CLOSE_LABEL_ID = \"__close-label-id__\"\n\n/**\n * CloseLabel is a label used for closing the menu.\n */\nexport default function newCloseLabel<T extends {} = {}>(choiseIndex?: number) { return new Label<T>(CLOSE_LABEL_ID, [], undefined, choiseIndex) }\n"]}
1
+ {"version":3,"sources":["../../src/functions/StepLabelUtility.ts","../../src/classes/Label.ts","../../src/classes/CloseLabel.ts"],"names":[],"mappings":";AAAA,OAAO,UAAU;AAmBV,SAAS,oBAAoB,OAAiD,OAA0D;AAC3I,SAAO,UAAU;AACrB;;;ACSA,IAAqB,QAArB,MAA8C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO1C,YAAY,IAAiB,OAAwD,WAAwC,aAAsB;AAC/I,SAAK,MAAM;AACX,SAAK,SAAS;AACd,SAAK,aAAa;AAClB,SAAK,eAAe;AAAA,EACxB;AAAA;AAAA;AAAA;AAAA,EAMA,IAAW,KAAkB;AACzB,WAAO,KAAK;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,IAAW,QAA4B;AACnC,QAAI,OAAO,KAAK,WAAW,YAAY;AACnC,aAAO,KAAK,OAAO;AAAA,IACvB;AACA,WAAO,KAAK;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOO,4BAA4B,eAAgE;AAC/F,QAAI,cAAc,WAAW,GAAG;AAC5B,aAAO;AAAA,IACX;AACA,QAAI,MAAc;AAClB,kBAAc,QAAQ,CAAC,MAAM,UAAU;AACnC,UAAI,oBAAoB,MAAM,KAAK,MAAM,KAAK,CAAC,GAAG;AAC9C,cAAM;AAAA,MACV;AAAA,IACJ,CAAC;AACD,WAAO;AAAA,EACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcA,IAAW,YAAsD;AAC7D,WAAO,KAAK;AAAA,EAChB;AAAA,EAGA,IAAW,cAAkC;AACzC,WAAO,KAAK;AAAA,EAChB;AACJ;;;ACrGO,IAAM,iBAAiB;AAKf,SAAR,cAAkD,aAAsB;AAAE,SAAO,IAAI,MAAS,gBAAgB,CAAC,GAAG,QAAW,WAAW;AAAE","sourcesContent":["import sha1 from 'crypto-js/sha1';\nimport { StepHistoryDataType } from \"../types/StepHistoryDataType\";\nimport { StepLabelType } from \"../types/StepLabelType\";\n\n/**\n * Convert StepLabel to StepHistoryData\n * @param step\n * @returns\n */\nexport function getStepSha1(step: StepLabelType): StepHistoryDataType {\n let sha1String = sha1(step.toString().toLocaleLowerCase())\n return sha1String.toString()\n}\n/**\n * Check if two steps are equal\n * @param step1\n * @param step2\n * @returns\n */\nexport function checkIfStepsIsEqual(step1: StepHistoryDataType | StepLabelType<any>, step2: StepHistoryDataType | StepLabelType<any>): boolean {\n return step1 === step2\n}\n","import { getLabelById } from \"../decorators\"\nimport { checkIfStepsIsEqual } from \"../functions/StepLabelUtility\"\nimport { LabelIdType } from \"../types/LabelIdType\"\nimport { StepHistoryDataType } from \"../types/StepHistoryDataType\"\nimport { StepLabelType } from \"../types/StepLabelType\"\n\n/**\n * Label is a class that contains a list of steps, which will be performed as the game continues.\n * For Ren'py this is the equivalent of a label.\n * @example\n * ```typescript\n * const START_LABEL_ID = \"StartLabel\"\n * \n * export const startLabel = newLabel(START_LABEL_ID,\n * [\n * (props) => {\n * GameWindowManager.clear()\n * setDialogue({ character: liam, text: \"Which test do you want to perform?\" })\n * setChoiceMenuOptions([\n * new ChoiceMenuOption(\"Events Test\", eventsTestLabel),\n * new ChoiceMenuOption(\"Show Image Test\", showImageTest),\n * ])\n * },\n * (props) => GameStepManager.jumpLabel(START_LABEL_ID, props),\n * ]\n * )\n * \n * GameStepManager.callLabel(StartLabel)\n * ```\n */\nexport default class Label<T extends {} = {}> {\n /**\n * @param id is the id of the label\n * @param steps is the list of steps that the label will perform\n * @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\n * @param choiseIndex is the index of the choice that the label will perform\n */\n constructor(id: LabelIdType, steps: StepLabelType<T>[] | (() => StepLabelType<T>[]), onStepRun?: () => void | Promise<void>, choiseIndex?: number) {\n this._id = id\n this._steps = steps\n this._onStepRun = onStepRun\n this._choiseIndex = choiseIndex\n }\n\n private _id: LabelIdType\n /**\n * Get the id of the label. This variable is used in the system to get the label by id, {@link getLabelById}\n */\n public get id(): LabelIdType {\n return this._id\n }\n\n private _steps: StepLabelType<T>[] | (() => StepLabelType<T>[])\n /**\n * Get the steps of the label.\n * This class should be extended and the steps method should be overridden.\n * Every time you update this list will also be updated when the other game versions load.\n */\n public get steps(): StepLabelType<T>[] {\n if (typeof this._steps === \"function\") {\n return this._steps()\n }\n return this._steps\n }\n\n /**\n * Get the corresponding steps number\n * @param externalSteps\n * @returns Numer of corresponding steps, for example, if externalSteps is [ABC, DEF, GHI] and the steps of the label is [ABC, GHT], the result will be 1\n */\n public getCorrespondingStepsNumber(externalSteps: StepHistoryDataType[] | StepLabelType[]): number {\n if (externalSteps.length === 0) {\n return 0\n }\n let res: number = 0\n externalSteps.forEach((step, index) => {\n if (checkIfStepsIsEqual(step, this.steps[index])) {\n res = index\n }\n })\n return res\n }\n\n private _onStepRun: (() => void | Promise<void>) | undefined\n /**\n * 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\n * @returns Promise<void> or void\n * @example\n * ```typescript\n * newLabel(\"id\", [], () => {\n * Assets.load('path/to/image1.png')\n * Assets.load('path/to/image2.png')\n * })\n * ```\n */\n public get onStepRun(): (() => void | Promise<void>) | undefined {\n return this._onStepRun\n }\n\n private _choiseIndex: number | undefined\n public get choiseIndex(): number | undefined {\n return this._choiseIndex\n }\n}\n","import Label from \"./Label\"\n\nexport const CLOSE_LABEL_ID = \"__close-label-id__\"\n\n/**\n * CloseLabel is a label used for closing the menu.\n */\nexport default function newCloseLabel<T extends {} = {}>(choiseIndex?: number) { return new Label<T>(CLOSE_LABEL_ID, [], undefined, choiseIndex) }\n"]}
@@ -11,7 +11,7 @@ type DialogueData = {
11
11
  /**
12
12
  * The id of the character that is speaking.
13
13
  */
14
- characterId?: string;
14
+ character?: string;
15
15
  /**
16
16
  * Other parameters that can be stored in the dialogue.
17
17
  */
@@ -41,7 +41,7 @@ declare class DialogueBaseModel<TCharacter extends CharacterBaseModel = Characte
41
41
  /**
42
42
  * The id of the character that is speaking.
43
43
  */
44
- characterId?: string;
44
+ character?: string;
45
45
  /**
46
46
  * Other parameters that can be stored in the dialogue.
47
47
  */
@@ -11,7 +11,7 @@ type DialogueData = {
11
11
  /**
12
12
  * The id of the character that is speaking.
13
13
  */
14
- characterId?: string;
14
+ character?: string;
15
15
  /**
16
16
  * Other parameters that can be stored in the dialogue.
17
17
  */
@@ -41,7 +41,7 @@ declare class DialogueBaseModel<TCharacter extends CharacterBaseModel = Characte
41
41
  /**
42
42
  * The id of the character that is speaking.
43
43
  */
44
- characterId?: string;
44
+ character?: string;
45
45
  /**
46
46
  * Other parameters that can be stored in the dialogue.
47
47
  */
@@ -19,15 +19,15 @@ var DialogueBaseModel = class {
19
19
  if (typeof text === "string") {
20
20
  this.text = text;
21
21
  if (typeof character === "string") {
22
- this.characterId = character;
22
+ this.character = character;
23
23
  } else {
24
- this.characterId = character == null ? void 0 : character.id;
24
+ this.character = character == null ? void 0 : character.id;
25
25
  }
26
26
  this.oltherParams = oltherParams;
27
27
  } else {
28
28
  this.text = text.text;
29
- if (text.characterId) {
30
- this.characterId = text.characterId;
29
+ if (text.character) {
30
+ this.character = text.character;
31
31
  }
32
32
  this.oltherParams = text.oltherParams || {};
33
33
  }
@@ -40,7 +40,7 @@ var DialogueBaseModel = class {
40
40
  export() {
41
41
  return {
42
42
  text: this.text,
43
- characterId: this.characterId,
43
+ character: this.character,
44
44
  oltherParams: this.oltherParams
45
45
  };
46
46
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/classes/DialogueBaseModel.ts"],"names":[],"mappings":";AA0BA,IAAqB,oBAArB,MAA2H;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMvH,YAAY,MAA6B,WAAiC,eAAsD,CAAC,GAAG;AAsBpI;AAAA;AAAA;AAAA,gBAAe;AAQf;AAAA;AAAA;AAAA,wBAAsD,CAAC;AA7BnD,QAAI,OAAO,SAAS,UAAU;AAC1B,WAAK,OAAO;AACZ,UAAI,OAAO,cAAc,UAAU;AAC/B,aAAK,cAAc;AAAA,MACvB,OACK;AACD,aAAK,cAAc,uCAAW;AAAA,MAClC;AACA,WAAK,eAAe;AAAA,IACxB,OACK;AACD,WAAK,OAAO,KAAK;AACjB,UAAI,KAAK,aAAa;AAClB,aAAK,cAAc,KAAK;AAAA,MAC5B;AACA,WAAK,eAAe,KAAK,gBAAgB,CAAC;AAAA,IAC9C;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAkBA,SAAuB;AACnB,WAAO;AAAA,MACH,MAAM,KAAK;AAAA,MACX,aAAa,KAAK;AAAA,MAClB,cAAc,KAAK;AAAA,IACvB;AAAA,EACJ;AACJ","sourcesContent":["import { StorageElementType } from \"../types\"\nimport CharacterBaseModel from \"./CharacterBaseModel\"\n\nexport type DialogueData = {\n /**\n * The text of the dialogue.\n */\n text: string\n /**\n * The id of the character that is speaking.\n */\n characterId?: string\n /**\n * Other parameters that can be stored in the dialogue.\n */\n oltherParams?: Record<string | number | symbol, StorageElementType>\n}\n\n/**\n * Base class for all dialogue models.\n * You can extend this class, but it is not reccomended. You can use the oltherParams property to store any other data you need.\n * @example\n * ```typescript\n * setDialogue(new DialogueBaseModel(\"Hello World\", character))\n * ```\n */\nexport default class DialogueBaseModel<TCharacter extends CharacterBaseModel = CharacterBaseModel> implements DialogueData {\n /**\n * @param text The text of the dialogue.\n * @param character The id of the character that is speaking. \n * @param oltherParams Other parameters that can be stored in the dialogue.\n */\n constructor(text: string | DialogueData, character?: string | TCharacter, oltherParams: { [key: string]: StorageElementType } = {}) {\n if (typeof text === \"string\") {\n this.text = text\n if (typeof character === \"string\") {\n this.characterId = character\n }\n else {\n this.characterId = character?.id\n }\n this.oltherParams = oltherParams\n }\n else {\n this.text = text.text\n if (text.characterId) {\n this.characterId = text.characterId\n }\n this.oltherParams = text.oltherParams || {}\n }\n }\n /**\n * The text of the dialogue.\n */\n text: string = \"\"\n /**\n * The id of the character that is speaking.\n */\n characterId?: string\n /**\n * Other parameters that can be stored in the dialogue.\n */\n oltherParams: { [key: string]: StorageElementType } = {}\n /**\n * Export the dialogue to a DialogueBaseData object.\n * \n * @returns The data of the dialogue.\n */\n export(): DialogueData {\n return {\n text: this.text,\n characterId: this.characterId,\n oltherParams: this.oltherParams\n }\n }\n}\n"]}
1
+ {"version":3,"sources":["../../src/classes/DialogueBaseModel.ts"],"names":[],"mappings":";AA0BA,IAAqB,oBAArB,MAA2H;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMvH,YAAY,MAA6B,WAAiC,eAAsD,CAAC,GAAG;AAsBpI;AAAA;AAAA;AAAA,gBAAe;AAQf;AAAA;AAAA;AAAA,wBAAsD,CAAC;AA7BnD,QAAI,OAAO,SAAS,UAAU;AAC1B,WAAK,OAAO;AACZ,UAAI,OAAO,cAAc,UAAU;AAC/B,aAAK,YAAY;AAAA,MACrB,OACK;AACD,aAAK,YAAY,uCAAW;AAAA,MAChC;AACA,WAAK,eAAe;AAAA,IACxB,OACK;AACD,WAAK,OAAO,KAAK;AACjB,UAAI,KAAK,WAAW;AAChB,aAAK,YAAY,KAAK;AAAA,MAC1B;AACA,WAAK,eAAe,KAAK,gBAAgB,CAAC;AAAA,IAC9C;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAkBA,SAAuB;AACnB,WAAO;AAAA,MACH,MAAM,KAAK;AAAA,MACX,WAAW,KAAK;AAAA,MAChB,cAAc,KAAK;AAAA,IACvB;AAAA,EACJ;AACJ","sourcesContent":["import { StorageElementType } from \"../types\"\nimport CharacterBaseModel from \"./CharacterBaseModel\"\n\nexport type DialogueData = {\n /**\n * The text of the dialogue.\n */\n text: string\n /**\n * The id of the character that is speaking.\n */\n character?: string\n /**\n * Other parameters that can be stored in the dialogue.\n */\n oltherParams?: Record<string | number | symbol, StorageElementType>\n}\n\n/**\n * Base class for all dialogue models.\n * You can extend this class, but it is not reccomended. You can use the oltherParams property to store any other data you need.\n * @example\n * ```typescript\n * setDialogue(new DialogueBaseModel(\"Hello World\", character))\n * ```\n */\nexport default class DialogueBaseModel<TCharacter extends CharacterBaseModel = CharacterBaseModel> implements DialogueData {\n /**\n * @param text The text of the dialogue.\n * @param character The id of the character that is speaking. \n * @param oltherParams Other parameters that can be stored in the dialogue.\n */\n constructor(text: string | DialogueData, character?: string | TCharacter, oltherParams: { [key: string]: StorageElementType } = {}) {\n if (typeof text === \"string\") {\n this.text = text\n if (typeof character === \"string\") {\n this.character = character\n }\n else {\n this.character = character?.id\n }\n this.oltherParams = oltherParams\n }\n else {\n this.text = text.text\n if (text.character) {\n this.character = text.character\n }\n this.oltherParams = text.oltherParams || {}\n }\n }\n /**\n * The text of the dialogue.\n */\n text: string = \"\"\n /**\n * The id of the character that is speaking.\n */\n character?: string\n /**\n * Other parameters that can be stored in the dialogue.\n */\n oltherParams: { [key: string]: StorageElementType } = {}\n /**\n * Export the dialogue to a DialogueBaseData object.\n * \n * @returns The data of the dialogue.\n */\n export(): DialogueData {\n return {\n text: this.text,\n character: this.character,\n oltherParams: this.oltherParams\n }\n }\n}\n"]}
@@ -17,15 +17,15 @@ var DialogueBaseModel = class {
17
17
  if (typeof text === "string") {
18
18
  this.text = text;
19
19
  if (typeof character === "string") {
20
- this.characterId = character;
20
+ this.character = character;
21
21
  } else {
22
- this.characterId = character == null ? void 0 : character.id;
22
+ this.character = character == null ? void 0 : character.id;
23
23
  }
24
24
  this.oltherParams = oltherParams;
25
25
  } else {
26
26
  this.text = text.text;
27
- if (text.characterId) {
28
- this.characterId = text.characterId;
27
+ if (text.character) {
28
+ this.character = text.character;
29
29
  }
30
30
  this.oltherParams = text.oltherParams || {};
31
31
  }
@@ -38,7 +38,7 @@ var DialogueBaseModel = class {
38
38
  export() {
39
39
  return {
40
40
  text: this.text,
41
- characterId: this.characterId,
41
+ character: this.character,
42
42
  oltherParams: this.oltherParams
43
43
  };
44
44
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/classes/DialogueBaseModel.ts"],"names":[],"mappings":";AA0BA,IAAqB,oBAArB,MAA2H;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMvH,YAAY,MAA6B,WAAiC,eAAsD,CAAC,GAAG;AAsBpI;AAAA;AAAA;AAAA,gBAAe;AAQf;AAAA;AAAA;AAAA,wBAAsD,CAAC;AA7BnD,QAAI,OAAO,SAAS,UAAU;AAC1B,WAAK,OAAO;AACZ,UAAI,OAAO,cAAc,UAAU;AAC/B,aAAK,cAAc;AAAA,MACvB,OACK;AACD,aAAK,cAAc,uCAAW;AAAA,MAClC;AACA,WAAK,eAAe;AAAA,IACxB,OACK;AACD,WAAK,OAAO,KAAK;AACjB,UAAI,KAAK,aAAa;AAClB,aAAK,cAAc,KAAK;AAAA,MAC5B;AACA,WAAK,eAAe,KAAK,gBAAgB,CAAC;AAAA,IAC9C;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAkBA,SAAuB;AACnB,WAAO;AAAA,MACH,MAAM,KAAK;AAAA,MACX,aAAa,KAAK;AAAA,MAClB,cAAc,KAAK;AAAA,IACvB;AAAA,EACJ;AACJ","sourcesContent":["import { StorageElementType } from \"../types\"\nimport CharacterBaseModel from \"./CharacterBaseModel\"\n\nexport type DialogueData = {\n /**\n * The text of the dialogue.\n */\n text: string\n /**\n * The id of the character that is speaking.\n */\n characterId?: string\n /**\n * Other parameters that can be stored in the dialogue.\n */\n oltherParams?: Record<string | number | symbol, StorageElementType>\n}\n\n/**\n * Base class for all dialogue models.\n * You can extend this class, but it is not reccomended. You can use the oltherParams property to store any other data you need.\n * @example\n * ```typescript\n * setDialogue(new DialogueBaseModel(\"Hello World\", character))\n * ```\n */\nexport default class DialogueBaseModel<TCharacter extends CharacterBaseModel = CharacterBaseModel> implements DialogueData {\n /**\n * @param text The text of the dialogue.\n * @param character The id of the character that is speaking. \n * @param oltherParams Other parameters that can be stored in the dialogue.\n */\n constructor(text: string | DialogueData, character?: string | TCharacter, oltherParams: { [key: string]: StorageElementType } = {}) {\n if (typeof text === \"string\") {\n this.text = text\n if (typeof character === \"string\") {\n this.characterId = character\n }\n else {\n this.characterId = character?.id\n }\n this.oltherParams = oltherParams\n }\n else {\n this.text = text.text\n if (text.characterId) {\n this.characterId = text.characterId\n }\n this.oltherParams = text.oltherParams || {}\n }\n }\n /**\n * The text of the dialogue.\n */\n text: string = \"\"\n /**\n * The id of the character that is speaking.\n */\n characterId?: string\n /**\n * Other parameters that can be stored in the dialogue.\n */\n oltherParams: { [key: string]: StorageElementType } = {}\n /**\n * Export the dialogue to a DialogueBaseData object.\n * \n * @returns The data of the dialogue.\n */\n export(): DialogueData {\n return {\n text: this.text,\n characterId: this.characterId,\n oltherParams: this.oltherParams\n }\n }\n}\n"]}
1
+ {"version":3,"sources":["../../src/classes/DialogueBaseModel.ts"],"names":[],"mappings":";AA0BA,IAAqB,oBAArB,MAA2H;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMvH,YAAY,MAA6B,WAAiC,eAAsD,CAAC,GAAG;AAsBpI;AAAA;AAAA;AAAA,gBAAe;AAQf;AAAA;AAAA;AAAA,wBAAsD,CAAC;AA7BnD,QAAI,OAAO,SAAS,UAAU;AAC1B,WAAK,OAAO;AACZ,UAAI,OAAO,cAAc,UAAU;AAC/B,aAAK,YAAY;AAAA,MACrB,OACK;AACD,aAAK,YAAY,uCAAW;AAAA,MAChC;AACA,WAAK,eAAe;AAAA,IACxB,OACK;AACD,WAAK,OAAO,KAAK;AACjB,UAAI,KAAK,WAAW;AAChB,aAAK,YAAY,KAAK;AAAA,MAC1B;AACA,WAAK,eAAe,KAAK,gBAAgB,CAAC;AAAA,IAC9C;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAkBA,SAAuB;AACnB,WAAO;AAAA,MACH,MAAM,KAAK;AAAA,MACX,WAAW,KAAK;AAAA,MAChB,cAAc,KAAK;AAAA,IACvB;AAAA,EACJ;AACJ","sourcesContent":["import { StorageElementType } from \"../types\"\nimport CharacterBaseModel from \"./CharacterBaseModel\"\n\nexport type DialogueData = {\n /**\n * The text of the dialogue.\n */\n text: string\n /**\n * The id of the character that is speaking.\n */\n character?: string\n /**\n * Other parameters that can be stored in the dialogue.\n */\n oltherParams?: Record<string | number | symbol, StorageElementType>\n}\n\n/**\n * Base class for all dialogue models.\n * You can extend this class, but it is not reccomended. You can use the oltherParams property to store any other data you need.\n * @example\n * ```typescript\n * setDialogue(new DialogueBaseModel(\"Hello World\", character))\n * ```\n */\nexport default class DialogueBaseModel<TCharacter extends CharacterBaseModel = CharacterBaseModel> implements DialogueData {\n /**\n * @param text The text of the dialogue.\n * @param character The id of the character that is speaking. \n * @param oltherParams Other parameters that can be stored in the dialogue.\n */\n constructor(text: string | DialogueData, character?: string | TCharacter, oltherParams: { [key: string]: StorageElementType } = {}) {\n if (typeof text === \"string\") {\n this.text = text\n if (typeof character === \"string\") {\n this.character = character\n }\n else {\n this.character = character?.id\n }\n this.oltherParams = oltherParams\n }\n else {\n this.text = text.text\n if (text.character) {\n this.character = text.character\n }\n this.oltherParams = text.oltherParams || {}\n }\n }\n /**\n * The text of the dialogue.\n */\n text: string = \"\"\n /**\n * The id of the character that is speaking.\n */\n character?: string\n /**\n * Other parameters that can be stored in the dialogue.\n */\n oltherParams: { [key: string]: StorageElementType } = {}\n /**\n * Export the dialogue to a DialogueBaseData object.\n * \n * @returns The data of the dialogue.\n */\n export(): DialogueData {\n return {\n text: this.text,\n character: this.character,\n oltherParams: this.oltherParams\n }\n }\n}\n"]}
@@ -37,7 +37,7 @@ declare class Label<T extends {} = {}> {
37
37
  constructor(id: LabelIdType, steps: StepLabelType<T>[] | (() => StepLabelType<T>[]), onStepRun?: () => void | Promise<void>, choiseIndex?: number);
38
38
  private _id;
39
39
  /**
40
- * Get the id of the label
40
+ * Get the id of the label. This variable is used in the system to get the label by id, {@link getLabelById}
41
41
  */
42
42
  get id(): LabelIdType;
43
43
  private _steps;
@@ -37,7 +37,7 @@ declare class Label<T extends {} = {}> {
37
37
  constructor(id: LabelIdType, steps: StepLabelType<T>[] | (() => StepLabelType<T>[]), onStepRun?: () => void | Promise<void>, choiseIndex?: number);
38
38
  private _id;
39
39
  /**
40
- * Get the id of the label
40
+ * Get the id of the label. This variable is used in the system to get the label by id, {@link getLabelById}
41
41
  */
42
42
  get id(): LabelIdType;
43
43
  private _steps;
@@ -22,7 +22,7 @@ var Label = class {
22
22
  this._choiseIndex = choiseIndex;
23
23
  }
24
24
  /**
25
- * Get the id of the label
25
+ * Get the id of the label. This variable is used in the system to get the label by id, {@link getLabelById}
26
26
  */
27
27
  get id() {
28
28
  return this._id;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/functions/StepLabelUtility.ts","../../src/classes/Label.ts"],"names":[],"mappings":";AAAA,OAAO,UAAU;AAmBV,SAAS,oBAAoB,OAAiD,OAA0D;AAC3I,SAAO,UAAU;AACrB;;;ACQA,IAAqB,QAArB,MAA8C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO1C,YAAY,IAAiB,OAAwD,WAAwC,aAAsB;AAC/I,SAAK,MAAM;AACX,SAAK,SAAS;AACd,SAAK,aAAa;AAClB,SAAK,eAAe;AAAA,EACxB;AAAA;AAAA;AAAA;AAAA,EAMA,IAAW,KAAkB;AACzB,WAAO,KAAK;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,IAAW,QAA4B;AACnC,QAAI,OAAO,KAAK,WAAW,YAAY;AACnC,aAAO,KAAK,OAAO;AAAA,IACvB;AACA,WAAO,KAAK;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOO,4BAA4B,eAAgE;AAC/F,QAAI,cAAc,WAAW,GAAG;AAC5B,aAAO;AAAA,IACX;AACA,QAAI,MAAc;AAClB,kBAAc,QAAQ,CAAC,MAAM,UAAU;AACnC,UAAI,oBAAoB,MAAM,KAAK,MAAM,KAAK,CAAC,GAAG;AAC9C,cAAM;AAAA,MACV;AAAA,IACJ,CAAC;AACD,WAAO;AAAA,EACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcA,IAAW,YAAsD;AAC7D,WAAO,KAAK;AAAA,EAChB;AAAA,EAGA,IAAW,cAAkC;AACzC,WAAO,KAAK;AAAA,EAChB;AACJ","sourcesContent":["import sha1 from 'crypto-js/sha1';\nimport { StepHistoryDataType } from \"../types/StepHistoryDataType\";\nimport { StepLabelType } from \"../types/StepLabelType\";\n\n/**\n * Convert StepLabel to StepHistoryData\n * @param step\n * @returns\n */\nexport function getStepSha1(step: StepLabelType): StepHistoryDataType {\n let sha1String = sha1(step.toString().toLocaleLowerCase())\n return sha1String.toString()\n}\n/**\n * Check if two steps are equal\n * @param step1\n * @param step2\n * @returns\n */\nexport function checkIfStepsIsEqual(step1: StepHistoryDataType | StepLabelType<any>, step2: StepHistoryDataType | StepLabelType<any>): boolean {\n return step1 === step2\n}\n","import { checkIfStepsIsEqual } from \"../functions/StepLabelUtility\"\nimport { LabelIdType } from \"../types/LabelIdType\"\nimport { StepHistoryDataType } from \"../types/StepHistoryDataType\"\nimport { StepLabelType } from \"../types/StepLabelType\"\n\n/**\n * Label is a class that contains a list of steps, which will be performed as the game continues.\n * For Ren'py this is the equivalent of a label.\n * @example\n * ```typescript\n * const START_LABEL_ID = \"StartLabel\"\n * \n * export const startLabel = newLabel(START_LABEL_ID,\n * [\n * (props) => {\n * GameWindowManager.clear()\n * setDialogue({ character: liam, text: \"Which test do you want to perform?\" })\n * setChoiceMenuOptions([\n * new ChoiceMenuOption(\"Events Test\", eventsTestLabel),\n * new ChoiceMenuOption(\"Show Image Test\", showImageTest),\n * ])\n * },\n * (props) => GameStepManager.jumpLabel(START_LABEL_ID, props),\n * ]\n * )\n * \n * GameStepManager.callLabel(StartLabel)\n * ```\n */\nexport default class Label<T extends {} = {}> {\n /**\n * @param id is the id of the label\n * @param steps is the list of steps that the label will perform\n * @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\n * @param choiseIndex is the index of the choice that the label will perform\n */\n constructor(id: LabelIdType, steps: StepLabelType<T>[] | (() => StepLabelType<T>[]), onStepRun?: () => void | Promise<void>, choiseIndex?: number) {\n this._id = id\n this._steps = steps\n this._onStepRun = onStepRun\n this._choiseIndex = choiseIndex\n }\n\n private _id: LabelIdType\n /**\n * Get the id of the label\n */\n public get id(): LabelIdType {\n return this._id\n }\n\n private _steps: StepLabelType<T>[] | (() => StepLabelType<T>[])\n /**\n * Get the steps of the label.\n * This class should be extended and the steps method should be overridden.\n * Every time you update this list will also be updated when the other game versions load.\n */\n public get steps(): StepLabelType<T>[] {\n if (typeof this._steps === \"function\") {\n return this._steps()\n }\n return this._steps\n }\n\n /**\n * Get the corresponding steps number\n * @param externalSteps\n * @returns Numer of corresponding steps, for example, if externalSteps is [ABC, DEF, GHI] and the steps of the label is [ABC, GHT], the result will be 1\n */\n public getCorrespondingStepsNumber(externalSteps: StepHistoryDataType[] | StepLabelType[]): number {\n if (externalSteps.length === 0) {\n return 0\n }\n let res: number = 0\n externalSteps.forEach((step, index) => {\n if (checkIfStepsIsEqual(step, this.steps[index])) {\n res = index\n }\n })\n return res\n }\n\n private _onStepRun: (() => void | Promise<void>) | undefined\n /**\n * 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\n * @returns Promise<void> or void\n * @example\n * ```typescript\n * newLabel(\"id\", [], () => {\n * Assets.load('path/to/image1.png')\n * Assets.load('path/to/image2.png')\n * })\n * ```\n */\n public get onStepRun(): (() => void | Promise<void>) | undefined {\n return this._onStepRun\n }\n\n private _choiseIndex: number | undefined\n public get choiseIndex(): number | undefined {\n return this._choiseIndex\n }\n}\n"]}
1
+ {"version":3,"sources":["../../src/functions/StepLabelUtility.ts","../../src/classes/Label.ts"],"names":[],"mappings":";AAAA,OAAO,UAAU;AAmBV,SAAS,oBAAoB,OAAiD,OAA0D;AAC3I,SAAO,UAAU;AACrB;;;ACSA,IAAqB,QAArB,MAA8C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO1C,YAAY,IAAiB,OAAwD,WAAwC,aAAsB;AAC/I,SAAK,MAAM;AACX,SAAK,SAAS;AACd,SAAK,aAAa;AAClB,SAAK,eAAe;AAAA,EACxB;AAAA;AAAA;AAAA;AAAA,EAMA,IAAW,KAAkB;AACzB,WAAO,KAAK;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,IAAW,QAA4B;AACnC,QAAI,OAAO,KAAK,WAAW,YAAY;AACnC,aAAO,KAAK,OAAO;AAAA,IACvB;AACA,WAAO,KAAK;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOO,4BAA4B,eAAgE;AAC/F,QAAI,cAAc,WAAW,GAAG;AAC5B,aAAO;AAAA,IACX;AACA,QAAI,MAAc;AAClB,kBAAc,QAAQ,CAAC,MAAM,UAAU;AACnC,UAAI,oBAAoB,MAAM,KAAK,MAAM,KAAK,CAAC,GAAG;AAC9C,cAAM;AAAA,MACV;AAAA,IACJ,CAAC;AACD,WAAO;AAAA,EACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcA,IAAW,YAAsD;AAC7D,WAAO,KAAK;AAAA,EAChB;AAAA,EAGA,IAAW,cAAkC;AACzC,WAAO,KAAK;AAAA,EAChB;AACJ","sourcesContent":["import sha1 from 'crypto-js/sha1';\nimport { StepHistoryDataType } from \"../types/StepHistoryDataType\";\nimport { StepLabelType } from \"../types/StepLabelType\";\n\n/**\n * Convert StepLabel to StepHistoryData\n * @param step\n * @returns\n */\nexport function getStepSha1(step: StepLabelType): StepHistoryDataType {\n let sha1String = sha1(step.toString().toLocaleLowerCase())\n return sha1String.toString()\n}\n/**\n * Check if two steps are equal\n * @param step1\n * @param step2\n * @returns\n */\nexport function checkIfStepsIsEqual(step1: StepHistoryDataType | StepLabelType<any>, step2: StepHistoryDataType | StepLabelType<any>): boolean {\n return step1 === step2\n}\n","import { getLabelById } from \"../decorators\"\nimport { checkIfStepsIsEqual } from \"../functions/StepLabelUtility\"\nimport { LabelIdType } from \"../types/LabelIdType\"\nimport { StepHistoryDataType } from \"../types/StepHistoryDataType\"\nimport { StepLabelType } from \"../types/StepLabelType\"\n\n/**\n * Label is a class that contains a list of steps, which will be performed as the game continues.\n * For Ren'py this is the equivalent of a label.\n * @example\n * ```typescript\n * const START_LABEL_ID = \"StartLabel\"\n * \n * export const startLabel = newLabel(START_LABEL_ID,\n * [\n * (props) => {\n * GameWindowManager.clear()\n * setDialogue({ character: liam, text: \"Which test do you want to perform?\" })\n * setChoiceMenuOptions([\n * new ChoiceMenuOption(\"Events Test\", eventsTestLabel),\n * new ChoiceMenuOption(\"Show Image Test\", showImageTest),\n * ])\n * },\n * (props) => GameStepManager.jumpLabel(START_LABEL_ID, props),\n * ]\n * )\n * \n * GameStepManager.callLabel(StartLabel)\n * ```\n */\nexport default class Label<T extends {} = {}> {\n /**\n * @param id is the id of the label\n * @param steps is the list of steps that the label will perform\n * @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\n * @param choiseIndex is the index of the choice that the label will perform\n */\n constructor(id: LabelIdType, steps: StepLabelType<T>[] | (() => StepLabelType<T>[]), onStepRun?: () => void | Promise<void>, choiseIndex?: number) {\n this._id = id\n this._steps = steps\n this._onStepRun = onStepRun\n this._choiseIndex = choiseIndex\n }\n\n private _id: LabelIdType\n /**\n * Get the id of the label. This variable is used in the system to get the label by id, {@link getLabelById}\n */\n public get id(): LabelIdType {\n return this._id\n }\n\n private _steps: StepLabelType<T>[] | (() => StepLabelType<T>[])\n /**\n * Get the steps of the label.\n * This class should be extended and the steps method should be overridden.\n * Every time you update this list will also be updated when the other game versions load.\n */\n public get steps(): StepLabelType<T>[] {\n if (typeof this._steps === \"function\") {\n return this._steps()\n }\n return this._steps\n }\n\n /**\n * Get the corresponding steps number\n * @param externalSteps\n * @returns Numer of corresponding steps, for example, if externalSteps is [ABC, DEF, GHI] and the steps of the label is [ABC, GHT], the result will be 1\n */\n public getCorrespondingStepsNumber(externalSteps: StepHistoryDataType[] | StepLabelType[]): number {\n if (externalSteps.length === 0) {\n return 0\n }\n let res: number = 0\n externalSteps.forEach((step, index) => {\n if (checkIfStepsIsEqual(step, this.steps[index])) {\n res = index\n }\n })\n return res\n }\n\n private _onStepRun: (() => void | Promise<void>) | undefined\n /**\n * 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\n * @returns Promise<void> or void\n * @example\n * ```typescript\n * newLabel(\"id\", [], () => {\n * Assets.load('path/to/image1.png')\n * Assets.load('path/to/image2.png')\n * })\n * ```\n */\n public get onStepRun(): (() => void | Promise<void>) | undefined {\n return this._onStepRun\n }\n\n private _choiseIndex: number | undefined\n public get choiseIndex(): number | undefined {\n return this._choiseIndex\n }\n}\n"]}
@@ -20,7 +20,7 @@ var Label = class {
20
20
  this._choiseIndex = choiseIndex;
21
21
  }
22
22
  /**
23
- * Get the id of the label
23
+ * Get the id of the label. This variable is used in the system to get the label by id, {@link getLabelById}
24
24
  */
25
25
  get id() {
26
26
  return this._id;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/functions/StepLabelUtility.ts","../../src/classes/Label.ts"],"names":[],"mappings":";AAAA,OAAO,UAAU;AAmBV,SAAS,oBAAoB,OAAiD,OAA0D;AAC3I,SAAO,UAAU;AACrB;;;ACQA,IAAqB,QAArB,MAA8C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO1C,YAAY,IAAiB,OAAwD,WAAwC,aAAsB;AAC/I,SAAK,MAAM;AACX,SAAK,SAAS;AACd,SAAK,aAAa;AAClB,SAAK,eAAe;AAAA,EACxB;AAAA;AAAA;AAAA;AAAA,EAMA,IAAW,KAAkB;AACzB,WAAO,KAAK;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,IAAW,QAA4B;AACnC,QAAI,OAAO,KAAK,WAAW,YAAY;AACnC,aAAO,KAAK,OAAO;AAAA,IACvB;AACA,WAAO,KAAK;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOO,4BAA4B,eAAgE;AAC/F,QAAI,cAAc,WAAW,GAAG;AAC5B,aAAO;AAAA,IACX;AACA,QAAI,MAAc;AAClB,kBAAc,QAAQ,CAAC,MAAM,UAAU;AACnC,UAAI,oBAAoB,MAAM,KAAK,MAAM,KAAK,CAAC,GAAG;AAC9C,cAAM;AAAA,MACV;AAAA,IACJ,CAAC;AACD,WAAO;AAAA,EACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcA,IAAW,YAAsD;AAC7D,WAAO,KAAK;AAAA,EAChB;AAAA,EAGA,IAAW,cAAkC;AACzC,WAAO,KAAK;AAAA,EAChB;AACJ","sourcesContent":["import sha1 from 'crypto-js/sha1';\nimport { StepHistoryDataType } from \"../types/StepHistoryDataType\";\nimport { StepLabelType } from \"../types/StepLabelType\";\n\n/**\n * Convert StepLabel to StepHistoryData\n * @param step\n * @returns\n */\nexport function getStepSha1(step: StepLabelType): StepHistoryDataType {\n let sha1String = sha1(step.toString().toLocaleLowerCase())\n return sha1String.toString()\n}\n/**\n * Check if two steps are equal\n * @param step1\n * @param step2\n * @returns\n */\nexport function checkIfStepsIsEqual(step1: StepHistoryDataType | StepLabelType<any>, step2: StepHistoryDataType | StepLabelType<any>): boolean {\n return step1 === step2\n}\n","import { checkIfStepsIsEqual } from \"../functions/StepLabelUtility\"\nimport { LabelIdType } from \"../types/LabelIdType\"\nimport { StepHistoryDataType } from \"../types/StepHistoryDataType\"\nimport { StepLabelType } from \"../types/StepLabelType\"\n\n/**\n * Label is a class that contains a list of steps, which will be performed as the game continues.\n * For Ren'py this is the equivalent of a label.\n * @example\n * ```typescript\n * const START_LABEL_ID = \"StartLabel\"\n * \n * export const startLabel = newLabel(START_LABEL_ID,\n * [\n * (props) => {\n * GameWindowManager.clear()\n * setDialogue({ character: liam, text: \"Which test do you want to perform?\" })\n * setChoiceMenuOptions([\n * new ChoiceMenuOption(\"Events Test\", eventsTestLabel),\n * new ChoiceMenuOption(\"Show Image Test\", showImageTest),\n * ])\n * },\n * (props) => GameStepManager.jumpLabel(START_LABEL_ID, props),\n * ]\n * )\n * \n * GameStepManager.callLabel(StartLabel)\n * ```\n */\nexport default class Label<T extends {} = {}> {\n /**\n * @param id is the id of the label\n * @param steps is the list of steps that the label will perform\n * @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\n * @param choiseIndex is the index of the choice that the label will perform\n */\n constructor(id: LabelIdType, steps: StepLabelType<T>[] | (() => StepLabelType<T>[]), onStepRun?: () => void | Promise<void>, choiseIndex?: number) {\n this._id = id\n this._steps = steps\n this._onStepRun = onStepRun\n this._choiseIndex = choiseIndex\n }\n\n private _id: LabelIdType\n /**\n * Get the id of the label\n */\n public get id(): LabelIdType {\n return this._id\n }\n\n private _steps: StepLabelType<T>[] | (() => StepLabelType<T>[])\n /**\n * Get the steps of the label.\n * This class should be extended and the steps method should be overridden.\n * Every time you update this list will also be updated when the other game versions load.\n */\n public get steps(): StepLabelType<T>[] {\n if (typeof this._steps === \"function\") {\n return this._steps()\n }\n return this._steps\n }\n\n /**\n * Get the corresponding steps number\n * @param externalSteps\n * @returns Numer of corresponding steps, for example, if externalSteps is [ABC, DEF, GHI] and the steps of the label is [ABC, GHT], the result will be 1\n */\n public getCorrespondingStepsNumber(externalSteps: StepHistoryDataType[] | StepLabelType[]): number {\n if (externalSteps.length === 0) {\n return 0\n }\n let res: number = 0\n externalSteps.forEach((step, index) => {\n if (checkIfStepsIsEqual(step, this.steps[index])) {\n res = index\n }\n })\n return res\n }\n\n private _onStepRun: (() => void | Promise<void>) | undefined\n /**\n * 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\n * @returns Promise<void> or void\n * @example\n * ```typescript\n * newLabel(\"id\", [], () => {\n * Assets.load('path/to/image1.png')\n * Assets.load('path/to/image2.png')\n * })\n * ```\n */\n public get onStepRun(): (() => void | Promise<void>) | undefined {\n return this._onStepRun\n }\n\n private _choiseIndex: number | undefined\n public get choiseIndex(): number | undefined {\n return this._choiseIndex\n }\n}\n"]}
1
+ {"version":3,"sources":["../../src/functions/StepLabelUtility.ts","../../src/classes/Label.ts"],"names":[],"mappings":";AAAA,OAAO,UAAU;AAmBV,SAAS,oBAAoB,OAAiD,OAA0D;AAC3I,SAAO,UAAU;AACrB;;;ACSA,IAAqB,QAArB,MAA8C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO1C,YAAY,IAAiB,OAAwD,WAAwC,aAAsB;AAC/I,SAAK,MAAM;AACX,SAAK,SAAS;AACd,SAAK,aAAa;AAClB,SAAK,eAAe;AAAA,EACxB;AAAA;AAAA;AAAA;AAAA,EAMA,IAAW,KAAkB;AACzB,WAAO,KAAK;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,IAAW,QAA4B;AACnC,QAAI,OAAO,KAAK,WAAW,YAAY;AACnC,aAAO,KAAK,OAAO;AAAA,IACvB;AACA,WAAO,KAAK;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOO,4BAA4B,eAAgE;AAC/F,QAAI,cAAc,WAAW,GAAG;AAC5B,aAAO;AAAA,IACX;AACA,QAAI,MAAc;AAClB,kBAAc,QAAQ,CAAC,MAAM,UAAU;AACnC,UAAI,oBAAoB,MAAM,KAAK,MAAM,KAAK,CAAC,GAAG;AAC9C,cAAM;AAAA,MACV;AAAA,IACJ,CAAC;AACD,WAAO;AAAA,EACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcA,IAAW,YAAsD;AAC7D,WAAO,KAAK;AAAA,EAChB;AAAA,EAGA,IAAW,cAAkC;AACzC,WAAO,KAAK;AAAA,EAChB;AACJ","sourcesContent":["import sha1 from 'crypto-js/sha1';\nimport { StepHistoryDataType } from \"../types/StepHistoryDataType\";\nimport { StepLabelType } from \"../types/StepLabelType\";\n\n/**\n * Convert StepLabel to StepHistoryData\n * @param step\n * @returns\n */\nexport function getStepSha1(step: StepLabelType): StepHistoryDataType {\n let sha1String = sha1(step.toString().toLocaleLowerCase())\n return sha1String.toString()\n}\n/**\n * Check if two steps are equal\n * @param step1\n * @param step2\n * @returns\n */\nexport function checkIfStepsIsEqual(step1: StepHistoryDataType | StepLabelType<any>, step2: StepHistoryDataType | StepLabelType<any>): boolean {\n return step1 === step2\n}\n","import { getLabelById } from \"../decorators\"\nimport { checkIfStepsIsEqual } from \"../functions/StepLabelUtility\"\nimport { LabelIdType } from \"../types/LabelIdType\"\nimport { StepHistoryDataType } from \"../types/StepHistoryDataType\"\nimport { StepLabelType } from \"../types/StepLabelType\"\n\n/**\n * Label is a class that contains a list of steps, which will be performed as the game continues.\n * For Ren'py this is the equivalent of a label.\n * @example\n * ```typescript\n * const START_LABEL_ID = \"StartLabel\"\n * \n * export const startLabel = newLabel(START_LABEL_ID,\n * [\n * (props) => {\n * GameWindowManager.clear()\n * setDialogue({ character: liam, text: \"Which test do you want to perform?\" })\n * setChoiceMenuOptions([\n * new ChoiceMenuOption(\"Events Test\", eventsTestLabel),\n * new ChoiceMenuOption(\"Show Image Test\", showImageTest),\n * ])\n * },\n * (props) => GameStepManager.jumpLabel(START_LABEL_ID, props),\n * ]\n * )\n * \n * GameStepManager.callLabel(StartLabel)\n * ```\n */\nexport default class Label<T extends {} = {}> {\n /**\n * @param id is the id of the label\n * @param steps is the list of steps that the label will perform\n * @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\n * @param choiseIndex is the index of the choice that the label will perform\n */\n constructor(id: LabelIdType, steps: StepLabelType<T>[] | (() => StepLabelType<T>[]), onStepRun?: () => void | Promise<void>, choiseIndex?: number) {\n this._id = id\n this._steps = steps\n this._onStepRun = onStepRun\n this._choiseIndex = choiseIndex\n }\n\n private _id: LabelIdType\n /**\n * Get the id of the label. This variable is used in the system to get the label by id, {@link getLabelById}\n */\n public get id(): LabelIdType {\n return this._id\n }\n\n private _steps: StepLabelType<T>[] | (() => StepLabelType<T>[])\n /**\n * Get the steps of the label.\n * This class should be extended and the steps method should be overridden.\n * Every time you update this list will also be updated when the other game versions load.\n */\n public get steps(): StepLabelType<T>[] {\n if (typeof this._steps === \"function\") {\n return this._steps()\n }\n return this._steps\n }\n\n /**\n * Get the corresponding steps number\n * @param externalSteps\n * @returns Numer of corresponding steps, for example, if externalSteps is [ABC, DEF, GHI] and the steps of the label is [ABC, GHT], the result will be 1\n */\n public getCorrespondingStepsNumber(externalSteps: StepHistoryDataType[] | StepLabelType[]): number {\n if (externalSteps.length === 0) {\n return 0\n }\n let res: number = 0\n externalSteps.forEach((step, index) => {\n if (checkIfStepsIsEqual(step, this.steps[index])) {\n res = index\n }\n })\n return res\n }\n\n private _onStepRun: (() => void | Promise<void>) | undefined\n /**\n * 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\n * @returns Promise<void> or void\n * @example\n * ```typescript\n * newLabel(\"id\", [], () => {\n * Assets.load('path/to/image1.png')\n * Assets.load('path/to/image2.png')\n * })\n * ```\n */\n public get onStepRun(): (() => void | Promise<void>) | undefined {\n return this._onStepRun\n }\n\n private _choiseIndex: number | undefined\n public get choiseIndex(): number | undefined {\n return this._choiseIndex\n }\n}\n"]}