Closed ahyangyi closed 8 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.
That's true, but I kind of expect CallbackManager to have some baseline support for graphics before the individual approach kicks in.
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:
has_purchase
for things that have a separate "on purchase" stage -- vehicles, stations, objects & road stopshas_graphics
for things that use action 3 to default to a graphic layout -- vehicles, houses, industry tiles, and a few other thingsThat 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.
Code updated -- I think it makes more sense than my own last iteration.
Yeah, now it looks like a step in the right direction.
Houses have graphics, may or may not have callbacks, and are not vehicles. Always defaulting
default
toself.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)