sprig icon indicating copy to clipboard operation
sprig copied to clipboard

Map editor generates invalid syntax with sprites with backtick key

Open MacaylaMarvelous81 opened this issue 1 year ago • 1 comments

Describe the bug When a sprite with a backtick (`) as its key is placed using the map editor, the editor places the backtick unescaped, ending the string literal causing invalid syntax which is not obvious until closing the map editor.

To Reproduce Steps to reproduce the behavior:

  1. Add a sprite with a backtick as a key to the legend
  2. Add the sprite to a map in the map editor

Expected behavior The sprite is placed on the map without breaking syntax, possibly through escaping the backtick.

Actual behavior
The backtick is placed in string and terminates the string early.

Screenshots

https://github.com/user-attachments/assets/efd36695-f586-497f-a4b7-77726b619ff2

Since escaping characters means that 1 character may not always = 1 tile, it might be better to just prevent using backtick for a sprite key.

(A separate issue where the map clicked on to edit is not the one that ends up being edited is also exhibited in the video but is not the subject of this issue.)

MacaylaMarvelous81 avatar Sep 05 '24 04:09 MacaylaMarvelous81