Skip to content

Commit

Permalink
Scripting: Added Tileset.isCollection to replace Tileset.collection
Browse files Browse the repository at this point in the history
The documentation mentioned a Tileset.isCollection property, but actually
the property was called Tileset.collection.

Fixed by adding Tileset.isCollection and deprecating Tileset.collection,
since the former matches the naming style for boolean properties.

Closes #3543
  • Loading branch information
bjorn committed Jan 13, 2023
1 parent 17cd449 commit 18432f7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* Scripting: Allow assigning null to Tile.objectGroup (by Logan Higinbotham, #3495)
* Scripting: Allow changing the items in a combo box added to a dialog
* Scripting: Fixed painting issues after changing TileLayer size (#3481)
* Scripting: Renamed Tileset.collection to Tileset.isCollection (#3543)
* Defold plugin: Allow overriding z value also when exporting to .collection (#3214)
* Qt 6: Fixed invisible tileset tabs when only a single tileset is open
* Fixed positioning of point object name labels (by Logan Higinbotham, #3400)
Expand Down
9 changes: 9 additions & 0 deletions docs/scripting-doc/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2968,6 +2968,15 @@ declare class Tileset extends Asset {

/**
* Whether this tileset is a collection of images (same as checking whether image is an empty string).
*
* @deprecated Use {@link isCollection} instead.
*/
readonly collection : boolean

/**
* Whether this tileset is a collection of images (same as checking whether image is an empty string).
*
* @since 1.10
*/
readonly isCollection : boolean

Expand Down
3 changes: 2 additions & 1 deletion src/tiled/editabletileset.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ class EditableTileset : public EditableAsset
Q_PROPERTY(Orientation orientation READ orientation WRITE setOrientation)
Q_PROPERTY(QColor transparentColor READ transparentColor WRITE setTransparentColor)
Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor)
Q_PROPERTY(bool collection READ isCollection)
Q_PROPERTY(bool collection READ isCollection) // deprecated
Q_PROPERTY(bool isCollection READ isCollection)
Q_PROPERTY(QList<QObject*> selectedTiles READ selectedTiles WRITE setSelectedTiles)

public:
Expand Down

0 comments on commit 18432f7

Please sign in to comment.