HaxeFlixel / flixel

Free, cross-platform 2D game engine powered by Haxe and OpenFL
https://haxeflixel.com/
MIT License
1.97k stars 434 forks source link

Add disabled status to FlxButton #3087

Closed itulau closed 6 months ago

itulau commented 6 months ago

Implements a DISABLED status for FlxButton. When a FlxButton is in this state mouse and input overlap will be ignored.

Small demo on which I tested this feature demo-disabled-flxbutton.zip

Tested on HTML5 and Linux, which are the only platforms I currently got working Flixel in general. demo

Closes #3083

Note: sprite "highlighted" status looks different for some reason in the preview, but compared side by side in Aseprite and they are the same.

Geokureli commented 6 months ago

Can you check flixel-ui and see if things that extend FlxButton don't break with normal use?

Geokureli commented 6 months ago

I tested this with Flixel-ui on a couple demos, no issues, I added FlxButtonState, which will cause some deprecation warnings on flixel-ui and flixel-addons, I have changes prepared on those repos to fix this

CI is gonna fail, until the change to flixel-ui is merged and vice versa, so don't worry about that

https://github.com/HaxeFlixel/flixel-ui/pull/271

itulau commented 6 months ago

uh oh, ok!

I was checking flixel-ui myself and I've noticed a few things that needed to change to accomodate for this new status, but I didn't have the time to test them out

https://github.com/itulau/flixel-ui/commit/601bf1fe0c2cacc0bdf0773a4d9606c134f158f7

Geokureli commented 6 months ago

HaxeFlixel/flixel-ui@e0ac95a

these are still valid changes, you'll just have to wait for a couple PRs. Also, we'll need to make sure that 4 button graphics in flixel-ui work with older flixel versions, which should be pretty easy

itulau commented 6 months ago

Ok, ping me when I can I open a PR to merge such changes. Or you prefer I open it right now and we handle it from there?

Geokureli commented 6 months ago

Ok, ping me when I can I open a PR to merge such changes. Or you prefer I open it right now and we handle it from there?

Flixel-ui is ready, be sure to backmerge dev into your branch

Geokureli commented 6 months ago

uh oh, ok!

I was checking flixel-ui myself and I've noticed a few things that needed to change to accomodate for this new status, but I didn't have the time to test them out

itulau/flixel-ui@601bf1f

Also @itulau be sure to use feature branches rather than your itulau/dev branch, this makes things a little easier for me when I'm inspecting contributions

itulau commented 6 months ago

uh oh, ok!

I was checking flixel-ui myself and I've noticed a few things that needed to change to accomodate for this new status, but I didn't have the time to test them out

itulau/flixel-ui@601bf1f

Also @itulau be sure to use feature branches rather than your itulau/dev branch, this makes things a little easier for me when I'm inspecting contributions

Yes, don't worry. I pushed the changes to my dev branch by mistake in a rush, but I'll be sure to use a feature branch like this PR.