citymania-org / grf-py

A Python framework for making NewGRFs for OpenTTD
GNU General Public License v2.0
14 stars 3 forks source link

(callback) Support more features #26

Closed ahyangyi closed 5 months ago

ahyangyi commented 6 months ago

Houses have graphics, may or may not have callbacks, and are not vehicles. Always defaulting default to self.graphics.default seems to work in all cases.

(BTW: I vaguely remember I made a similar proposal before, but I can't find it among the existing closed PRs... weird)

ldpl commented 6 months ago

That was actually changed in https://github.com/citymania-org/grf-py/commit/957c8b9cf2470109b7311c2e4d831929a60a6d51 as not all features have graphics and need individual approach. For example, industries don't have it at all. Ideally houses also need to have special graphics handling as they can have multiple tiles.

Atm CallbackManager was only really implemented for vehicles and industries.

ahyangyi commented 6 months ago

That's true, but I kind of expect CallbackManager to have some baseline support for graphics before the individual approach kicks in.

ahyangyi commented 6 months ago

Today I run into station callback problems... I think now I understand more about the issue -- there isn't a "baseline" to support, each type needs something slightly different.

But I guess I can start to try to split the is_vehicle in the function into two distinct concepts:

That wouldn't include things such as multi-tile support for big houses, though I feel it could use another PR. And I feel it's on a different abstraction level -- but it's a topic that could be saved for later.

ahyangyi commented 6 months ago

Code updated -- I think it makes more sense than my own last iteration.

ldpl commented 5 months ago

Yeah, now it looks like a step in the right direction.