Skip to content

Commit

Permalink
Python plugin: Added missing values to MapObject.Shape enum
Browse files Browse the repository at this point in the history
Closes #2898
  • Loading branch information
bjorn committed Sep 29, 2020
1 parent a75e8b9 commit ba6cdd8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions src/plugins/python/pythonbind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7595,6 +7595,18 @@ inittiled_Tiled(void)
tmp_value = PyLong_FromLong(Tiled::MapObject::Polyline);
PyDict_SetItemString((PyObject*) PyTiledMapObject_Type.tp_dict, "Polyline", tmp_value);
Py_DECREF(tmp_value);
// Tiled::MapObject::Ellipse
tmp_value = PyLong_FromLong(Tiled::MapObject::Ellipse);
PyDict_SetItemString((PyObject*) PyTiledMapObject_Type.tp_dict, "Ellipse", tmp_value);
Py_DECREF(tmp_value);
// Tiled::MapObject::Text
tmp_value = PyLong_FromLong(Tiled::MapObject::Text);
PyDict_SetItemString((PyObject*) PyTiledMapObject_Type.tp_dict, "Text", tmp_value);
Py_DECREF(tmp_value);
// Tiled::MapObject::Point
tmp_value = PyLong_FromLong(Tiled::MapObject::Point);
PyDict_SetItemString((PyObject*) PyTiledMapObject_Type.tp_dict, "Point", tmp_value);
Py_DECREF(tmp_value);
}
{
PyObject *tmp_value;
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/python/tiledbinding.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def _decorate(obj, *args, **kwargs):
cls_mapobject.add_constructor([])
cls_mapobject.add_constructor([('QString','name'), ('QString','type'),
('QPointF','pos'), ('QSizeF','size') ])
cls_mapobject.add_enum('Shape', ('Rectangle','Polygon','Polyline'))
cls_mapobject.add_enum('Shape', ('Rectangle','Polygon','Polyline','Ellipse','Text','Point'))
cls_mapobject.add_method('setPosition', None, [('QPointF','pos')])
cls_mapobject.add_method('x', 'double', [])
cls_mapobject.add_method('setX', None, [('double','x')])
Expand Down

0 comments on commit ba6cdd8

Please sign in to comment.