Once ENIGMA
has its own format, it will finally be possible for it to include its own resources in outputted game files. That being the case, it is time, as Luis indicated earlier, that LGM offers a less painful method of defining custom resources.
Notice: I am in no way an expert on Java. I speak in this thread solely on authority of designing the C++ backend to potential extensions, which here is not much authority at all. My suggestions are to be taken not as a suggestion for the Java code behind the mechanism, but as the overall concept of the goals thereof.
That said, I think we should first define the goals simply in terms of what has been shown to be needed thus far (namely, by Luis's "Panes" extension proposal and my "Libraries" proposal which will conclude this message).
Before that, terms. For the purpose of this message (feel free to adopt them for your own), the following lexicons will be used:
"Loader" refers to the mechanism which will load extensions to the LateralGM interface.
"Extension" refers to a single unspecified object the Loader is loading.
"Component" refers to an interface element, such as a button or a graphic.
"Node" refers to a resource tree Component.
"MDI" refers to whatever the fuck that Java thing is that houses all the other editor windows.
- The Loader must allow the addition of a Node or group of Nodes (represented by a folder) into the resource tree.
- The Plugin must be informed when a tree Node under its control is double clicked. (original proposal said this job was the Loader's)
- Each extension will be responsible for tracking its own data and creating its own UI elements in the passed MDI context.
- Each Extension will be given the opportunity to save or load its data when the rest of the game is doing so.
- Extensions will be given a method of identifying themselves as being instantiable in other resources
- Take, for example, a 3D mesh resource. It would inherit from a class that can be assigned to a GM object as one assigns a sprite or mask.
- An Extension that can be instantiated in room will be allowed to be placed multiple times, visually.
- Such an Extension should provide a method to obtain bounding box information for placement and clipping, as well as a method to render itself in the room.
- Extensions that can be instantiated in GM objects should provide a method of obtaining an iconic preview, as sprites do.
- Extensions must be able to supply a unique ID and a C-structured or easily restructured dump of relevant data to the output executable. If the ID is not unique, backend plugins (Namely, ENIGMA) will be unable to determine what structure they are looking at, resulting in undefined behavior (like segfault). The data must obviously be easily structured per the C spec (like POD) so that ENIGMA can work with them.
- A method must be provided of accessing any complicated UI Components to the Extensions (Namely, the JEdit class and the GML syntax highlighting context, which should be easily extended or swapped out in a specific JEdit instance). (original proposal said this job was the Loader's)
I have not decided how the C++ backend should be extended, aside from that it must share a list of extension IDs.
What I have decided on is a new resource that will be added, in addition to Panes. R4's introduction called for a resource dubbed "Whitespace" and renamed to "Definitions." Both names suck. I now propose that this be a tabbed, C-code resource, basically offering what simple C IDE's offer (tabs and a code editing pane with simple features).
This proposal is likely incomplete, but I have work tomorrow and should be sleeping. Comments welcome. Comments from Java programmers especially welcome.