MovingBlocks/Terasology — pull request #307 by miniME89 (2012-08-05 17:56:42+00:00)
Title: GUI system uses an event-driven design now.

Changed the GUI system so it uses events now. All UI components are able to handle events offered by the interfaces IMouseMoveListener, IMouseButtonListener, IClickListener, IFocusListener. Moreover there are some UI components which also offer the events from the IChangedListener or IScrollListener interfaces.

Keyboard events are not implemented yet.

The update function in the base class UIDisplayElement should now be avoided. Same things can be achieved by using events. I needed to update every UI component in the gui.components package to do so. I haven't updated all yet. The UIInventory for example still uses the update function which should also work by using events.

@small-jeeper : maybe you could take a look at the different UI components you worked on, such as the dropbox and see if the behavior is the same as before.

It also should now be quite easy to implement a working inventory with drag/drop action ;)

This is a big update which includes a lot of changes in the GUI system and i tested my changes as much as i could. But there will probably still be some misbehavior of some UI components.

The look and feel of the GUI system should be the same as before (for most parts) but it is now easier to add UI components and it will be easier to implement the new GUI system along with a JSON parser for the layout and style of elements within the UI.