This is a launcher that starts before your game allowing players to set the game's graphical options. This was created to solve the issue of Leadwerks starting at the highest resolution of the monitor, instead of the current desktop settings. It uses a quick and dirty method to get the desktop resolution. THIS HAS NOT BEEN TESTED ON LINUX!! If this works on linux let me know, or if you made any changes to make it work.
The script is to be loaded with your game and launched before the main window is created. There are some modifications to main.lua but they are very simple.
Here is the script. Save it as Launcher.lua in the same folder as Menu.lua
To use it, first add:
import("Scripts/Launcher.lua")
to the top of Main.lua.
Next add
LauncherMenu()
After the title line.
Lastly, change:
window=Window:Create(title,0,0,gfxmode.x,gfxmode.y,windowstyle)
to
window=Window:Create(title,0,0,gfxmode.x,gfxmode.y, LauncherWindowMode)
This is all that needs to be done.
In action: