HaxeFlixel / flixel-demos

Collection of demos for HaxeFlixel
https://haxeflixel.com/demos
422 stars 291 forks source link

Prevent soft-locking in RPGInterface demo (Fixes #267) #327

Closed UncertainProd closed 6 months ago

UncertainProd commented 7 months ago

Fix for #267. For some reason, FlxUIPopup does not propagate CLICK_EVENT correctly to the parent state.

Geokureli commented 7 months ago

is this a bug with FlxUIPopup that we should fix, or normal behavior that the demo does not account for?

UncertainProd commented 7 months ago

Looking at FlxUIPopup, it looks like there's some code that forwards the CLICK_EVENT to the parent state only if one of the eventParams is either "affirm", "cancel" or "alt". But it looks like that never actually happens: https://github.com/HaxeFlixel/flixel-ui/blob/81dd17d9b2626cb85ffa0be39becb44f8f062d94/flixel/addons/ui/FlxUIPopup.hx#L200

Edit: Searching around flixel-ui for the word "affirm" it looks like the above line is the only place where it's even mentioned so its probably a bug in flixel-ui. I made a PR for it here: https://github.com/HaxeFlixel/flixel-ui/pull/259

UncertainProd commented 6 months ago

Closing this in favor of https://github.com/HaxeFlixel/flixel-ui/pull/259