Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API doc for isCollection should be collection #3543

Closed
solerante opened this issue Dec 12, 2022 · 3 comments
Closed

API doc for isCollection should be collection #3543

solerante opened this issue Dec 12, 2022 · 3 comments
Labels
bug Broken behavior.

Comments

@solerante
Copy link

Describe the bug
Tileset.isCollection returns nothing but Tileset.collection returns true or false.
https://www.mapeditor.org/docs/scripting/classes/Tileset.html#isCollection

To Reproduce
Steps to reproduce the behavior:

  1. Open a tileset
  2. execute script tiled.activeAsset.isCollection
  3. log returns an empty line

alternatively:

  1. Open a tileset
  2. execute script tiled.activeAsset.collection
  3. log returns true or false

Expected behavior
Tileset.isCollection should return true or false, or API doc should be updated to Tileset.collection

Media
Screenshot (42)

Specifications:

  • OS: Windows 10
  • Tiled Version: 1.9.2
@solerante solerante added the bug Broken behavior. label Dec 12, 2022
@eishiya
Copy link
Contributor

eishiya commented Dec 12, 2022

I imagine existing scripts that use this are more likely to be following the docs and using isCollection - if anyone had run into this issue before, they probably would've opened an issue. Plus, isCollection is consistent with isTileset, isTileMap, etc.

The name of the field for the JS side is defined here, and seems to only be used in this one line, so this is probably the easiest place to fix it.

Q_PROPERTY(bool collection READ isCollection)

@bjorn
Copy link
Member

bjorn commented Jan 13, 2023

I imagine existing scripts that use this are more likely to be following the docs and using isCollection

I think that's unlikely, because they would have noticed it isn't working. :-) Anyway, I think I'll just make both work at this point.

@bjorn bjorn closed this as completed in 18432f7 Jan 13, 2023
@eishiya
Copy link
Contributor

eishiya commented Jan 13, 2023

I imagine existing scripts that use this are more likely to be following the docs and using isCollection

I think that's unlikely, because they would have noticed it isn't working. :-) Anyway, I think I'll just make both work at this point.

My scripts use isCollection because it's in the docs and I just never tested with image collections because I don't use them myself xP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Broken behavior.
Projects
None yet
Development

No branches or pull requests

3 participants