Scripting: TileLayerEdit.setTile() is affected by current selection
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 12.9k
- Forks
- 2k
- Avg merge
- 4h 27m
- Merged PRs (30d)
- 8
Description
If the current map has any tiles selected, `TileLayerEdit.setTile()` will only work within the selection, and will not change any tiles outside the selection. This means that it is necessary to clear the user's selection when it isn't relevant to the script's action. Scripts should not have to do that.
I expect `setTile()` to set the tile, nothing more, nothing less. Its documentation does not state anything else. It also ignores layer lock status, as it should! It should be up to scripts to respect restrictions like locks and selections.
That said, a version of `setTile()` that *does* automatically respect selections (and layer locks!) could be convenient too, as a separate function that returns `true` when it set the tile and `false` when it did not.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the TileLayerEdit.setTile() implementation and its documentation, then inspect any nearby scripting tests for how selection state is applied. Done means setTile() changes the requested tile regardless of the current selection, while preserving the documented behavior and adding coverage for selected and unselected tiles.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- game-dev, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100