Don't change frame for inanimate objects
This commit is contained in:
parent
f6552c57af
commit
de0a5b526b
3 changed files with 7 additions and 1 deletions
|
@ -99,6 +99,7 @@ public:
|
||||||
int frame = 0;
|
int frame = 0;
|
||||||
bool hFlip = false;
|
bool hFlip = false;
|
||||||
bool usingSprite;
|
bool usingSprite;
|
||||||
|
bool inanimate;
|
||||||
|
|
||||||
DraggablePixmapItem *pixmapItem = nullptr;
|
DraggablePixmapItem *pixmapItem = nullptr;
|
||||||
void setPixmapItem(DraggablePixmapItem *item) { pixmapItem = item; }
|
void setPixmapItem(DraggablePixmapItem *item) { pixmapItem = item; }
|
||||||
|
|
|
@ -26,7 +26,8 @@ Event::Event(const Event& toCopy) :
|
||||||
spriteHeight(toCopy.spriteHeight),
|
spriteHeight(toCopy.spriteHeight),
|
||||||
frame(toCopy.frame),
|
frame(toCopy.frame),
|
||||||
hFlip(toCopy.hFlip),
|
hFlip(toCopy.hFlip),
|
||||||
usingSprite(toCopy.usingSprite)
|
usingSprite(toCopy.usingSprite),
|
||||||
|
inanimate(toCopy.inanimate)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
Event::Event(QJsonObject obj, QString type) : Event()
|
Event::Event(QJsonObject obj, QString type) : Event()
|
||||||
|
@ -427,6 +428,8 @@ void Event::setFrameFromMovement(QString facingDir) {
|
||||||
// defaults
|
// defaults
|
||||||
this->frame = 0;
|
this->frame = 0;
|
||||||
this->hFlip = false;
|
this->hFlip = false;
|
||||||
|
if (this->inanimate)
|
||||||
|
return;
|
||||||
if (facingDir == "DIR_NORTH") {
|
if (facingDir == "DIR_NORTH") {
|
||||||
this->frame = 1;
|
this->frame = 1;
|
||||||
this->hFlip = false;
|
this->hFlip = false;
|
||||||
|
|
|
@ -2441,6 +2441,7 @@ void Project::loadEventPixmaps(QList<Event*> objects) {
|
||||||
object->spriteWidth = 16;
|
object->spriteWidth = 16;
|
||||||
object->spriteHeight = 16;
|
object->spriteHeight = 16;
|
||||||
object->usingSprite = false;
|
object->usingSprite = false;
|
||||||
|
object->inanimate = true;
|
||||||
QString event_type = object->get("event_type");
|
QString event_type = object->get("event_type");
|
||||||
if (event_type == EventType::Object) {
|
if (event_type == EventType::Object) {
|
||||||
object->pixmap = QPixmap(":/images/Entities_16x16.png").copy(0, 0, 16, 16);
|
object->pixmap = QPixmap(":/images/Entities_16x16.png").copy(0, 0, 16, 16);
|
||||||
|
@ -2457,6 +2458,7 @@ void Project::loadEventPixmaps(QList<Event*> objects) {
|
||||||
if (event_type == EventType::Object) {
|
if (event_type == EventType::Object) {
|
||||||
QString info_label = pointerHash[object->get("sprite")].replace("&", "");
|
QString info_label = pointerHash[object->get("sprite")].replace("&", "");
|
||||||
QStringList gfx_info = parser.readCArray("src/data/object_events/object_event_graphics_info.h", info_label);
|
QStringList gfx_info = parser.readCArray("src/data/object_events/object_event_graphics_info.h", info_label);
|
||||||
|
object->inanimate = (gfx_info.value(8) == "TRUE");
|
||||||
QString pic_label = gfx_info.value(14);
|
QString pic_label = gfx_info.value(14);
|
||||||
QString dimensions_label = gfx_info.value(11);
|
QString dimensions_label = gfx_info.value(11);
|
||||||
QString subsprites_label = gfx_info.value(12);
|
QString subsprites_label = gfx_info.value(12);
|
||||||
|
|
Loading…
Reference in a new issue