Files
gymkhana-actions/docs/api/ESCDialog.md
Dennis Ploeger 1f28fdc8f3 feat: Implemented all dialog features. Fixes #345 (#376)
Co-authored-by: Dennis Ploeger <develop@dieploegers.de>
Co-authored-by: dploeger <dploeger@users.noreply.github.com>
2021-08-27 08:15:52 +02:00

1.2 KiB

ESCDialog

Extends: ESCStatement < Object

Description

An ESC dialog

Constants Descriptions

END_REGEX

const END_REGEX: String = "^(?<indent>\\s*)!.*$"

A Regex that matches the end of a dialog

REGEX

const REGEX: String = "^(\\s*)\\?( (?<avatar>[^ ]+))?( (?<timeout>[^ ]+))?( (?<timeout_option>.+))?$"

Regex that matches dialog lines

Property Descriptions

avatar

var avatar: String = "-"

Avatar used in the dialog

timeout

var timeout: int = 0

Timeout until the timeout_option option is selected. Use 0 for no timeout

timeout_option

var timeout_option: int = 0

The dialog option to select when timeout is reached

options

var options: Array

A list of ESCDialogOptions

Method Descriptions

_init

func _init(dialog_string: String)

Construct a dialog from a dialog string

is_valid

func is_valid() -> bool

Check if dialog is valid

run

func run()

Run this dialog