I have some overlay buttons inside a node bundle on top of my core game loop. I allow interaction with the world map by getting the global x/y of the click. If players click an overlay ui button it interacts with the button and ALSO the global click in the game.
Any clean solutions to prevent this from happening? (without a bunch of if conditions to see if the click was first a ui click) * but maybe this is also the cleanest solution?
Another idea I had would be to get a local x/y on screen or a rect of where the ui buttons are and prevent world map interactions when clicks are detected in that area, but that seems hacky and troublesome if the ui is dynamic. Perhaps it's easy to get the rect of a node bundle so this is less troublesome? I ideally don't want to portion off the game map into a smaller rectangle, I like the look and feel of the ui buttons going overtop to allow more real estate in the game.
Open to any ideas. Thanks!