Class: NarrationManagerStatic
Defined in: src/narration/NarrationManagerStatic.ts:27
Properties
_stepCounter
> static _stepCounter: number = 0
Defined in: src/narration/NarrationManagerStatic.ts:202
choiceMadeTemp
> static choiceMadeTemp: number | undefined = undefined
Defined in: src/narration/NarrationManagerStatic.ts:29
lastHistoryStep
> static lastHistoryStep: Omit<HistoryStep, "diff"> | null = null
Defined in: src/narration/NarrationManagerStatic.ts:30
onLabelStarting?
> static optional onLabelStarting?: (labelId, props, options, defaultStart) => StepLabelResultType | Promise<StepLabelResultType>
Defined in: src/narration/NarrationManagerStatic.ts:369
Is a function that will be executed every time a label is about to be started, either via
call or jump (this includes labels started through a choice of type "call" or "jump").
By default (when this is not set), the label is started immediately, exactly like before this
hook existed. If you set it, you take control: call defaultStart() yourself whenever you want
the label to actually run (right away, or later, e.g. from a subsequent next()-like action in
your template). Until defaultStart() is called, nothing about the label happens: it is not
added to the history and no step of it runs.
Parameters
labelId
string
props
StepLabelProps
options
choiceMade?
number
closeCurrentLabel?
boolean
type
string
defaultStart
() => Promise<StepLabelResultType>
Returns
StepLabelResultType | Promise<StepLabelResultType>
onLoadingLabel?
> static optional onLoadingLabel?: (stepId, label) => void | Promise<void>
Defined in: src/narration/NarrationManagerStatic.ts:357
Parameters
stepId
number
label
LabelAbstract<any>
Returns
void | Promise<void>
onStepEnd?
> static optional onStepEnd?: (stepId, label) => void | Promise<void>
Defined in: src/narration/NarrationManagerStatic.ts:358
Parameters
stepId
number
label
LabelAbstract<any>
Returns
void | Promise<void>
Accessors
_currentLabel
Get Signature
> get static _currentLabel(): Label<{ }> | undefined
Defined in: src/narration/NarrationManagerStatic.ts:223
Returns
Label<{ }> | undefined
allChoicesMade
Get Signature
> get static allChoicesMade(): ChoicesMadeType[]
Defined in: src/narration/NarrationManagerStatic.ts:187
is a list of all choices made by the player during the progression of the steps.
Returns
ChoicesMadeType[]
Set Signature
> set static allChoicesMade(value): void
Defined in: src/narration/NarrationManagerStatic.ts:195
Parameters
value
ChoicesMadeType[]
Returns
void
allOpenedLabels
Get Signature
> get static allOpenedLabels(): AllOpenedLabelsType
Defined in: src/narration/NarrationManagerStatic.ts:35
is a list of all labels that have been opened during the progression of the steps. the key is the label id and the biggest step opened.
Returns
AllOpenedLabelsType
Set Signature
> set static allOpenedLabels(value): void
Defined in: src/narration/NarrationManagerStatic.ts:43
Parameters
value
AllOpenedLabelsType
Returns
void
currentLabelId
Get Signature
> get static currentLabelId(): string | undefined
Defined in: src/narration/NarrationManagerStatic.ts:232
currentLabelId is the current label id that occurred during the progression of the steps.
Returns
string | undefined
currentLabelStepIndex
Get Signature
> get static currentLabelStepIndex(): number | null
Defined in: src/narration/NarrationManagerStatic.ts:242
Returns
number | null
onStepStart
Get Signature
> get static onStepStart(): ((stepId, label) => Promise<void[]>) | undefined
Defined in: src/narration/NarrationManagerStatic.ts:343
Returns
((stepId, label) => Promise<void[]>) | undefined
Set Signature
> set static onStepStart(value): void
Defined in: src/narration/NarrationManagerStatic.ts:337
Parameters
value
(stepId, label) => void | Promise<void>
Returns
void
openedLabels
Get Signature
> get static openedLabels(): OpenedLabel[]
Defined in: src/narration/NarrationManagerStatic.ts:210
Returns
Set Signature
> set static openedLabels(value): void
Defined in: src/narration/NarrationManagerStatic.ts:213
Parameters
value
Returns
void
originalOpenedLabels
Get Signature
> get static originalOpenedLabels(): OpenedLabel[]
Defined in: src/narration/NarrationManagerStatic.ts:217
Returns
Set Signature
> set static originalOpenedLabels(value): void
Defined in: src/narration/NarrationManagerStatic.ts:220
Parameters
value
Returns
void
Methods
addChoicesMade()
> static addChoicesMade(label, stepIndex, stepSha, choiceMade): void
Defined in: src/narration/NarrationManagerStatic.ts:269
Parameters
label
string
stepIndex
number
stepSha
string
choiceMade
number
Returns
void
addLabelHistory()
> static addLabelHistory(label, stepIndex): void
Defined in: src/narration/NarrationManagerStatic.ts:260
Add a label to the history.
Parameters
label
string
The label to add to the history.
stepIndex
number
The step index of the label.
Returns
void
getCurrentStepTimesCounter()
> static getCurrentStepTimesCounter(nestedId?): number
Defined in: src/narration/NarrationManagerStatic.ts:110
Parameters
nestedId?
string = ""
Returns
number
getCurrentStepTimesCounterData()
> static getCurrentStepTimesCounterData(nestedId?): CurrentStepTimesCounterMemotyData | null
Defined in: src/narration/NarrationManagerStatic.ts:50
Parameters
nestedId?
string = ""
Returns
CurrentStepTimesCounterMemotyData | null
getRandomNumber()
> static getRandomNumber(min, max, options?): number | undefined
Defined in: src/narration/NarrationManagerStatic.ts:126
Parameters
min
number
max
number
options?
nestedId?
string
onceOnly?
boolean
Returns
number | undefined
increaseCurrentStepIndex()
> static increaseCurrentStepIndex(): void
Defined in: src/narration/NarrationManagerStatic.ts:319
Increase the current step index of the current label.
Returns
void
increaseStepCounter()
> static increaseStepCounter(): void
Defined in: src/narration/NarrationManagerStatic.ts:206
Increase the last step index that occurred during the progression of the steps.
Returns
void
pushNewLabel()
> static pushNewLabel(label): void
Defined in: src/narration/NarrationManagerStatic.ts:301
Add a label to the history.
Parameters
label
string
The label to add to the history.
Returns
void
Throws
when the label is not found in the registered labels.
resetCurrentStepTimesCounter()
> static resetCurrentStepTimesCounter(nestedId?): void
Defined in: src/narration/NarrationManagerStatic.ts:161
Parameters
nestedId?
string = ""
Returns
void