Grimmys / rpg_tactical_fantasy_game

A tactical turn-based game project in pygame, open to support
GNU General Public License v3.0
405 stars 85 forks source link

Buttons linked to callable #42

Closed Grimmys closed 3 years ago

Grimmys commented 3 years ago

Currently, the clicks on the buttons are really complex: at each button an id is associated, which is associated to a specific menu. The button returns the id (and some optional arguments), and then the active scene reads the id to know which statements should be executed, using eventually the optional arguments if necessary.

This PR replaces this whole system by simply attach a callback to each button. This callback is executed on click, and that's it.