Abilities v2, controlling hex visuals? #2469
Closed
andretchen0
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I've got a local working version of what was discussed here:
#2460
It works fine. For the moment it sends an adapter "Sprite" to
Hexthat interceptsloadTexturecalls. When aHexcallsloadTexturethe new functionality fills arrays with theHex.displayandHex.overlaytexture keys, then uses the values of those arrays to assemble a couple of large textures that represent the whole grid.Call this ensemble of arrays
GridVisuals.So far, so good.
But the reason separating
GridVisualsfromHexandHexGridis so that the game isn't tied toHexupdates for visuals. In particular, it's my goal that revamped abilities will update their own visuals and handle callbacks directly.However, simply letting any function – anywhere anytime – update
GridVisualsis ... probably not ideal.To address that, I think we create a small
GridVisualsGuardobject that holds a stack. It can offer up a "manager" interface to allow pushing and popping to the stack. And it can offer a "user" interface that makesGridVisualsavailable, but only to the top object of the stack.Hexs andHexGridcan merrily keep updating, but the updates won't have any effect unless they're at the top of the stack.Note
If I were making a game on my own, I wouldn't bother with the
GridVisualsGuard. But given that lots of people update this project, it's probably not a bad idea to do some defensive coding here.Thoughts?
Objections, opinions, etc.?
Beta Was this translation helpful? Give feedback.
All reactions