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

Attempt to fix changing sprites of certain objects in editor #1964

Merged
merged 6 commits into from Dec 19, 2021

Conversation

Semphriss
Copy link
Member

Fixes #1961

Or rather, should.

Please test this PR to ensure that all objects are indeed fixed.

@HybridDog The rublight's settings builder pulls from grandparent MovingObject instead of parent MovingSprite; was it intended to be that way? It seems like an accident, but I don't want to risk introducing unintended side effects.
image

Important notes

  • Spotlight currently cannot have its sprite changed because it is composed of several layers of different sprites; it would need to be refactored before supporting sprite changing. I did not do it in this PR because I wanted to stick to simple bugfixes strictly, to have it merged in time for 0.6.3 if possible (and to avoid introducing new bugs, as much as possible).

@Narre
Copy link
Contributor

Narre commented Dec 17, 2021

I had a quick look (but I didn't test everything thoroughly). This is what noticed:

  • The editor now renders Ice Flames as regular flames by default, even though the game doesn't.
  • Same for leafshot - the editor renders them as kamikazesnowballs, the game doesn't. I think these are probably caused by the editor defaulting to a different sprite than the game when no sprite is actually set in the *.stl/stwm file.
  • Decal still doesn't update its hitbox after a sprite change

image
I don't know exactly what you meant by this, but flames, iceflames and ghostflames are not just retextures, they have different behaviours to fire/ice flowers.

  • So the sprite of ghost flames should still be settable. The user might have their own sprite for an addon and may not want their flames to be killable with the iceflower(flame) or fireflower(iceflame).

@Semphriss
Copy link
Member Author

@Narre I've updated the PR to include those changes. Big thanks for the catch about flames, I wasn't aware of that!

Could you (or anyone familiar with C++) review my modifications with the #include's in the flame files? Since I removed some stuff to make it more flexible, I saw I could simplify the whole thing, but I'm not sure if my edits are optimal, so I'd like to be reviewed on this by someone, if possible.

@Narre
Copy link
Contributor

Narre commented Dec 17, 2021

I tested it and it all seems to be working correctly :)

As for the review, I'm only just beginning with C++, I've only ever worked in C nonplusplus (and in no large projects) before, so I don't dare to comment on any C++ code. You'll have to ask someone else about that.

@Narre
Copy link
Contributor

Narre commented Dec 17, 2021

Just one more thing - please remove the ability to change the sprite of worldmap-spawnpoint. Spawnpoints can't be rendered and setting their sprite just crashes the game.

@tobbi tobbi merged commit def597f into SuperTux:master Dec 19, 2021
@HybridDog
Copy link
Contributor

The rublight's settings builder pulls from grandparent MovingObject instead of parent MovingSprite; was it intended to be that way?

If I remember correctly, it wasn't intentional.

@HybridDog HybridDog removed their request for review December 19, 2021 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Object sprite changes don't update unless editor is reloaded
4 participants