Page 1 of 1

Lua library imports

Posted: Sun Sep 08, 2013 6:27 am
by robn
Just drawing your attention to #1499 which was merged yesterday and is now in the builds. The short of it is that you now have to import Lua libs and classes before you use them. So do "local Game = import('Game')" before "Game.player", and so on.

Take a look at the standard scripts to see what's going on. It'll mean a fairly trivial change for all your Lua files. It also gives some advantages. Look at data/ui/InfoView to see what this enables - each screen now has its own file, which is much easier to manage (and brings us a little closer to doing things like allow mods to add screens).

That's all :)