@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.
- package/dist/{TickerBase-BAUiHet_.d.ts → TickerBase-3rLpDpmb.d.ts} +9 -0
- package/dist/{TickerBase-BctFf13y.d.mts → TickerBase-DKYzbzro.d.mts} +9 -0
- package/dist/classes/CanvasEvent.d.mts +6 -0
- package/dist/classes/CanvasEvent.d.ts +6 -0
- package/dist/classes/CanvasEvent.js +8 -1
- package/dist/classes/CanvasEvent.js.map +1 -1
- package/dist/classes/CanvasEvent.mjs +8 -1
- package/dist/classes/CanvasEvent.mjs.map +1 -1
- package/dist/classes/CharacterBaseModel.js +105 -77
- package/dist/classes/CharacterBaseModel.js.map +1 -1
- package/dist/classes/CharacterBaseModel.mjs +105 -77
- package/dist/classes/CharacterBaseModel.mjs.map +1 -1
- package/dist/classes/ChoiceMenuOption.js +106 -78
- package/dist/classes/ChoiceMenuOption.js.map +1 -1
- package/dist/classes/ChoiceMenuOption.mjs +106 -78
- package/dist/classes/ChoiceMenuOption.mjs.map +1 -1
- package/dist/classes/CloseLabel.js +2 -2
- package/dist/classes/CloseLabel.js.map +1 -1
- package/dist/classes/CloseLabel.mjs +2 -2
- package/dist/classes/CloseLabel.mjs.map +1 -1
- package/dist/classes/DialogueBaseModel.d.mts +2 -2
- package/dist/classes/DialogueBaseModel.d.ts +2 -2
- package/dist/classes/DialogueBaseModel.js +6 -6
- package/dist/classes/DialogueBaseModel.js.map +1 -1
- package/dist/classes/DialogueBaseModel.mjs +6 -6
- package/dist/classes/DialogueBaseModel.mjs.map +1 -1
- package/dist/classes/Label.d.mts +1 -1
- package/dist/classes/Label.d.ts +1 -1
- package/dist/classes/Label.js +2 -2
- package/dist/classes/Label.js.map +1 -1
- package/dist/classes/Label.mjs +2 -2
- package/dist/classes/Label.mjs.map +1 -1
- package/dist/classes/StoredClassModel.js +105 -77
- package/dist/classes/StoredClassModel.js.map +1 -1
- package/dist/classes/StoredClassModel.mjs +105 -77
- package/dist/classes/StoredClassModel.mjs.map +1 -1
- package/dist/classes/canvas/CanvasBase.d.mts +5 -1
- package/dist/classes/canvas/CanvasBase.d.ts +5 -1
- package/dist/classes/canvas/CanvasBase.js +8 -1
- package/dist/classes/canvas/CanvasBase.js.map +1 -1
- package/dist/classes/canvas/CanvasBase.mjs +8 -1
- package/dist/classes/canvas/CanvasBase.mjs.map +1 -1
- package/dist/classes/canvas/CanvasContainer.d.mts +4 -1
- package/dist/classes/canvas/CanvasContainer.d.ts +4 -1
- package/dist/classes/canvas/CanvasContainer.js +67 -47
- package/dist/classes/canvas/CanvasContainer.js.map +1 -1
- package/dist/classes/canvas/CanvasContainer.mjs +67 -48
- package/dist/classes/canvas/CanvasContainer.mjs.map +1 -1
- package/dist/classes/canvas/CanvasImage.d.mts +4 -2
- package/dist/classes/canvas/CanvasImage.d.ts +4 -2
- package/dist/classes/canvas/CanvasImage.js +34 -23
- package/dist/classes/canvas/CanvasImage.js.map +1 -1
- package/dist/classes/canvas/CanvasImage.mjs +31 -23
- package/dist/classes/canvas/CanvasImage.mjs.map +1 -1
- package/dist/classes/canvas/CanvasSprite.d.mts +5 -2
- package/dist/classes/canvas/CanvasSprite.d.ts +5 -2
- package/dist/classes/canvas/CanvasSprite.js +26 -20
- package/dist/classes/canvas/CanvasSprite.js.map +1 -1
- package/dist/classes/canvas/CanvasSprite.mjs +26 -21
- package/dist/classes/canvas/CanvasSprite.mjs.map +1 -1
- package/dist/classes/canvas/CanvasText.d.mts +6 -3
- package/dist/classes/canvas/CanvasText.d.ts +6 -3
- package/dist/classes/canvas/CanvasText.js +35 -27
- package/dist/classes/canvas/CanvasText.js.map +1 -1
- package/dist/classes/canvas/CanvasText.mjs +35 -28
- package/dist/classes/canvas/CanvasText.mjs.map +1 -1
- package/dist/classes/canvas/index.js +192 -166
- package/dist/classes/canvas/index.js.map +1 -1
- package/dist/classes/canvas/index.mjs +192 -166
- package/dist/classes/canvas/index.mjs.map +1 -1
- package/dist/classes/index.d.mts +1 -0
- package/dist/classes/index.d.ts +1 -0
- package/dist/classes/index.js +118 -83
- package/dist/classes/index.js.map +1 -1
- package/dist/classes/index.mjs +118 -83
- package/dist/classes/index.mjs.map +1 -1
- package/dist/classes/ticker/FadeAlphaTicker.d.mts +2 -1
- package/dist/classes/ticker/FadeAlphaTicker.d.ts +2 -1
- package/dist/classes/ticker/FadeAlphaTicker.js +105 -77
- package/dist/classes/ticker/FadeAlphaTicker.js.map +1 -1
- package/dist/classes/ticker/FadeAlphaTicker.mjs +105 -77
- package/dist/classes/ticker/FadeAlphaTicker.mjs.map +1 -1
- package/dist/classes/ticker/MoveTicker.d.mts +2 -1
- package/dist/classes/ticker/MoveTicker.d.ts +2 -1
- package/dist/classes/ticker/MoveTicker.js +105 -77
- package/dist/classes/ticker/MoveTicker.js.map +1 -1
- package/dist/classes/ticker/MoveTicker.mjs +105 -77
- package/dist/classes/ticker/MoveTicker.mjs.map +1 -1
- package/dist/classes/ticker/RotateTicker.d.mts +2 -1
- package/dist/classes/ticker/RotateTicker.d.ts +2 -1
- package/dist/classes/ticker/RotateTicker.js +105 -77
- package/dist/classes/ticker/RotateTicker.js.map +1 -1
- package/dist/classes/ticker/RotateTicker.mjs +105 -77
- package/dist/classes/ticker/RotateTicker.mjs.map +1 -1
- package/dist/classes/ticker/TickerBase.d.mts +2 -1
- package/dist/classes/ticker/TickerBase.d.ts +2 -1
- package/dist/classes/ticker/TickerBase.js +6 -1
- package/dist/classes/ticker/TickerBase.js.map +1 -1
- package/dist/classes/ticker/TickerBase.mjs +6 -1
- package/dist/classes/ticker/TickerBase.mjs.map +1 -1
- package/dist/classes/ticker/ZoomTicker.d.mts +9 -3
- package/dist/classes/ticker/ZoomTicker.d.ts +9 -3
- package/dist/classes/ticker/ZoomTicker.js +120 -78
- package/dist/classes/ticker/ZoomTicker.js.map +1 -1
- package/dist/classes/ticker/ZoomTicker.mjs +118 -78
- package/dist/classes/ticker/ZoomTicker.mjs.map +1 -1
- package/dist/classes/ticker/index.d.mts +2 -1
- package/dist/classes/ticker/index.d.ts +2 -1
- package/dist/classes/ticker/index.js +242 -214
- package/dist/classes/ticker/index.js.map +1 -1
- package/dist/classes/ticker/index.mjs +242 -214
- package/dist/classes/ticker/index.mjs.map +1 -1
- package/dist/constants.d.mts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +2 -2
- package/dist/constants.js.map +1 -1
- package/dist/constants.mjs +2 -2
- package/dist/constants.mjs.map +1 -1
- package/dist/decorators/CanvasElementDecorator.d.mts +3 -3
- package/dist/decorators/CanvasElementDecorator.d.ts +3 -3
- package/dist/decorators/CanvasElementDecorator.js +73 -53
- package/dist/decorators/CanvasElementDecorator.js.map +1 -1
- package/dist/decorators/CanvasElementDecorator.mjs +72 -52
- package/dist/decorators/CanvasElementDecorator.mjs.map +1 -1
- package/dist/decorators/CharacterDecorator.js +1 -1
- package/dist/decorators/CharacterDecorator.js.map +1 -1
- package/dist/decorators/CharacterDecorator.mjs +1 -1
- package/dist/decorators/CharacterDecorator.mjs.map +1 -1
- package/dist/decorators/EventDecorator.d.mts +7 -7
- package/dist/decorators/EventDecorator.d.ts +7 -7
- package/dist/decorators/EventDecorator.js +12 -11
- package/dist/decorators/EventDecorator.js.map +1 -1
- package/dist/decorators/EventDecorator.mjs +11 -10
- package/dist/decorators/EventDecorator.mjs.map +1 -1
- package/dist/decorators/LabelDecorator.js +106 -78
- package/dist/decorators/LabelDecorator.js.map +1 -1
- package/dist/decorators/LabelDecorator.mjs +106 -78
- package/dist/decorators/LabelDecorator.mjs.map +1 -1
- package/dist/decorators/TickerDecorator.d.mts +5 -5
- package/dist/decorators/TickerDecorator.d.ts +5 -5
- package/dist/decorators/TickerDecorator.js +7 -6
- package/dist/decorators/TickerDecorator.js.map +1 -1
- package/dist/decorators/TickerDecorator.mjs +7 -6
- package/dist/decorators/TickerDecorator.mjs.map +1 -1
- package/dist/decorators/index.d.mts +1 -1
- package/dist/decorators/index.d.ts +1 -1
- package/dist/decorators/index.js +108 -78
- package/dist/decorators/index.js.map +1 -1
- package/dist/decorators/index.mjs +108 -78
- package/dist/decorators/index.mjs.map +1 -1
- package/dist/functions/CanvasUtility.js +66 -47
- package/dist/functions/CanvasUtility.js.map +1 -1
- package/dist/functions/CanvasUtility.mjs +66 -47
- package/dist/functions/CanvasUtility.mjs.map +1 -1
- package/dist/functions/DialogueUtility.d.mts +1 -1
- package/dist/functions/DialogueUtility.d.ts +1 -1
- package/dist/functions/DialogueUtility.js +250 -211
- package/dist/functions/DialogueUtility.js.map +1 -1
- package/dist/functions/DialogueUtility.mjs +250 -211
- package/dist/functions/DialogueUtility.mjs.map +1 -1
- package/dist/functions/DiffUtility.js +1 -1
- package/dist/functions/DiffUtility.js.map +1 -1
- package/dist/functions/DiffUtility.mjs +1 -1
- package/dist/functions/DiffUtility.mjs.map +1 -1
- package/dist/functions/EasterEgg.js +1 -1
- package/dist/functions/EasterEgg.js.map +1 -1
- package/dist/functions/EasterEgg.mjs +1 -1
- package/dist/functions/EasterEgg.mjs.map +1 -1
- package/dist/functions/ExportUtility.js +1 -1
- package/dist/functions/ExportUtility.js.map +1 -1
- package/dist/functions/ExportUtility.mjs +1 -1
- package/dist/functions/ExportUtility.mjs.map +1 -1
- package/dist/functions/FlagsUtility.js +105 -77
- package/dist/functions/FlagsUtility.js.map +1 -1
- package/dist/functions/FlagsUtility.mjs +105 -77
- package/dist/functions/FlagsUtility.mjs.map +1 -1
- package/dist/functions/GameUtility.js +105 -77
- package/dist/functions/GameUtility.js.map +1 -1
- package/dist/functions/GameUtility.mjs +105 -77
- package/dist/functions/GameUtility.mjs.map +1 -1
- package/dist/functions/ImageUtility.d.mts +35 -2
- package/dist/functions/ImageUtility.d.ts +35 -2
- package/dist/functions/ImageUtility.js +381 -196
- package/dist/functions/ImageUtility.js.map +1 -1
- package/dist/functions/ImageUtility.mjs +378 -197
- package/dist/functions/ImageUtility.mjs.map +1 -1
- package/dist/functions/SavesUtility.d.mts +2 -2
- package/dist/functions/SavesUtility.d.ts +2 -2
- package/dist/functions/SavesUtility.js +153 -83
- package/dist/functions/SavesUtility.js.map +1 -1
- package/dist/functions/SavesUtility.mjs +153 -83
- package/dist/functions/SavesUtility.mjs.map +1 -1
- package/dist/functions/StepLabelUtility.js +1 -1
- package/dist/functions/StepLabelUtility.js.map +1 -1
- package/dist/functions/StepLabelUtility.mjs +1 -1
- package/dist/functions/StepLabelUtility.mjs.map +1 -1
- package/dist/functions/TextureUtility.js +10 -8
- package/dist/functions/TextureUtility.js.map +1 -1
- package/dist/functions/TextureUtility.mjs +10 -8
- package/dist/functions/TextureUtility.mjs.map +1 -1
- package/dist/functions/TickerUtility.js +1 -1
- package/dist/functions/TickerUtility.js.map +1 -1
- package/dist/functions/TickerUtility.mjs +1 -1
- package/dist/functions/TickerUtility.mjs.map +1 -1
- package/dist/functions/index.d.mts +6 -3
- package/dist/functions/index.d.ts +6 -3
- package/dist/functions/index.js +289 -93
- package/dist/functions/index.js.map +1 -1
- package/dist/functions/index.mjs +287 -95
- package/dist/functions/index.mjs.map +1 -1
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +758 -165
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +756 -167
- package/dist/index.mjs.map +1 -1
- package/dist/interface/CharacterBaseModelProps.js +1 -1
- package/dist/interface/CharacterBaseModelProps.js.map +1 -1
- package/dist/interface/CharacterBaseModelProps.mjs +1 -1
- package/dist/interface/CharacterBaseModelProps.mjs.map +1 -1
- package/dist/interface/DialogueHistory.js +1 -1
- package/dist/interface/DialogueHistory.js.map +1 -1
- package/dist/interface/DialogueHistory.mjs +1 -1
- package/dist/interface/DialogueHistory.mjs.map +1 -1
- package/dist/interface/IHistoryStep.d.mts +2 -2
- package/dist/interface/IHistoryStep.d.ts +2 -2
- package/dist/interface/IHistoryStep.js +1 -1
- package/dist/interface/IHistoryStep.js.map +1 -1
- package/dist/interface/IHistoryStep.mjs +1 -1
- package/dist/interface/IHistoryStep.mjs.map +1 -1
- package/dist/interface/IOpenedLabel.js +1 -1
- package/dist/interface/IOpenedLabel.js.map +1 -1
- package/dist/interface/IOpenedLabel.mjs +1 -1
- package/dist/interface/IOpenedLabel.mjs.map +1 -1
- package/dist/interface/ISaveData.d.mts +2 -2
- package/dist/interface/ISaveData.d.ts +2 -2
- package/dist/interface/ISaveData.js +1 -1
- package/dist/interface/ISaveData.js.map +1 -1
- package/dist/interface/ISaveData.mjs +1 -1
- package/dist/interface/ISaveData.mjs.map +1 -1
- package/dist/interface/ITicker.d.mts +2 -1
- package/dist/interface/ITicker.d.ts +2 -1
- package/dist/interface/ITicker.js +1 -1
- package/dist/interface/ITicker.js.map +1 -1
- package/dist/interface/ITicker.mjs +1 -1
- package/dist/interface/ITicker.mjs.map +1 -1
- package/dist/interface/ITickersSteps.d.mts +12 -3
- package/dist/interface/ITickersSteps.d.ts +12 -3
- package/dist/interface/ITickersSteps.js +1 -1
- package/dist/interface/ITickersSteps.js.map +1 -1
- package/dist/interface/ITickersSteps.mjs +1 -1
- package/dist/interface/ITickersSteps.mjs.map +1 -1
- package/dist/interface/TickerHistory.d.mts +3 -3
- package/dist/interface/TickerHistory.d.ts +3 -3
- package/dist/interface/TickerHistory.js +1 -1
- package/dist/interface/TickerHistory.js.map +1 -1
- package/dist/interface/TickerHistory.mjs +1 -1
- package/dist/interface/TickerHistory.mjs.map +1 -1
- package/dist/interface/TickerProgrationType.js +1 -1
- package/dist/interface/TickerProgrationType.js.map +1 -1
- package/dist/interface/TickerProgrationType.mjs +1 -1
- package/dist/interface/TickerProgrationType.mjs.map +1 -1
- package/dist/interface/TickerTimeoutHistory.js +1 -1
- package/dist/interface/TickerTimeoutHistory.js.map +1 -1
- package/dist/interface/TickerTimeoutHistory.mjs +1 -1
- package/dist/interface/TickerTimeoutHistory.mjs.map +1 -1
- package/dist/interface/canvas/ICanvasBaseMemory.d.mts +1 -1
- package/dist/interface/canvas/ICanvasBaseMemory.d.ts +1 -1
- package/dist/interface/canvas/ICanvasBaseMemory.js +1 -1
- package/dist/interface/canvas/ICanvasBaseMemory.js.map +1 -1
- package/dist/interface/canvas/ICanvasBaseMemory.mjs +1 -1
- package/dist/interface/canvas/ICanvasBaseMemory.mjs.map +1 -1
- package/dist/interface/canvas/ICanvasContainerMemory.js +1 -1
- package/dist/interface/canvas/ICanvasContainerMemory.js.map +1 -1
- package/dist/interface/canvas/ICanvasContainerMemory.mjs +1 -1
- package/dist/interface/canvas/ICanvasContainerMemory.mjs.map +1 -1
- package/dist/interface/canvas/ICanvasImageMemory.d.mts +2 -2
- package/dist/interface/canvas/ICanvasImageMemory.d.ts +2 -2
- package/dist/interface/canvas/ICanvasImageMemory.js +1 -1
- package/dist/interface/canvas/ICanvasImageMemory.js.map +1 -1
- package/dist/interface/canvas/ICanvasImageMemory.mjs +1 -1
- package/dist/interface/canvas/ICanvasImageMemory.mjs.map +1 -1
- package/dist/interface/canvas/ICanvasSpriteMemory.d.mts +1 -2
- package/dist/interface/canvas/ICanvasSpriteMemory.d.ts +1 -2
- package/dist/interface/canvas/ICanvasSpriteMemory.js +1 -1
- package/dist/interface/canvas/ICanvasSpriteMemory.js.map +1 -1
- package/dist/interface/canvas/ICanvasSpriteMemory.mjs +1 -1
- package/dist/interface/canvas/ICanvasSpriteMemory.mjs.map +1 -1
- package/dist/interface/canvas/ICanvasTextTextMemory.d.mts +1 -2
- package/dist/interface/canvas/ICanvasTextTextMemory.d.ts +1 -2
- package/dist/interface/canvas/ICanvasTextTextMemory.js +1 -1
- package/dist/interface/canvas/ICanvasTextTextMemory.js.map +1 -1
- package/dist/interface/canvas/ICanvasTextTextMemory.mjs +1 -1
- package/dist/interface/canvas/ICanvasTextTextMemory.mjs.map +1 -1
- package/dist/interface/canvas/ITextureMemory.js +1 -1
- package/dist/interface/canvas/ITextureMemory.js.map +1 -1
- package/dist/interface/canvas/ITextureMemory.mjs +1 -1
- package/dist/interface/canvas/ITextureMemory.mjs.map +1 -1
- package/dist/interface/canvas/index.js +1 -1
- package/dist/interface/canvas/index.js.map +1 -1
- package/dist/interface/canvas/index.mjs +1 -1
- package/dist/interface/canvas/index.mjs.map +1 -1
- package/dist/interface/export/ExportedCanvas.d.mts +2 -2
- package/dist/interface/export/ExportedCanvas.d.ts +2 -2
- package/dist/interface/export/ExportedCanvas.js +1 -1
- package/dist/interface/export/ExportedCanvas.js.map +1 -1
- package/dist/interface/export/ExportedCanvas.mjs +1 -1
- package/dist/interface/export/ExportedCanvas.mjs.map +1 -1
- package/dist/interface/export/ExportedStep.d.mts +2 -2
- package/dist/interface/export/ExportedStep.d.ts +2 -2
- package/dist/interface/export/ExportedStep.js +1 -1
- package/dist/interface/export/ExportedStep.js.map +1 -1
- package/dist/interface/export/ExportedStep.mjs +1 -1
- package/dist/interface/export/ExportedStep.mjs.map +1 -1
- package/dist/interface/export/ExportedStorage.js +1 -1
- package/dist/interface/export/ExportedStorage.js.map +1 -1
- package/dist/interface/export/ExportedStorage.mjs +1 -1
- package/dist/interface/export/ExportedStorage.mjs.map +1 -1
- package/dist/interface/export/index.d.mts +2 -2
- package/dist/interface/export/index.d.ts +2 -2
- package/dist/interface/export/index.js +1 -1
- package/dist/interface/export/index.js.map +1 -1
- package/dist/interface/export/index.mjs +1 -1
- package/dist/interface/export/index.mjs.map +1 -1
- package/dist/interface/index.d.mts +2 -2
- package/dist/interface/index.d.ts +2 -2
- package/dist/interface/index.js +1 -1
- package/dist/interface/index.js.map +1 -1
- package/dist/interface/index.mjs +1 -1
- package/dist/interface/index.mjs.map +1 -1
- package/dist/labels/BaseCanvasElementTestLabel.js +1317 -395
- package/dist/labels/BaseCanvasElementTestLabel.js.map +1 -1
- package/dist/labels/BaseCanvasElementTestLabel.mjs +1318 -396
- package/dist/labels/BaseCanvasElementTestLabel.mjs.map +1 -1
- package/dist/labels/{EventsTestLabel.d.mts → CanvasEventsTestLabel.d.mts} +4 -7
- package/dist/labels/{EventsTestLabel.d.ts → CanvasEventsTestLabel.d.ts} +4 -7
- package/dist/labels/{EventsTestLabel.js → CanvasEventsTestLabel.js} +332 -110
- package/dist/labels/CanvasEventsTestLabel.js.map +1 -0
- package/dist/labels/{EventsTestLabel.mjs → CanvasEventsTestLabel.mjs} +332 -110
- package/dist/labels/CanvasEventsTestLabel.mjs.map +1 -0
- package/dist/labels/{TintingTestLabel.d.mts → CustomTickerCanvasElementTestLabel.d.mts} +5 -4
- package/dist/labels/{TintingTestLabel.d.ts → CustomTickerCanvasElementTestLabel.d.ts} +5 -4
- package/dist/labels/{TickerTestLabel.js → CustomTickerCanvasElementTestLabel.js} +674 -490
- package/dist/labels/CustomTickerCanvasElementTestLabel.js.map +1 -0
- package/dist/labels/{TickerTestLabel.mjs → CustomTickerCanvasElementTestLabel.mjs} +675 -491
- package/dist/labels/CustomTickerCanvasElementTestLabel.mjs.map +1 -0
- package/dist/labels/{ShowImageTest.js → ImagesAnimationsTestLabel.js} +385 -94
- package/dist/labels/ImagesAnimationsTestLabel.js.map +1 -0
- package/dist/labels/{ShowImageTest.mjs → ImagesAnimationsTestLabel.mjs} +385 -94
- package/dist/labels/ImagesAnimationsTestLabel.mjs.map +1 -0
- package/dist/labels/MarkdownTest.js +162 -92
- package/dist/labels/MarkdownTest.js.map +1 -1
- package/dist/labels/MarkdownTest.mjs +162 -92
- package/dist/labels/MarkdownTest.mjs.map +1 -1
- package/dist/labels/StartLabel.js +803 -164
- package/dist/labels/StartLabel.js.map +1 -1
- package/dist/labels/StartLabel.mjs +804 -165
- package/dist/labels/StartLabel.mjs.map +1 -1
- package/dist/labels/TestConstant.d.mts +3 -1
- package/dist/labels/TestConstant.d.ts +3 -1
- package/dist/labels/TestConstant.js +109 -77
- package/dist/labels/TestConstant.js.map +1 -1
- package/dist/labels/TestConstant.mjs +108 -78
- package/dist/labels/TestConstant.mjs.map +1 -1
- package/dist/labels/index.js +803 -164
- package/dist/labels/index.js.map +1 -1
- package/dist/labels/index.mjs +804 -165
- package/dist/labels/index.mjs.map +1 -1
- package/dist/managers/StepManager.d.mts +5 -4
- package/dist/managers/StepManager.d.ts +5 -4
- package/dist/managers/StepManager.js +152 -82
- package/dist/managers/StepManager.js.map +1 -1
- package/dist/managers/StepManager.mjs +152 -82
- package/dist/managers/StepManager.mjs.map +1 -1
- package/dist/managers/StorageManager.js +1 -1
- package/dist/managers/StorageManager.js.map +1 -1
- package/dist/managers/StorageManager.mjs +1 -1
- package/dist/managers/StorageManager.mjs.map +1 -1
- package/dist/managers/WindowManager.d.mts +2 -2
- package/dist/managers/WindowManager.d.ts +2 -2
- package/dist/managers/WindowManager.js +96 -72
- package/dist/managers/WindowManager.js.map +1 -1
- package/dist/managers/WindowManager.mjs +96 -72
- package/dist/managers/WindowManager.mjs.map +1 -1
- package/dist/managers/index.d.mts +2 -2
- package/dist/managers/index.d.ts +2 -2
- package/dist/managers/index.js +152 -82
- package/dist/managers/index.js.map +1 -1
- package/dist/managers/index.mjs +152 -82
- package/dist/managers/index.mjs.map +1 -1
- package/dist/override/StepLabelProps.js +1 -1
- package/dist/override/StepLabelProps.js.map +1 -1
- package/dist/override/StepLabelProps.mjs +1 -1
- package/dist/override/StepLabelProps.mjs.map +1 -1
- package/dist/override/StepLabelResult.js +1 -1
- package/dist/override/StepLabelResult.js.map +1 -1
- package/dist/override/StepLabelResult.mjs +1 -1
- package/dist/override/StepLabelResult.mjs.map +1 -1
- package/dist/override/index.js +1 -1
- package/dist/override/index.js.map +1 -1
- package/dist/override/index.mjs +1 -1
- package/dist/override/index.mjs.map +1 -1
- package/dist/types/CanvasElementTagType.js +1 -1
- package/dist/types/CanvasElementTagType.js.map +1 -1
- package/dist/types/CanvasElementTagType.mjs +1 -1
- package/dist/types/CanvasElementTagType.mjs.map +1 -1
- package/dist/types/CanvasEventNamesType.js +1 -1
- package/dist/types/CanvasEventNamesType.js.map +1 -1
- package/dist/types/CanvasEventNamesType.mjs +1 -1
- package/dist/types/CanvasEventNamesType.mjs.map +1 -1
- package/dist/types/ChoiceMenuOptionsType.js +1 -1
- package/dist/types/ChoiceMenuOptionsType.js.map +1 -1
- package/dist/types/ChoiceMenuOptionsType.mjs +1 -1
- package/dist/types/ChoiceMenuOptionsType.mjs.map +1 -1
- package/dist/types/CloseType.js +1 -1
- package/dist/types/CloseType.js.map +1 -1
- package/dist/types/CloseType.mjs +1 -1
- package/dist/types/CloseType.mjs.map +1 -1
- package/dist/types/EventIdType.js +1 -1
- package/dist/types/EventIdType.js.map +1 -1
- package/dist/types/EventIdType.mjs +1 -1
- package/dist/types/EventIdType.mjs.map +1 -1
- package/dist/types/HistoryChoiceMenuOption.js +1 -1
- package/dist/types/HistoryChoiceMenuOption.js.map +1 -1
- package/dist/types/HistoryChoiceMenuOption.mjs +1 -1
- package/dist/types/HistoryChoiceMenuOption.mjs.map +1 -1
- package/dist/types/LabelIdType.js +1 -1
- package/dist/types/LabelIdType.js.map +1 -1
- package/dist/types/LabelIdType.mjs +1 -1
- package/dist/types/LabelIdType.mjs.map +1 -1
- package/dist/types/LabelRunModeType.js +1 -1
- package/dist/types/LabelRunModeType.js.map +1 -1
- package/dist/types/LabelRunModeType.mjs +1 -1
- package/dist/types/LabelRunModeType.mjs.map +1 -1
- package/dist/types/PauseType.js +1 -1
- package/dist/types/PauseType.js.map +1 -1
- package/dist/types/PauseType.mjs +1 -1
- package/dist/types/PauseType.mjs.map +1 -1
- package/dist/types/RepeatType.js +1 -1
- package/dist/types/RepeatType.js.map +1 -1
- package/dist/types/RepeatType.mjs +1 -1
- package/dist/types/RepeatType.mjs.map +1 -1
- package/dist/types/StepHistoryDataType.js +1 -1
- package/dist/types/StepHistoryDataType.js.map +1 -1
- package/dist/types/StepHistoryDataType.mjs +1 -1
- package/dist/types/StepHistoryDataType.mjs.map +1 -1
- package/dist/types/StepLabelType.js +1 -1
- package/dist/types/StepLabelType.js.map +1 -1
- package/dist/types/StepLabelType.mjs +1 -1
- package/dist/types/StepLabelType.mjs.map +1 -1
- package/dist/types/StorageElementType.js +1 -1
- package/dist/types/StorageElementType.js.map +1 -1
- package/dist/types/StorageElementType.mjs +1 -1
- package/dist/types/StorageElementType.mjs.map +1 -1
- package/dist/types/TickerIdType.js +1 -1
- package/dist/types/TickerIdType.js.map +1 -1
- package/dist/types/TickerIdType.mjs +1 -1
- package/dist/types/TickerIdType.mjs.map +1 -1
- package/dist/types/index.js +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/index.mjs +1 -1
- package/dist/types/index.mjs.map +1 -1
- package/dist/types/ticker/FadeAlphaTickerProps.js +1 -1
- package/dist/types/ticker/FadeAlphaTickerProps.js.map +1 -1
- package/dist/types/ticker/FadeAlphaTickerProps.mjs +1 -1
- package/dist/types/ticker/FadeAlphaTickerProps.mjs.map +1 -1
- package/dist/types/ticker/MoveTickerProps.d.mts +1 -1
- package/dist/types/ticker/MoveTickerProps.d.ts +1 -1
- package/dist/types/ticker/MoveTickerProps.js +1 -1
- package/dist/types/ticker/MoveTickerProps.js.map +1 -1
- package/dist/types/ticker/MoveTickerProps.mjs +1 -1
- package/dist/types/ticker/MoveTickerProps.mjs.map +1 -1
- package/dist/types/ticker/RotateTickerProps.d.mts +1 -1
- package/dist/types/ticker/RotateTickerProps.d.ts +1 -1
- package/dist/types/ticker/RotateTickerProps.js +1 -1
- package/dist/types/ticker/RotateTickerProps.js.map +1 -1
- package/dist/types/ticker/RotateTickerProps.mjs +1 -1
- package/dist/types/ticker/RotateTickerProps.mjs.map +1 -1
- package/dist/types/ticker/TagToRemoveAfterType.js +1 -1
- package/dist/types/ticker/TagToRemoveAfterType.js.map +1 -1
- package/dist/types/ticker/TagToRemoveAfterType.mjs +1 -1
- package/dist/types/ticker/TagToRemoveAfterType.mjs.map +1 -1
- package/dist/types/ticker/ZoomTickerProps.js +1 -1
- package/dist/types/ticker/ZoomTickerProps.js.map +1 -1
- package/dist/types/ticker/ZoomTickerProps.mjs +1 -1
- package/dist/types/ticker/ZoomTickerProps.mjs.map +1 -1
- package/dist/types/ticker/index.js +1 -1
- package/dist/types/ticker/index.js.map +1 -1
- package/dist/types/ticker/index.mjs +1 -1
- package/dist/types/ticker/index.mjs.map +1 -1
- package/package.json +4 -4
- package/dist/labels/EventsTestLabel.js.map +0 -1
- package/dist/labels/EventsTestLabel.mjs.map +0 -1
- package/dist/labels/ShowImageTest.js.map +0 -1
- package/dist/labels/ShowImageTest.mjs.map +0 -1
- package/dist/labels/TickerTestLabel.d.mts +0 -9
- package/dist/labels/TickerTestLabel.d.ts +0 -9
- package/dist/labels/TickerTestLabel.js.map +0 -1
- package/dist/labels/TickerTestLabel.mjs.map +0 -1
- package/dist/labels/TintingTestLabel.js +0 -1786
- package/dist/labels/TintingTestLabel.js.map +0 -1
- package/dist/labels/TintingTestLabel.mjs +0 -1780
- package/dist/labels/TintingTestLabel.mjs.map +0 -1
- /package/dist/labels/{ShowImageTest.d.mts → ImagesAnimationsTestLabel.d.mts} +0 -0
- /package/dist/labels/{ShowImageTest.d.ts → ImagesAnimationsTestLabel.d.ts} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var pixi_js = require('pixi.js');
|
|
4
|
-
require('deep-diff');
|
|
4
|
+
var deepDiff = require('deep-diff');
|
|
5
5
|
var sha1 = require('crypto-js/sha1');
|
|
6
6
|
|
|
7
7
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -56,138 +56,6 @@ var __async = (__this, __arguments, generator) => {
|
|
|
56
56
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
57
57
|
});
|
|
58
58
|
};
|
|
59
|
-
|
|
60
|
-
// src/decorators/CanvasElementDecorator.ts
|
|
61
|
-
var registeredCanvasElement = {};
|
|
62
|
-
function getCanvasElementInstanceByClassName(canvasName) {
|
|
63
|
-
try {
|
|
64
|
-
let eventType = registeredCanvasElement[canvasName];
|
|
65
|
-
if (!eventType) {
|
|
66
|
-
if (canvasName === "CanvasContainer") {
|
|
67
|
-
eventType = CanvasContainer;
|
|
68
|
-
} else if (canvasName === "CanvasImage") {
|
|
69
|
-
eventType = CanvasImage;
|
|
70
|
-
} else if (canvasName === "CanvasSprite") {
|
|
71
|
-
eventType = CanvasSprite;
|
|
72
|
-
} else if (canvasName === "CanvasText") {
|
|
73
|
-
eventType = CanvasText;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
if (!eventType) {
|
|
77
|
-
console.error(`[Pixi'VN] CanvasElement ${canvasName} not found`);
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
let canvasElement = new eventType();
|
|
81
|
-
return canvasElement;
|
|
82
|
-
} catch (e) {
|
|
83
|
-
console.error(`[Pixi'VN] Error while getting CanvasElement ${canvasName}`, e);
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
// src/functions/CanvasUtility.ts
|
|
89
|
-
function getTextureMemory(texture) {
|
|
90
|
-
let sourceTexture = texture.source;
|
|
91
|
-
let textureMemory = {
|
|
92
|
-
image: sourceTexture.label
|
|
93
|
-
};
|
|
94
|
-
return textureMemory;
|
|
95
|
-
}
|
|
96
|
-
function exportCanvasElement(element) {
|
|
97
|
-
return element.memory;
|
|
98
|
-
}
|
|
99
|
-
function importCanvasElement(memory) {
|
|
100
|
-
let element = getCanvasElementInstanceByClassName(memory.className);
|
|
101
|
-
if (element) {
|
|
102
|
-
element.memory = memory;
|
|
103
|
-
} else {
|
|
104
|
-
throw new Error("[Pixi'VN] The element " + memory.className + " could not be created");
|
|
105
|
-
}
|
|
106
|
-
return element;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
// src/classes/canvas/CanvasContainer.ts
|
|
110
|
-
var CanvasContainer = class extends pixi_js.Container {
|
|
111
|
-
get memory() {
|
|
112
|
-
let memory = getMemoryContainer(this);
|
|
113
|
-
this.children.forEach((child) => {
|
|
114
|
-
memory.elements.push(exportCanvasElement(child));
|
|
115
|
-
});
|
|
116
|
-
return memory;
|
|
117
|
-
}
|
|
118
|
-
set memory(value) {
|
|
119
|
-
setMemoryContainer(this, value);
|
|
120
|
-
value.elements.forEach((child) => {
|
|
121
|
-
this.addChild(importCanvasElement(child));
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
function getMemoryContainer(element) {
|
|
126
|
-
return {
|
|
127
|
-
className: "CanvasContainer",
|
|
128
|
-
elements: [],
|
|
129
|
-
width: element.width,
|
|
130
|
-
height: element.height,
|
|
131
|
-
isRenderGroup: element.isRenderGroup,
|
|
132
|
-
blendMode: element.blendMode,
|
|
133
|
-
tint: element.tint,
|
|
134
|
-
alpha: element.alpha,
|
|
135
|
-
angle: element.angle,
|
|
136
|
-
renderable: element.renderable,
|
|
137
|
-
rotation: element.rotation,
|
|
138
|
-
scale: { x: element.scale.x, y: element.scale.y },
|
|
139
|
-
pivot: { x: element.pivot.x, y: element.pivot.y },
|
|
140
|
-
position: { x: element.position.x, y: element.position.y },
|
|
141
|
-
skew: { x: element.skew.x, y: element.skew.y },
|
|
142
|
-
visible: element.visible,
|
|
143
|
-
culled: element.culled,
|
|
144
|
-
x: element.x,
|
|
145
|
-
y: element.y,
|
|
146
|
-
boundsArea: element.boundsArea,
|
|
147
|
-
cursor: element.cursor,
|
|
148
|
-
eventMode: element.eventMode,
|
|
149
|
-
interactive: element.interactive,
|
|
150
|
-
interactiveChildren: element.interactiveChildren,
|
|
151
|
-
hitArea: element.hitArea
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
function setMemoryContainer(element, memory) {
|
|
155
|
-
memory.width && (element.width = memory.width);
|
|
156
|
-
memory.height && (element.height = memory.height);
|
|
157
|
-
memory.isRenderGroup && (element.isRenderGroup = memory.isRenderGroup);
|
|
158
|
-
memory.blendMode && (element.blendMode = memory.blendMode);
|
|
159
|
-
memory.tint && (element.tint = memory.tint);
|
|
160
|
-
memory.alpha && (element.alpha = memory.alpha);
|
|
161
|
-
memory.angle && (element.angle = memory.angle);
|
|
162
|
-
memory.renderable && (element.renderable = memory.renderable);
|
|
163
|
-
memory.rotation && (element.rotation = memory.rotation);
|
|
164
|
-
if (memory.scale) {
|
|
165
|
-
if (typeof memory.scale === "number") {
|
|
166
|
-
element.scale.set(memory.scale, memory.scale);
|
|
167
|
-
} else {
|
|
168
|
-
element.scale.set(memory.scale.x, memory.scale.y);
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
if (memory.pivot) {
|
|
172
|
-
if (typeof memory.pivot === "number") {
|
|
173
|
-
element.pivot.set(memory.pivot, memory.pivot);
|
|
174
|
-
} else {
|
|
175
|
-
element.pivot.set(memory.pivot.x, memory.pivot.y);
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
memory.position && element.position.set(memory.position.x, memory.position.y);
|
|
179
|
-
memory.skew && element.skew.set(memory.skew.x, memory.skew.y);
|
|
180
|
-
memory.visible && (element.visible = memory.visible);
|
|
181
|
-
memory.culled && (element.culled = memory.culled);
|
|
182
|
-
memory.x && (element.x = memory.x);
|
|
183
|
-
memory.y && (element.y = memory.y);
|
|
184
|
-
memory.boundsArea && (element.boundsArea = memory.boundsArea);
|
|
185
|
-
memory.cursor && (element.cursor = memory.cursor);
|
|
186
|
-
memory.eventMode && (element.eventMode = memory.eventMode);
|
|
187
|
-
memory.interactive && (element.interactive = memory.interactive);
|
|
188
|
-
memory.interactiveChildren && (element.interactiveChildren = memory.interactiveChildren);
|
|
189
|
-
memory.hitArea && (element.hitArea = memory.hitArea);
|
|
190
|
-
}
|
|
191
59
|
function getTexture(imageUrl) {
|
|
192
60
|
return __async(this, null, function* () {
|
|
193
61
|
if (pixi_js.Assets.cache.has(imageUrl)) {
|
|
@@ -209,17 +77,19 @@ function getTexture(imageUrl) {
|
|
|
209
77
|
});
|
|
210
78
|
});
|
|
211
79
|
}
|
|
212
|
-
function
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
console.warn("[Pixi'VN] CanvasText.style.fill is a FillGradient or FillPattern, this is not supported yet.", fill);
|
|
216
|
-
fill = "#00FF00";
|
|
80
|
+
function getFillGradientFillPattern(prop, propName) {
|
|
81
|
+
if (!(prop instanceof Object)) {
|
|
82
|
+
return prop;
|
|
217
83
|
}
|
|
84
|
+
console.warn(`[Pixi'VN] CanvasText.style.${propName} is a FillGradient or FillPattern, this is not supported yet.`, prop);
|
|
85
|
+
return void 0;
|
|
86
|
+
}
|
|
87
|
+
function getTextStyle(style) {
|
|
218
88
|
return {
|
|
219
89
|
align: style.align,
|
|
220
90
|
breakWords: style.breakWords,
|
|
221
91
|
dropShadow: style.dropShadow,
|
|
222
|
-
fill,
|
|
92
|
+
fill: getFillGradientFillPattern(style.stroke, "fill"),
|
|
223
93
|
fontFamily: style.fontFamily,
|
|
224
94
|
fontSize: style.fontSize,
|
|
225
95
|
fontStyle: style.fontStyle,
|
|
@@ -229,7 +99,7 @@ function getTextStyle(style) {
|
|
|
229
99
|
letterSpacing: style.letterSpacing,
|
|
230
100
|
lineHeight: style.lineHeight,
|
|
231
101
|
padding: style.padding,
|
|
232
|
-
stroke: style.stroke,
|
|
102
|
+
stroke: getFillGradientFillPattern(style.stroke, "stroke"),
|
|
233
103
|
textBaseline: style.textBaseline,
|
|
234
104
|
trim: style.trim,
|
|
235
105
|
whiteSpace: style.whiteSpace,
|
|
@@ -240,40 +110,43 @@ function getTextStyle(style) {
|
|
|
240
110
|
|
|
241
111
|
// src/decorators/EventDecorator.ts
|
|
242
112
|
var registeredEvents = {};
|
|
243
|
-
function
|
|
113
|
+
function getEventTypeById(eventId) {
|
|
244
114
|
try {
|
|
245
|
-
let eventType = registeredEvents[
|
|
115
|
+
let eventType = registeredEvents[eventId];
|
|
246
116
|
if (!eventType) {
|
|
247
|
-
console.error(`[Pixi'VN] Event ${
|
|
117
|
+
console.error(`[Pixi'VN] Event ${eventId} not found`);
|
|
248
118
|
return;
|
|
249
119
|
}
|
|
250
120
|
new eventType();
|
|
251
121
|
return eventType;
|
|
252
122
|
} catch (e) {
|
|
253
|
-
console.error(`[Pixi'VN] Error while getting Event ${
|
|
123
|
+
console.error(`[Pixi'VN] Error while getting Event ${eventId}`, e);
|
|
254
124
|
return;
|
|
255
125
|
}
|
|
256
126
|
}
|
|
257
|
-
function
|
|
127
|
+
function getEventInstanceById(eventId) {
|
|
258
128
|
try {
|
|
259
|
-
let eventType = registeredEvents[
|
|
129
|
+
let eventType = registeredEvents[eventId];
|
|
260
130
|
if (!eventType) {
|
|
261
|
-
console.error(`[Pixi'VN] Event ${
|
|
131
|
+
console.error(`[Pixi'VN] Event ${eventId} not found`);
|
|
262
132
|
return;
|
|
263
133
|
}
|
|
264
134
|
let event = new eventType();
|
|
265
135
|
return event;
|
|
266
136
|
} catch (e) {
|
|
267
|
-
console.error(`[Pixi'VN] Error while getting Event ${
|
|
137
|
+
console.error(`[Pixi'VN] Error while getting Event ${eventId}`, e);
|
|
268
138
|
return;
|
|
269
139
|
}
|
|
270
140
|
}
|
|
271
141
|
|
|
272
142
|
// src/classes/canvas/CanvasSprite.ts
|
|
143
|
+
var CANVAS_SPRITE_ID = "CanvasSprite";
|
|
273
144
|
var CanvasSprite = class _CanvasSprite extends pixi_js.Sprite {
|
|
274
|
-
constructor() {
|
|
275
|
-
super(
|
|
145
|
+
constructor(options) {
|
|
146
|
+
super(options);
|
|
147
|
+
this.pixivnId = CANVAS_SPRITE_ID;
|
|
276
148
|
this._onEvents = {};
|
|
149
|
+
this.pixivnId = this.constructor.prototype.pixivnId || CANVAS_SPRITE_ID;
|
|
277
150
|
}
|
|
278
151
|
get memory() {
|
|
279
152
|
return getMemorySprite(this);
|
|
@@ -314,9 +187,9 @@ var CanvasSprite = class _CanvasSprite extends pixi_js.Sprite {
|
|
|
314
187
|
* ```
|
|
315
188
|
*/
|
|
316
189
|
onEvent(event, eventClass) {
|
|
317
|
-
let
|
|
318
|
-
let instance =
|
|
319
|
-
this._onEvents[event] =
|
|
190
|
+
let id = eventClass.prototype.id;
|
|
191
|
+
let instance = getEventInstanceById(id);
|
|
192
|
+
this._onEvents[event] = id;
|
|
320
193
|
if (instance) {
|
|
321
194
|
super.on(event, () => {
|
|
322
195
|
instance.fn(event, this);
|
|
@@ -345,7 +218,7 @@ var CanvasSprite = class _CanvasSprite extends pixi_js.Sprite {
|
|
|
345
218
|
function getMemorySprite(element) {
|
|
346
219
|
let temp = getMemoryContainer(element);
|
|
347
220
|
return __spreadProps(__spreadValues({}, temp), {
|
|
348
|
-
|
|
221
|
+
pixivnId: element.pixivnId,
|
|
349
222
|
textureImage: getTextureMemory(element.texture),
|
|
350
223
|
anchor: { x: element.anchor.x, y: element.anchor.y },
|
|
351
224
|
roundPixels: element.roundPixels,
|
|
@@ -368,8 +241,8 @@ function setMemorySprite(element, memory) {
|
|
|
368
241
|
}
|
|
369
242
|
memory.roundPixels && (element.roundPixels = memory.roundPixels);
|
|
370
243
|
for (let event in memory.onEvents) {
|
|
371
|
-
let
|
|
372
|
-
let instance =
|
|
244
|
+
let id = memory.onEvents[event];
|
|
245
|
+
let instance = getEventTypeById(id);
|
|
373
246
|
if (instance) {
|
|
374
247
|
element.onEvent(event, instance);
|
|
375
248
|
}
|
|
@@ -377,9 +250,11 @@ function setMemorySprite(element, memory) {
|
|
|
377
250
|
}
|
|
378
251
|
|
|
379
252
|
// src/classes/canvas/CanvasImage.ts
|
|
253
|
+
var CANVAS_IMAGE_ID = "CanvasImage";
|
|
380
254
|
var CanvasImage = class _CanvasImage extends CanvasSprite {
|
|
381
255
|
constructor(options, imageLink) {
|
|
382
256
|
super(options);
|
|
257
|
+
this.pixivnId = CANVAS_IMAGE_ID;
|
|
383
258
|
this.imageLink = "";
|
|
384
259
|
if (imageLink) {
|
|
385
260
|
this.imageLink = imageLink;
|
|
@@ -387,12 +262,13 @@ var CanvasImage = class _CanvasImage extends CanvasSprite {
|
|
|
387
262
|
}
|
|
388
263
|
get memory() {
|
|
389
264
|
return __spreadProps(__spreadValues({}, getMemorySprite(this)), {
|
|
390
|
-
|
|
391
|
-
|
|
265
|
+
pixivnId: this.pixivnId,
|
|
266
|
+
imageLink: this.imageLink
|
|
392
267
|
});
|
|
393
268
|
}
|
|
394
269
|
set memory(memory) {
|
|
395
270
|
setMemorySprite(this, memory);
|
|
271
|
+
this.imageLink = memory.imageLink;
|
|
396
272
|
}
|
|
397
273
|
static from(source, skipCache) {
|
|
398
274
|
let sprite = pixi_js.Sprite.from(source, skipCache);
|
|
@@ -420,10 +296,13 @@ var CanvasImage = class _CanvasImage extends CanvasSprite {
|
|
|
420
296
|
});
|
|
421
297
|
}
|
|
422
298
|
};
|
|
299
|
+
var CANVAS_TEXT_ID = "CanvasText";
|
|
423
300
|
var CanvasText = class extends pixi_js.Text {
|
|
424
|
-
constructor() {
|
|
425
|
-
super(
|
|
301
|
+
constructor(options) {
|
|
302
|
+
super(options);
|
|
303
|
+
this.pixivnId = CANVAS_TEXT_ID;
|
|
426
304
|
this._onEvents = {};
|
|
305
|
+
this.pixivnId = this.constructor.prototype.pixivnId || CANVAS_TEXT_ID;
|
|
427
306
|
}
|
|
428
307
|
get memory() {
|
|
429
308
|
return getMemoryText(this);
|
|
@@ -464,9 +343,9 @@ var CanvasText = class extends pixi_js.Text {
|
|
|
464
343
|
* ```
|
|
465
344
|
*/
|
|
466
345
|
onEvent(event, eventClass) {
|
|
467
|
-
let
|
|
468
|
-
let instance =
|
|
469
|
-
this._onEvents[event] =
|
|
346
|
+
let id = eventClass.prototype.id;
|
|
347
|
+
let instance = getEventInstanceById(id);
|
|
348
|
+
this._onEvents[event] = id;
|
|
470
349
|
if (instance) {
|
|
471
350
|
super.on(event, () => {
|
|
472
351
|
instance.fn(event, this);
|
|
@@ -489,7 +368,7 @@ var CanvasText = class extends pixi_js.Text {
|
|
|
489
368
|
function getMemoryText(element) {
|
|
490
369
|
let temp = getMemoryContainer(element);
|
|
491
370
|
return __spreadProps(__spreadValues({}, temp), {
|
|
492
|
-
|
|
371
|
+
pixivnId: element.pixivnId,
|
|
493
372
|
anchor: { x: element.anchor.x, y: element.anchor.y },
|
|
494
373
|
text: element.text,
|
|
495
374
|
resolution: element.resolution,
|
|
@@ -512,13 +391,170 @@ function setMemoryText(element, memory) {
|
|
|
512
391
|
memory.style && (element.style = memory.style);
|
|
513
392
|
memory.roundPixels && (element.roundPixels = memory.roundPixels);
|
|
514
393
|
for (let event in memory.onEvents) {
|
|
515
|
-
let
|
|
516
|
-
let instance =
|
|
394
|
+
let id = memory.onEvents[event];
|
|
395
|
+
let instance = getEventTypeById(id);
|
|
517
396
|
if (instance) {
|
|
518
397
|
element.onEvent(event, instance);
|
|
519
398
|
}
|
|
520
399
|
}
|
|
521
400
|
}
|
|
401
|
+
|
|
402
|
+
// src/decorators/CanvasElementDecorator.ts
|
|
403
|
+
var registeredCanvasElement = {};
|
|
404
|
+
function getCanvasElementInstanceById(canvasId) {
|
|
405
|
+
try {
|
|
406
|
+
let eventType = registeredCanvasElement[canvasId];
|
|
407
|
+
if (!eventType) {
|
|
408
|
+
if (canvasId === CANVAS_CONTAINER_ID) {
|
|
409
|
+
eventType = CanvasContainer;
|
|
410
|
+
} else if (canvasId === CANVAS_IMAGE_ID) {
|
|
411
|
+
eventType = CanvasImage;
|
|
412
|
+
} else if (canvasId === CANVAS_SPRITE_ID) {
|
|
413
|
+
eventType = CanvasSprite;
|
|
414
|
+
} else if (canvasId === CANVAS_TEXT_ID) {
|
|
415
|
+
eventType = CanvasText;
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
if (!eventType) {
|
|
419
|
+
console.error(`[Pixi'VN] CanvasElement ${canvasId} not found`);
|
|
420
|
+
return;
|
|
421
|
+
}
|
|
422
|
+
let canvasElement = new eventType();
|
|
423
|
+
return canvasElement;
|
|
424
|
+
} catch (e) {
|
|
425
|
+
console.error(`[Pixi'VN] Error while getting CanvasElement ${canvasId}`, e);
|
|
426
|
+
return;
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
// src/functions/CanvasUtility.ts
|
|
431
|
+
function getTextureMemory(texture) {
|
|
432
|
+
let sourceTexture = texture.source;
|
|
433
|
+
let textureMemory = {
|
|
434
|
+
image: sourceTexture.label
|
|
435
|
+
};
|
|
436
|
+
return textureMemory;
|
|
437
|
+
}
|
|
438
|
+
function exportCanvasElement(element) {
|
|
439
|
+
return element.memory;
|
|
440
|
+
}
|
|
441
|
+
function importCanvasElement(memory) {
|
|
442
|
+
let element = getCanvasElementInstanceById(memory.pixivnId);
|
|
443
|
+
if (element) {
|
|
444
|
+
element.memory = memory;
|
|
445
|
+
} else {
|
|
446
|
+
throw new Error("[Pixi'VN] The element " + memory.pixivnId + " could not be created");
|
|
447
|
+
}
|
|
448
|
+
return element;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
// src/classes/canvas/CanvasContainer.ts
|
|
452
|
+
var CANVAS_CONTAINER_ID = "CanvasContainer";
|
|
453
|
+
var CanvasContainer = class extends pixi_js.Container {
|
|
454
|
+
constructor(options) {
|
|
455
|
+
super(options);
|
|
456
|
+
this.pixivnId = CANVAS_CONTAINER_ID;
|
|
457
|
+
this.pixivnId = this.constructor.prototype.pixivnId || CANVAS_CONTAINER_ID;
|
|
458
|
+
}
|
|
459
|
+
get memory() {
|
|
460
|
+
let memory = getMemoryContainer(this);
|
|
461
|
+
this.children.forEach((child) => {
|
|
462
|
+
memory.elements.push(exportCanvasElement(child));
|
|
463
|
+
});
|
|
464
|
+
return memory;
|
|
465
|
+
}
|
|
466
|
+
set memory(value) {
|
|
467
|
+
setMemoryContainer(this, value);
|
|
468
|
+
value.elements.forEach((child) => {
|
|
469
|
+
this.addChild(importCanvasElement(child));
|
|
470
|
+
});
|
|
471
|
+
}
|
|
472
|
+
};
|
|
473
|
+
function getMemoryContainer(element) {
|
|
474
|
+
let className = "CanvasContainer";
|
|
475
|
+
if (element.hasOwnProperty("pixivnId")) {
|
|
476
|
+
className = element.pixivnId;
|
|
477
|
+
}
|
|
478
|
+
return {
|
|
479
|
+
pixivnId: className,
|
|
480
|
+
elements: [],
|
|
481
|
+
width: element.width,
|
|
482
|
+
height: element.height,
|
|
483
|
+
isRenderGroup: element.isRenderGroup,
|
|
484
|
+
blendMode: element.blendMode,
|
|
485
|
+
tint: element.tint,
|
|
486
|
+
alpha: element.alpha,
|
|
487
|
+
angle: element.angle,
|
|
488
|
+
renderable: element.renderable,
|
|
489
|
+
rotation: element.rotation,
|
|
490
|
+
scale: { x: element.scale.x, y: element.scale.y },
|
|
491
|
+
pivot: { x: element.pivot.x, y: element.pivot.y },
|
|
492
|
+
position: { x: element.position.x, y: element.position.y },
|
|
493
|
+
skew: { x: element.skew.x, y: element.skew.y },
|
|
494
|
+
visible: element.visible,
|
|
495
|
+
x: element.x,
|
|
496
|
+
y: element.y,
|
|
497
|
+
boundsArea: element.boundsArea,
|
|
498
|
+
cursor: element.cursor,
|
|
499
|
+
eventMode: element.eventMode,
|
|
500
|
+
interactive: element.interactive,
|
|
501
|
+
interactiveChildren: element.interactiveChildren,
|
|
502
|
+
hitArea: element.hitArea
|
|
503
|
+
};
|
|
504
|
+
}
|
|
505
|
+
function setMemoryContainer(element, memory) {
|
|
506
|
+
memory.width && (element.width = memory.width);
|
|
507
|
+
memory.height && (element.height = memory.height);
|
|
508
|
+
memory.isRenderGroup && (element.isRenderGroup = memory.isRenderGroup);
|
|
509
|
+
memory.blendMode && (element.blendMode = memory.blendMode);
|
|
510
|
+
memory.tint && (element.tint = memory.tint);
|
|
511
|
+
memory.alpha && (element.alpha = memory.alpha);
|
|
512
|
+
memory.angle && (element.angle = memory.angle);
|
|
513
|
+
memory.renderable && (element.renderable = memory.renderable);
|
|
514
|
+
memory.rotation && (element.rotation = memory.rotation);
|
|
515
|
+
if (memory.scale) {
|
|
516
|
+
if (typeof memory.scale === "number") {
|
|
517
|
+
element.scale.set(memory.scale, memory.scale);
|
|
518
|
+
} else {
|
|
519
|
+
element.scale.set(memory.scale.x, memory.scale.y);
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
if (memory.pivot) {
|
|
523
|
+
if (typeof memory.pivot === "number") {
|
|
524
|
+
element.pivot.set(memory.pivot, memory.pivot);
|
|
525
|
+
} else {
|
|
526
|
+
element.pivot.set(memory.pivot.x, memory.pivot.y);
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
memory.position && element.position.set(memory.position.x, memory.position.y);
|
|
530
|
+
memory.skew && element.skew.set(memory.skew.x, memory.skew.y);
|
|
531
|
+
memory.visible && (element.visible = memory.visible);
|
|
532
|
+
memory.x && (element.x = memory.x);
|
|
533
|
+
memory.y && (element.y = memory.y);
|
|
534
|
+
memory.boundsArea && (element.boundsArea = memory.boundsArea);
|
|
535
|
+
memory.cursor && (element.cursor = memory.cursor);
|
|
536
|
+
memory.eventMode && (element.eventMode = memory.eventMode);
|
|
537
|
+
memory.interactive && (element.interactive = memory.interactive);
|
|
538
|
+
memory.interactiveChildren && (element.interactiveChildren = memory.interactiveChildren);
|
|
539
|
+
memory.hitArea && (element.hitArea = memory.hitArea);
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
// src/decorators/CharacterDecorator.ts
|
|
543
|
+
var registeredCharacters = {};
|
|
544
|
+
function saveCharacter(character) {
|
|
545
|
+
if (Array.isArray(character)) {
|
|
546
|
+
character.forEach((c) => saveCharacter(c));
|
|
547
|
+
return;
|
|
548
|
+
}
|
|
549
|
+
if (registeredCharacters[character.id]) {
|
|
550
|
+
console.info(`[Pixi'VN] Character id ${character.id} already exists, it will be overwritten`);
|
|
551
|
+
}
|
|
552
|
+
registeredCharacters[character.id] = character;
|
|
553
|
+
}
|
|
554
|
+
function getStepSha1(step) {
|
|
555
|
+
let sha1String = sha1__default.default(step.toString().toLocaleLowerCase());
|
|
556
|
+
return sha1String.toString();
|
|
557
|
+
}
|
|
522
558
|
function checkIfStepsIsEqual(step1, step2) {
|
|
523
559
|
return step1 === step2;
|
|
524
560
|
}
|
|
@@ -538,7 +574,7 @@ var Label = class {
|
|
|
538
574
|
this._choiseIndex = choiseIndex;
|
|
539
575
|
}
|
|
540
576
|
/**
|
|
541
|
-
* Get the id of the label
|
|
577
|
+
* Get the id of the label. This variable is used in the system to get the label by id, {@link getLabelById}
|
|
542
578
|
*/
|
|
543
579
|
get id() {
|
|
544
580
|
return this._id;
|
|
@@ -589,11 +625,237 @@ var Label = class {
|
|
|
589
625
|
return this._choiseIndex;
|
|
590
626
|
}
|
|
591
627
|
};
|
|
592
|
-
|
|
593
|
-
|
|
628
|
+
|
|
629
|
+
// src/classes/CloseLabel.ts
|
|
630
|
+
var CLOSE_LABEL_ID = "__close-label-id__";
|
|
631
|
+
function newCloseLabel(choiseIndex) {
|
|
632
|
+
return new Label(CLOSE_LABEL_ID, [], void 0, choiseIndex);
|
|
594
633
|
}
|
|
595
634
|
|
|
596
|
-
// src/
|
|
635
|
+
// src/types/CloseType.ts
|
|
636
|
+
var Close = "close";
|
|
637
|
+
|
|
638
|
+
// src/functions/DialogueUtility.ts
|
|
639
|
+
function setDialogue(props) {
|
|
640
|
+
let text = "";
|
|
641
|
+
let character = void 0;
|
|
642
|
+
let dialogue;
|
|
643
|
+
if (typeof props === "string") {
|
|
644
|
+
text = props;
|
|
645
|
+
dialogue = new DialogueBaseModel(text, character);
|
|
646
|
+
} else if (!(props instanceof DialogueBaseModel)) {
|
|
647
|
+
text = props.text;
|
|
648
|
+
if (props.character) {
|
|
649
|
+
if (typeof props.character === "string") {
|
|
650
|
+
character = props.character;
|
|
651
|
+
} else {
|
|
652
|
+
character = props.character.id;
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
dialogue = new DialogueBaseModel(text, character);
|
|
656
|
+
} else {
|
|
657
|
+
dialogue = props;
|
|
658
|
+
}
|
|
659
|
+
GameStorageManager.setVariable(GameStorageManager.keysSystem.CURRENT_DIALOGUE_MEMORY_KEY, dialogue);
|
|
660
|
+
GameStorageManager.setVariable(GameStorageManager.keysSystem.LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY, GameStepManager.lastStepIndex);
|
|
661
|
+
}
|
|
662
|
+
function getDialogue() {
|
|
663
|
+
return GameStorageManager.getVariable(GameStorageManager.keysSystem.CURRENT_DIALOGUE_MEMORY_KEY);
|
|
664
|
+
}
|
|
665
|
+
function getChoiceMenuOptions() {
|
|
666
|
+
let d = GameStorageManager.getVariable(GameStorageManager.keysSystem.CURRENT_MENU_OPTIONS_MEMORY_KEY);
|
|
667
|
+
if (d) {
|
|
668
|
+
let options = [];
|
|
669
|
+
d.forEach((option, index) => {
|
|
670
|
+
if (option.type === Close) {
|
|
671
|
+
let itemLabel = newCloseLabel(index);
|
|
672
|
+
options.push({
|
|
673
|
+
text: option.text,
|
|
674
|
+
label: itemLabel,
|
|
675
|
+
type: Close,
|
|
676
|
+
closeCurrentLabel: option.closeCurrentLabel,
|
|
677
|
+
props: {}
|
|
678
|
+
});
|
|
679
|
+
return;
|
|
680
|
+
}
|
|
681
|
+
let label = getLabelById(option.label);
|
|
682
|
+
if (label) {
|
|
683
|
+
let itemLabel = new Label(label.id, label.steps, label.onStepRun, index);
|
|
684
|
+
options.push(__spreadProps(__spreadValues({}, option), {
|
|
685
|
+
label: itemLabel
|
|
686
|
+
}));
|
|
687
|
+
}
|
|
688
|
+
});
|
|
689
|
+
return options;
|
|
690
|
+
}
|
|
691
|
+
return void 0;
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
// src/functions/TickerUtility.ts
|
|
695
|
+
function updateTickerProgression(args, propertyName, progression) {
|
|
696
|
+
if (args[propertyName] === void 0 || !progression || args[propertyName] === progression.limit) {
|
|
697
|
+
return;
|
|
698
|
+
}
|
|
699
|
+
if (typeof args[propertyName] === "number") {
|
|
700
|
+
if (progression.type === "linear") {
|
|
701
|
+
args[propertyName] = getLinearProgression(args[propertyName], progression);
|
|
702
|
+
} else if (progression.type === "exponential") {
|
|
703
|
+
args[propertyName] = getExponentialProgression(args[propertyName], progression);
|
|
704
|
+
}
|
|
705
|
+
} else if (args[propertyName] !== void 0 && typeof args[propertyName] === "object" && args[propertyName].haveOwnProperty("x") && args[propertyName].haveOwnProperty("y") && typeof args[propertyName].x === "number" && typeof args[propertyName].y === "number") {
|
|
706
|
+
if (progression.type === "linear") {
|
|
707
|
+
args[propertyName].x = getLinearProgression(args[propertyName].x, progression);
|
|
708
|
+
args[propertyName].y = getLinearProgression(args[propertyName].y, progression);
|
|
709
|
+
} else if (progression.type === "exponential") {
|
|
710
|
+
args[propertyName].x = getExponentialProgression(args[propertyName].x, progression);
|
|
711
|
+
args[propertyName].y = getExponentialProgression(args[propertyName].y, progression);
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
function getLinearProgression(number, progression) {
|
|
716
|
+
if (progression.limit !== void 0) {
|
|
717
|
+
if (number > progression.limit && progression.amt > 0) {
|
|
718
|
+
return progression.limit;
|
|
719
|
+
} else if (number < progression.limit && progression.amt < 0) {
|
|
720
|
+
return progression.limit;
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
return number + progression.amt / 60;
|
|
724
|
+
}
|
|
725
|
+
function getExponentialProgression(number, progression) {
|
|
726
|
+
if (progression.limit !== void 0) {
|
|
727
|
+
if (number > progression.limit && progression.percentage > 0) {
|
|
728
|
+
return progression.limit;
|
|
729
|
+
} else if (number < progression.limit && progression.percentage < 0) {
|
|
730
|
+
return progression.limit;
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
return number + number * progression.percentage;
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
// src/classes/ticker/TickerBase.ts
|
|
737
|
+
var TickerBase = class {
|
|
738
|
+
/**
|
|
739
|
+
* @param args The arguments that you want to pass to the ticker.
|
|
740
|
+
* @param duration The duration of the ticker in seconds. If is undefined, the step will end only when the animation is finished (if the animation doesn't have a goal to reach then it won't finish). @default undefined
|
|
741
|
+
* @param priority The priority of the ticker. @default UPDATE_PRIORITY.NORMAL
|
|
742
|
+
*/
|
|
743
|
+
constructor(args, duration, priority) {
|
|
744
|
+
/**
|
|
745
|
+
* Get the id of the ticker. This variable is used in the system to get the ticker by id, {@link geTickerInstanceById}
|
|
746
|
+
*/
|
|
747
|
+
this.id = "ticker_id_not_set";
|
|
748
|
+
this.args = args;
|
|
749
|
+
this.duration = duration;
|
|
750
|
+
this.priority = priority;
|
|
751
|
+
this.id = this.constructor.prototype.id;
|
|
752
|
+
}
|
|
753
|
+
/**
|
|
754
|
+
* The method that will be called every frame.
|
|
755
|
+
* This method should be overridden and you can use GameWindowManager.addCanvasElement() to get the canvas element of the canvas, and edit them.
|
|
756
|
+
* @param _ticker The ticker that is calling this method
|
|
757
|
+
* @param _args The arguments that you passed when you added the ticker
|
|
758
|
+
* @param _tags The tags of the canvas elements that are connected to this ticker
|
|
759
|
+
* @param _tickerId The id of the ticker. You can use this to get the ticker from the {@link GameWindowManager.currentTickers}
|
|
760
|
+
*/
|
|
761
|
+
fn(_ticker, _args, _tags, _tickerId) {
|
|
762
|
+
throw new Error("[Pixi'VN] The method TickerBase.fn() must be overridden");
|
|
763
|
+
}
|
|
764
|
+
};
|
|
765
|
+
|
|
766
|
+
// src/classes/ticker/ZoomTicker.ts
|
|
767
|
+
var ZoomTicker = class extends TickerBase {
|
|
768
|
+
fn(ticker, args, tags, tickerId) {
|
|
769
|
+
let xSpeed = 0.1;
|
|
770
|
+
let ySpeed = 0.1;
|
|
771
|
+
if (args.speed) {
|
|
772
|
+
if (typeof args.speed === "number") {
|
|
773
|
+
xSpeed = args.speed;
|
|
774
|
+
ySpeed = args.speed;
|
|
775
|
+
} else {
|
|
776
|
+
xSpeed = args.speed.x;
|
|
777
|
+
ySpeed = args.speed.y;
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
xSpeed /= 60;
|
|
781
|
+
ySpeed /= 60;
|
|
782
|
+
let tagToRemoveAfter2 = args.tagToRemoveAfter || [];
|
|
783
|
+
if (typeof tagToRemoveAfter2 === "string") {
|
|
784
|
+
tagToRemoveAfter2 = [tagToRemoveAfter2];
|
|
785
|
+
}
|
|
786
|
+
let type = args.type || "zoom";
|
|
787
|
+
let xLimit = type === "zoom" ? Infinity : 0;
|
|
788
|
+
let yLimit = type === "zoom" ? Infinity : 0;
|
|
789
|
+
if (args.limit) {
|
|
790
|
+
if (typeof args.limit === "number") {
|
|
791
|
+
xLimit = args.limit;
|
|
792
|
+
yLimit = args.limit;
|
|
793
|
+
} else {
|
|
794
|
+
xLimit = args.limit.x;
|
|
795
|
+
yLimit = args.limit.y;
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
tags.filter((tag) => {
|
|
799
|
+
var _a;
|
|
800
|
+
let element = GameWindowManager.getCanvasElement(tag);
|
|
801
|
+
if (args.startOnlyIfHaveTexture) {
|
|
802
|
+
if (element && element instanceof pixi_js.Sprite && ((_a = element.texture) == null ? void 0 : _a.label) == "EMPTY") {
|
|
803
|
+
return false;
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
return true;
|
|
807
|
+
}).forEach((tag) => {
|
|
808
|
+
let element = GameWindowManager.getCanvasElement(tag);
|
|
809
|
+
if (element && element instanceof pixi_js.Container) {
|
|
810
|
+
if (type === "zoom" && (element.scale.x < xLimit || element.scale.y < yLimit)) {
|
|
811
|
+
element.scale.x += xSpeed * ticker.deltaTime;
|
|
812
|
+
element.scale.y += ySpeed * ticker.deltaTime;
|
|
813
|
+
} else if (type === "unzoom" && (element.scale.x > xLimit || element.scale.y > yLimit)) {
|
|
814
|
+
element.scale.x -= xSpeed * ticker.deltaTime;
|
|
815
|
+
element.scale.y -= ySpeed * ticker.deltaTime;
|
|
816
|
+
}
|
|
817
|
+
if (type === "zoom") {
|
|
818
|
+
if (element.scale.x > xLimit) {
|
|
819
|
+
element.scale.x = xLimit;
|
|
820
|
+
}
|
|
821
|
+
if (element.scale.y > yLimit) {
|
|
822
|
+
element.scale.y = yLimit;
|
|
823
|
+
}
|
|
824
|
+
if (element.scale.x >= xLimit && element.scale.y >= yLimit) {
|
|
825
|
+
element.scale.x = xLimit;
|
|
826
|
+
element.scale.y = yLimit;
|
|
827
|
+
this.onEndOfTicker(tag, tickerId, element, tagToRemoveAfter2);
|
|
828
|
+
}
|
|
829
|
+
} else if (type === "unzoom") {
|
|
830
|
+
if (element.scale.x < xLimit) {
|
|
831
|
+
element.scale.x = xLimit;
|
|
832
|
+
}
|
|
833
|
+
if (element.scale.y < yLimit) {
|
|
834
|
+
element.scale.y = yLimit;
|
|
835
|
+
}
|
|
836
|
+
if (element.scale.x <= xLimit && element.scale.y <= yLimit) {
|
|
837
|
+
element.scale.x = xLimit;
|
|
838
|
+
element.scale.y = yLimit;
|
|
839
|
+
this.onEndOfTicker(tag, tickerId, element, tagToRemoveAfter2);
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
if (xSpeed < 1e-5 && ySpeed < 1e-5 && !(args.speedProgression && args.speedProgression.type == "linear" && args.speedProgression.amt != 0)) {
|
|
843
|
+
this.onEndOfTicker(tag, tickerId, element, tagToRemoveAfter2);
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
});
|
|
847
|
+
if (args.speedProgression)
|
|
848
|
+
updateTickerProgression(args, "speed", args.speedProgression);
|
|
849
|
+
}
|
|
850
|
+
onEndOfTicker(tag, tickerId, _element, tagToRemoveAfter2) {
|
|
851
|
+
GameWindowManager.onEndOfTicker(tag, this, tagToRemoveAfter2, tickerId);
|
|
852
|
+
}
|
|
853
|
+
};
|
|
854
|
+
ZoomTicker = __decorateClass([
|
|
855
|
+
tickerDecorator()
|
|
856
|
+
], ZoomTicker);
|
|
857
|
+
|
|
858
|
+
// src/constants.ts
|
|
597
859
|
var Repeat = "repeat";
|
|
598
860
|
|
|
599
861
|
// src/functions/ImageUtility.ts
|
|
@@ -612,6 +874,47 @@ function createExportableElement(element) {
|
|
|
612
874
|
}
|
|
613
875
|
}
|
|
614
876
|
|
|
877
|
+
// src/functions/DiffUtility.ts
|
|
878
|
+
function restoreDeepDiffChanges(data, differences) {
|
|
879
|
+
let result = createExportableElement(data);
|
|
880
|
+
differences.forEach((diff2) => {
|
|
881
|
+
let dataToEdit = result;
|
|
882
|
+
if (diff2.path && diff2.path.length > 0) {
|
|
883
|
+
diff2.path.forEach((path, index) => {
|
|
884
|
+
if (diff2.path && index === diff2.path.length - 1) {
|
|
885
|
+
if (diff2.kind === "E" || diff2.kind === "D") {
|
|
886
|
+
dataToEdit[path] = diff2.lhs;
|
|
887
|
+
} else if (diff2.kind === "N") {
|
|
888
|
+
if (Number.isInteger(path)) {
|
|
889
|
+
if (Array.isArray(dataToEdit)) {
|
|
890
|
+
dataToEdit.splice(path, 1);
|
|
891
|
+
}
|
|
892
|
+
} else if (typeof path === "string") {
|
|
893
|
+
delete dataToEdit[path];
|
|
894
|
+
}
|
|
895
|
+
} else if (diff2.kind === "A") {
|
|
896
|
+
let index2 = diff2.index;
|
|
897
|
+
if (diff2.item.kind === "N") {
|
|
898
|
+
dataToEdit[path].splice(index2, 1);
|
|
899
|
+
} else if (diff2.item.kind === "E" || diff2.item.kind === "D") {
|
|
900
|
+
dataToEdit[path][index2] = diff2.item.lhs;
|
|
901
|
+
} else if (diff2.item.kind === "A") {
|
|
902
|
+
console.warn("[Pixi'VN] Nested array found, skipping diff", diff2);
|
|
903
|
+
} else {
|
|
904
|
+
console.warn("[Pixi'VN] No array found, skipping diff", diff2);
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
} else {
|
|
908
|
+
dataToEdit = dataToEdit[path];
|
|
909
|
+
}
|
|
910
|
+
});
|
|
911
|
+
} else {
|
|
912
|
+
console.warn("[Pixi'VN] No path found, skipping diff", diff2);
|
|
913
|
+
}
|
|
914
|
+
});
|
|
915
|
+
return result;
|
|
916
|
+
}
|
|
917
|
+
|
|
615
918
|
// src/managers/StorageManager.ts
|
|
616
919
|
var _GameStorageManager = class _GameStorageManager {
|
|
617
920
|
constructor() {
|
|
@@ -697,31 +1000,6 @@ var _GameStorageManager = class _GameStorageManager {
|
|
|
697
1000
|
_GameStorageManager.storage = {};
|
|
698
1001
|
var GameStorageManager = _GameStorageManager;
|
|
699
1002
|
|
|
700
|
-
// src/classes/ticker/TickerBase.ts
|
|
701
|
-
var TickerBase = class {
|
|
702
|
-
/**
|
|
703
|
-
* @param args The arguments that you want to pass to the ticker.
|
|
704
|
-
* @param duration The duration of the ticker in seconds. If is undefined, the step will end only when the animation is finished (if the animation doesn't have a goal to reach then it won't finish). @default undefined
|
|
705
|
-
* @param priority The priority of the ticker. @default UPDATE_PRIORITY.NORMAL
|
|
706
|
-
*/
|
|
707
|
-
constructor(args, duration, priority) {
|
|
708
|
-
this.args = args;
|
|
709
|
-
this.duration = duration;
|
|
710
|
-
this.priority = priority;
|
|
711
|
-
}
|
|
712
|
-
/**
|
|
713
|
-
* The method that will be called every frame.
|
|
714
|
-
* This method should be overridden and you can use GameWindowManager.addCanvasElement() to get the canvas element of the canvas, and edit them.
|
|
715
|
-
* @param _ticker The ticker that is calling this method
|
|
716
|
-
* @param _args The arguments that you passed when you added the ticker
|
|
717
|
-
* @param _tags The tags of the canvas elements that are connected to this ticker
|
|
718
|
-
* @param _tickerId The id of the ticker. You can use this to get the ticker from the {@link GameWindowManager.currentTickers}
|
|
719
|
-
*/
|
|
720
|
-
fn(_ticker, _args, _tags, _tickerId) {
|
|
721
|
-
throw new Error("[Pixi'VN] The method TickerBase.fn() must be overridden");
|
|
722
|
-
}
|
|
723
|
-
};
|
|
724
|
-
|
|
725
1003
|
// src/decorators/TickerDecorator.ts
|
|
726
1004
|
var registeredTickers = {};
|
|
727
1005
|
function tickerDecorator(name) {
|
|
@@ -732,19 +1010,20 @@ function tickerDecorator(name) {
|
|
|
732
1010
|
if (registeredTickers[name]) {
|
|
733
1011
|
console.info(`[Pixi'VN] Ticker ${name} already exists, it will be overwritten`);
|
|
734
1012
|
}
|
|
1013
|
+
target.prototype.id = name;
|
|
735
1014
|
registeredTickers[name] = target;
|
|
736
1015
|
};
|
|
737
1016
|
}
|
|
738
|
-
function
|
|
1017
|
+
function geTickerInstanceById(tickerId, args, duration, priority) {
|
|
739
1018
|
try {
|
|
740
|
-
let ticker = registeredTickers[
|
|
1019
|
+
let ticker = registeredTickers[tickerId];
|
|
741
1020
|
if (!ticker) {
|
|
742
|
-
console.error(`[Pixi'VN] Ticker ${
|
|
1021
|
+
console.error(`[Pixi'VN] Ticker ${tickerId} not found`);
|
|
743
1022
|
return;
|
|
744
1023
|
}
|
|
745
1024
|
return new ticker(args, duration, priority);
|
|
746
1025
|
} catch (e) {
|
|
747
|
-
console.error(`[Pixi'VN] Error while getting Ticker ${
|
|
1026
|
+
console.error(`[Pixi'VN] Error while getting Ticker ${tickerId}`, e);
|
|
748
1027
|
return;
|
|
749
1028
|
}
|
|
750
1029
|
}
|
|
@@ -816,7 +1095,7 @@ var _GameWindowManager = class _GameWindowManager {
|
|
|
816
1095
|
height
|
|
817
1096
|
}, options)).then(() => {
|
|
818
1097
|
_GameWindowManager._isInitialized = true;
|
|
819
|
-
this.
|
|
1098
|
+
this.addCanvasIntoHTMLElement(element);
|
|
820
1099
|
window.addEventListener("resize", _GameWindowManager.resize);
|
|
821
1100
|
_GameWindowManager.resize();
|
|
822
1101
|
asciiArtLog();
|
|
@@ -827,7 +1106,7 @@ var _GameWindowManager = class _GameWindowManager {
|
|
|
827
1106
|
* Add the canvas into a html element.
|
|
828
1107
|
* @param element it is the html element where I will put the canvas. Example: document.body
|
|
829
1108
|
*/
|
|
830
|
-
static
|
|
1109
|
+
static addCanvasIntoHTMLElement(element) {
|
|
831
1110
|
if (_GameWindowManager.isInitialized) {
|
|
832
1111
|
element.appendChild(_GameWindowManager.app.canvas);
|
|
833
1112
|
} else {
|
|
@@ -1073,18 +1352,18 @@ var _GameWindowManager = class _GameWindowManager {
|
|
|
1073
1352
|
* ```
|
|
1074
1353
|
*/
|
|
1075
1354
|
static addTicker(canvasElementTag, ticker) {
|
|
1076
|
-
let
|
|
1355
|
+
let tickerId = ticker.id;
|
|
1077
1356
|
if (typeof canvasElementTag === "string") {
|
|
1078
1357
|
canvasElementTag = [canvasElementTag];
|
|
1079
1358
|
}
|
|
1080
|
-
if (!
|
|
1081
|
-
console.error(`[Pixi'VN] Ticker ${
|
|
1359
|
+
if (!geTickerInstanceById(tickerId, ticker.args, ticker.duration, ticker.priority)) {
|
|
1360
|
+
console.error(`[Pixi'VN] Ticker ${tickerId} not found`);
|
|
1082
1361
|
return;
|
|
1083
1362
|
}
|
|
1084
1363
|
let tickerHistory = {
|
|
1085
1364
|
fn: () => {
|
|
1086
1365
|
},
|
|
1087
|
-
|
|
1366
|
+
id: tickerId,
|
|
1088
1367
|
args: createExportableElement(ticker.args),
|
|
1089
1368
|
canvasElementTags: canvasElementTag,
|
|
1090
1369
|
priority: ticker.priority,
|
|
@@ -1100,11 +1379,11 @@ var _GameWindowManager = class _GameWindowManager {
|
|
|
1100
1379
|
_GameWindowManager.removeTicker(id);
|
|
1101
1380
|
}
|
|
1102
1381
|
}, ticker.duration * 1e3);
|
|
1103
|
-
_GameWindowManager.addTickerTimeoutInfo(canvasElementTag,
|
|
1382
|
+
_GameWindowManager.addTickerTimeoutInfo(canvasElementTag, tickerId, timeout.toString(), true);
|
|
1104
1383
|
}
|
|
1105
1384
|
}
|
|
1106
1385
|
static pushTicker(id, tickerData, ticker) {
|
|
1107
|
-
_GameWindowManager.removeAssociationBetweenTickerCanvasElement(tickerData.canvasElementTags,
|
|
1386
|
+
_GameWindowManager.removeAssociationBetweenTickerCanvasElement(tickerData.canvasElementTags, ticker);
|
|
1108
1387
|
_GameWindowManager._currentTickers[id] = tickerData;
|
|
1109
1388
|
tickerData.fn = (t) => {
|
|
1110
1389
|
let data = _GameWindowManager._currentTickers[id];
|
|
@@ -1145,9 +1424,9 @@ var _GameWindowManager = class _GameWindowManager {
|
|
|
1145
1424
|
if (step.hasOwnProperty("type") && step.type === "pause") {
|
|
1146
1425
|
return step;
|
|
1147
1426
|
}
|
|
1148
|
-
let
|
|
1427
|
+
let tickerId = step.id;
|
|
1149
1428
|
return {
|
|
1150
|
-
ticker:
|
|
1429
|
+
ticker: tickerId,
|
|
1151
1430
|
args: createExportableElement(step.args),
|
|
1152
1431
|
duration: step.duration
|
|
1153
1432
|
};
|
|
@@ -1185,16 +1464,16 @@ var _GameWindowManager = class _GameWindowManager {
|
|
|
1185
1464
|
_GameWindowManager.addTickerTimeoutInfo(tag, "steps", timeout.toString(), false);
|
|
1186
1465
|
return;
|
|
1187
1466
|
}
|
|
1188
|
-
let ticker =
|
|
1467
|
+
let ticker = geTickerInstanceById(step.ticker, step.args, step.duration, step.priority);
|
|
1189
1468
|
if (!ticker) {
|
|
1190
1469
|
console.error(`[Pixi'VN] Ticker ${step.ticker} not found`);
|
|
1191
1470
|
return;
|
|
1192
1471
|
}
|
|
1193
|
-
let tickerName = ticker.
|
|
1472
|
+
let tickerName = ticker.id;
|
|
1194
1473
|
let tickerHistory = {
|
|
1195
1474
|
fn: () => {
|
|
1196
1475
|
},
|
|
1197
|
-
|
|
1476
|
+
id: tickerName,
|
|
1198
1477
|
args: createExportableElement(ticker.args),
|
|
1199
1478
|
canvasElementTags: [tag],
|
|
1200
1479
|
priority: ticker.priority,
|
|
@@ -1251,26 +1530,26 @@ var _GameWindowManager = class _GameWindowManager {
|
|
|
1251
1530
|
* ```
|
|
1252
1531
|
*/
|
|
1253
1532
|
static removeAssociationBetweenTickerCanvasElement(tags, ticker) {
|
|
1254
|
-
let
|
|
1533
|
+
let tickerId;
|
|
1255
1534
|
if (typeof ticker === "string") {
|
|
1256
|
-
|
|
1535
|
+
tickerId = ticker;
|
|
1257
1536
|
} else if (ticker instanceof TickerBase) {
|
|
1258
|
-
|
|
1537
|
+
tickerId = ticker.id;
|
|
1259
1538
|
} else {
|
|
1260
|
-
|
|
1539
|
+
tickerId = ticker.prototype.id;
|
|
1261
1540
|
}
|
|
1262
1541
|
if (typeof tags === "string") {
|
|
1263
1542
|
tags = [tags];
|
|
1264
1543
|
}
|
|
1265
1544
|
for (let id in _GameWindowManager._currentTickers) {
|
|
1266
1545
|
let ticker2 = _GameWindowManager._currentTickers[id];
|
|
1267
|
-
if (ticker2.
|
|
1546
|
+
if (ticker2.id === tickerId) {
|
|
1268
1547
|
_GameWindowManager._currentTickers[id].canvasElementTags = ticker2.canvasElementTags.filter((e) => !tags.includes(e));
|
|
1269
1548
|
}
|
|
1270
1549
|
}
|
|
1271
1550
|
for (let timeout in _GameWindowManager._currentTickersTimeouts) {
|
|
1272
1551
|
let TickerTimeout = _GameWindowManager._currentTickersTimeouts[timeout];
|
|
1273
|
-
if (TickerTimeout.ticker ===
|
|
1552
|
+
if (TickerTimeout.ticker === tickerId && TickerTimeout.canBeDeletedBeforeEnd) {
|
|
1274
1553
|
_GameWindowManager._currentTickersTimeouts[timeout].tags = TickerTimeout.tags.filter((t) => !tags.includes(t));
|
|
1275
1554
|
}
|
|
1276
1555
|
}
|
|
@@ -1456,11 +1735,11 @@ var _GameWindowManager = class _GameWindowManager {
|
|
|
1456
1735
|
for (let id in currentTickers) {
|
|
1457
1736
|
let t = currentTickers[id];
|
|
1458
1737
|
let tags = t.canvasElementTags;
|
|
1459
|
-
let ticker =
|
|
1738
|
+
let ticker = geTickerInstanceById(t.id, t.args, t.duration, t.priority);
|
|
1460
1739
|
if (ticker) {
|
|
1461
1740
|
_GameWindowManager.addTicker(tags, ticker);
|
|
1462
1741
|
} else {
|
|
1463
|
-
console.error(`[Pixi'VN] Ticker ${t.
|
|
1742
|
+
console.error(`[Pixi'VN] Ticker ${t.id} not found`);
|
|
1464
1743
|
}
|
|
1465
1744
|
}
|
|
1466
1745
|
}
|
|
@@ -1485,109 +1764,819 @@ _GameWindowManager._currentTickersSteps = {};
|
|
|
1485
1764
|
_GameWindowManager._currentTickersTimeouts = {};
|
|
1486
1765
|
var GameWindowManager = _GameWindowManager;
|
|
1487
1766
|
|
|
1488
|
-
// src/
|
|
1489
|
-
var
|
|
1490
|
-
|
|
1491
|
-
if (registeredLabels[id]) {
|
|
1492
|
-
console.info(`[Pixi'VN] Label ${id} already exists, it will be overwritten`);
|
|
1767
|
+
// src/managers/StepManager.ts
|
|
1768
|
+
var _GameStepManager = class _GameStepManager {
|
|
1769
|
+
constructor() {
|
|
1493
1770
|
}
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1771
|
+
static get stepsHistory() {
|
|
1772
|
+
return _GameStepManager._stepsHistory;
|
|
1773
|
+
}
|
|
1774
|
+
/**
|
|
1775
|
+
* lastStepIndex is the last step index that occurred during the progression of the steps. **Not is the length of the stepsHistory - 1.**
|
|
1776
|
+
*/
|
|
1777
|
+
static get lastStepIndex() {
|
|
1778
|
+
return _GameStepManager._lastStepIndex;
|
|
1779
|
+
}
|
|
1780
|
+
/**
|
|
1781
|
+
* Increase the last step index that occurred during the progression of the steps.
|
|
1782
|
+
*/
|
|
1783
|
+
static increaseLastStepIndex() {
|
|
1784
|
+
_GameStepManager._lastStepIndex++;
|
|
1785
|
+
}
|
|
1786
|
+
static get openedLabels() {
|
|
1787
|
+
return _GameStepManager._openedLabels;
|
|
1788
|
+
}
|
|
1789
|
+
/**
|
|
1790
|
+
* currentLabelId is the current label id that occurred during the progression of the steps.
|
|
1791
|
+
*/
|
|
1792
|
+
static get currentLabelId() {
|
|
1793
|
+
if (_GameStepManager._openedLabels.length > 0) {
|
|
1794
|
+
let item = _GameStepManager._openedLabels[_GameStepManager._openedLabels.length - 1];
|
|
1795
|
+
return item.label;
|
|
1509
1796
|
}
|
|
1510
|
-
|
|
1511
|
-
|
|
1797
|
+
return void 0;
|
|
1798
|
+
}
|
|
1799
|
+
/**
|
|
1800
|
+
* currentLabel is the current label that occurred during the progression of the steps.
|
|
1801
|
+
*/
|
|
1802
|
+
static get currentLabel() {
|
|
1803
|
+
if (_GameStepManager.currentLabelId) {
|
|
1804
|
+
return getLabelById(_GameStepManager.currentLabelId);
|
|
1512
1805
|
}
|
|
1513
|
-
|
|
1514
|
-
|
|
1806
|
+
}
|
|
1807
|
+
static get currentLabelStepIndex() {
|
|
1808
|
+
if (_GameStepManager._openedLabels.length > 0) {
|
|
1809
|
+
let item = _GameStepManager._openedLabels[_GameStepManager._openedLabels.length - 1];
|
|
1810
|
+
return item.currentStepIndex;
|
|
1515
1811
|
}
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1812
|
+
return null;
|
|
1813
|
+
}
|
|
1814
|
+
/**
|
|
1815
|
+
* lastHistoryStep is the last history step that occurred during the progression of the steps.
|
|
1816
|
+
*/
|
|
1817
|
+
static get lastHistoryStep() {
|
|
1818
|
+
if (_GameStepManager._stepsHistory.length > 0) {
|
|
1819
|
+
return _GameStepManager._stepsHistory[_GameStepManager._stepsHistory.length - 1];
|
|
1820
|
+
}
|
|
1821
|
+
return null;
|
|
1822
|
+
}
|
|
1823
|
+
static get originalStepData() {
|
|
1824
|
+
if (!_GameStepManager._originalStepData) {
|
|
1825
|
+
return {
|
|
1826
|
+
path: "",
|
|
1827
|
+
storage: {},
|
|
1828
|
+
canvas: {
|
|
1829
|
+
childrenTagsOrder: [],
|
|
1830
|
+
currentElements: {},
|
|
1831
|
+
currentTickers: {},
|
|
1832
|
+
currentTickersSteps: {}
|
|
1833
|
+
},
|
|
1834
|
+
labelIndex: -1,
|
|
1835
|
+
openedLabels: []
|
|
1836
|
+
};
|
|
1837
|
+
}
|
|
1838
|
+
return createExportableElement(_GameStepManager._originalStepData);
|
|
1839
|
+
}
|
|
1840
|
+
static set originalStepData(value) {
|
|
1841
|
+
_GameStepManager._originalStepData = createExportableElement(value);
|
|
1842
|
+
}
|
|
1843
|
+
/* Edit History Methods */
|
|
1844
|
+
/**
|
|
1845
|
+
* Add a label to the history.
|
|
1846
|
+
* @param label The label to add to the history.
|
|
1847
|
+
*/
|
|
1848
|
+
static addStepHistory(step, choiseMade) {
|
|
1849
|
+
let stepHistory = getStepSha1(step);
|
|
1850
|
+
let historyStep = {
|
|
1851
|
+
path: window.location.pathname,
|
|
1852
|
+
storage: GameStorageManager.export(),
|
|
1853
|
+
canvas: GameWindowManager.export(),
|
|
1854
|
+
labelIndex: _GameStepManager.currentLabelStepIndex || 0,
|
|
1855
|
+
openedLabels: createExportableElement(_GameStepManager._openedLabels)
|
|
1856
|
+
};
|
|
1857
|
+
if (_GameStepManager.originalStepData) {
|
|
1858
|
+
if (_GameStepManager.originalStepData.openedLabels.length === historyStep.openedLabels.length) {
|
|
1859
|
+
try {
|
|
1860
|
+
let lastStepDataOpenedLabelsString = JSON.stringify(_GameStepManager.originalStepData.openedLabels);
|
|
1861
|
+
let historyStepOpenedLabelsString = JSON.stringify(historyStep.openedLabels);
|
|
1862
|
+
if (lastStepDataOpenedLabelsString === historyStepOpenedLabelsString && _GameStepManager.originalStepData.path === historyStep.path && _GameStepManager.originalStepData.labelIndex === historyStep.labelIndex) {
|
|
1863
|
+
return;
|
|
1864
|
+
}
|
|
1865
|
+
} catch (e) {
|
|
1866
|
+
console.error("[Pixi'VN] Error comparing openedLabels", e);
|
|
1532
1867
|
}
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1868
|
+
}
|
|
1869
|
+
}
|
|
1870
|
+
let data = deepDiff.diff(_GameStepManager.originalStepData, historyStep);
|
|
1871
|
+
if (data) {
|
|
1872
|
+
let dialoge = void 0;
|
|
1873
|
+
let requiredChoices = void 0;
|
|
1874
|
+
if (GameStorageManager.getVariable(GameStorageManager.keysSystem.LAST_DIALOGUE_ADDED_IN_STEP_MEMORY_KEY) === _GameStepManager.lastStepIndex) {
|
|
1875
|
+
dialoge = getDialogue();
|
|
1876
|
+
}
|
|
1877
|
+
if (GameStorageManager.getVariable(GameStorageManager.keysSystem.LAST_MENU_OPTIONS_ADDED_IN_STEP_MEMORY_KEY) === _GameStepManager.lastStepIndex) {
|
|
1878
|
+
requiredChoices = GameStorageManager.getVariable(GameStorageManager.keysSystem.CURRENT_MENU_OPTIONS_MEMORY_KEY);
|
|
1879
|
+
}
|
|
1880
|
+
_GameStepManager._stepsHistory.push({
|
|
1881
|
+
diff: data,
|
|
1882
|
+
currentLabel: _GameStepManager.currentLabelId,
|
|
1883
|
+
dialoge,
|
|
1884
|
+
choices: requiredChoices,
|
|
1885
|
+
stepSha1: stepHistory,
|
|
1886
|
+
index: _GameStepManager.lastStepIndex,
|
|
1887
|
+
choiceIndexMade: choiseMade
|
|
1888
|
+
});
|
|
1889
|
+
_GameStepManager.originalStepData = historyStep;
|
|
1890
|
+
}
|
|
1891
|
+
_GameStepManager.increaseLastStepIndex();
|
|
1892
|
+
}
|
|
1893
|
+
/**
|
|
1894
|
+
* Add a label to the history.
|
|
1895
|
+
* @param label The label to add to the history.
|
|
1896
|
+
*/
|
|
1897
|
+
static pushNewLabel(label) {
|
|
1898
|
+
let currentLabel = getLabelById(label);
|
|
1899
|
+
if (!currentLabel) {
|
|
1900
|
+
throw new Error(`[Pixi'VN] Label ${label} not found`);
|
|
1901
|
+
}
|
|
1902
|
+
_GameStepManager._openedLabels.push({
|
|
1903
|
+
label,
|
|
1904
|
+
currentStepIndex: 0
|
|
1905
|
+
});
|
|
1906
|
+
}
|
|
1907
|
+
/**
|
|
1908
|
+
* Close the current label and add it to the history.
|
|
1909
|
+
* @returns
|
|
1910
|
+
*/
|
|
1911
|
+
static closeCurrentLabel() {
|
|
1912
|
+
if (!_GameStepManager.currentLabelId) {
|
|
1913
|
+
console.warn("[Pixi'VN] No label to close");
|
|
1914
|
+
return;
|
|
1915
|
+
}
|
|
1916
|
+
if (!_GameStepManager.currentLabel) {
|
|
1917
|
+
console.error("[Pixi'VN] currentLabel not found");
|
|
1918
|
+
return;
|
|
1919
|
+
}
|
|
1920
|
+
_GameStepManager._openedLabels.pop();
|
|
1921
|
+
}
|
|
1922
|
+
/**
|
|
1923
|
+
* Close all labels and add them to the history. **Attention: This method can cause an unhandled game ending.**
|
|
1924
|
+
*/
|
|
1925
|
+
static closeAllLabels() {
|
|
1926
|
+
while (_GameStepManager._openedLabels.length > 0) {
|
|
1927
|
+
_GameStepManager.closeCurrentLabel();
|
|
1928
|
+
}
|
|
1929
|
+
}
|
|
1930
|
+
/**
|
|
1931
|
+
* Increase the current step index of the current label.
|
|
1932
|
+
*/
|
|
1933
|
+
static increaseCurrentStepIndex() {
|
|
1934
|
+
let item = _GameStepManager._openedLabels[_GameStepManager._openedLabels.length - 1];
|
|
1935
|
+
_GameStepManager._openedLabels[_GameStepManager._openedLabels.length - 1] = __spreadProps(__spreadValues({}, item), {
|
|
1936
|
+
currentStepIndex: item.currentStepIndex + 1
|
|
1937
|
+
});
|
|
1938
|
+
}
|
|
1939
|
+
static restorLastLabelList() {
|
|
1940
|
+
_GameStepManager._openedLabels = _GameStepManager.originalStepData.openedLabels;
|
|
1941
|
+
}
|
|
1942
|
+
/* Run Methods */
|
|
1943
|
+
static get canGoNext() {
|
|
1944
|
+
let options = getChoiceMenuOptions();
|
|
1945
|
+
if (options && options.length > 0) {
|
|
1946
|
+
return false;
|
|
1947
|
+
}
|
|
1948
|
+
return true;
|
|
1949
|
+
}
|
|
1950
|
+
/**
|
|
1951
|
+
* Execute the next step and add it to the history.
|
|
1952
|
+
* @param props The props to pass to the step.
|
|
1953
|
+
* @param choiseMade The index of the choise made by the player. (This params is used in the choice menu)
|
|
1954
|
+
* @returns StepLabelResultType or undefined.
|
|
1955
|
+
* @example
|
|
1956
|
+
* ```typescript
|
|
1957
|
+
* function nextOnClick() {
|
|
1958
|
+
* setLoading(true)
|
|
1959
|
+
* GameStepManager.goNext(yourParams)
|
|
1960
|
+
* .then((result) => {
|
|
1961
|
+
* setUpdate((p) => p + 1)
|
|
1962
|
+
* setLoading(false)
|
|
1963
|
+
* if (result) {
|
|
1964
|
+
* // your code
|
|
1965
|
+
* }
|
|
1966
|
+
* })
|
|
1967
|
+
* .catch((e) => {
|
|
1968
|
+
* setLoading(false)
|
|
1969
|
+
* console.error(e)
|
|
1970
|
+
* })
|
|
1971
|
+
* }
|
|
1972
|
+
* ```
|
|
1973
|
+
*/
|
|
1974
|
+
static goNext(props, choiseMade) {
|
|
1975
|
+
return __async(this, null, function* () {
|
|
1976
|
+
if (!_GameStepManager.canGoNext) {
|
|
1977
|
+
console.warn("[Pixi'VN] The player must make a choice");
|
|
1978
|
+
return;
|
|
1979
|
+
}
|
|
1980
|
+
_GameStepManager.increaseCurrentStepIndex();
|
|
1981
|
+
return yield _GameStepManager.runCurrentStep(props, choiseMade);
|
|
1982
|
+
});
|
|
1983
|
+
}
|
|
1984
|
+
/**
|
|
1985
|
+
* Execute the current step and add it to the history.
|
|
1986
|
+
* @param props The props to pass to the step.
|
|
1987
|
+
* @param choiseMade The choise made by the player.
|
|
1988
|
+
* @returns StepLabelResultType or undefined.
|
|
1989
|
+
*/
|
|
1990
|
+
static runCurrentStep(props, choiseMade) {
|
|
1991
|
+
return __async(this, null, function* () {
|
|
1992
|
+
if (_GameStepManager.currentLabelId) {
|
|
1993
|
+
let currentLabelStepIndex = _GameStepManager.currentLabelStepIndex;
|
|
1994
|
+
if (currentLabelStepIndex === null) {
|
|
1995
|
+
console.error("[Pixi'VN] currentLabelStepIndex is null");
|
|
1996
|
+
return;
|
|
1997
|
+
}
|
|
1998
|
+
let currentLabel = _GameStepManager.currentLabel;
|
|
1999
|
+
if (!currentLabel) {
|
|
2000
|
+
console.error("[Pixi'VN] currentLabel not found");
|
|
2001
|
+
return;
|
|
2002
|
+
}
|
|
2003
|
+
if (currentLabel.steps.length > currentLabelStepIndex) {
|
|
2004
|
+
let step = currentLabel.steps[currentLabelStepIndex];
|
|
2005
|
+
let result = yield step(props);
|
|
2006
|
+
_GameStepManager.addStepHistory(step, choiseMade);
|
|
2007
|
+
return result;
|
|
2008
|
+
} else if (_GameStepManager.openedLabels.length > 1) {
|
|
2009
|
+
_GameStepManager.closeCurrentLabel();
|
|
2010
|
+
return yield _GameStepManager.goNext(props, choiseMade);
|
|
2011
|
+
} else {
|
|
2012
|
+
_GameStepManager.restorLastLabelList();
|
|
2013
|
+
console.error("[Pixi'VN] The end of the game is not managed, so the game is blocked. Read this documentation to know how to manage the end of the game: https://pixi-vn.web.app/start/labels.html#how-manage-the-end-of-the-game");
|
|
2014
|
+
return;
|
|
2015
|
+
}
|
|
2016
|
+
}
|
|
2017
|
+
});
|
|
2018
|
+
}
|
|
2019
|
+
/**
|
|
2020
|
+
* Execute the label and add it to the history. (It's similar to Ren'Py's call function)
|
|
2021
|
+
* @param label The label to execute or the id of the label
|
|
2022
|
+
* @param props The props to pass to the label.
|
|
2023
|
+
* @returns StepLabelResultType or undefined.
|
|
2024
|
+
* @example
|
|
2025
|
+
* ```typescript
|
|
2026
|
+
* GameStepManager.callLabel(startLabel, yourParams).then((result) => {
|
|
2027
|
+
* if (result) {
|
|
2028
|
+
* // your code
|
|
2029
|
+
* }
|
|
2030
|
+
* })
|
|
2031
|
+
* ```
|
|
2032
|
+
* @example
|
|
2033
|
+
* ```typescript
|
|
2034
|
+
* // if you use it in a step label you should return the result.
|
|
2035
|
+
* return GameStepManager.callLabel(startLabel).then((result) => {
|
|
2036
|
+
* return result
|
|
2037
|
+
* })
|
|
2038
|
+
* ```
|
|
2039
|
+
*/
|
|
2040
|
+
static callLabel(label, props) {
|
|
2041
|
+
return __async(this, null, function* () {
|
|
2042
|
+
let choiseMade = void 0;
|
|
2043
|
+
let labelId;
|
|
2044
|
+
if (typeof label === "string") {
|
|
2045
|
+
labelId = label;
|
|
2046
|
+
} else {
|
|
2047
|
+
labelId = label.id;
|
|
2048
|
+
if (typeof label.choiseIndex === "number") {
|
|
2049
|
+
choiseMade = label.choiseIndex;
|
|
2050
|
+
}
|
|
2051
|
+
}
|
|
2052
|
+
try {
|
|
2053
|
+
if (labelId === CLOSE_LABEL_ID) {
|
|
2054
|
+
let closeCurrentLabel = newCloseLabel(choiseMade);
|
|
2055
|
+
let choice = {
|
|
2056
|
+
label: closeCurrentLabel,
|
|
2057
|
+
text: "",
|
|
2058
|
+
closeCurrentLabel: false,
|
|
2059
|
+
type: "close",
|
|
2060
|
+
props: {}
|
|
2061
|
+
};
|
|
2062
|
+
return _GameStepManager.closeChoiceMenu(choice, props);
|
|
2063
|
+
}
|
|
2064
|
+
let tempLabel = getLabelById(labelId);
|
|
2065
|
+
if (!tempLabel) {
|
|
2066
|
+
throw new Error(`[Pixi'VN] Label ${labelId} not found`);
|
|
2067
|
+
}
|
|
2068
|
+
_GameStepManager.pushNewLabel(tempLabel.id);
|
|
2069
|
+
} catch (e) {
|
|
2070
|
+
console.error("[Pixi'VN] Error calling label", e);
|
|
2071
|
+
return;
|
|
2072
|
+
}
|
|
2073
|
+
return yield _GameStepManager.runCurrentStep(props, choiseMade);
|
|
2074
|
+
});
|
|
2075
|
+
}
|
|
2076
|
+
/**
|
|
2077
|
+
* Execute the label, close the current label, execute the new label and add the new label to the history. (It's similar to Ren'Py's jump function)
|
|
2078
|
+
* @param label The label to execute.
|
|
2079
|
+
* @param props The props to pass to the label or the id of the label
|
|
2080
|
+
* @returns StepLabelResultType or undefined.
|
|
2081
|
+
* @example
|
|
2082
|
+
* ```typescript
|
|
2083
|
+
* GameStepManager.jumpLabel(startLabel, yourParams).then((result) => {
|
|
2084
|
+
* if (result) {
|
|
2085
|
+
* // your code
|
|
2086
|
+
* }
|
|
2087
|
+
* })
|
|
2088
|
+
* ```
|
|
2089
|
+
* @example
|
|
2090
|
+
* ```typescript
|
|
2091
|
+
* // if you use it in a step label you should return the result.
|
|
2092
|
+
* return GameStepManager.jumpLabel(startLabel).then((result) => {
|
|
2093
|
+
* return result
|
|
2094
|
+
* })
|
|
2095
|
+
* ```
|
|
2096
|
+
*/
|
|
2097
|
+
static jumpLabel(label, props) {
|
|
2098
|
+
return __async(this, null, function* () {
|
|
2099
|
+
_GameStepManager.closeCurrentLabel();
|
|
2100
|
+
let choiseMade = void 0;
|
|
2101
|
+
let labelId;
|
|
2102
|
+
if (typeof label === "string") {
|
|
2103
|
+
labelId = label;
|
|
2104
|
+
} else {
|
|
2105
|
+
labelId = label.id;
|
|
2106
|
+
if (typeof label.choiseIndex === "number") {
|
|
2107
|
+
choiseMade = label.choiseIndex;
|
|
2108
|
+
}
|
|
2109
|
+
}
|
|
2110
|
+
try {
|
|
2111
|
+
if (labelId === CLOSE_LABEL_ID) {
|
|
2112
|
+
let closeCurrentLabel = newCloseLabel(choiseMade);
|
|
2113
|
+
let choice = {
|
|
2114
|
+
label: closeCurrentLabel,
|
|
2115
|
+
text: "",
|
|
2116
|
+
closeCurrentLabel: false,
|
|
2117
|
+
type: "close",
|
|
2118
|
+
props: {}
|
|
2119
|
+
};
|
|
2120
|
+
return _GameStepManager.closeChoiceMenu(choice, props);
|
|
1539
2121
|
}
|
|
2122
|
+
let tempLabel = getLabelById(labelId);
|
|
2123
|
+
if (!tempLabel) {
|
|
2124
|
+
throw new Error(`[Pixi'VN] Label ${labelId} not found`);
|
|
2125
|
+
}
|
|
2126
|
+
_GameStepManager.pushNewLabel(tempLabel.id);
|
|
2127
|
+
} catch (e) {
|
|
2128
|
+
console.error("[Pixi'VN] Error jumping label", e);
|
|
2129
|
+
return;
|
|
1540
2130
|
}
|
|
2131
|
+
return yield _GameStepManager.runCurrentStep(props, choiseMade);
|
|
1541
2132
|
});
|
|
1542
2133
|
}
|
|
2134
|
+
/**
|
|
2135
|
+
* When the player is in a choice menu, can use this function to exit to the choice menu.
|
|
2136
|
+
* @param choice
|
|
2137
|
+
* @param props
|
|
2138
|
+
* @returns StepLabelResultType or undefined.
|
|
2139
|
+
* @example
|
|
2140
|
+
* ```typescript
|
|
2141
|
+
* GameStepManager.closeChoiceMenu(yourParams).then((result) => {
|
|
2142
|
+
* if (result) {
|
|
2143
|
+
* // your code
|
|
2144
|
+
* }
|
|
2145
|
+
* })
|
|
2146
|
+
* ```
|
|
2147
|
+
*/
|
|
2148
|
+
static closeChoiceMenu(choice, props) {
|
|
2149
|
+
return __async(this, null, function* () {
|
|
2150
|
+
let label = choice.label;
|
|
2151
|
+
let choiseMade = void 0;
|
|
2152
|
+
if (typeof label.choiseIndex === "number") {
|
|
2153
|
+
choiseMade = label.choiseIndex;
|
|
2154
|
+
}
|
|
2155
|
+
if (choice.closeCurrentLabel) {
|
|
2156
|
+
_GameStepManager.closeCurrentLabel();
|
|
2157
|
+
}
|
|
2158
|
+
return _GameStepManager.goNext(props, choiseMade);
|
|
2159
|
+
});
|
|
2160
|
+
}
|
|
2161
|
+
/* After Update Methods */
|
|
2162
|
+
// /**
|
|
2163
|
+
// * After the update or code edit, some steps or labels may no longer match.
|
|
2164
|
+
// * - In case of step mismatch, the game will be updated to the last matching step.
|
|
2165
|
+
// * - In case of label mismatch, the game gives an error.
|
|
2166
|
+
// * @returns
|
|
2167
|
+
// */
|
|
2168
|
+
// private static afterUpdate() {
|
|
2169
|
+
// // TODO: implement
|
|
2170
|
+
// if (!GameStepManager.currentLabel) {
|
|
2171
|
+
// // TODO: implement
|
|
2172
|
+
// return
|
|
2173
|
+
// }
|
|
2174
|
+
// let currentLabel = getLabelInstanceByClassName(GameStepManager.currentLabel)
|
|
2175
|
+
// if (!currentLabel) {
|
|
2176
|
+
// console.error("Label not found")
|
|
2177
|
+
// return
|
|
2178
|
+
// }
|
|
2179
|
+
// let oldSteps = GameStepManager.stepsAfterLastHistoryLabel
|
|
2180
|
+
// let currentStepIndex = currentLabel.getCorrespondingStepsNumber(oldSteps)
|
|
2181
|
+
// let stepToRemove = oldSteps.length - currentStepIndex
|
|
2182
|
+
// GameStepManager.removeLastHistoryNodes(stepToRemove)
|
|
2183
|
+
// GameStepManager.loadLastStep()
|
|
2184
|
+
// }
|
|
2185
|
+
// private static loadLastStep() {
|
|
2186
|
+
// // TODO: implement
|
|
2187
|
+
// }
|
|
2188
|
+
// /**
|
|
2189
|
+
// * Remove a number of items from the last of the history.
|
|
2190
|
+
// * @param itemNumber The number of items to remove from the last of the history.
|
|
2191
|
+
// */
|
|
2192
|
+
// private static removeLastHistoryNodes(itemNumber: number) {
|
|
2193
|
+
// // TODO: implement
|
|
2194
|
+
// for (let i = 0; i < itemNumber; i++) {
|
|
2195
|
+
// GameStepManager._stepsHistory.pop()
|
|
2196
|
+
// }
|
|
2197
|
+
// }
|
|
2198
|
+
// /**
|
|
2199
|
+
// * stepsAfterLastHistoryLabel is a list of steps that occurred after the last history label.
|
|
2200
|
+
// */
|
|
2201
|
+
// private static get stepsAfterLastHistoryLabel(): StepHistoryDataType[] {
|
|
2202
|
+
// let length = GameStepManager._stepsHistory.length
|
|
2203
|
+
// let steps: StepHistoryDataType[] = []
|
|
2204
|
+
// for (let i = length - 1; i >= 0; i--) {
|
|
2205
|
+
// let element = GameStepManager._stepsHistory[i]
|
|
2206
|
+
// if (typeof element === "object" && "stepSha1" in element) {
|
|
2207
|
+
// steps.push(element.stepSha1)
|
|
2208
|
+
// }
|
|
2209
|
+
// else {
|
|
2210
|
+
// break
|
|
2211
|
+
// }
|
|
2212
|
+
// }
|
|
2213
|
+
// steps = steps.reverse()
|
|
2214
|
+
// return steps
|
|
2215
|
+
// }
|
|
2216
|
+
/* Go Back & Refresh Methods */
|
|
2217
|
+
/**
|
|
2218
|
+
* Go back to the last step and add it to the history.
|
|
2219
|
+
* @param navigate The navigate function.
|
|
2220
|
+
* @param steps The number of steps to go back.
|
|
2221
|
+
* @returns
|
|
2222
|
+
* @example
|
|
2223
|
+
* ```typescript
|
|
2224
|
+
* export function goBack(navigate: (path: string) => void, afterBack?: () => void) {
|
|
2225
|
+
* GameStepManager.goBack(navigate)
|
|
2226
|
+
* afterBack && afterBack()
|
|
2227
|
+
* }
|
|
2228
|
+
* ```
|
|
2229
|
+
*/
|
|
2230
|
+
static goBack(navigate, steps = 1) {
|
|
2231
|
+
if (steps <= 0) {
|
|
2232
|
+
console.warn("[Pixi'VN] Steps must be greater than 0");
|
|
2233
|
+
return;
|
|
2234
|
+
}
|
|
2235
|
+
if (_GameStepManager._stepsHistory.length <= 1) {
|
|
2236
|
+
console.warn("[Pixi'VN] No steps to go back");
|
|
2237
|
+
return;
|
|
2238
|
+
}
|
|
2239
|
+
let restoredStep = _GameStepManager.goBackInternal(steps, _GameStepManager.originalStepData);
|
|
2240
|
+
if (restoredStep) {
|
|
2241
|
+
_GameStepManager._originalStepData = restoredStep;
|
|
2242
|
+
_GameStepManager._openedLabels = createExportableElement(restoredStep.openedLabels);
|
|
2243
|
+
GameStorageManager.import(createExportableElement(restoredStep.storage));
|
|
2244
|
+
GameWindowManager.import(createExportableElement(restoredStep.canvas));
|
|
2245
|
+
navigate(restoredStep.path);
|
|
2246
|
+
} else {
|
|
2247
|
+
console.error("[Pixi'VN] Error going back");
|
|
2248
|
+
}
|
|
2249
|
+
}
|
|
2250
|
+
static goBackInternal(steps, restoredStep) {
|
|
2251
|
+
if (steps <= 0) {
|
|
2252
|
+
return restoredStep;
|
|
2253
|
+
}
|
|
2254
|
+
if (_GameStepManager._stepsHistory.length == 0) {
|
|
2255
|
+
return restoredStep;
|
|
2256
|
+
}
|
|
2257
|
+
let lastHistoryStep = _GameStepManager.lastHistoryStep;
|
|
2258
|
+
if (lastHistoryStep) {
|
|
2259
|
+
try {
|
|
2260
|
+
let result = restoreDeepDiffChanges(restoredStep, lastHistoryStep.diff);
|
|
2261
|
+
_GameStepManager._lastStepIndex = lastHistoryStep.index;
|
|
2262
|
+
_GameStepManager._stepsHistory.pop();
|
|
2263
|
+
return _GameStepManager.goBackInternal(steps - 1, result);
|
|
2264
|
+
} catch (e) {
|
|
2265
|
+
console.error("[Pixi'VN] Error applying diff", e);
|
|
2266
|
+
return restoredStep;
|
|
2267
|
+
}
|
|
2268
|
+
} else {
|
|
2269
|
+
return restoredStep;
|
|
2270
|
+
}
|
|
2271
|
+
}
|
|
2272
|
+
/**
|
|
2273
|
+
* Return true if it is possible to go back.
|
|
2274
|
+
*/
|
|
2275
|
+
static get canGoBack() {
|
|
2276
|
+
return _GameStepManager._stepsHistory.length > 1;
|
|
2277
|
+
}
|
|
2278
|
+
/**
|
|
2279
|
+
* Add a label to the history.
|
|
2280
|
+
*/
|
|
2281
|
+
static clear() {
|
|
2282
|
+
_GameStepManager._stepsHistory = [];
|
|
2283
|
+
_GameStepManager._openedLabels = [];
|
|
2284
|
+
}
|
|
2285
|
+
/* Export and Import Methods */
|
|
2286
|
+
/**
|
|
2287
|
+
* Export the history to a JSON string.
|
|
2288
|
+
* @returns The history in a JSON string.
|
|
2289
|
+
*/
|
|
2290
|
+
static exportJson() {
|
|
2291
|
+
return JSON.stringify(this.export());
|
|
2292
|
+
}
|
|
2293
|
+
/**
|
|
2294
|
+
* Export the history to an object.
|
|
2295
|
+
* @returns The history in an object.
|
|
2296
|
+
*/
|
|
2297
|
+
static export() {
|
|
2298
|
+
return {
|
|
2299
|
+
stepsHistory: _GameStepManager._stepsHistory,
|
|
2300
|
+
openedLabels: _GameStepManager._openedLabels,
|
|
2301
|
+
lastStepIndex: _GameStepManager._lastStepIndex,
|
|
2302
|
+
originalStepData: _GameStepManager._originalStepData
|
|
2303
|
+
};
|
|
2304
|
+
}
|
|
2305
|
+
/**
|
|
2306
|
+
* Import the history from a JSON string.
|
|
2307
|
+
* @param dataString The history in a JSON string.
|
|
2308
|
+
*/
|
|
2309
|
+
static importJson(dataString) {
|
|
2310
|
+
_GameStepManager.import(JSON.parse(dataString));
|
|
2311
|
+
}
|
|
2312
|
+
/**
|
|
2313
|
+
* Import the history from an object.
|
|
2314
|
+
* @param data The history in an object.
|
|
2315
|
+
*/
|
|
2316
|
+
static import(data) {
|
|
2317
|
+
_GameStepManager.clear();
|
|
2318
|
+
try {
|
|
2319
|
+
if (data.hasOwnProperty("stepsHistory")) {
|
|
2320
|
+
_GameStepManager._stepsHistory = data["stepsHistory"];
|
|
2321
|
+
} else {
|
|
2322
|
+
console.warn("[Pixi'VN] Could not import stepsHistory data, so will be ignored");
|
|
2323
|
+
}
|
|
2324
|
+
if (data.hasOwnProperty("openedLabels")) {
|
|
2325
|
+
_GameStepManager._openedLabels = data["openedLabels"];
|
|
2326
|
+
} else {
|
|
2327
|
+
console.warn("[Pixi'VN] Could not import openedLabels data, so will be ignored");
|
|
2328
|
+
}
|
|
2329
|
+
if (data.hasOwnProperty("lastStepIndex")) {
|
|
2330
|
+
_GameStepManager._lastStepIndex = data["lastStepIndex"];
|
|
2331
|
+
} else {
|
|
2332
|
+
console.warn("[Pixi'VN] Could not import lastStepIndex data, so will be ignored");
|
|
2333
|
+
}
|
|
2334
|
+
if (data.hasOwnProperty("originalStepData")) {
|
|
2335
|
+
_GameStepManager._originalStepData = data["originalStepData"];
|
|
2336
|
+
} else {
|
|
2337
|
+
console.warn("[Pixi'VN] Could not import originalStepData data, so will be ignored");
|
|
2338
|
+
}
|
|
2339
|
+
} catch (e) {
|
|
2340
|
+
console.error("[Pixi'VN] Error importing data", e);
|
|
2341
|
+
}
|
|
2342
|
+
}
|
|
1543
2343
|
};
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
2344
|
+
/**
|
|
2345
|
+
* stepHistory is a list of label events and steps that occurred during the progression of the steps.
|
|
2346
|
+
*/
|
|
2347
|
+
_GameStepManager._stepsHistory = [];
|
|
2348
|
+
_GameStepManager._lastStepIndex = 0;
|
|
2349
|
+
_GameStepManager._openedLabels = [];
|
|
2350
|
+
_GameStepManager._originalStepData = void 0;
|
|
2351
|
+
var GameStepManager = _GameStepManager;
|
|
1547
2352
|
|
|
1548
|
-
// src/
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
2353
|
+
// src/classes/StoredClassModel.ts
|
|
2354
|
+
var StoredClassModel = class {
|
|
2355
|
+
/**
|
|
2356
|
+
* @param categoryId The id of the category. For example if you are storing a character class, you can use "characters" as categoryId. so all instances of the character class will be stored in the "characters" category.
|
|
2357
|
+
* @param id The id of instance of the class. This id must be unique for the category.
|
|
2358
|
+
*/
|
|
2359
|
+
constructor(categoryId, id) {
|
|
2360
|
+
this.categoryId = categoryId;
|
|
2361
|
+
this._id = id;
|
|
1552
2362
|
}
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
2363
|
+
/**
|
|
2364
|
+
* Is id of the stored class. is unique for this class.
|
|
2365
|
+
*/
|
|
2366
|
+
get id() {
|
|
2367
|
+
return this._id;
|
|
2368
|
+
}
|
|
2369
|
+
/**
|
|
2370
|
+
* Update a property in the storage.
|
|
2371
|
+
* @param propertyName The name of the property to set.
|
|
2372
|
+
* @param value The value to set. If is undefined, the property will be removed from the storage.
|
|
2373
|
+
*/
|
|
2374
|
+
setStorageProperty(propertyName, value) {
|
|
2375
|
+
let storage = GameStorageManager.getVariable(this.categoryId);
|
|
2376
|
+
if (!storage) {
|
|
2377
|
+
storage = {};
|
|
1558
2378
|
}
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
2379
|
+
if (!storage.hasOwnProperty(this.id)) {
|
|
2380
|
+
storage[this.id] = {};
|
|
2381
|
+
}
|
|
2382
|
+
if (value === void 0 || value === null) {
|
|
2383
|
+
if (storage[this.id].hasOwnProperty(propertyName)) {
|
|
2384
|
+
delete storage[this.id][propertyName];
|
|
2385
|
+
}
|
|
2386
|
+
} else {
|
|
2387
|
+
storage[this.id] = __spreadProps(__spreadValues({}, storage[this.id]), { [propertyName]: value });
|
|
1566
2388
|
}
|
|
2389
|
+
if (Object.keys(storage[this.id]).length === 0) {
|
|
2390
|
+
delete storage[this.id];
|
|
2391
|
+
}
|
|
2392
|
+
GameStorageManager.setVariable(this.categoryId, storage);
|
|
1567
2393
|
}
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
2394
|
+
/**
|
|
2395
|
+
* Get a property from the storage.
|
|
2396
|
+
* @param propertyName The name of the property to get.
|
|
2397
|
+
* @returns The value of the property. If the property is not found, returns undefined.
|
|
2398
|
+
*/
|
|
2399
|
+
getStorageProperty(propertyName) {
|
|
2400
|
+
let storage = GameStorageManager.getVariable(this.categoryId);
|
|
2401
|
+
if (storage && storage.hasOwnProperty(this.id) && storage[this.id].hasOwnProperty(propertyName)) {
|
|
2402
|
+
return storage[this.id][propertyName];
|
|
1575
2403
|
}
|
|
2404
|
+
return void 0;
|
|
1576
2405
|
}
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
2406
|
+
};
|
|
2407
|
+
|
|
2408
|
+
// src/classes/CharacterBaseModel.ts
|
|
2409
|
+
var CharacterBaseModel2 = class extends StoredClassModel {
|
|
2410
|
+
/**
|
|
2411
|
+
* @param id The id of the character.
|
|
2412
|
+
* @param props The properties of the character.
|
|
2413
|
+
*/
|
|
2414
|
+
constructor(id, props) {
|
|
2415
|
+
super(GameStorageManager.keysSystem.CHARACTER_CATEGORY_KEY, id);
|
|
2416
|
+
this.defaultName = "";
|
|
2417
|
+
this.defaultName = props.name;
|
|
2418
|
+
this.defaultSurname = props.surname;
|
|
2419
|
+
this.defaultAge = props.age;
|
|
2420
|
+
this._icon = props.icon;
|
|
2421
|
+
this._color = props.color;
|
|
2422
|
+
}
|
|
2423
|
+
/***
|
|
2424
|
+
* The name of the character.
|
|
2425
|
+
* If you set undefined, it will return the default name.
|
|
2426
|
+
*/
|
|
2427
|
+
get name() {
|
|
2428
|
+
return this.getStorageProperty("name") || this.defaultName;
|
|
2429
|
+
}
|
|
2430
|
+
set name(value) {
|
|
2431
|
+
this.setStorageProperty("name", value);
|
|
2432
|
+
}
|
|
2433
|
+
/**
|
|
2434
|
+
* The surname of the character.
|
|
2435
|
+
* If you set undefined, it will return the default surname.
|
|
2436
|
+
*/
|
|
2437
|
+
get surname() {
|
|
2438
|
+
return this.getStorageProperty("surname") || this.defaultSurname;
|
|
2439
|
+
}
|
|
2440
|
+
set surname(value) {
|
|
2441
|
+
this.setStorageProperty("surname", value);
|
|
2442
|
+
}
|
|
2443
|
+
/**
|
|
2444
|
+
* The age of the character.
|
|
2445
|
+
* If you set undefined, it will return the default age.
|
|
2446
|
+
*/
|
|
2447
|
+
get age() {
|
|
2448
|
+
return this.getStorageProperty("age") || this.defaultAge;
|
|
2449
|
+
}
|
|
2450
|
+
set age(value) {
|
|
2451
|
+
this.setStorageProperty("age", value);
|
|
2452
|
+
}
|
|
2453
|
+
/**
|
|
2454
|
+
* The icon of the character.
|
|
2455
|
+
*/
|
|
2456
|
+
get icon() {
|
|
2457
|
+
return this._icon;
|
|
2458
|
+
}
|
|
2459
|
+
/**
|
|
2460
|
+
* The color of the character.
|
|
2461
|
+
*/
|
|
2462
|
+
get color() {
|
|
2463
|
+
return this._color;
|
|
2464
|
+
}
|
|
2465
|
+
};
|
|
2466
|
+
|
|
2467
|
+
// src/classes/DialogueBaseModel.ts
|
|
2468
|
+
var DialogueBaseModel = class {
|
|
2469
|
+
/**
|
|
2470
|
+
* @param text The text of the dialogue.
|
|
2471
|
+
* @param character The id of the character that is speaking.
|
|
2472
|
+
* @param oltherParams Other parameters that can be stored in the dialogue.
|
|
2473
|
+
*/
|
|
2474
|
+
constructor(text, character, oltherParams = {}) {
|
|
2475
|
+
/**
|
|
2476
|
+
* The text of the dialogue.
|
|
2477
|
+
*/
|
|
2478
|
+
this.text = "";
|
|
2479
|
+
/**
|
|
2480
|
+
* Other parameters that can be stored in the dialogue.
|
|
2481
|
+
*/
|
|
2482
|
+
this.oltherParams = {};
|
|
2483
|
+
if (typeof text === "string") {
|
|
2484
|
+
this.text = text;
|
|
2485
|
+
if (typeof character === "string") {
|
|
2486
|
+
this.character = character;
|
|
2487
|
+
} else {
|
|
2488
|
+
this.character = character == null ? void 0 : character.id;
|
|
2489
|
+
}
|
|
2490
|
+
this.oltherParams = oltherParams;
|
|
2491
|
+
} else {
|
|
2492
|
+
this.text = text.text;
|
|
2493
|
+
if (text.character) {
|
|
2494
|
+
this.character = text.character;
|
|
2495
|
+
}
|
|
2496
|
+
this.oltherParams = text.oltherParams || {};
|
|
1585
2497
|
}
|
|
1586
2498
|
}
|
|
1587
|
-
|
|
2499
|
+
/**
|
|
2500
|
+
* Export the dialogue to a DialogueBaseData object.
|
|
2501
|
+
*
|
|
2502
|
+
* @returns The data of the dialogue.
|
|
2503
|
+
*/
|
|
2504
|
+
export() {
|
|
2505
|
+
return {
|
|
2506
|
+
text: this.text,
|
|
2507
|
+
character: this.character,
|
|
2508
|
+
oltherParams: this.oltherParams
|
|
2509
|
+
};
|
|
2510
|
+
}
|
|
2511
|
+
};
|
|
2512
|
+
|
|
2513
|
+
// src/decorators/LabelDecorator.ts
|
|
2514
|
+
var registeredLabels = {};
|
|
2515
|
+
function newLabel(id, steps, onStepRun) {
|
|
2516
|
+
if (registeredLabels[id]) {
|
|
2517
|
+
console.info(`[Pixi'VN] Label ${id} already exists, it will be overwritten`);
|
|
2518
|
+
}
|
|
2519
|
+
let label = new Label(id, steps, onStepRun);
|
|
2520
|
+
registeredLabels[id] = label;
|
|
2521
|
+
return label;
|
|
2522
|
+
}
|
|
2523
|
+
function getLabelById(id) {
|
|
2524
|
+
let label = registeredLabels[id];
|
|
2525
|
+
if (!label) {
|
|
2526
|
+
console.error(`[Pixi'VN] Label ${id} not found`);
|
|
2527
|
+
return;
|
|
2528
|
+
}
|
|
2529
|
+
return label;
|
|
1588
2530
|
}
|
|
1589
2531
|
|
|
1590
|
-
// src/classes/ticker/
|
|
2532
|
+
// src/classes/ticker/FadeAlphaTicker.ts
|
|
2533
|
+
var FadeAlphaTicker = class extends TickerBase {
|
|
2534
|
+
fn(ticker, args, tags, tickerId) {
|
|
2535
|
+
let type = args.type === void 0 ? "hide" : args.type;
|
|
2536
|
+
let duration = args.duration === void 0 ? 1 : args.duration;
|
|
2537
|
+
let speed = 1 / (duration * 60);
|
|
2538
|
+
let limit = args.limit === void 0 ? type === "hide" ? 0 : 1 : args.limit;
|
|
2539
|
+
let tagToRemoveAfter2 = args.tagToRemoveAfter || [];
|
|
2540
|
+
if (typeof tagToRemoveAfter2 === "string") {
|
|
2541
|
+
tagToRemoveAfter2 = [tagToRemoveAfter2];
|
|
2542
|
+
}
|
|
2543
|
+
if (type === "hide" && limit < 0) {
|
|
2544
|
+
limit = 0;
|
|
2545
|
+
}
|
|
2546
|
+
if (type === "show" && limit > 1) {
|
|
2547
|
+
limit = 1;
|
|
2548
|
+
}
|
|
2549
|
+
tags.filter((tag) => {
|
|
2550
|
+
var _a;
|
|
2551
|
+
let element = GameWindowManager.getCanvasElement(tag);
|
|
2552
|
+
if (args.startOnlyIfHaveTexture) {
|
|
2553
|
+
if (element && element instanceof pixi_js.Sprite && ((_a = element.texture) == null ? void 0 : _a.label) == "EMPTY") {
|
|
2554
|
+
return false;
|
|
2555
|
+
}
|
|
2556
|
+
}
|
|
2557
|
+
return true;
|
|
2558
|
+
}).forEach((tag) => {
|
|
2559
|
+
let element = GameWindowManager.getCanvasElement(tag);
|
|
2560
|
+
if (element && element instanceof pixi_js.Container) {
|
|
2561
|
+
if (type === "show" && element.alpha < limit) {
|
|
2562
|
+
element.alpha += speed * ticker.deltaTime;
|
|
2563
|
+
} else if (type === "hide" && element.alpha > limit) {
|
|
2564
|
+
element.alpha -= speed * ticker.deltaTime;
|
|
2565
|
+
}
|
|
2566
|
+
if (type === "show" && element.alpha >= limit) {
|
|
2567
|
+
element.alpha = limit;
|
|
2568
|
+
GameWindowManager.onEndOfTicker(tag, this, tagToRemoveAfter2, tickerId);
|
|
2569
|
+
} else if (type === "hide" && element.alpha <= limit) {
|
|
2570
|
+
element.alpha = limit;
|
|
2571
|
+
GameWindowManager.onEndOfTicker(tag, this, tagToRemoveAfter2, tickerId);
|
|
2572
|
+
}
|
|
2573
|
+
}
|
|
2574
|
+
});
|
|
2575
|
+
}
|
|
2576
|
+
};
|
|
2577
|
+
FadeAlphaTicker = __decorateClass([
|
|
2578
|
+
tickerDecorator()
|
|
2579
|
+
], FadeAlphaTicker);
|
|
1591
2580
|
var MoveTicker = class extends TickerBase {
|
|
1592
2581
|
fn(ticker, args, tags, tickerId) {
|
|
1593
2582
|
let xSpeed = 1;
|
|
@@ -1684,104 +2673,32 @@ var RotateTicker = class extends TickerBase {
|
|
|
1684
2673
|
RotateTicker = __decorateClass([
|
|
1685
2674
|
tickerDecorator()
|
|
1686
2675
|
], RotateTicker);
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
ySpeed = args.speed.y;
|
|
1698
|
-
}
|
|
1699
|
-
}
|
|
1700
|
-
xSpeed /= 60;
|
|
1701
|
-
ySpeed /= 60;
|
|
1702
|
-
let tagToRemoveAfter2 = args.tagToRemoveAfter || [];
|
|
1703
|
-
if (typeof tagToRemoveAfter2 === "string") {
|
|
1704
|
-
tagToRemoveAfter2 = [tagToRemoveAfter2];
|
|
1705
|
-
}
|
|
1706
|
-
let type = args.type || "zoom";
|
|
1707
|
-
let xLimit = Infinity;
|
|
1708
|
-
let yLimit = Infinity;
|
|
1709
|
-
if (args.limit) {
|
|
1710
|
-
if (typeof args.limit === "number") {
|
|
1711
|
-
xLimit = args.limit;
|
|
1712
|
-
yLimit = args.limit;
|
|
1713
|
-
} else {
|
|
1714
|
-
xLimit = args.limit.x;
|
|
1715
|
-
yLimit = args.limit.y;
|
|
1716
|
-
}
|
|
1717
|
-
}
|
|
1718
|
-
tags.filter((tag) => {
|
|
1719
|
-
var _a;
|
|
1720
|
-
let element = GameWindowManager.getCanvasElement(tag);
|
|
1721
|
-
if (args.startOnlyIfHaveTexture) {
|
|
1722
|
-
if (element && element instanceof pixi_js.Sprite && ((_a = element.texture) == null ? void 0 : _a.label) == "EMPTY") {
|
|
1723
|
-
return false;
|
|
1724
|
-
}
|
|
1725
|
-
}
|
|
1726
|
-
return true;
|
|
1727
|
-
}).forEach((tag) => {
|
|
1728
|
-
let element = GameWindowManager.getCanvasElement(tag);
|
|
1729
|
-
if (element && element instanceof pixi_js.Container) {
|
|
1730
|
-
if (type === "zoom" && (element.scale.x < xLimit || element.scale.y < yLimit)) {
|
|
1731
|
-
element.scale.x += xSpeed * ticker.deltaTime;
|
|
1732
|
-
element.scale.y += ySpeed * ticker.deltaTime;
|
|
1733
|
-
} else if (type === "unzoom" && (element.scale.x > xLimit || element.scale.y > yLimit)) {
|
|
1734
|
-
element.scale.x -= xSpeed * ticker.deltaTime;
|
|
1735
|
-
element.scale.y -= ySpeed * ticker.deltaTime;
|
|
1736
|
-
}
|
|
1737
|
-
if (type === "zoom") {
|
|
1738
|
-
if (element.scale.x > xLimit) {
|
|
1739
|
-
element.scale.x = xLimit;
|
|
1740
|
-
}
|
|
1741
|
-
if (element.scale.y > yLimit) {
|
|
1742
|
-
element.scale.y = yLimit;
|
|
1743
|
-
}
|
|
1744
|
-
if (element.scale.x >= xLimit && element.scale.y >= yLimit) {
|
|
1745
|
-
element.scale.x = xLimit;
|
|
1746
|
-
element.scale.y = yLimit;
|
|
1747
|
-
GameWindowManager.onEndOfTicker(tag, this, tagToRemoveAfter2, tickerId);
|
|
1748
|
-
}
|
|
1749
|
-
} else if (type === "unzoom") {
|
|
1750
|
-
if (element.scale.x < xLimit) {
|
|
1751
|
-
element.scale.x = xLimit;
|
|
1752
|
-
}
|
|
1753
|
-
if (element.scale.y < yLimit) {
|
|
1754
|
-
element.scale.y = yLimit;
|
|
1755
|
-
}
|
|
1756
|
-
if (element.scale.x <= xLimit && element.scale.y <= yLimit) {
|
|
1757
|
-
element.scale.x = xLimit;
|
|
1758
|
-
element.scale.y = yLimit;
|
|
1759
|
-
GameWindowManager.onEndOfTicker(tag, this, tagToRemoveAfter2, tickerId);
|
|
1760
|
-
}
|
|
1761
|
-
}
|
|
1762
|
-
if (xSpeed < 1e-5 && ySpeed < 1e-5 && !(args.speedProgression && args.speedProgression.type == "linear" && args.speedProgression.amt != 0)) {
|
|
1763
|
-
GameWindowManager.onEndOfTicker(tag, this, tagToRemoveAfter2, tickerId);
|
|
1764
|
-
}
|
|
1765
|
-
}
|
|
1766
|
-
});
|
|
1767
|
-
if (args.speedProgression)
|
|
1768
|
-
updateTickerProgression(args, "speed", args.speedProgression);
|
|
1769
|
-
}
|
|
1770
|
-
};
|
|
1771
|
-
ZoomTicker = __decorateClass([
|
|
1772
|
-
tickerDecorator()
|
|
1773
|
-
], ZoomTicker);
|
|
2676
|
+
|
|
2677
|
+
// src/labels/TestConstant.ts
|
|
2678
|
+
var juliette = new CharacterBaseModel2("___pixivn_juliette___", {
|
|
2679
|
+
name: "Juliette",
|
|
2680
|
+
age: 25,
|
|
2681
|
+
icon: "https://firebasestorage.googleapis.com/v0/b/pixi-vn.appspot.com/o/public%2Fcharacters%2Fjuliette-square.webp?alt=media&token=5856ae7b-d99e-4563-86ec-cbc48cc9c6b4",
|
|
2682
|
+
color: "#ac0086"
|
|
2683
|
+
});
|
|
2684
|
+
saveCharacter(juliette);
|
|
2685
|
+
var bunnyImage = "https://pixijs.com/assets/bunny.png";
|
|
1774
2686
|
|
|
1775
2687
|
// src/labels/BaseCanvasElementTestLabel.ts
|
|
2688
|
+
var BASE_CANVAS_ELEMENT_LABEL = "___pixi_vn_base_canvas_element_label___";
|
|
1776
2689
|
var baseCanvasElementTestLabel = newLabel(
|
|
1777
|
-
|
|
2690
|
+
BASE_CANVAS_ELEMENT_LABEL,
|
|
1778
2691
|
[
|
|
1779
2692
|
() => __async(void 0, null, function* () {
|
|
1780
|
-
|
|
2693
|
+
let number = 25;
|
|
2694
|
+
setDialogue({
|
|
2695
|
+
character: juliette,
|
|
2696
|
+
text: `Here's what's going to happen: I'm going to create ${number} bunnies (CanvasSprites) and put them in a CanvasContainer.`
|
|
2697
|
+
});
|
|
1781
2698
|
const container = new CanvasContainer();
|
|
1782
2699
|
GameWindowManager.addCanvasElement("container", container);
|
|
1783
|
-
const texture = yield pixi_js.Assets.load(
|
|
1784
|
-
for (let i = 0; i <
|
|
2700
|
+
const texture = yield pixi_js.Assets.load(bunnyImage);
|
|
2701
|
+
for (let i = 0; i < number; i++) {
|
|
1785
2702
|
const bunny = new CanvasSprite(texture);
|
|
1786
2703
|
bunny.x = i % 5 * 40;
|
|
1787
2704
|
bunny.y = Math.floor(i / 5) * 40;
|
|
@@ -1791,10 +2708,15 @@ var baseCanvasElementTestLabel = newLabel(
|
|
|
1791
2708
|
container.y = GameWindowManager.screen.height / 2;
|
|
1792
2709
|
container.pivot.x = container.width / 2;
|
|
1793
2710
|
container.pivot.y = container.height / 2;
|
|
1794
|
-
GameWindowManager.addTicker("container", new RotateTicker({ speed:
|
|
2711
|
+
GameWindowManager.addTicker("container", new RotateTicker({ speed: 1 }));
|
|
1795
2712
|
}),
|
|
1796
2713
|
() => __async(void 0, null, function* () {
|
|
1797
2714
|
removeCanvasElement("container");
|
|
2715
|
+
setDialogue({
|
|
2716
|
+
character: juliette,
|
|
2717
|
+
text: `Here's what's going to happen: I'm going to create some text elements with different styles and put them on the stage.
|
|
2718
|
+
But it will generate a warn message, because the FillGradient or FillPattern has not yet been supported by the Pixi\u2019VN ( you can see the status of the issue here: [#76](https://github.com/DRincs-Productions/pixi-vn/issues/76)).`
|
|
2719
|
+
});
|
|
1798
2720
|
const basicText = new CanvasText({ text: "Basic text in pixi" });
|
|
1799
2721
|
basicText.x = 50;
|
|
1800
2722
|
basicText.y = 100;
|
|
@@ -1856,5 +2778,5 @@ var baseCanvasElementTestLabel = newLabel(
|
|
|
1856
2778
|
);
|
|
1857
2779
|
|
|
1858
2780
|
exports.baseCanvasElementTestLabel = baseCanvasElementTestLabel;
|
|
1859
|
-
//# sourceMappingURL=
|
|
2781
|
+
//# sourceMappingURL=BaseCanvasElementTestLabel.js.map
|
|
1860
2782
|
//# sourceMappingURL=BaseCanvasElementTestLabel.js.map
|