Lua library imports

Post Reply
robn
Posts: 302
Joined: Mon Jul 01, 2013 1:11 am
Location: Melbourne, Australia

Lua library imports

Post 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 :)
Post Reply