LogoPixi’VN
indexInterfaces

Interface: HistoryManagerInterface

Defined in: src/history/interfaces/HistoryManagerInterface.ts:12

Properties

back

> back: (props, options?) => Promise<StepLabelResultType>

Defined in: src/history/interfaces/HistoryManagerInterface.ts:46

Go back to the last step and add it to the history.

Parameters

props

StepLabelProps

The step label properties.

options?

The navigation options.

steps?

number

The number of steps to go back. Must be greater than 0.

Default

1

Returns

Promise<StepLabelResultType>


canGoBack

> readonly canGoBack: boolean

Defined in: src/history/interfaces/HistoryManagerInterface.ts:62

Return true if it is possible to go back.


currentLabelHistory

> readonly currentLabelHistory: NarrationHistory[]

Defined in: src/history/interfaces/HistoryManagerInterface.ts:23

Get the history of the latest steps belonging to the current label and its child labels.

Returns

the history of the dialogues, choices and steps


diffMap

> readonly diffMap: CachedMap<number, Difference[]>

Defined in: src/history/interfaces/HistoryManagerInterface.ts:122

Map that contains all the differences between the steps in the history. The differences will be used to restore a step.

Don't edit unless you're sure what you're doing.


lastKey

> readonly lastKey: number | null

Defined in: src/history/interfaces/HistoryManagerInterface.ts:91

Get the last key (id) of the history.


narrationMap

> readonly narrationMap: CachedMap<number, NarrationHistory>

Defined in: src/history/interfaces/HistoryManagerInterface.ts:128

Map that contains all the narration history.

Don't edit unless you're sure what you're doing.


narrativeHistory

> readonly narrativeHistory: NarrationHistory[]

Defined in: src/history/interfaces/HistoryManagerInterface.ts:17

Get the narrative history.

Returns

the history of the dialogues, choices and steps


size

> readonly size: number

Defined in: src/history/interfaces/HistoryManagerInterface.ts:87

Number of items in the history.


stepLimitSaved

> stepLimitSaved: number

Defined in: src/history/interfaces/HistoryManagerInterface.ts:34

The number of steps to keep in the history into the save file.

The other older steps will be compressed will be used in HistoryManagerInterface.narrativeHistory to show the older dialogues. In the compressed steps, the canvas and storage information will be removed.

This also means that a player, after saving and loading a save, will only be able to go back to NarrationManagerInterface.stepLimitSaved steps.

If you want to keep all steps in the history, you can set this value to Infinity.


stepsInfoMap

> readonly stepsInfoMap: CachedMap<number, Omit<HistoryStep, "diff">>

Defined in: src/history/interfaces/HistoryManagerInterface.ts:115

Map that contains all information about the steps in the history.

Don't edit unless you're sure what you're doing.

Methods

add()

> add(historyInfo?, opstions?): void

Defined in: src/history/interfaces/HistoryManagerInterface.ts:71

Add a step to the history.

Parameters

historyInfo?

HistoryInfo

Info about the step to add.

opstions?

Options to add the step.

ignoreSameStep?

boolean

If true, the step will not be added to the history if the current step is the same as the last step.

Returns

void


blockGoBack()

> blockGoBack(): void

Defined in: src/history/interfaces/HistoryManagerInterface.ts:58

Block the go back function.

Returns

void


clear()

> clear(): void

Defined in: src/history/interfaces/HistoryManagerInterface.ts:83

Clear the history.

Returns

void


delete()

> delete(stepIndex): void

Defined in: src/history/interfaces/HistoryManagerInterface.ts:109

Remove a step from the history.

Parameters

stepIndex

number

The key (id) of the step to remove.

Returns

void

True if the step was removed, false if it was not found.


export()

> export(): HistoryGameState

Defined in: src/history/interfaces/HistoryManagerInterface.ts:136

Export the history to an object.

Returns

HistoryGameState

The history in an object.


get()

> get(stepIndex): NarrationHistory | undefined

Defined in: src/history/interfaces/HistoryManagerInterface.ts:103

Get a step from the history.

Note: If the step not contains any information, this method will return undefined.

Parameters

stepIndex

number

The key (id) of the step to get.

Returns

NarrationHistory | undefined

The step.


keys()

> keys(): MapIterator<number>

Defined in: src/history/interfaces/HistoryManagerInterface.ts:95

Get all the keys (id) of the history.

Returns

MapIterator<number>


removeNarrativeHistory()

> removeNarrativeHistory(itemsNumber?): void

Defined in: src/history/interfaces/HistoryManagerInterface.ts:39

Delete the narrative history.

Parameters

itemsNumber?

number

The number of items to delete. If undefined, all items will be deleted.

Returns

void


restore()

> restore(data): Promise<void>

Defined in: src/history/interfaces/HistoryManagerInterface.ts:141

Restore the history from an object.

Parameters

data

object

The history in an object.

Returns

Promise<void>