tzachshabtay / MonoAGS

AGS (Adventure Game Studio) reimagined in Mono
https://tzachshabtay.github.io/MonoAGS/
Artistic License 2.0
27 stars 8 forks source link

Editor- Support creating entities #309

Closed tzachshabtay closed 5 years ago

tzachshabtay commented 5 years ago

Added support for creating new entities from the editor. This includes preliminary support for generating code for the creation of those new entities (currently only written to string and not really to files).

When right clicking in the canvas (when in edit mode), you'll get a context menu with the available presets for creation (objects, characters, buttons, etc). When you choose an entity, it will open up a wizard which takes the parameters from the factory method in the code. The factory methods will be fine tuned in the future to contain the most common properties you'd want to set for this entity. The wizard also allows you to select whether the entity will be added to the room or as a gui (with reasonable defaults selected for each preset). Also, if you've right clicked the canvas from inside an existing entity you'll also be offered to add the new entity as a child of the clicked entity.

A demo of this can be seen here: https://imgur.com/SXwsz6C

This method wizard was written in such a way that it can be reused in the future for the interaction editor as well.

Additional changes made in this PR were mostly for the needed controls to operate the wizard: the inspector was refactored to be able to operate on basically anything that knows how to describe itself and more UIs were added or refined (menus, listbox, scrolling experience was greatly improved and stack layout gained the ability to layout around a center point).