From 87f331ca3c4b3607a2f0772352513ddfd9461461 Mon Sep 17 00:00:00 2001 From: Joshua Granick Date: Tue, 1 Nov 2016 07:39:50 -0700 Subject: [PATCH] Make sure lime.Assets when onPreloaderComplete is called --- templates/haxe/ApplicationMain.hx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/templates/haxe/ApplicationMain.hx b/templates/haxe/ApplicationMain.hx index fbf75ea30..bdbca0e50 100644 --- a/templates/haxe/ApplicationMain.hx +++ b/templates/haxe/ApplicationMain.hx @@ -63,6 +63,7 @@ class ApplicationMain { public static function create ():Void { preloader = new ::if (PRELOADER_NAME != "")::::PRELOADER_NAME::::else::lime.app.Preloader::end:: (); + preloader.onComplete.add (registerLibrary); #if !munit app = new ::APP_MAIN:: (); @@ -170,10 +171,15 @@ class ApplicationMain { #end - public static function start ():Void { + private static function registerLibrary ():Void { lime.Assets.registerLibrary ("default", new DefaultAssetLibrary ()); + } + + + public static function start ():Void { + #if !munit var result = app.exec ();