Template fix

This commit is contained in:
Joshua Granick
2019-02-14 09:09:39 -08:00
parent 0c163a80e7
commit 5eb13042d9
2 changed files with 62 additions and 56 deletions

View File

@@ -10,8 +10,7 @@ class ElectronSetup
electron.main.App.commandLine.appendSwitch('ignore-gpu-blacklist', 'true');
var windows:Array<OpenFLWindow> = [
::foreach
windows::
::foreach windows::
{
allowHighDPI: ::allowHighDPI::,
alwaysOnTop: ::alwaysOnTop::,
@@ -35,9 +34,7 @@ class ElectronSetup
width: ::width::,
x: ::x::,
y: ::y::
},
::
end::
},::end::
];
for (i in 0...windows.length)
@@ -67,7 +64,10 @@ class ElectronSetup
ElectronSetup.window.on(closed, function()
{
if (js.Node.process.platform != 'darwin') electron.main.App.quit();
if (js.Node.process.platform != 'darwin')
{
electron.main.App.quit();
}
});
ElectronSetup.window.loadURL('file://' + js.Node.__dirname + '/index.html');

View File

@@ -4,6 +4,7 @@ import::APP_MAIN::;
@:access(lime.app.Application)
@:access(lime.system.System)
@:dox(hide) class ApplicationMain
{
public static function main()
@@ -29,7 +30,8 @@ import::APP_MAIN::;
app.meta.set("version", "::meta.version::");
#if !flash
::foreach windows::var attributes:lime.ui.WindowAttributes =
::foreach windows::
var attributes:lime.ui.WindowAttributes =
{
allowHighDPI: ::allowHighDPI::,
alwaysOnTop: ::alwaysOnTop::,
@@ -37,9 +39,7 @@ import::APP_MAIN::;
// display: ::display::,
element: null,
frameRate: ::fps::,
#if !web
fullscreen:::fullscreen::,
#end
#if !web fullscreen: ::fullscreen::, #end
height: ::height::,
hidden: #if munit true #else ::hidden:: #end,
maximized: ::maximized::,
@@ -89,8 +89,10 @@ import::APP_MAIN::;
app.createWindow(attributes);
::end::
#elseif !air
app.window.context.attributes.background = ::WIN_BACKGROUND::;
app.window.frameRate = ::WIN_FPS::;
#end
#end
@@ -116,13 +118,17 @@ import::APP_MAIN::;
public static function start(app:lime.app.Application = null):Void
{
#if !munit
var result = app.exec();
#if (sys && !ios && !nodejs && !emscripten)
lime.system.System.exit(result);
#end
#else
new ::APP_MAIN::();
#end
}