UNPKG

@drincs/pixi-vn

Version:

Pixi'VN is a npm package that provides various features for creating visual novels.

86 lines (83 loc) 2.63 kB
import deepDiff from 'deep-diff'; import { IStoratedChoiceMenuOption } from '../classes/ChoiceMenuOption.js'; import { LabelIdType } from '../types/LabelIdType.js'; import IOpenedLabel from './IOpenedLabel.js'; import ExportedCanvas from './export/ExportedCanvas.js'; import ExportedStorage from './export/ExportedStorage.js'; import DialogueBaseModel from '../classes/DialogueBaseModel.js'; import { StepHistoryDataType } from '../types/StepHistoryDataType.js'; import '../types/StorageElementType.js'; import '../classes/Label.js'; import '../types/StepLabelType.js'; import '@drincs/pixi-vn/dist/override'; import '../classes/LabelAbstract.js'; import './LabelProps.js'; import '../types/CloseType.js'; import '../types/LabelRunModeType.js'; import './canvas/ICanvasBaseMemory.js'; import './ITickersSteps.js'; import 'pixi.js'; import '../TickerBase-3rLpDpmb.js'; import '../types/TickerIdType.js'; import '../types/PauseType.js'; import '../types/RepeatType.js'; import './TickerHistory.js'; import '../classes/CharacterBaseModel.js'; import './CharacterBaseModelProps.js'; import '../classes/StoredClassModel.js'; /** * IHistoryStep is a interface that contains the information of a step in the history. */ interface IHistoryStepData { /** * The browser path that occurred during the progression of the steps. */ path: string; /** * The storage that occurred during the progression of the steps. */ storage: ExportedStorage; /** * The index of the label that occurred during the progression of the steps. */ labelIndex: number; /** * The canvas that occurred during the progression of the steps. */ canvas: ExportedCanvas; /** * The opened labels that occurred during the progression of the steps. */ openedLabels: IOpenedLabel[]; } interface IHistoryStep<T extends DialogueBaseModel = DialogueBaseModel> { /** * The difference between the previous step and the current step. */ diff: deepDiff.Diff<IHistoryStepData, IHistoryStepData>[]; /** * The label id of the current step. */ currentLabel?: LabelIdType; /** * The sha1 of the step function. */ stepSha1: StepHistoryDataType; /** * The index of the step in the history. */ index: number; /** * Dialogue to be shown in the game */ dialoge?: T; /** * List of choices asked of the player */ choices?: IStoratedChoiceMenuOption[]; /** * The choice made by the player */ choiceIndexMade?: number; } export type { IHistoryStepData, IHistoryStep as default };