ENIGMA Forums

Contributing to ENIGMA => Developing ENIGMA => Topic started by: Mangolion on September 10, 2014, 09:46:42 pm

Title: Pls explain Lateral GM's source code
Post by: Mangolion on September 10, 2014, 09:46:42 pm
I am planning to run Lateral GM on Android, I have experiences making Android Apps, I can design rather complex GUI. However, I am a complete newbie when it comes to Java's Swing, looking at the jumble that is Lateral GM's code on GUI, I have absolutely no idea where to start. Could someone please draw me a picture of its GUI components or something?
Title: Re: Pls explain Lateral GM's source code
Post by: Goombert on September 10, 2014, 10:23:25 pm
There was an attempt to document LateralGM's editors, there is not much documented about LateralGM's code, you'd have to search the Wiki but I can't really provide anything as I don't think there is much available that would be of use to you. The structure of the program is quantitative to specifics, when it comes to specific things I could better assist and explain to you the components or code involved in a working system of the program. It would be a better idea for you ask specific questions about how something works.

Overall when LGM is launched it loads any jars from a plugins folder, such as the ENIGMA plugin which adds a new format and compiler capabilities. Otherwise LateralGM executed by itself is just a program for editing the GM projects.
Title: Re: Pls explain Lateral GM's source code
Post by: Mangolion on September 11, 2014, 08:38:00 am
I know that LG is only meant to edit GM files, I am going to port it onto Android so I can create files on the fly on my tablet. Perhaps in the future we can literally compile enigma projects on Android! There are already C++ compilers on the OS.
Title: Re: Pls explain Lateral GM's source code
Post by: daz on September 11, 2014, 04:00:48 pm
I think you vastly underestimate the amount of work that would go into making an LGM Android port. You would be best off creating your own fork, salvaging the back end and recreating the front end yourself.

Also unless you change how files are loaded, you'll likely be running into out of memory errors with larger project files. I would really not recommend you proceed unless you have a strong stomach.
Title: Re: Pls explain Lateral GM's source code
Post by: Mangolion on September 12, 2014, 09:13:03 am
Most Android phones nowadays have 1-2 GB of Ram, so out of memory is no longer a concern, I am thinking of maybe making a library with all of the GUI components and gmk file loading. But I can't figure out how to decode the gmk file and put in the values, perhaps someone could tell me a little about how to open it through Lgm's source code?
I won't be starting the project for a while though, I'm planning to develop a special ide environment for Android tablets that allows viewing of multiple windows(like the lgm IDE) and that i'll take some time.
Title: Re: Pls explain Lateral GM's source code
Post by: sorlok_reaves on September 12, 2014, 09:49:58 am
You can have a look at the following file, which reads older (GMK) files:
https://github.com/IsmAvatar/LateralGM/blob/master/org/lateralgm/file/GmFileReader.java

There are similar readers in the same package for reading GMX files, etc.
Title: Re: Pls explain Lateral GM's source code
Post by: Mangolion on September 12, 2014, 12:15:07 pm
Thx, I'll look into it
Title: Re: Pls explain Lateral GM's source code
Post by: IsmAvatar on September 16, 2014, 10:22:22 pm
Our wiki has a good deal of information to help you with developing LGM. For starters, getting the code set up for dev initially is documented here:
http://enigma-dev.org/docs/Wiki/LateralGM:Developing

Understanding the layout of the code is the next task, documented here:
http://enigma-dev.org/docs/Wiki/LateralGM:Packages

All of the file-handling code is contained within /org/lateralgm/file/
All of the frame code for e.g. the frame shon for editing a Room or an Object is contained within /org/lateralgm/subfarmes/
All of our custom components, like custom widgets like the ResourceMenu and IntegerField, are in /org/lateralgm/components/


While LGM was designed to be cross-platform, and mobile devices technically support it (since it is Java), I never considered it worthwhile to do, due to the extreme limitations of mobile platforms (such as the lack of a normal keyboard or two-button mouse) which make IDEs on them less-than-trivial. So while you're welcome to do it, and I'm certainly not going to stop you, I'd just discourage it because it seems silly. Instead, you might try shifting your efforts towards getting games to compile for mobile devices (enigma-side).