FyroxEngine / Fyrox

3D and 2D game engine written in Rust
https://fyrox.rs
MIT License
7.69k stars 348 forks source link

Button not triggering `on_ui_message` #536

Closed bocksdin closed 1 year ago

bocksdin commented 1 year ago

Title.

Followed this piece of code, as well as the comment in the Button.rs engine file: https://fyrox-book.github.io/fyrox/ui/button.html

on_ui_message never triggers.

My code: https://github.com/RoryLetteney/crab-clicker/blob/main/game/src/lib.rs

Engine version 0.30.0

mrDIMAS commented 1 year ago

Hi! You need to put this block of code https://github.com/RoryLetteney/crab-clicker/blob/main/game/src/lib.rs#L120-L138 into this https://github.com/RoryLetteney/crab-clicker/blob/main/game/src/lib.rs#L194 method. Now you have just a standalone method that is never called, I'm pretty sure that the compiler warns you about this.

bocksdin commented 1 year ago

Ah, don't know how I didn't see that in the Plugin. I'll open a PR to fix the Fyrox Book then. Thank you.