Skip to content

Commit

Permalink
Add mainCommandLine as bootType
Browse files Browse the repository at this point in the history
  • Loading branch information
hughsando committed Aug 8, 2024
1 parent 2ab034e commit d7be30f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
8 changes: 6 additions & 2 deletions templates/haxe/ApplicationMain.hx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class ApplicationMain
new ::APP_MAIN::();
::elseif (APP_BOOT_TYPE=="BootTypeAddStage")::
new ApplicationDocument();
::else::
::elseif (APP_BOOT_TYPE!="BootTypeMainCommandLine")::
ApplicationBoot.createInstance();
::end::
}
Expand Down Expand Up @@ -117,8 +117,10 @@ class ApplicationMain
#end

#end


::if (APP_BOOT_TYPE=="BootTypeMainCommandLine")::
::APP_MAIN::.main();
::else::

#if flash
// Flash
Expand Down Expand Up @@ -266,6 +268,8 @@ class ApplicationMain
// Unknown framework
createInstance();
#end

::end::
}

@:keep function keepMe() return Reflect.callMethod;
Expand Down
1 change: 1 addition & 0 deletions tools/nme/src/project/BootType.hx
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ enum BootType
BootTypeMain;
BootTypeNew;
BootTypeAddStage;
BootTypeMainCommandLine;
}
2 changes: 1 addition & 1 deletion tools/nme/src/project/NMMLParser.hx
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ class NMMLParser
project.app.preloader = substitute(element.att.preloader);

case "bootType":
var types = ["auto", "main", "new", "addStage" ];
var types = ["auto", "main", "new", "addStage", "mainCommandLine" ];
var type = substitute(element.att.bootType);
var typeId = types.indexOf(type);
if (typeId<0)
Expand Down

0 comments on commit d7be30f

Please sign in to comment.