Files
gymkhana-actions/docs/api/ESCDialog.md
Dennis Ploeger 58d880101d Optimized Docs (#7)
Authored-by: Dennis Ploeger <develop@dieploegers.de>
2021-06-22 23:06:20 +02:00

1.3 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*)\\?( (?<type>[^ ]+))?( (?<avatar>[^ ]+))?( (?<timeout>[^ ]+))?( (?<timeout_option>.+))?$"

Regex that matches dialog lines

Property Descriptions

type

var type: String = ""

Dialog type FIXME, currently unused, but needs reimplementation

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

Dialogs have no conditions, just return true

run

func run()

Run this dialog