lua extracted from drawspace.lib and deported directly in dfront tool