A back-end plug-in (i.e. a plug-in which does nothing visible by itself, but provides other plug-ins with additional features).
It is currently used by my plug-ins only and it is required (just once!) to run some of them. Developers of other plug-ins are welcome to use it too!
File rwgui_0_5_1.zip updated with the two images missing in the previous release!
*) Modal dialogue box, with title bar and close (X) button.
*) 'Automatic' horizontal, vertical or tabular layout of collections of GuiElements.
*) Check/radio boxes
*) Modal menus, with title bar and scrollable if "too long"
*) Modal menu to select a player
*) Modal message box (with optional timed auto-closing)
*) Modeless informational window
*) Message box
*) Title bar with optional close button
*) 11 small icons for basic interface elements (close button, arrows, check and radio buttons)
0.5.1 change log:
*) Fixed a possible null pointer exception with GuiVerticalLayout.getItemId()
*) Simplified image loading
*) Added GuiLayout.getChildFromId()
Download link at the bottom of this post. Version 0.5.1 is backward compatible with version 0.5.0, 0.4.0 and 0.3.0.
Installation (for everybody!)
Extract the files in the ZIP placing the whole rwgui folder into the plugins folder of RW (if the plugins folder does not exist, just create one). The resulting hierarchy shall be:
This is all!
The plug-in has no command, as it is not intended to be invoked by players, but used by other plug-ins.
Use by other plug-ins (for plug-in developers)
Warning: This is very experimental work, code is under active development!
A plug-in which does nothing by itself and rather provides classes and tools for other plug-ins to display and manage GUI 'containers', freeing other developers from the implementation details of (part of?) the GUI and also potentially providing a consistent user experience to players.
It is a separate plug-in, which needs to be installed only once in RW and which any other plug-in can use without 'including' it in its own package.
There are limitations and some 'dirty code' to work around the current RW API limitations, but I have seen in practice that it is possible for any plug-in to request a GUI object from this new GUI plug-in and to be notified of user selection.
According to my experience, it also simplifies noticeably some repetitive tasks in GUI implementation.
1) The rwgui.jar has to be added to the project of your plug-in and then it has to be somewhere in your hard disk. The details of how to add it depend on the specific IDE you are using, but the steps are exactly the same as for the Rising World own PluginAPI.jar which your plug-in should already know about.
This is only for the compiler to know about rwgui.jar internals; rwgui.jar itself shall not be included in your final .jar or shipped with it in any way.
2) The rwgui_<version>.zip shall be unZIPped in the Rising World plugins folder (as described in Installation above). This will be the care of the server owner, though: do not include it in your plug-in!
Documentation: the RWGui_doc.zip contains the Javadoc of the RWGui class and sub-classes in HTML format. Everything needed to use the GUI back-end is there!
Sample sources: the sampleDlgBox_src.zip file contains the sources of a very minimal, but complete, plug-in exemplifying the use of the GuiDialogueBox class.
Comments and proposals for improvements and extensions are welcome!
The source code of this plug-i is available on github under the Creative Commons by-sa 3.0 license.