Just to be clear, this isn't a feature request, rather it's a proposal to merge some changes I've made to the physics behavior's custom collision mask editor with the version on the SVN. These changes are all usability related, simplifying the mask creation process with some nifty new features.
All of the changes take place in two files, Edittime.cpp and Main.h. Here's a download link to the altered files and a compiled version of the plugin:Physics Changes[CHANGE]
- The first and last vertices are marked; the first vertex has a red minus symbol inside while the last vertex has a blue plus symbol inside. This is so users will know better where the next point will be placed.[ADDITION]
- Vertex dragging. If a user left clicks and holds the mouse over a vertex, the vertex can be dragged around. All newly placed vertices are also placed in drag mode. Holding the control key will disable this, allowing the user to place vertices on top of one another and place many points quickly without worrying about dragging them.[ADDITION]
- Rick clicking on any vertex will delete it, instead of having to delete all the vertices after it sequentially just to delete it.[ADDITION]
- Holding down the shift key will display lines running from the first and last vertices to the mouse, showing where new collision lines will run if a point is placed.
Variable and function additions in the code include:POINTF* dragPoint in the EditExt class in Main.h
- This is a pointer to the vertex currently being dragged.bool setWindowFocus in the EditExt class in Main.h
- This is set to true when first starting the mask editor. If the value equals true, the focus is set on the frame editor and the value is set to false.bool MouseOverPoint(bool deletePoint) function in EditTime.cpp
- This is used to detect if the mouse is hovering over a vertex and for deleting any such vertices if specified as true through deletePoint. Also, if a vertex is being hovered over, dragPoint will be pointed to it.
Most of the feature additions are contained in EditExt::OnMessage() and MouseOverPoint(). These are where point dragging and point deletion are handled. The shift key preview is contained in EditExt::Draw().
So, there it is for your consideration. I've tested everything and it all seems to work properly, but since I don't entirely know how parts of the plugin work, some of it may not be properly handled -- mostly these concerns lie in the point deletion aspect of MouseOverPoint().