nndda / Theatre

:performing_arts: Yet another Godot (linear) dialogue addon. Written in human-readable plain text. Compatible with Godot 4.3.
https://nndda.github.io/Theatre/
MIT License
28 stars 2 forks source link

Reformat `Dialogue` syntax #4

Closed nndda closed 6 months ago

nndda commented 9 months ago

Currently Dialogue 'raw' text file use 4 space indentation to differentiate between character name, dialogue body, and function calls:

character_name
    "dialogue body goes here"
    func()

~Godot can use either tab or spaces for indentation. To avoid any conflict I think its better to use symbols/characters instead. If the whitespaces are trimmed, this also makes indentation optional.~

Maybe its better to determine wether the editor is using spaces or tabs using text_editor/behavior/indent/type

Constructing the variable with a direct string input, within a function in a script, also count the function's indents.

func _ready():
    var dlg = Dialogue.new("""
    foo:
       Hello, World!
     """)

Resulted as:

    foo:
       Hello, World!