-
Notifications
You must be signed in to change notification settings - Fork 439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Debugger: add "FlxObjects-are-draggable"-mode #1862
Conversation
It's no longer a plugin, lots of things are missing and it's not working (it crashes). It compiles without errors though :D
From now on, all tools have access to the list of selected items.
It should allow the interactive debug to continue to work even when a replay is being played.
On Neko, Mode seems to crash immediately:
|
The UI is a bit confusing to me. 100% alpha seems to mean that the tool is not active, while a lowered alpha means that the tool is active? I'd have expected this to behave the other way around, similar to the debugger window toggle buttons. I'm also not sure how it makes sense that multiple tools can be selected at once. I haven't really been able to make the eraser work. And the cursor only ever seems to change to the first tool? It also seems like whenever the cursor changes to the first tool, the system cursor is also shown, which is distracting because of the mouse lag. |
I wouldn't worry about documentation too much. These are just internal debugger methods (not public API), there isn't a whole lot to be documented about them as long as they are aptly named. |
I forgot to check Neko (and all other platforms but Flash). I'm sorry, single platform habit. I will fix the problem.
Yeah, the UI is not final. I want to replace the current alpha buttons with "real" buttons (the ones with background, border, etc). I think it will make everything easier to understand/use. I will only go for that if you approve the idea of a toolbar.
Those are all bugs that I will fix after we decide on the use of a toolbar or not.
Hum, I need to add some custom mouse handling code to the debugger to fix that (as we previously discussed). |
As a consequence, cursor movements during debug interactions will not be affected by changes made to in-game cursor, such as when it is updated by VCR.
It should drastically improve the tool performance when there are lots of invisible things on the screen (e.g. a pool of dead particles).
I've made the changes you asked for, @Gama11
Some thoughts:
I would rather like to gradually add the actions window and the tile tool in the future using dedicated PRs than continue to bloat this PR here. What do you think? |
Makes sense, I prefer small PRs anyway. |
Great! I will wait for any issues with this PR then. I will work on the new tools after it gets merged. |
I feel like at this point, this is polished enough to be merged - thanks for the amazing contribution! 👍 Without knowing the keyboard shortcut(s), it's a bit cumbersome right now, so it'd be nice to have tooltips or somethings as hints. Of course, that'd require implementing tooltips for the debugger first.. :D The need to counteract the velocities of moving objects also bothers me a bit when using this in Mode. Minor polish issue: there's a fraction of a second at startup, at least on Flash, where the "move" cursor is visible instead of Mode's default cursor. It would be nice if the new functionality could be documented here: http://haxeflixel.com/documentation/debugger/ (sources are located in the flixel-docs repo, you can also click "Edit" in the upper right). Note that this should target the |
see #1862 - use for-each loops - replaced selectedItems with a FlxTypedGroup<FlxObject> - make use of (default, null) properties - invert if-statements to reduce nesting - remove empty doc comments
I did a bit of code cleanup. I hope I didn't break anything in the process. Your code is quite consistent and clean (I also like the architecture), but a bit AS3-y. ;) |
Thank you for all the guidance! It's a pleasure to contribute to HaxeFlixel 😄 🎉
Agreed! I am planning to give UX a bit of love in the upcoming interactions (e.g. animated, dashed line for selected items, better handling of clicks to prevent unselecting things by accident, probably a Ctrl+Z functionality). I will add tooltips to that list too.
You can avoid that by using the "pause" button of VCR. I will add that info to the docs.
I will check on that.
Sure! I think I could write the docs as a mini tutorial, with small gifs explaining each tool and how they can be used. How about that? Additionally since more things will be added in the future (e.g. the tile tool), I suggest we create a separate page for interactive debug, otherwise http://haxeflixel.com/documentation/debugger/ will get a lot of text and images. Just let me know how you prefer it.
I've made some tests and everything looks ok.
Thanks! I've carefully inspected your changes (sorry about giving you that much work!) and will adherence to that in the future. About the AS3-y, I'm still migrating to Haxe 😄 |
Looking forward to it.
Yeah, I noticed that that's working now, great work on that. :) Definitely something that should be noted in the docs.
Sounds very sensible, that page is already fairly long.
Awesome!
Please don't apologize for contributing! Besides, it's my problem if I'm this obsessed about code style. ;) |
Ok, awesome! I will start working on the docs soon.
You have to be this obsessed, otherwise we will end up with a mess at the end of the day :D |
Something you should probably know, since it's bitten me a few times: OpenFL has a bit of code in its externs that leads to what would otherwise have been a compiler error being a runtime error (for field access of To fix this, go to implements #if flash Dynamic #else Dynamic<DisplayObject> #end |
Ok, thanks for the heads up! |
When my game first starts up (flash target, haven't tried others), the cursor is the drag one instead of the regular one. It seems like it resolves itself by frame 2, but it's apparent for me because my frame 1 takes a while with random generation. |
I will check on that @MSGhero, thanks for the heads up. |
I actually just fixed that: 80cd87f |
see HaxeFlixel#1862 - use for-each loops - replaced selectedItems with a FlxTypedGroup<FlxObject> - make use of (default, null) properties - invert if-statements to reduce nesting - remove empty doc comments
This pull request contains a port of Flixel community's interactive debug feature. The new "interactive debug" mode can be activated by clicking the pencil icon at the top of the debugger.
Available tools (functionalities) during interaction:
This implementation has the idea of a toolbar (appears at the left of the screen when the interactive debug is activated). I am waiting for feedback on this. If you guys like the idea, I can fix any bugs and improve the toolbar (make it look more like a toolbar), otherwise I can remove it all together.
I implemented the toolbar because I envision more tools in the future, like a tile manipulator, rotation, etc.
_NOTICE_: a lot of the methods I created are not documented. I will add documentation after the review process has settled all details/changes.
Here is a gif of the whole thing working: