@drincs/pixi-vn 0.6.2 → 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/classes/CanvasEvent.js +1 -1
- package/dist/classes/CanvasEvent.js.map +1 -1
- package/dist/classes/CanvasEvent.mjs +1 -1
- package/dist/classes/CanvasEvent.mjs.map +1 -1
- package/dist/classes/CharacterBaseModel.js +15 -15
- package/dist/classes/CharacterBaseModel.js.map +1 -1
- package/dist/classes/CharacterBaseModel.mjs +15 -15
- package/dist/classes/CharacterBaseModel.mjs.map +1 -1
- package/dist/classes/ChoiceMenuOption.js +15 -15
- package/dist/classes/ChoiceMenuOption.js.map +1 -1
- package/dist/classes/ChoiceMenuOption.mjs +15 -15
- package/dist/classes/ChoiceMenuOption.mjs.map +1 -1
- package/dist/classes/CloseLabel.js +1 -1
- package/dist/classes/CloseLabel.js.map +1 -1
- package/dist/classes/CloseLabel.mjs +1 -1
- package/dist/classes/CloseLabel.mjs.map +1 -1
- package/dist/classes/DialogueBaseModel.js +1 -1
- package/dist/classes/DialogueBaseModel.js.map +1 -1
- package/dist/classes/DialogueBaseModel.mjs +1 -1
- package/dist/classes/DialogueBaseModel.mjs.map +1 -1
- package/dist/classes/Label.js +1 -1
- package/dist/classes/Label.js.map +1 -1
- package/dist/classes/Label.mjs +1 -1
- package/dist/classes/Label.mjs.map +1 -1
- package/dist/classes/StoredClassModel.js +15 -15
- package/dist/classes/StoredClassModel.js.map +1 -1
- package/dist/classes/StoredClassModel.mjs +15 -15
- package/dist/classes/StoredClassModel.mjs.map +1 -1
- package/dist/classes/canvas/CanvasBase.js +1 -1
- package/dist/classes/canvas/CanvasBase.js.map +1 -1
- package/dist/classes/canvas/CanvasBase.mjs +1 -1
- package/dist/classes/canvas/CanvasBase.mjs.map +1 -1
- package/dist/classes/canvas/CanvasContainer.js +13 -13
- package/dist/classes/canvas/CanvasContainer.js.map +1 -1
- package/dist/classes/canvas/CanvasContainer.mjs +13 -13
- package/dist/classes/canvas/CanvasContainer.mjs.map +1 -1
- package/dist/classes/canvas/CanvasImage.js +2 -4
- package/dist/classes/canvas/CanvasImage.js.map +1 -1
- package/dist/classes/canvas/CanvasImage.mjs +2 -4
- package/dist/classes/canvas/CanvasImage.mjs.map +1 -1
- package/dist/classes/canvas/CanvasSprite.js +2 -4
- package/dist/classes/canvas/CanvasSprite.js.map +1 -1
- package/dist/classes/canvas/CanvasSprite.mjs +2 -4
- package/dist/classes/canvas/CanvasSprite.mjs.map +1 -1
- package/dist/classes/canvas/CanvasText.js +11 -11
- package/dist/classes/canvas/CanvasText.js.map +1 -1
- package/dist/classes/canvas/CanvasText.mjs +11 -11
- package/dist/classes/canvas/CanvasText.mjs.map +1 -1
- package/dist/classes/canvas/index.js +13 -13
- package/dist/classes/canvas/index.js.map +1 -1
- package/dist/classes/canvas/index.mjs +13 -13
- package/dist/classes/canvas/index.mjs.map +1 -1
- package/dist/classes/index.js +15 -15
- package/dist/classes/index.js.map +1 -1
- package/dist/classes/index.mjs +15 -15
- package/dist/classes/index.mjs.map +1 -1
- package/dist/classes/ticker/FadeAlphaTicker.js +15 -15
- package/dist/classes/ticker/FadeAlphaTicker.js.map +1 -1
- package/dist/classes/ticker/FadeAlphaTicker.mjs +15 -15
- package/dist/classes/ticker/FadeAlphaTicker.mjs.map +1 -1
- package/dist/classes/ticker/MoveTicker.js +15 -15
- package/dist/classes/ticker/MoveTicker.js.map +1 -1
- package/dist/classes/ticker/MoveTicker.mjs +15 -15
- package/dist/classes/ticker/MoveTicker.mjs.map +1 -1
- package/dist/classes/ticker/RotateTicker.js +15 -15
- package/dist/classes/ticker/RotateTicker.js.map +1 -1
- package/dist/classes/ticker/RotateTicker.mjs +15 -15
- package/dist/classes/ticker/RotateTicker.mjs.map +1 -1
- package/dist/classes/ticker/TickerBase.js +1 -1
- package/dist/classes/ticker/TickerBase.js.map +1 -1
- package/dist/classes/ticker/TickerBase.mjs +1 -1
- package/dist/classes/ticker/TickerBase.mjs.map +1 -1
- package/dist/classes/ticker/ZoomTicker.js +15 -15
- package/dist/classes/ticker/ZoomTicker.js.map +1 -1
- package/dist/classes/ticker/ZoomTicker.mjs +15 -15
- package/dist/classes/ticker/ZoomTicker.mjs.map +1 -1
- package/dist/classes/ticker/index.js +15 -15
- package/dist/classes/ticker/index.js.map +1 -1
- package/dist/classes/ticker/index.mjs +15 -15
- 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.js +13 -13
- package/dist/decorators/CanvasElementDecorator.js.map +1 -1
- package/dist/decorators/CanvasElementDecorator.mjs +13 -13
- 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.js +1 -1
- package/dist/decorators/EventDecorator.js.map +1 -1
- package/dist/decorators/EventDecorator.mjs +1 -1
- package/dist/decorators/EventDecorator.mjs.map +1 -1
- package/dist/decorators/LabelDecorator.js +15 -15
- package/dist/decorators/LabelDecorator.js.map +1 -1
- package/dist/decorators/LabelDecorator.mjs +15 -15
- package/dist/decorators/LabelDecorator.mjs.map +1 -1
- package/dist/decorators/TickerDecorator.js +1 -1
- package/dist/decorators/TickerDecorator.js.map +1 -1
- package/dist/decorators/TickerDecorator.mjs +1 -1
- package/dist/decorators/TickerDecorator.mjs.map +1 -1
- package/dist/decorators/index.js +15 -15
- package/dist/decorators/index.js.map +1 -1
- package/dist/decorators/index.mjs +15 -15
- package/dist/decorators/index.mjs.map +1 -1
- package/dist/functions/CanvasUtility.js +13 -13
- package/dist/functions/CanvasUtility.js.map +1 -1
- package/dist/functions/CanvasUtility.mjs +13 -13
- package/dist/functions/CanvasUtility.mjs.map +1 -1
- package/dist/functions/DialogueUtility.js +15 -15
- package/dist/functions/DialogueUtility.js.map +1 -1
- package/dist/functions/DialogueUtility.mjs +15 -15
- 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 +15 -15
- package/dist/functions/FlagsUtility.js.map +1 -1
- package/dist/functions/FlagsUtility.mjs +15 -15
- package/dist/functions/FlagsUtility.mjs.map +1 -1
- package/dist/functions/GameUtility.js +15 -15
- package/dist/functions/GameUtility.js.map +1 -1
- package/dist/functions/GameUtility.mjs +15 -15
- package/dist/functions/GameUtility.mjs.map +1 -1
- package/dist/functions/ImageUtility.js +15 -15
- package/dist/functions/ImageUtility.js.map +1 -1
- package/dist/functions/ImageUtility.mjs +15 -15
- package/dist/functions/ImageUtility.mjs.map +1 -1
- package/dist/functions/SavesUtility.js +16 -16
- package/dist/functions/SavesUtility.js.map +1 -1
- package/dist/functions/SavesUtility.mjs +16 -16
- 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.js +16 -16
- package/dist/functions/index.js.map +1 -1
- package/dist/functions/index.mjs +16 -16
- package/dist/functions/index.mjs.map +1 -1
- package/dist/index.js +119 -17
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +120 -18
- 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.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.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.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.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.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.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.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.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.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.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.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.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.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 +917 -23
- package/dist/labels/BaseCanvasElementTestLabel.js.map +1 -1
- package/dist/labels/BaseCanvasElementTestLabel.mjs +917 -23
- package/dist/labels/BaseCanvasElementTestLabel.mjs.map +1 -1
- package/dist/labels/CanvasEventsTestLabel.js +15 -15
- package/dist/labels/CanvasEventsTestLabel.js.map +1 -1
- package/dist/labels/CanvasEventsTestLabel.mjs +15 -15
- package/dist/labels/CanvasEventsTestLabel.mjs.map +1 -1
- package/dist/labels/CustomTickerCanvasElementTestLabel.js +15 -18
- package/dist/labels/CustomTickerCanvasElementTestLabel.js.map +1 -1
- package/dist/labels/CustomTickerCanvasElementTestLabel.mjs +15 -18
- package/dist/labels/CustomTickerCanvasElementTestLabel.mjs.map +1 -1
- package/dist/labels/ImagesAnimationsTestLabel.js +15 -15
- package/dist/labels/ImagesAnimationsTestLabel.js.map +1 -1
- package/dist/labels/ImagesAnimationsTestLabel.mjs +15 -15
- package/dist/labels/ImagesAnimationsTestLabel.mjs.map +1 -1
- package/dist/labels/MarkdownTest.js +15 -15
- package/dist/labels/MarkdownTest.js.map +1 -1
- package/dist/labels/MarkdownTest.mjs +15 -15
- package/dist/labels/MarkdownTest.mjs.map +1 -1
- package/dist/labels/StartLabel.js +121 -19
- package/dist/labels/StartLabel.js.map +1 -1
- package/dist/labels/StartLabel.mjs +122 -20
- package/dist/labels/StartLabel.mjs.map +1 -1
- package/dist/labels/TestConstant.js +15 -15
- package/dist/labels/TestConstant.js.map +1 -1
- package/dist/labels/TestConstant.mjs +15 -15
- package/dist/labels/TestConstant.mjs.map +1 -1
- package/dist/labels/index.js +121 -19
- package/dist/labels/index.js.map +1 -1
- package/dist/labels/index.mjs +122 -20
- package/dist/labels/index.mjs.map +1 -1
- package/dist/managers/StepManager.js +15 -15
- package/dist/managers/StepManager.js.map +1 -1
- package/dist/managers/StepManager.mjs +15 -15
- 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 +1 -1
- package/dist/managers/WindowManager.d.ts +1 -1
- package/dist/managers/WindowManager.js +15 -15
- package/dist/managers/WindowManager.js.map +1 -1
- package/dist/managers/WindowManager.mjs +15 -15
- package/dist/managers/WindowManager.mjs.map +1 -1
- package/dist/managers/index.js +15 -15
- package/dist/managers/index.js.map +1 -1
- package/dist/managers/index.mjs +15 -15
- 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.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.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/TickerTestLabel.d.mts +0 -9
- package/dist/labels/TickerTestLabel.d.ts +0 -9
- package/dist/labels/TickerTestLabel.js +0 -2675
- package/dist/labels/TickerTestLabel.js.map +0 -1
- package/dist/labels/TickerTestLabel.mjs +0 -2669
- package/dist/labels/TickerTestLabel.mjs.map +0 -1
|
@@ -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 }; }
|
|
@@ -77,17 +77,19 @@ function getTexture(imageUrl) {
|
|
|
77
77
|
});
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
|
-
function
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
console.warn("[Pixi'VN] CanvasText.style.fill is a FillGradient or FillPattern, this is not supported yet.", fill);
|
|
84
|
-
fill = "#00FF00";
|
|
80
|
+
function getFillGradientFillPattern(prop, propName) {
|
|
81
|
+
if (!(prop instanceof Object)) {
|
|
82
|
+
return prop;
|
|
85
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) {
|
|
86
88
|
return {
|
|
87
89
|
align: style.align,
|
|
88
90
|
breakWords: style.breakWords,
|
|
89
91
|
dropShadow: style.dropShadow,
|
|
90
|
-
fill,
|
|
92
|
+
fill: getFillGradientFillPattern(style.stroke, "fill"),
|
|
91
93
|
fontFamily: style.fontFamily,
|
|
92
94
|
fontSize: style.fontSize,
|
|
93
95
|
fontStyle: style.fontStyle,
|
|
@@ -97,7 +99,7 @@ function getTextStyle(style) {
|
|
|
97
99
|
letterSpacing: style.letterSpacing,
|
|
98
100
|
lineHeight: style.lineHeight,
|
|
99
101
|
padding: style.padding,
|
|
100
|
-
stroke: style.stroke,
|
|
102
|
+
stroke: getFillGradientFillPattern(style.stroke, "stroke"),
|
|
101
103
|
textBaseline: style.textBaseline,
|
|
102
104
|
trim: style.trim,
|
|
103
105
|
whiteSpace: style.whiteSpace,
|
|
@@ -144,7 +146,7 @@ var CanvasSprite = class _CanvasSprite extends pixi_js.Sprite {
|
|
|
144
146
|
super(options);
|
|
145
147
|
this.pixivnId = CANVAS_SPRITE_ID;
|
|
146
148
|
this._onEvents = {};
|
|
147
|
-
this.pixivnId = this.constructor.prototype.pixivnId;
|
|
149
|
+
this.pixivnId = this.constructor.prototype.pixivnId || CANVAS_SPRITE_ID;
|
|
148
150
|
}
|
|
149
151
|
get memory() {
|
|
150
152
|
return getMemorySprite(this);
|
|
@@ -300,7 +302,7 @@ var CanvasText = class extends pixi_js.Text {
|
|
|
300
302
|
super(options);
|
|
301
303
|
this.pixivnId = CANVAS_TEXT_ID;
|
|
302
304
|
this._onEvents = {};
|
|
303
|
-
this.pixivnId = this.constructor.prototype.pixivnId;
|
|
305
|
+
this.pixivnId = this.constructor.prototype.pixivnId || CANVAS_TEXT_ID;
|
|
304
306
|
}
|
|
305
307
|
get memory() {
|
|
306
308
|
return getMemoryText(this);
|
|
@@ -452,7 +454,7 @@ var CanvasContainer = class extends pixi_js.Container {
|
|
|
452
454
|
constructor(options) {
|
|
453
455
|
super(options);
|
|
454
456
|
this.pixivnId = CANVAS_CONTAINER_ID;
|
|
455
|
-
this.pixivnId = this.constructor.prototype.pixivnId;
|
|
457
|
+
this.pixivnId = this.constructor.prototype.pixivnId || CANVAS_CONTAINER_ID;
|
|
456
458
|
}
|
|
457
459
|
get memory() {
|
|
458
460
|
let memory = getMemoryContainer(this);
|
|
@@ -490,7 +492,6 @@ function getMemoryContainer(element) {
|
|
|
490
492
|
position: { x: element.position.x, y: element.position.y },
|
|
491
493
|
skew: { x: element.skew.x, y: element.skew.y },
|
|
492
494
|
visible: element.visible,
|
|
493
|
-
culled: element.culled,
|
|
494
495
|
x: element.x,
|
|
495
496
|
y: element.y,
|
|
496
497
|
boundsArea: element.boundsArea,
|
|
@@ -528,7 +529,6 @@ function setMemoryContainer(element, memory) {
|
|
|
528
529
|
memory.position && element.position.set(memory.position.x, memory.position.y);
|
|
529
530
|
memory.skew && element.skew.set(memory.skew.x, memory.skew.y);
|
|
530
531
|
memory.visible && (element.visible = memory.visible);
|
|
531
|
-
memory.culled && (element.culled = memory.culled);
|
|
532
532
|
memory.x && (element.x = memory.x);
|
|
533
533
|
memory.y && (element.y = memory.y);
|
|
534
534
|
memory.boundsArea && (element.boundsArea = memory.boundsArea);
|
|
@@ -538,6 +538,23 @@ function setMemoryContainer(element, memory) {
|
|
|
538
538
|
memory.interactiveChildren && (element.interactiveChildren = memory.interactiveChildren);
|
|
539
539
|
memory.hitArea && (element.hitArea = memory.hitArea);
|
|
540
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
|
+
}
|
|
541
558
|
function checkIfStepsIsEqual(step1, step2) {
|
|
542
559
|
return step1 === step2;
|
|
543
560
|
}
|
|
@@ -608,8 +625,70 @@ var Label = class {
|
|
|
608
625
|
return this._choiseIndex;
|
|
609
626
|
}
|
|
610
627
|
};
|
|
611
|
-
|
|
612
|
-
|
|
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);
|
|
633
|
+
}
|
|
634
|
+
|
|
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;
|
|
613
692
|
}
|
|
614
693
|
|
|
615
694
|
// src/functions/TickerUtility.ts
|
|
@@ -795,6 +874,47 @@ function createExportableElement(element) {
|
|
|
795
874
|
}
|
|
796
875
|
}
|
|
797
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
|
+
|
|
798
918
|
// src/managers/StorageManager.ts
|
|
799
919
|
var _GameStorageManager = class _GameStorageManager {
|
|
800
920
|
constructor() {
|
|
@@ -975,7 +1095,7 @@ var _GameWindowManager = class _GameWindowManager {
|
|
|
975
1095
|
height
|
|
976
1096
|
}, options)).then(() => {
|
|
977
1097
|
_GameWindowManager._isInitialized = true;
|
|
978
|
-
this.
|
|
1098
|
+
this.addCanvasIntoHTMLElement(element);
|
|
979
1099
|
window.addEventListener("resize", _GameWindowManager.resize);
|
|
980
1100
|
_GameWindowManager.resize();
|
|
981
1101
|
asciiArtLog();
|
|
@@ -986,7 +1106,7 @@ var _GameWindowManager = class _GameWindowManager {
|
|
|
986
1106
|
* Add the canvas into a html element.
|
|
987
1107
|
* @param element it is the html element where I will put the canvas. Example: document.body
|
|
988
1108
|
*/
|
|
989
|
-
static
|
|
1109
|
+
static addCanvasIntoHTMLElement(element) {
|
|
990
1110
|
if (_GameWindowManager.isInitialized) {
|
|
991
1111
|
element.appendChild(_GameWindowManager.app.canvas);
|
|
992
1112
|
} else {
|
|
@@ -1644,6 +1764,752 @@ _GameWindowManager._currentTickersSteps = {};
|
|
|
1644
1764
|
_GameWindowManager._currentTickersTimeouts = {};
|
|
1645
1765
|
var GameWindowManager = _GameWindowManager;
|
|
1646
1766
|
|
|
1767
|
+
// src/managers/StepManager.ts
|
|
1768
|
+
var _GameStepManager = class _GameStepManager {
|
|
1769
|
+
constructor() {
|
|
1770
|
+
}
|
|
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;
|
|
1796
|
+
}
|
|
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);
|
|
1805
|
+
}
|
|
1806
|
+
}
|
|
1807
|
+
static get currentLabelStepIndex() {
|
|
1808
|
+
if (_GameStepManager._openedLabels.length > 0) {
|
|
1809
|
+
let item = _GameStepManager._openedLabels[_GameStepManager._openedLabels.length - 1];
|
|
1810
|
+
return item.currentStepIndex;
|
|
1811
|
+
}
|
|
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);
|
|
1867
|
+
}
|
|
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);
|
|
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;
|
|
2130
|
+
}
|
|
2131
|
+
return yield _GameStepManager.runCurrentStep(props, choiseMade);
|
|
2132
|
+
});
|
|
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
|
+
}
|
|
2343
|
+
};
|
|
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;
|
|
2352
|
+
|
|
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;
|
|
2362
|
+
}
|
|
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 = {};
|
|
2378
|
+
}
|
|
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 });
|
|
2388
|
+
}
|
|
2389
|
+
if (Object.keys(storage[this.id]).length === 0) {
|
|
2390
|
+
delete storage[this.id];
|
|
2391
|
+
}
|
|
2392
|
+
GameStorageManager.setVariable(this.categoryId, storage);
|
|
2393
|
+
}
|
|
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];
|
|
2403
|
+
}
|
|
2404
|
+
return void 0;
|
|
2405
|
+
}
|
|
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 || {};
|
|
2497
|
+
}
|
|
2498
|
+
}
|
|
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
|
+
|
|
1647
2513
|
// src/decorators/LabelDecorator.ts
|
|
1648
2514
|
var registeredLabels = {};
|
|
1649
2515
|
function newLabel(id, steps, onStepRun) {
|
|
@@ -1654,6 +2520,14 @@ function newLabel(id, steps, onStepRun) {
|
|
|
1654
2520
|
registeredLabels[id] = label;
|
|
1655
2521
|
return label;
|
|
1656
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;
|
|
2530
|
+
}
|
|
1657
2531
|
|
|
1658
2532
|
// src/classes/ticker/FadeAlphaTicker.ts
|
|
1659
2533
|
var FadeAlphaTicker = class extends TickerBase {
|
|
@@ -1800,16 +2674,31 @@ RotateTicker = __decorateClass([
|
|
|
1800
2674
|
tickerDecorator()
|
|
1801
2675
|
], RotateTicker);
|
|
1802
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";
|
|
2686
|
+
|
|
1803
2687
|
// src/labels/BaseCanvasElementTestLabel.ts
|
|
2688
|
+
var BASE_CANVAS_ELEMENT_LABEL = "___pixi_vn_base_canvas_element_label___";
|
|
1804
2689
|
var baseCanvasElementTestLabel = newLabel(
|
|
1805
|
-
|
|
2690
|
+
BASE_CANVAS_ELEMENT_LABEL,
|
|
1806
2691
|
[
|
|
1807
2692
|
() => __async(void 0, null, function* () {
|
|
1808
|
-
|
|
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
|
+
});
|
|
1809
2698
|
const container = new CanvasContainer();
|
|
1810
2699
|
GameWindowManager.addCanvasElement("container", container);
|
|
1811
|
-
const texture = yield pixi_js.Assets.load(
|
|
1812
|
-
for (let i = 0; i <
|
|
2700
|
+
const texture = yield pixi_js.Assets.load(bunnyImage);
|
|
2701
|
+
for (let i = 0; i < number; i++) {
|
|
1813
2702
|
const bunny = new CanvasSprite(texture);
|
|
1814
2703
|
bunny.x = i % 5 * 40;
|
|
1815
2704
|
bunny.y = Math.floor(i / 5) * 40;
|
|
@@ -1819,10 +2708,15 @@ var baseCanvasElementTestLabel = newLabel(
|
|
|
1819
2708
|
container.y = GameWindowManager.screen.height / 2;
|
|
1820
2709
|
container.pivot.x = container.width / 2;
|
|
1821
2710
|
container.pivot.y = container.height / 2;
|
|
1822
|
-
GameWindowManager.addTicker("container", new RotateTicker({ speed:
|
|
2711
|
+
GameWindowManager.addTicker("container", new RotateTicker({ speed: 1 }));
|
|
1823
2712
|
}),
|
|
1824
2713
|
() => __async(void 0, null, function* () {
|
|
1825
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
|
+
});
|
|
1826
2720
|
const basicText = new CanvasText({ text: "Basic text in pixi" });
|
|
1827
2721
|
basicText.x = 50;
|
|
1828
2722
|
basicText.y = 100;
|
|
@@ -1884,5 +2778,5 @@ var baseCanvasElementTestLabel = newLabel(
|
|
|
1884
2778
|
);
|
|
1885
2779
|
|
|
1886
2780
|
exports.baseCanvasElementTestLabel = baseCanvasElementTestLabel;
|
|
1887
|
-
//# sourceMappingURL=
|
|
2781
|
+
//# sourceMappingURL=BaseCanvasElementTestLabel.js.map
|
|
1888
2782
|
//# sourceMappingURL=BaseCanvasElementTestLabel.js.map
|