@drincs/pixi-vn 0.6.1 → 0.6.3

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 (505) 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 +8 -1
  6. package/dist/classes/CanvasEvent.js.map +1 -1
  7. package/dist/classes/CanvasEvent.mjs +8 -1
  8. package/dist/classes/CanvasEvent.mjs.map +1 -1
  9. package/dist/classes/CharacterBaseModel.js +105 -77
  10. package/dist/classes/CharacterBaseModel.js.map +1 -1
  11. package/dist/classes/CharacterBaseModel.mjs +105 -77
  12. package/dist/classes/CharacterBaseModel.mjs.map +1 -1
  13. package/dist/classes/ChoiceMenuOption.js +106 -78
  14. package/dist/classes/ChoiceMenuOption.js.map +1 -1
  15. package/dist/classes/ChoiceMenuOption.mjs +106 -78
  16. package/dist/classes/ChoiceMenuOption.mjs.map +1 -1
  17. package/dist/classes/CloseLabel.js +2 -2
  18. package/dist/classes/CloseLabel.js.map +1 -1
  19. package/dist/classes/CloseLabel.mjs +2 -2
  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 +6 -6
  24. package/dist/classes/DialogueBaseModel.js.map +1 -1
  25. package/dist/classes/DialogueBaseModel.mjs +6 -6
  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 +2 -2
  30. package/dist/classes/Label.js.map +1 -1
  31. package/dist/classes/Label.mjs +2 -2
  32. package/dist/classes/Label.mjs.map +1 -1
  33. package/dist/classes/StoredClassModel.js +105 -77
  34. package/dist/classes/StoredClassModel.js.map +1 -1
  35. package/dist/classes/StoredClassModel.mjs +105 -77
  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 +8 -1
  40. package/dist/classes/canvas/CanvasBase.js.map +1 -1
  41. package/dist/classes/canvas/CanvasBase.mjs +8 -1
  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 +67 -47
  46. package/dist/classes/canvas/CanvasContainer.js.map +1 -1
  47. package/dist/classes/canvas/CanvasContainer.mjs +67 -48
  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 +34 -23
  52. package/dist/classes/canvas/CanvasImage.js.map +1 -1
  53. package/dist/classes/canvas/CanvasImage.mjs +31 -23
  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 +26 -20
  58. package/dist/classes/canvas/CanvasSprite.js.map +1 -1
  59. package/dist/classes/canvas/CanvasSprite.mjs +26 -21
  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 +35 -27
  64. package/dist/classes/canvas/CanvasText.js.map +1 -1
  65. package/dist/classes/canvas/CanvasText.mjs +35 -28
  66. package/dist/classes/canvas/CanvasText.mjs.map +1 -1
  67. package/dist/classes/canvas/index.js +192 -166
  68. package/dist/classes/canvas/index.js.map +1 -1
  69. package/dist/classes/canvas/index.mjs +192 -166
  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 +118 -83
  74. package/dist/classes/index.js.map +1 -1
  75. package/dist/classes/index.mjs +118 -83
  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 +105 -77
  80. package/dist/classes/ticker/FadeAlphaTicker.js.map +1 -1
  81. package/dist/classes/ticker/FadeAlphaTicker.mjs +105 -77
  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 +105 -77
  86. package/dist/classes/ticker/MoveTicker.js.map +1 -1
  87. package/dist/classes/ticker/MoveTicker.mjs +105 -77
  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 +105 -77
  92. package/dist/classes/ticker/RotateTicker.js.map +1 -1
  93. package/dist/classes/ticker/RotateTicker.mjs +105 -77
  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 +6 -1
  98. package/dist/classes/ticker/TickerBase.js.map +1 -1
  99. package/dist/classes/ticker/TickerBase.mjs +6 -1
  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 +120 -78
  104. package/dist/classes/ticker/ZoomTicker.js.map +1 -1
  105. package/dist/classes/ticker/ZoomTicker.mjs +118 -78
  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 +242 -214
  110. package/dist/classes/ticker/index.js.map +1 -1
  111. package/dist/classes/ticker/index.mjs +242 -214
  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 +2 -2
  116. package/dist/constants.js.map +1 -1
  117. package/dist/constants.mjs +2 -2
  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 +73 -53
  122. package/dist/decorators/CanvasElementDecorator.js.map +1 -1
  123. package/dist/decorators/CanvasElementDecorator.mjs +72 -52
  124. package/dist/decorators/CanvasElementDecorator.mjs.map +1 -1
  125. package/dist/decorators/CharacterDecorator.js +1 -1
  126. package/dist/decorators/CharacterDecorator.js.map +1 -1
  127. package/dist/decorators/CharacterDecorator.mjs +1 -1
  128. package/dist/decorators/CharacterDecorator.mjs.map +1 -1
  129. package/dist/decorators/EventDecorator.d.mts +7 -7
  130. package/dist/decorators/EventDecorator.d.ts +7 -7
  131. package/dist/decorators/EventDecorator.js +12 -11
  132. package/dist/decorators/EventDecorator.js.map +1 -1
  133. package/dist/decorators/EventDecorator.mjs +11 -10
  134. package/dist/decorators/EventDecorator.mjs.map +1 -1
  135. package/dist/decorators/LabelDecorator.js +106 -78
  136. package/dist/decorators/LabelDecorator.js.map +1 -1
  137. package/dist/decorators/LabelDecorator.mjs +106 -78
  138. package/dist/decorators/LabelDecorator.mjs.map +1 -1
  139. package/dist/decorators/TickerDecorator.d.mts +5 -5
  140. package/dist/decorators/TickerDecorator.d.ts +5 -5
  141. package/dist/decorators/TickerDecorator.js +7 -6
  142. package/dist/decorators/TickerDecorator.js.map +1 -1
  143. package/dist/decorators/TickerDecorator.mjs +7 -6
  144. package/dist/decorators/TickerDecorator.mjs.map +1 -1
  145. package/dist/decorators/index.d.mts +1 -1
  146. package/dist/decorators/index.d.ts +1 -1
  147. package/dist/decorators/index.js +108 -78
  148. package/dist/decorators/index.js.map +1 -1
  149. package/dist/decorators/index.mjs +108 -78
  150. package/dist/decorators/index.mjs.map +1 -1
  151. package/dist/functions/CanvasUtility.js +66 -47
  152. package/dist/functions/CanvasUtility.js.map +1 -1
  153. package/dist/functions/CanvasUtility.mjs +66 -47
  154. package/dist/functions/CanvasUtility.mjs.map +1 -1
  155. package/dist/functions/DialogueUtility.d.mts +1 -1
  156. package/dist/functions/DialogueUtility.d.ts +1 -1
  157. package/dist/functions/DialogueUtility.js +250 -211
  158. package/dist/functions/DialogueUtility.js.map +1 -1
  159. package/dist/functions/DialogueUtility.mjs +250 -211
  160. package/dist/functions/DialogueUtility.mjs.map +1 -1
  161. package/dist/functions/DiffUtility.js +1 -1
  162. package/dist/functions/DiffUtility.js.map +1 -1
  163. package/dist/functions/DiffUtility.mjs +1 -1
  164. package/dist/functions/DiffUtility.mjs.map +1 -1
  165. package/dist/functions/EasterEgg.js +1 -1
  166. package/dist/functions/EasterEgg.js.map +1 -1
  167. package/dist/functions/EasterEgg.mjs +1 -1
  168. package/dist/functions/EasterEgg.mjs.map +1 -1
  169. package/dist/functions/ExportUtility.js +1 -1
  170. package/dist/functions/ExportUtility.js.map +1 -1
  171. package/dist/functions/ExportUtility.mjs +1 -1
  172. package/dist/functions/ExportUtility.mjs.map +1 -1
  173. package/dist/functions/FlagsUtility.js +105 -77
  174. package/dist/functions/FlagsUtility.js.map +1 -1
  175. package/dist/functions/FlagsUtility.mjs +105 -77
  176. package/dist/functions/FlagsUtility.mjs.map +1 -1
  177. package/dist/functions/GameUtility.js +105 -77
  178. package/dist/functions/GameUtility.js.map +1 -1
  179. package/dist/functions/GameUtility.mjs +105 -77
  180. package/dist/functions/GameUtility.mjs.map +1 -1
  181. package/dist/functions/ImageUtility.d.mts +35 -2
  182. package/dist/functions/ImageUtility.d.ts +35 -2
  183. package/dist/functions/ImageUtility.js +381 -196
  184. package/dist/functions/ImageUtility.js.map +1 -1
  185. package/dist/functions/ImageUtility.mjs +378 -197
  186. package/dist/functions/ImageUtility.mjs.map +1 -1
  187. package/dist/functions/SavesUtility.d.mts +2 -2
  188. package/dist/functions/SavesUtility.d.ts +2 -2
  189. package/dist/functions/SavesUtility.js +153 -83
  190. package/dist/functions/SavesUtility.js.map +1 -1
  191. package/dist/functions/SavesUtility.mjs +153 -83
  192. package/dist/functions/SavesUtility.mjs.map +1 -1
  193. package/dist/functions/StepLabelUtility.js +1 -1
  194. package/dist/functions/StepLabelUtility.js.map +1 -1
  195. package/dist/functions/StepLabelUtility.mjs +1 -1
  196. package/dist/functions/StepLabelUtility.mjs.map +1 -1
  197. package/dist/functions/TextureUtility.js +10 -8
  198. package/dist/functions/TextureUtility.js.map +1 -1
  199. package/dist/functions/TextureUtility.mjs +10 -8
  200. package/dist/functions/TextureUtility.mjs.map +1 -1
  201. package/dist/functions/TickerUtility.js +1 -1
  202. package/dist/functions/TickerUtility.js.map +1 -1
  203. package/dist/functions/TickerUtility.mjs +1 -1
  204. package/dist/functions/TickerUtility.mjs.map +1 -1
  205. package/dist/functions/index.d.mts +6 -3
  206. package/dist/functions/index.d.ts +6 -3
  207. package/dist/functions/index.js +289 -93
  208. package/dist/functions/index.js.map +1 -1
  209. package/dist/functions/index.mjs +287 -95
  210. package/dist/functions/index.mjs.map +1 -1
  211. package/dist/index.d.mts +4 -4
  212. package/dist/index.d.ts +4 -4
  213. package/dist/index.js +758 -165
  214. package/dist/index.js.map +1 -1
  215. package/dist/index.mjs +756 -167
  216. package/dist/index.mjs.map +1 -1
  217. package/dist/interface/CharacterBaseModelProps.js +1 -1
  218. package/dist/interface/CharacterBaseModelProps.js.map +1 -1
  219. package/dist/interface/CharacterBaseModelProps.mjs +1 -1
  220. package/dist/interface/CharacterBaseModelProps.mjs.map +1 -1
  221. package/dist/interface/DialogueHistory.js +1 -1
  222. package/dist/interface/DialogueHistory.js.map +1 -1
  223. package/dist/interface/DialogueHistory.mjs +1 -1
  224. package/dist/interface/DialogueHistory.mjs.map +1 -1
  225. package/dist/interface/IHistoryStep.d.mts +2 -2
  226. package/dist/interface/IHistoryStep.d.ts +2 -2
  227. package/dist/interface/IHistoryStep.js +1 -1
  228. package/dist/interface/IHistoryStep.js.map +1 -1
  229. package/dist/interface/IHistoryStep.mjs +1 -1
  230. package/dist/interface/IHistoryStep.mjs.map +1 -1
  231. package/dist/interface/IOpenedLabel.js +1 -1
  232. package/dist/interface/IOpenedLabel.js.map +1 -1
  233. package/dist/interface/IOpenedLabel.mjs +1 -1
  234. package/dist/interface/IOpenedLabel.mjs.map +1 -1
  235. package/dist/interface/ISaveData.d.mts +2 -2
  236. package/dist/interface/ISaveData.d.ts +2 -2
  237. package/dist/interface/ISaveData.js +1 -1
  238. package/dist/interface/ISaveData.js.map +1 -1
  239. package/dist/interface/ISaveData.mjs +1 -1
  240. package/dist/interface/ISaveData.mjs.map +1 -1
  241. package/dist/interface/ITicker.d.mts +2 -1
  242. package/dist/interface/ITicker.d.ts +2 -1
  243. package/dist/interface/ITicker.js +1 -1
  244. package/dist/interface/ITicker.js.map +1 -1
  245. package/dist/interface/ITicker.mjs +1 -1
  246. package/dist/interface/ITicker.mjs.map +1 -1
  247. package/dist/interface/ITickersSteps.d.mts +12 -3
  248. package/dist/interface/ITickersSteps.d.ts +12 -3
  249. package/dist/interface/ITickersSteps.js +1 -1
  250. package/dist/interface/ITickersSteps.js.map +1 -1
  251. package/dist/interface/ITickersSteps.mjs +1 -1
  252. package/dist/interface/ITickersSteps.mjs.map +1 -1
  253. package/dist/interface/TickerHistory.d.mts +3 -3
  254. package/dist/interface/TickerHistory.d.ts +3 -3
  255. package/dist/interface/TickerHistory.js +1 -1
  256. package/dist/interface/TickerHistory.js.map +1 -1
  257. package/dist/interface/TickerHistory.mjs +1 -1
  258. package/dist/interface/TickerHistory.mjs.map +1 -1
  259. package/dist/interface/TickerProgrationType.js +1 -1
  260. package/dist/interface/TickerProgrationType.js.map +1 -1
  261. package/dist/interface/TickerProgrationType.mjs +1 -1
  262. package/dist/interface/TickerProgrationType.mjs.map +1 -1
  263. package/dist/interface/TickerTimeoutHistory.js +1 -1
  264. package/dist/interface/TickerTimeoutHistory.js.map +1 -1
  265. package/dist/interface/TickerTimeoutHistory.mjs +1 -1
  266. package/dist/interface/TickerTimeoutHistory.mjs.map +1 -1
  267. package/dist/interface/canvas/ICanvasBaseMemory.d.mts +1 -1
  268. package/dist/interface/canvas/ICanvasBaseMemory.d.ts +1 -1
  269. package/dist/interface/canvas/ICanvasBaseMemory.js +1 -1
  270. package/dist/interface/canvas/ICanvasBaseMemory.js.map +1 -1
  271. package/dist/interface/canvas/ICanvasBaseMemory.mjs +1 -1
  272. package/dist/interface/canvas/ICanvasBaseMemory.mjs.map +1 -1
  273. package/dist/interface/canvas/ICanvasContainerMemory.js +1 -1
  274. package/dist/interface/canvas/ICanvasContainerMemory.js.map +1 -1
  275. package/dist/interface/canvas/ICanvasContainerMemory.mjs +1 -1
  276. package/dist/interface/canvas/ICanvasContainerMemory.mjs.map +1 -1
  277. package/dist/interface/canvas/ICanvasImageMemory.d.mts +2 -2
  278. package/dist/interface/canvas/ICanvasImageMemory.d.ts +2 -2
  279. package/dist/interface/canvas/ICanvasImageMemory.js +1 -1
  280. package/dist/interface/canvas/ICanvasImageMemory.js.map +1 -1
  281. package/dist/interface/canvas/ICanvasImageMemory.mjs +1 -1
  282. package/dist/interface/canvas/ICanvasImageMemory.mjs.map +1 -1
  283. package/dist/interface/canvas/ICanvasSpriteMemory.d.mts +1 -2
  284. package/dist/interface/canvas/ICanvasSpriteMemory.d.ts +1 -2
  285. package/dist/interface/canvas/ICanvasSpriteMemory.js +1 -1
  286. package/dist/interface/canvas/ICanvasSpriteMemory.js.map +1 -1
  287. package/dist/interface/canvas/ICanvasSpriteMemory.mjs +1 -1
  288. package/dist/interface/canvas/ICanvasSpriteMemory.mjs.map +1 -1
  289. package/dist/interface/canvas/ICanvasTextTextMemory.d.mts +1 -2
  290. package/dist/interface/canvas/ICanvasTextTextMemory.d.ts +1 -2
  291. package/dist/interface/canvas/ICanvasTextTextMemory.js +1 -1
  292. package/dist/interface/canvas/ICanvasTextTextMemory.js.map +1 -1
  293. package/dist/interface/canvas/ICanvasTextTextMemory.mjs +1 -1
  294. package/dist/interface/canvas/ICanvasTextTextMemory.mjs.map +1 -1
  295. package/dist/interface/canvas/ITextureMemory.js +1 -1
  296. package/dist/interface/canvas/ITextureMemory.js.map +1 -1
  297. package/dist/interface/canvas/ITextureMemory.mjs +1 -1
  298. package/dist/interface/canvas/ITextureMemory.mjs.map +1 -1
  299. package/dist/interface/canvas/index.js +1 -1
  300. package/dist/interface/canvas/index.js.map +1 -1
  301. package/dist/interface/canvas/index.mjs +1 -1
  302. package/dist/interface/canvas/index.mjs.map +1 -1
  303. package/dist/interface/export/ExportedCanvas.d.mts +2 -2
  304. package/dist/interface/export/ExportedCanvas.d.ts +2 -2
  305. package/dist/interface/export/ExportedCanvas.js +1 -1
  306. package/dist/interface/export/ExportedCanvas.js.map +1 -1
  307. package/dist/interface/export/ExportedCanvas.mjs +1 -1
  308. package/dist/interface/export/ExportedCanvas.mjs.map +1 -1
  309. package/dist/interface/export/ExportedStep.d.mts +2 -2
  310. package/dist/interface/export/ExportedStep.d.ts +2 -2
  311. package/dist/interface/export/ExportedStep.js +1 -1
  312. package/dist/interface/export/ExportedStep.js.map +1 -1
  313. package/dist/interface/export/ExportedStep.mjs +1 -1
  314. package/dist/interface/export/ExportedStep.mjs.map +1 -1
  315. package/dist/interface/export/ExportedStorage.js +1 -1
  316. package/dist/interface/export/ExportedStorage.js.map +1 -1
  317. package/dist/interface/export/ExportedStorage.mjs +1 -1
  318. package/dist/interface/export/ExportedStorage.mjs.map +1 -1
  319. package/dist/interface/export/index.d.mts +2 -2
  320. package/dist/interface/export/index.d.ts +2 -2
  321. package/dist/interface/export/index.js +1 -1
  322. package/dist/interface/export/index.js.map +1 -1
  323. package/dist/interface/export/index.mjs +1 -1
  324. package/dist/interface/export/index.mjs.map +1 -1
  325. package/dist/interface/index.d.mts +2 -2
  326. package/dist/interface/index.d.ts +2 -2
  327. package/dist/interface/index.js +1 -1
  328. package/dist/interface/index.js.map +1 -1
  329. package/dist/interface/index.mjs +1 -1
  330. package/dist/interface/index.mjs.map +1 -1
  331. package/dist/labels/BaseCanvasElementTestLabel.js +1317 -395
  332. package/dist/labels/BaseCanvasElementTestLabel.js.map +1 -1
  333. package/dist/labels/BaseCanvasElementTestLabel.mjs +1318 -396
  334. package/dist/labels/BaseCanvasElementTestLabel.mjs.map +1 -1
  335. package/dist/labels/{EventsTestLabel.d.mts → CanvasEventsTestLabel.d.mts} +4 -7
  336. package/dist/labels/{EventsTestLabel.d.ts → CanvasEventsTestLabel.d.ts} +4 -7
  337. package/dist/labels/{EventsTestLabel.js → CanvasEventsTestLabel.js} +332 -110
  338. package/dist/labels/CanvasEventsTestLabel.js.map +1 -0
  339. package/dist/labels/{EventsTestLabel.mjs → CanvasEventsTestLabel.mjs} +332 -110
  340. package/dist/labels/CanvasEventsTestLabel.mjs.map +1 -0
  341. package/dist/labels/{TintingTestLabel.d.mts → CustomTickerCanvasElementTestLabel.d.mts} +5 -4
  342. package/dist/labels/{TintingTestLabel.d.ts → CustomTickerCanvasElementTestLabel.d.ts} +5 -4
  343. package/dist/labels/{TickerTestLabel.js → CustomTickerCanvasElementTestLabel.js} +674 -490
  344. package/dist/labels/CustomTickerCanvasElementTestLabel.js.map +1 -0
  345. package/dist/labels/{TickerTestLabel.mjs → CustomTickerCanvasElementTestLabel.mjs} +675 -491
  346. package/dist/labels/CustomTickerCanvasElementTestLabel.mjs.map +1 -0
  347. package/dist/labels/{ShowImageTest.js → ImagesAnimationsTestLabel.js} +385 -94
  348. package/dist/labels/ImagesAnimationsTestLabel.js.map +1 -0
  349. package/dist/labels/{ShowImageTest.mjs → ImagesAnimationsTestLabel.mjs} +385 -94
  350. package/dist/labels/ImagesAnimationsTestLabel.mjs.map +1 -0
  351. package/dist/labels/MarkdownTest.js +162 -92
  352. package/dist/labels/MarkdownTest.js.map +1 -1
  353. package/dist/labels/MarkdownTest.mjs +162 -92
  354. package/dist/labels/MarkdownTest.mjs.map +1 -1
  355. package/dist/labels/StartLabel.js +803 -164
  356. package/dist/labels/StartLabel.js.map +1 -1
  357. package/dist/labels/StartLabel.mjs +804 -165
  358. package/dist/labels/StartLabel.mjs.map +1 -1
  359. package/dist/labels/TestConstant.d.mts +3 -1
  360. package/dist/labels/TestConstant.d.ts +3 -1
  361. package/dist/labels/TestConstant.js +109 -77
  362. package/dist/labels/TestConstant.js.map +1 -1
  363. package/dist/labels/TestConstant.mjs +108 -78
  364. package/dist/labels/TestConstant.mjs.map +1 -1
  365. package/dist/labels/index.js +803 -164
  366. package/dist/labels/index.js.map +1 -1
  367. package/dist/labels/index.mjs +804 -165
  368. package/dist/labels/index.mjs.map +1 -1
  369. package/dist/managers/StepManager.d.mts +5 -4
  370. package/dist/managers/StepManager.d.ts +5 -4
  371. package/dist/managers/StepManager.js +152 -82
  372. package/dist/managers/StepManager.js.map +1 -1
  373. package/dist/managers/StepManager.mjs +152 -82
  374. package/dist/managers/StepManager.mjs.map +1 -1
  375. package/dist/managers/StorageManager.js +1 -1
  376. package/dist/managers/StorageManager.js.map +1 -1
  377. package/dist/managers/StorageManager.mjs +1 -1
  378. package/dist/managers/StorageManager.mjs.map +1 -1
  379. package/dist/managers/WindowManager.d.mts +2 -2
  380. package/dist/managers/WindowManager.d.ts +2 -2
  381. package/dist/managers/WindowManager.js +96 -72
  382. package/dist/managers/WindowManager.js.map +1 -1
  383. package/dist/managers/WindowManager.mjs +96 -72
  384. package/dist/managers/WindowManager.mjs.map +1 -1
  385. package/dist/managers/index.d.mts +2 -2
  386. package/dist/managers/index.d.ts +2 -2
  387. package/dist/managers/index.js +152 -82
  388. package/dist/managers/index.js.map +1 -1
  389. package/dist/managers/index.mjs +152 -82
  390. package/dist/managers/index.mjs.map +1 -1
  391. package/dist/override/StepLabelProps.js +1 -1
  392. package/dist/override/StepLabelProps.js.map +1 -1
  393. package/dist/override/StepLabelProps.mjs +1 -1
  394. package/dist/override/StepLabelProps.mjs.map +1 -1
  395. package/dist/override/StepLabelResult.js +1 -1
  396. package/dist/override/StepLabelResult.js.map +1 -1
  397. package/dist/override/StepLabelResult.mjs +1 -1
  398. package/dist/override/StepLabelResult.mjs.map +1 -1
  399. package/dist/override/index.js +1 -1
  400. package/dist/override/index.js.map +1 -1
  401. package/dist/override/index.mjs +1 -1
  402. package/dist/override/index.mjs.map +1 -1
  403. package/dist/types/CanvasElementTagType.js +1 -1
  404. package/dist/types/CanvasElementTagType.js.map +1 -1
  405. package/dist/types/CanvasElementTagType.mjs +1 -1
  406. package/dist/types/CanvasElementTagType.mjs.map +1 -1
  407. package/dist/types/CanvasEventNamesType.js +1 -1
  408. package/dist/types/CanvasEventNamesType.js.map +1 -1
  409. package/dist/types/CanvasEventNamesType.mjs +1 -1
  410. package/dist/types/CanvasEventNamesType.mjs.map +1 -1
  411. package/dist/types/ChoiceMenuOptionsType.js +1 -1
  412. package/dist/types/ChoiceMenuOptionsType.js.map +1 -1
  413. package/dist/types/ChoiceMenuOptionsType.mjs +1 -1
  414. package/dist/types/ChoiceMenuOptionsType.mjs.map +1 -1
  415. package/dist/types/CloseType.js +1 -1
  416. package/dist/types/CloseType.js.map +1 -1
  417. package/dist/types/CloseType.mjs +1 -1
  418. package/dist/types/CloseType.mjs.map +1 -1
  419. package/dist/types/EventIdType.js +1 -1
  420. package/dist/types/EventIdType.js.map +1 -1
  421. package/dist/types/EventIdType.mjs +1 -1
  422. package/dist/types/EventIdType.mjs.map +1 -1
  423. package/dist/types/HistoryChoiceMenuOption.js +1 -1
  424. package/dist/types/HistoryChoiceMenuOption.js.map +1 -1
  425. package/dist/types/HistoryChoiceMenuOption.mjs +1 -1
  426. package/dist/types/HistoryChoiceMenuOption.mjs.map +1 -1
  427. package/dist/types/LabelIdType.js +1 -1
  428. package/dist/types/LabelIdType.js.map +1 -1
  429. package/dist/types/LabelIdType.mjs +1 -1
  430. package/dist/types/LabelIdType.mjs.map +1 -1
  431. package/dist/types/LabelRunModeType.js +1 -1
  432. package/dist/types/LabelRunModeType.js.map +1 -1
  433. package/dist/types/LabelRunModeType.mjs +1 -1
  434. package/dist/types/LabelRunModeType.mjs.map +1 -1
  435. package/dist/types/PauseType.js +1 -1
  436. package/dist/types/PauseType.js.map +1 -1
  437. package/dist/types/PauseType.mjs +1 -1
  438. package/dist/types/PauseType.mjs.map +1 -1
  439. package/dist/types/RepeatType.js +1 -1
  440. package/dist/types/RepeatType.js.map +1 -1
  441. package/dist/types/RepeatType.mjs +1 -1
  442. package/dist/types/RepeatType.mjs.map +1 -1
  443. package/dist/types/StepHistoryDataType.js +1 -1
  444. package/dist/types/StepHistoryDataType.js.map +1 -1
  445. package/dist/types/StepHistoryDataType.mjs +1 -1
  446. package/dist/types/StepHistoryDataType.mjs.map +1 -1
  447. package/dist/types/StepLabelType.js +1 -1
  448. package/dist/types/StepLabelType.js.map +1 -1
  449. package/dist/types/StepLabelType.mjs +1 -1
  450. package/dist/types/StepLabelType.mjs.map +1 -1
  451. package/dist/types/StorageElementType.js +1 -1
  452. package/dist/types/StorageElementType.js.map +1 -1
  453. package/dist/types/StorageElementType.mjs +1 -1
  454. package/dist/types/StorageElementType.mjs.map +1 -1
  455. package/dist/types/TickerIdType.js +1 -1
  456. package/dist/types/TickerIdType.js.map +1 -1
  457. package/dist/types/TickerIdType.mjs +1 -1
  458. package/dist/types/TickerIdType.mjs.map +1 -1
  459. package/dist/types/index.js +1 -1
  460. package/dist/types/index.js.map +1 -1
  461. package/dist/types/index.mjs +1 -1
  462. package/dist/types/index.mjs.map +1 -1
  463. package/dist/types/ticker/FadeAlphaTickerProps.js +1 -1
  464. package/dist/types/ticker/FadeAlphaTickerProps.js.map +1 -1
  465. package/dist/types/ticker/FadeAlphaTickerProps.mjs +1 -1
  466. package/dist/types/ticker/FadeAlphaTickerProps.mjs.map +1 -1
  467. package/dist/types/ticker/MoveTickerProps.d.mts +1 -1
  468. package/dist/types/ticker/MoveTickerProps.d.ts +1 -1
  469. package/dist/types/ticker/MoveTickerProps.js +1 -1
  470. package/dist/types/ticker/MoveTickerProps.js.map +1 -1
  471. package/dist/types/ticker/MoveTickerProps.mjs +1 -1
  472. package/dist/types/ticker/MoveTickerProps.mjs.map +1 -1
  473. package/dist/types/ticker/RotateTickerProps.d.mts +1 -1
  474. package/dist/types/ticker/RotateTickerProps.d.ts +1 -1
  475. package/dist/types/ticker/RotateTickerProps.js +1 -1
  476. package/dist/types/ticker/RotateTickerProps.js.map +1 -1
  477. package/dist/types/ticker/RotateTickerProps.mjs +1 -1
  478. package/dist/types/ticker/RotateTickerProps.mjs.map +1 -1
  479. package/dist/types/ticker/TagToRemoveAfterType.js +1 -1
  480. package/dist/types/ticker/TagToRemoveAfterType.js.map +1 -1
  481. package/dist/types/ticker/TagToRemoveAfterType.mjs +1 -1
  482. package/dist/types/ticker/TagToRemoveAfterType.mjs.map +1 -1
  483. package/dist/types/ticker/ZoomTickerProps.js +1 -1
  484. package/dist/types/ticker/ZoomTickerProps.js.map +1 -1
  485. package/dist/types/ticker/ZoomTickerProps.mjs +1 -1
  486. package/dist/types/ticker/ZoomTickerProps.mjs.map +1 -1
  487. package/dist/types/ticker/index.js +1 -1
  488. package/dist/types/ticker/index.js.map +1 -1
  489. package/dist/types/ticker/index.mjs +1 -1
  490. package/dist/types/ticker/index.mjs.map +1 -1
  491. package/package.json +4 -4
  492. package/dist/labels/EventsTestLabel.js.map +0 -1
  493. package/dist/labels/EventsTestLabel.mjs.map +0 -1
  494. package/dist/labels/ShowImageTest.js.map +0 -1
  495. package/dist/labels/ShowImageTest.mjs.map +0 -1
  496. package/dist/labels/TickerTestLabel.d.mts +0 -9
  497. package/dist/labels/TickerTestLabel.d.ts +0 -9
  498. package/dist/labels/TickerTestLabel.js.map +0 -1
  499. package/dist/labels/TickerTestLabel.mjs.map +0 -1
  500. package/dist/labels/TintingTestLabel.js +0 -1786
  501. package/dist/labels/TintingTestLabel.js.map +0 -1
  502. package/dist/labels/TintingTestLabel.mjs +0 -1780
  503. package/dist/labels/TintingTestLabel.mjs.map +0 -1
  504. /package/dist/labels/{ShowImageTest.d.mts → ImagesAnimationsTestLabel.d.mts} +0 -0
  505. /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;
@@ -84,5 +84,5 @@ function newCloseLabel(choiseIndex) {
84
84
 
85
85
  exports.CLOSE_LABEL_ID = CLOSE_LABEL_ID;
86
86
  exports.default = newCloseLabel;
87
- //# sourceMappingURL=out.js.map
87
+ //# sourceMappingURL=CloseLabel.js.map
88
88
  //# sourceMappingURL=CloseLabel.js.map
@@ -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":";;;;;;;AAmBO,SAAS,mBAAA,CAAoB,OAAiD,KAA0D,EAAA;AAC3I,EAAA,OAAO,KAAU,KAAA,KAAA,CAAA;AACrB,CAAA;;;ACSA,IAAqB,QAArB,MAA8C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO1C,WAAY,CAAA,EAAA,EAAiB,KAAwD,EAAA,SAAA,EAAwC,WAAsB,EAAA;AAC/I,IAAA,IAAA,CAAK,GAAM,GAAA,EAAA,CAAA;AACX,IAAA,IAAA,CAAK,MAAS,GAAA,KAAA,CAAA;AACd,IAAA,IAAA,CAAK,UAAa,GAAA,SAAA,CAAA;AAClB,IAAA,IAAA,CAAK,YAAe,GAAA,WAAA,CAAA;AAAA,GACxB;AAAA;AAAA;AAAA;AAAA,EAMA,IAAW,EAAkB,GAAA;AACzB,IAAA,OAAO,IAAK,CAAA,GAAA,CAAA;AAAA,GAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,IAAW,KAA4B,GAAA;AACnC,IAAI,IAAA,OAAO,IAAK,CAAA,MAAA,KAAW,UAAY,EAAA;AACnC,MAAA,OAAO,KAAK,MAAO,EAAA,CAAA;AAAA,KACvB;AACA,IAAA,OAAO,IAAK,CAAA,MAAA,CAAA;AAAA,GAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOO,4BAA4B,aAAgE,EAAA;AAC/F,IAAI,IAAA,aAAA,CAAc,WAAW,CAAG,EAAA;AAC5B,MAAO,OAAA,CAAA,CAAA;AAAA,KACX;AACA,IAAA,IAAI,GAAc,GAAA,CAAA,CAAA;AAClB,IAAc,aAAA,CAAA,OAAA,CAAQ,CAAC,IAAA,EAAM,KAAU,KAAA;AACnC,MAAA,IAAI,oBAAoB,IAAM,EAAA,IAAA,CAAK,KAAM,CAAA,KAAK,CAAC,CAAG,EAAA;AAC9C,QAAM,GAAA,GAAA,KAAA,CAAA;AAAA,OACV;AAAA,KACH,CAAA,CAAA;AACD,IAAO,OAAA,GAAA,CAAA;AAAA,GACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcA,IAAW,SAAsD,GAAA;AAC7D,IAAA,OAAO,IAAK,CAAA,UAAA,CAAA;AAAA,GAChB;AAAA,EAGA,IAAW,WAAkC,GAAA;AACzC,IAAA,OAAO,IAAK,CAAA,YAAA,CAAA;AAAA,GAChB;AACJ,CAAA,CAAA;;;ACrGO,IAAM,cAAiB,GAAA,qBAAA;AAKf,SAAR,cAAkD,WAAsB,EAAA;AAAE,EAAA,OAAO,IAAI,KAAS,CAAA,cAAA,EAAgB,EAAC,EAAG,QAAW,WAAW,CAAA,CAAA;AAAE","file":"CloseLabel.js","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;
@@ -79,5 +79,5 @@ function newCloseLabel(choiseIndex) {
79
79
  }
80
80
 
81
81
  export { CLOSE_LABEL_ID, newCloseLabel as default };
82
- //# sourceMappingURL=out.js.map
82
+ //# sourceMappingURL=CloseLabel.mjs.map
83
83
  //# sourceMappingURL=CloseLabel.mjs.map
@@ -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":";;;AAmBO,SAAS,mBAAA,CAAoB,OAAiD,KAA0D,EAAA;AAC3I,EAAA,OAAO,KAAU,KAAA,KAAA,CAAA;AACrB,CAAA;;;ACSA,IAAqB,QAArB,MAA8C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO1C,WAAY,CAAA,EAAA,EAAiB,KAAwD,EAAA,SAAA,EAAwC,WAAsB,EAAA;AAC/I,IAAA,IAAA,CAAK,GAAM,GAAA,EAAA,CAAA;AACX,IAAA,IAAA,CAAK,MAAS,GAAA,KAAA,CAAA;AACd,IAAA,IAAA,CAAK,UAAa,GAAA,SAAA,CAAA;AAClB,IAAA,IAAA,CAAK,YAAe,GAAA,WAAA,CAAA;AAAA,GACxB;AAAA;AAAA;AAAA;AAAA,EAMA,IAAW,EAAkB,GAAA;AACzB,IAAA,OAAO,IAAK,CAAA,GAAA,CAAA;AAAA,GAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,IAAW,KAA4B,GAAA;AACnC,IAAI,IAAA,OAAO,IAAK,CAAA,MAAA,KAAW,UAAY,EAAA;AACnC,MAAA,OAAO,KAAK,MAAO,EAAA,CAAA;AAAA,KACvB;AACA,IAAA,OAAO,IAAK,CAAA,MAAA,CAAA;AAAA,GAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOO,4BAA4B,aAAgE,EAAA;AAC/F,IAAI,IAAA,aAAA,CAAc,WAAW,CAAG,EAAA;AAC5B,MAAO,OAAA,CAAA,CAAA;AAAA,KACX;AACA,IAAA,IAAI,GAAc,GAAA,CAAA,CAAA;AAClB,IAAc,aAAA,CAAA,OAAA,CAAQ,CAAC,IAAA,EAAM,KAAU,KAAA;AACnC,MAAA,IAAI,oBAAoB,IAAM,EAAA,IAAA,CAAK,KAAM,CAAA,KAAK,CAAC,CAAG,EAAA;AAC9C,QAAM,GAAA,GAAA,KAAA,CAAA;AAAA,OACV;AAAA,KACH,CAAA,CAAA;AACD,IAAO,OAAA,GAAA,CAAA;AAAA,GACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcA,IAAW,SAAsD,GAAA;AAC7D,IAAA,OAAO,IAAK,CAAA,UAAA,CAAA;AAAA,GAChB;AAAA,EAGA,IAAW,WAAkC,GAAA;AACzC,IAAA,OAAO,IAAK,CAAA,YAAA,CAAA;AAAA,GAChB;AACJ,CAAA,CAAA;;;ACrGO,IAAM,cAAiB,GAAA,qBAAA;AAKf,SAAR,cAAkD,WAAsB,EAAA;AAAE,EAAA,OAAO,IAAI,KAAS,CAAA,cAAA,EAAgB,EAAC,EAAG,QAAW,WAAW,CAAA,CAAA;AAAE","file":"CloseLabel.mjs","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,12 +40,12 @@ 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
  }
47
47
  };
48
48
 
49
49
  module.exports = DialogueBaseModel;
50
- //# sourceMappingURL=out.js.map
50
+ //# sourceMappingURL=DialogueBaseModel.js.map
51
51
  //# sourceMappingURL=DialogueBaseModel.js.map
@@ -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,WAAY,CAAA,IAAA,EAA6B,SAAiC,EAAA,YAAA,GAAsD,EAAI,EAAA;AAsBpI;AAAA;AAAA;AAAA,IAAe,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA;AAQf;AAAA;AAAA;AAAA,IAAA,IAAA,CAAA,YAAA,GAAsD,EAAC,CAAA;AA7BnD,IAAI,IAAA,OAAO,SAAS,QAAU,EAAA;AAC1B,MAAA,IAAA,CAAK,IAAO,GAAA,IAAA,CAAA;AACZ,MAAI,IAAA,OAAO,cAAc,QAAU,EAAA;AAC/B,QAAA,IAAA,CAAK,SAAY,GAAA,SAAA,CAAA;AAAA,OAEhB,MAAA;AACD,QAAA,IAAA,CAAK,YAAY,SAAW,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,SAAA,CAAA,EAAA,CAAA;AAAA,OAChC;AACA,MAAA,IAAA,CAAK,YAAe,GAAA,YAAA,CAAA;AAAA,KAEnB,MAAA;AACD,MAAA,IAAA,CAAK,OAAO,IAAK,CAAA,IAAA,CAAA;AACjB,MAAA,IAAI,KAAK,SAAW,EAAA;AAChB,QAAA,IAAA,CAAK,YAAY,IAAK,CAAA,SAAA,CAAA;AAAA,OAC1B;AACA,MAAK,IAAA,CAAA,YAAA,GAAe,IAAK,CAAA,YAAA,IAAgB,EAAC,CAAA;AAAA,KAC9C;AAAA,GACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAkBA,MAAuB,GAAA;AACnB,IAAO,OAAA;AAAA,MACH,MAAM,IAAK,CAAA,IAAA;AAAA,MACX,WAAW,IAAK,CAAA,SAAA;AAAA,MAChB,cAAc,IAAK,CAAA,YAAA;AAAA,KACvB,CAAA;AAAA,GACJ;AACJ","file":"DialogueBaseModel.js","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,12 +38,12 @@ 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
  }
45
45
  };
46
46
 
47
47
  export { DialogueBaseModel as default };
48
- //# sourceMappingURL=out.js.map
48
+ //# sourceMappingURL=DialogueBaseModel.mjs.map
49
49
  //# sourceMappingURL=DialogueBaseModel.mjs.map
@@ -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,WAAY,CAAA,IAAA,EAA6B,SAAiC,EAAA,YAAA,GAAsD,EAAI,EAAA;AAsBpI;AAAA;AAAA;AAAA,IAAe,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA;AAQf;AAAA;AAAA;AAAA,IAAA,IAAA,CAAA,YAAA,GAAsD,EAAC,CAAA;AA7BnD,IAAI,IAAA,OAAO,SAAS,QAAU,EAAA;AAC1B,MAAA,IAAA,CAAK,IAAO,GAAA,IAAA,CAAA;AACZ,MAAI,IAAA,OAAO,cAAc,QAAU,EAAA;AAC/B,QAAA,IAAA,CAAK,SAAY,GAAA,SAAA,CAAA;AAAA,OAEhB,MAAA;AACD,QAAA,IAAA,CAAK,YAAY,SAAW,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,SAAA,CAAA,EAAA,CAAA;AAAA,OAChC;AACA,MAAA,IAAA,CAAK,YAAe,GAAA,YAAA,CAAA;AAAA,KAEnB,MAAA;AACD,MAAA,IAAA,CAAK,OAAO,IAAK,CAAA,IAAA,CAAA;AACjB,MAAA,IAAI,KAAK,SAAW,EAAA;AAChB,QAAA,IAAA,CAAK,YAAY,IAAK,CAAA,SAAA,CAAA;AAAA,OAC1B;AACA,MAAK,IAAA,CAAA,YAAA,GAAe,IAAK,CAAA,YAAA,IAAgB,EAAC,CAAA;AAAA,KAC9C;AAAA,GACJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAkBA,MAAuB,GAAA;AACnB,IAAO,OAAA;AAAA,MACH,MAAM,IAAK,CAAA,IAAA;AAAA,MACX,WAAW,IAAK,CAAA,SAAA;AAAA,MAChB,cAAc,IAAK,CAAA,YAAA;AAAA,KACvB,CAAA;AAAA,GACJ;AACJ","file":"DialogueBaseModel.mjs","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;
@@ -75,5 +75,5 @@ var Label = class {
75
75
  };
76
76
 
77
77
  module.exports = Label;
78
- //# sourceMappingURL=out.js.map
78
+ //# sourceMappingURL=Label.js.map
79
79
  //# sourceMappingURL=Label.js.map
@@ -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":";;;;;AAmBO,SAAS,mBAAA,CAAoB,OAAiD,KAA0D,EAAA;AAC3I,EAAA,OAAO,KAAU,KAAA,KAAA,CAAA;AACrB,CAAA;;;ACSA,IAAqB,QAArB,MAA8C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO1C,WAAY,CAAA,EAAA,EAAiB,KAAwD,EAAA,SAAA,EAAwC,WAAsB,EAAA;AAC/I,IAAA,IAAA,CAAK,GAAM,GAAA,EAAA,CAAA;AACX,IAAA,IAAA,CAAK,MAAS,GAAA,KAAA,CAAA;AACd,IAAA,IAAA,CAAK,UAAa,GAAA,SAAA,CAAA;AAClB,IAAA,IAAA,CAAK,YAAe,GAAA,WAAA,CAAA;AAAA,GACxB;AAAA;AAAA;AAAA;AAAA,EAMA,IAAW,EAAkB,GAAA;AACzB,IAAA,OAAO,IAAK,CAAA,GAAA,CAAA;AAAA,GAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,IAAW,KAA4B,GAAA;AACnC,IAAI,IAAA,OAAO,IAAK,CAAA,MAAA,KAAW,UAAY,EAAA;AACnC,MAAA,OAAO,KAAK,MAAO,EAAA,CAAA;AAAA,KACvB;AACA,IAAA,OAAO,IAAK,CAAA,MAAA,CAAA;AAAA,GAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOO,4BAA4B,aAAgE,EAAA;AAC/F,IAAI,IAAA,aAAA,CAAc,WAAW,CAAG,EAAA;AAC5B,MAAO,OAAA,CAAA,CAAA;AAAA,KACX;AACA,IAAA,IAAI,GAAc,GAAA,CAAA,CAAA;AAClB,IAAc,aAAA,CAAA,OAAA,CAAQ,CAAC,IAAA,EAAM,KAAU,KAAA;AACnC,MAAA,IAAI,oBAAoB,IAAM,EAAA,IAAA,CAAK,KAAM,CAAA,KAAK,CAAC,CAAG,EAAA;AAC9C,QAAM,GAAA,GAAA,KAAA,CAAA;AAAA,OACV;AAAA,KACH,CAAA,CAAA;AACD,IAAO,OAAA,GAAA,CAAA;AAAA,GACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcA,IAAW,SAAsD,GAAA;AAC7D,IAAA,OAAO,IAAK,CAAA,UAAA,CAAA;AAAA,GAChB;AAAA,EAGA,IAAW,WAAkC,GAAA;AACzC,IAAA,OAAO,IAAK,CAAA,YAAA,CAAA;AAAA,GAChB;AACJ","file":"Label.js","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;
@@ -73,5 +73,5 @@ var Label = class {
73
73
  };
74
74
 
75
75
  export { Label as default };
76
- //# sourceMappingURL=out.js.map
76
+ //# sourceMappingURL=Label.mjs.map
77
77
  //# sourceMappingURL=Label.mjs.map
@@ -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":";;;AAmBO,SAAS,mBAAA,CAAoB,OAAiD,KAA0D,EAAA;AAC3I,EAAA,OAAO,KAAU,KAAA,KAAA,CAAA;AACrB,CAAA;;;ACSA,IAAqB,QAArB,MAA8C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO1C,WAAY,CAAA,EAAA,EAAiB,KAAwD,EAAA,SAAA,EAAwC,WAAsB,EAAA;AAC/I,IAAA,IAAA,CAAK,GAAM,GAAA,EAAA,CAAA;AACX,IAAA,IAAA,CAAK,MAAS,GAAA,KAAA,CAAA;AACd,IAAA,IAAA,CAAK,UAAa,GAAA,SAAA,CAAA;AAClB,IAAA,IAAA,CAAK,YAAe,GAAA,WAAA,CAAA;AAAA,GACxB;AAAA;AAAA;AAAA;AAAA,EAMA,IAAW,EAAkB,GAAA;AACzB,IAAA,OAAO,IAAK,CAAA,GAAA,CAAA;AAAA,GAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,IAAW,KAA4B,GAAA;AACnC,IAAI,IAAA,OAAO,IAAK,CAAA,MAAA,KAAW,UAAY,EAAA;AACnC,MAAA,OAAO,KAAK,MAAO,EAAA,CAAA;AAAA,KACvB;AACA,IAAA,OAAO,IAAK,CAAA,MAAA,CAAA;AAAA,GAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOO,4BAA4B,aAAgE,EAAA;AAC/F,IAAI,IAAA,aAAA,CAAc,WAAW,CAAG,EAAA;AAC5B,MAAO,OAAA,CAAA,CAAA;AAAA,KACX;AACA,IAAA,IAAI,GAAc,GAAA,CAAA,CAAA;AAClB,IAAc,aAAA,CAAA,OAAA,CAAQ,CAAC,IAAA,EAAM,KAAU,KAAA;AACnC,MAAA,IAAI,oBAAoB,IAAM,EAAA,IAAA,CAAK,KAAM,CAAA,KAAK,CAAC,CAAG,EAAA;AAC9C,QAAM,GAAA,GAAA,KAAA,CAAA;AAAA,OACV;AAAA,KACH,CAAA,CAAA;AACD,IAAO,OAAA,GAAA,CAAA;AAAA,GACX;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcA,IAAW,SAAsD,GAAA;AAC7D,IAAA,OAAO,IAAK,CAAA,UAAA,CAAA;AAAA,GAChB;AAAA,EAGA,IAAW,WAAkC,GAAA;AACzC,IAAA,OAAO,IAAK,CAAA,YAAA,CAAA;AAAA,GAChB;AACJ","file":"Label.mjs","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"]}