Skip to content
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

Fix issue 206 #215

Closed
wants to merge 53 commits into from
Closed

Fix issue 206 #215

wants to merge 53 commits into from

Conversation

Dovyski
Copy link
Member

@Dovyski Dovyski commented Aug 4, 2014

The interactive debug plugin is usable. Even though some code comments and docs are missing, I created this pull request to receive some feedback about the code and the plugin usability. I want to write some more docs before this gets merged.

If you are going to test it, here's a mini howto:

  • The plugin comes disabled by default. Enable it by calling FlxG.addPlugin(new InteractiveDebug()); during create() of any game state;
  • The same key that opens Flixel's debug overlay will open the plugin tools too. Make sure FlxG.debug is true.
  • Use the pointer tool to select things (hold the Ctrl key to select more than one element at time). Selected elements can be moved around using the move tool or using the pointer tool while holding Shift. Selected elements can be kille()d by clicking the eraser tool or by pressing the Delete key (Shit+delete will remove the selected elements from Flixel rendering list);

I've made a few tests using the game Mode, by Adam.

I don't know why, but the commit log shows more commits than I added myself. There are commits by @IQAndreas, for instance that's because I created a pull request against master. I will change that before merging.

Fix: #206

IQAndreas and others added 30 commits November 23, 2013 10:56
As we are using odd numbers for dev versions and even numbers for
release versions, this will eventually merge into master as v2.58.
Replaced flixelcommunity.github.com with flixelcommunity.org.
Edited both package names and import statements so that they now point
to the correct, new locations of the classes. Some import statements
were removed since classes now shared the same package, other import
statements had to be added since the classes were no longer in the same
package.

Had to change the following properties from `internal` to `protected`
after the classes that used them had to change package:

 * Input::_lookup
 * Input::_map
 * Input::_total

Had to change the following properties from `internal` to `public`
after the classes that used them had to change package:

 * FlxBasic._ACTIVECOUNT
 * FlxBasic._VISIBLECOUNT
Sadly, the paths are relative, but at least they are reliable.
Also updated any references to the class.
Organize Flixel into packages

Fixes FlixelCommunity#194

* Change main package from `org.flixel` to just `flixel`
* Organize Flixel's classes into several, more logically organized packages
* Rename `FlxAnim` to `FlxAnimation`
Basic framework set up; more to come!
Also added a slight notice at the top crediting the sources for most of
the code.
Also added more arguments to some of the existing functions.

I think I'm almost satisfied with this class now.
Plus some slight bug fixing (also removed two "untyped" warnings that I
missed). Pretty good turnout for a class I didn't test before
committing.
I didn't delete them, just moved them "out of the way" and added a
`@deprecated` flag, as well as a warning every time someone tries to
access them (see `FlxG.warnDeprecated()`).
Also did some performance tweaking, and in some cases, cut out large
chunks simply for the sake of clarity, nothing more.
Apparently, you can't have anything after the @see (or any other
@something) variables.

Second, the ASDoc compiler doesn't like the less than or greater than
symbols.
Add 'FlxRandom' pseudo-random number generator
They weren't due to me previously having stored the entire project on an external NTFS harddrive,
which obviously didn't support Linux's permissions system, but instead treated every file as
having 755 permissions.

It is fixed now. :)
Realized this was required when I tried to generate the documentation
for [Flixel Power Tools](https://github.com/FlixelCommunity/Flixel-
Power-Tools/).
Changed permissions to 755
The `generate-asdoc.sh` script now allows for a `lib` folder.
FlxU.rotatePoint() -> FlxPoint.rotate()
FlxU.getAngle()    -> FlxPoint.angleBetwee()
FlxU.getDistance() -> FlxPoint.distance()
`FlxMath` is a new Math class which is not dependent on any target
platform.

FlxU.abs()   -> FlxMath.abs()
FlxU.floor() -> FlxMath.floor()
FlxU.ceil()  -> FlxMath.ceil()
FlxU.round() -> FlxMath.round()
FlxU.min()   -> FlxMath.min()
FlxU.max()   -> FlxMath.max()
FlxU.bound() -> FlxMath.clamp()
FlxU.getTicks() -> FlxG.getTicks()

Also removed obsolete ASDoc comment.
Also includes some slight canges to the arguments (instead of
automatically retrieving the time elapsed from FlxG, users are required
to include that information as an argument.)

Also updated any references that were still using the old version.

    FlxU.computeVelocity() -> FlxMath.computeVelocity()
FlxG.signals is already working. Right now it only has a single signal (reset), dispatched when FlxG.resetGame() is called.
The TimeManager plugin is now based on the new plugin architecture. It uses signals to monitor state switches.

The signal "beforeStateSwitch" was added to FlxG.signals. It is dispatched when the current state is about to be destroyed and the new state is about to be assigned as the current state.
The "postDraw" signal is dispatched after the current state has been drawn. The "preUpdate" signal is dispatched before Flixel updates the current state (and its children).

Those are the signals plugins should subscribe to in order to draw on the screen or update itself along with Flixel.

DebugPathDisplay and TimerManager have been refactored to rely on those signals.
Plugins were required to extend FlxBasic, but that makes not much sense since plugins were never added to the state display list. I've created FlxPlugin, a simple interface that makes more sense to me.

Right now the only required method plugins must implement is destroy(), which is not being invoked, by the way.
I just moved all replay code from one place to another. It compiles, but it's not working. The VCR code was slightly modified, but it remains in place.
The code is a mess with hacks everywhere, but I was able to save a replay session, load and play it. Best of all, it WORKED! HA! The VRC UI is not updating, I didn't test pausing/resuming/stopping the replay.
Dovyski added 23 commits June 3, 2014 17:23
I've renamed FlxG_ignoreInput to FlxG.ignoreInput. There was a commented code in FlxGame regarding the VCR replay. It was removed for now and will be incorporate into the replay plugin soon.
First iteration for the new plugin system.

The replay functionality was moved to the new plugin architecture too, but it's not working.
Even though the debugger has several overlays (console window, watch windows, etc), it makes no sense to me that it extends flash.display.Sprite. I've created an "overlays" property in the debugger and attached all overlays there.

It will make the FlxDebugger API much simpler because all the inherited flash.display.Sprite methods will be gone.

From now on, plugins and developers can use FlxG.debugger.overlays.addChild() to add their own debug overlays.
The debugger initialization is now "lazy", which means Flixel will initiate a bare minimum debugger at first. If FlxG.debugger.show() is called, the debugger is properly initialized.

It's now possible to programmatically change the debugger visibility using show(), hide() and toggleVisibility().

Since the debugger is now lazyly initialized, I've removed the forceDebugger property in FlxGame. As discussed in FlixelCommunity#158, it's was causing confusion and problems. If FlxG.debug is false and a developer still wants to show the debugger, a call to FlxG.debugger.show(true) will force the initialization.
This commit creates a panel with icons at the right of the screen when the debugger is visible. Every icon acts as a tool.

The interactive debug mode will be implemented as a plugin, so developers can turn it on only if it is needed.
The drawing code related to the interactive debug is really bad, it needs some love. For now I was only interested to test things out.
This first implementation is quite simple, but it allows developers to remove all selected items. Use the DELETE key to remove an item from the screen (kill() is invoked) or SHIFT+DELETE (kill() is invoked and the item is removed from the parent group).
The Tile tool has been commented out. It's not fully working.
Dovyski added a commit to FlixelCommunity/FlixelSandbox that referenced this pull request Aug 5, 2014
This new test will only work when the new debugger gets merged (FlixelCommunity/flixel#215)
@IQAndreas
Copy link
Member

Dovyski wants to merge 53 commits into FlixelCommunity:master from Dovyski:fix-issue-206

I don't think you can change the target branch after having created the pull request (at least, I can't find any buttons or drop boxes anywhere that you can change it).

But it's no problem; let me know when the code is finished, tested, and ready to be merged, and I will do it manually via command-line.

It feels good coding again, even if it's just tiny things like cleaning up git commits. 😃

@Dovyski
Copy link
Member Author

Dovyski commented Aug 7, 2014

But it's no problem; let me know when the code is finished, tested, and ready to be merged, and I will do it manually via command-line.

Don't worry! I've caused too much trouble already. I will close this pull request and open a new one (targeting the right branch this time), I think it will be better. Thanks anyway!

It feels good coding again, even if it's just tiny things like cleaning up git commits. 😃

Awesome! :D

@Dovyski Dovyski closed this Aug 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Overhaul the built-in debugger
2 participants