(minor) sprite object enabled in collection
This commit is contained in:
parent
494658e5c3
commit
f2eaee95ec
|
@ -1,3 +1,4 @@
|
|||
#pragma once
|
||||
#include "Common.h"
|
||||
#include <list>
|
||||
#include "UI.h"
|
||||
|
@ -9,4 +10,4 @@ class Resources
|
|||
public:
|
||||
static sf::Font font;
|
||||
static GameEngine* game;
|
||||
};
|
||||
};
|
||||
|
|
14
src/UI.h
14
src/UI.h
|
@ -1281,8 +1281,10 @@ switch (target->derived_type()) \
|
|||
|
||||
// this would be a great use case for .tp_base
|
||||
if (!PyObject_IsInstance(o, (PyObject*)&PyUIFrameType) &&
|
||||
//!PyObject_IsInstance(o, (PyObject*)&PyUISpriteType) &&
|
||||
!PyObject_IsInstance(o, (PyObject*)&PyUICaptionType))
|
||||
!PyObject_IsInstance(o, (PyObject*)&PyUISpriteType) &&
|
||||
!PyObject_IsInstance(o, (PyObject*)&PyUICaptionType) // &&
|
||||
//!PyObject_IsInstance(o, (PyObject*)&PyUIGridType)
|
||||
)
|
||||
{
|
||||
PyErr_SetString(PyExc_TypeError, "Only Frame, Caption, Sprite, and Grid objects can be added to UICollection");
|
||||
return NULL;
|
||||
|
@ -1298,9 +1300,11 @@ switch (target->derived_type()) \
|
|||
PyUICaptionObject* caption = (PyUICaptionObject*)o;
|
||||
self->data->push_back(caption->data);
|
||||
}
|
||||
//if (PyObject_IsInstance(o, (PyObject*)&PyUISpriteType))
|
||||
//{
|
||||
//}
|
||||
if (PyObject_IsInstance(o, (PyObject*)&PyUISpriteType))
|
||||
{
|
||||
PyUISpriteObject* sprite = (PyUISpriteObject*)o;
|
||||
self->data->push_back(sprite->data);
|
||||
}
|
||||
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
|
|
Loading…
Reference in New Issue