adapap / OWScript

Python-like scripting language which transpiles into Overwatch Workshop script rulesets.
MIT License
37 stars 2 forks source link

Allow empty strings combinations #38

Closed netux closed 4 years ago

netux commented 4 years ago

This allows for strings like:

I tested this with the following code:

const ss = [
    `Hello`,
    `Hello `,
    ` Hello`,
    ` Hello `,
    `Hello {}`(0),
    `Hello / {} - Goodbye`(0),
    ``,
    ` `,
    `  `,
    `   `,
    ` {} `(0),
    `Hello:Goodbye`,
    `Hello::Goodbye`,
    `Hello:::Goodbye`,
    `Hello   / `,
    `#     `,
    `Round      `,
    `-> `,
    `¡ !`
]

Rule "Empty strings"
    Event
        Ongoing - Global
    Actions
        for s in ss:
            Create HUD Text(Everyone, s, null, null, Left, 1, White, White, White, Visible To And String)

which in game looked like this: image

If anyone finds a strings that don't parse correctly, let me know.