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,34 +10,31 @@ class ElectronSetup
electron.main.App.commandLine.appendSwitch('ignore-gpu-blacklist', 'true'); electron.main.App.commandLine.appendSwitch('ignore-gpu-blacklist', 'true');
var windows:Array<OpenFLWindow> = [ var windows:Array<OpenFLWindow> = [
::foreach ::foreach windows::
windows::
{ {
allowHighDPI:::allowHighDPI::, allowHighDPI: ::allowHighDPI::,
alwaysOnTop:::alwaysOnTop::, alwaysOnTop: ::alwaysOnTop::,
antialiasing:::antialiasing::, antialiasing: ::antialiasing::,
background:::background::, background: ::background::,
borderless:::borderless::, borderless: ::borderless::,
colorDepth:::colorDepth::, colorDepth: ::colorDepth::,
depthBuffer:::depthBuffer::, depthBuffer: ::depthBuffer::,
display:::display::, display: ::display::,
fullscreen:::fullscreen::, fullscreen: ::fullscreen::,
hardware:::hardware::, hardware: ::hardware::,
height:::height::, height: ::height::,
hidden: #if munit true #else::hidden:: #end, hidden: #if munit true #else ::hidden:: #end,
maximized:::maximized::, maximized: ::maximized::,
minimized:::minimized::, minimized: ::minimized::,
parameters:::parameters::, parameters: ::parameters::,
resizable:::resizable::, resizable: ::resizable::,
stencilBuffer:::stencilBuffer::, stencilBuffer: ::stencilBuffer::,
title: "::title::", title: "::title::",
vsync:::vsync::, vsync: ::vsync::,
width:::width::, width: ::width::,
x:::x::, x: ::x::,
y:::y:: y: ::y::
}, },::end::
::
end::
]; ];
for (i in 0...windows.length) for (i in 0...windows.length)
@@ -67,7 +64,10 @@ class ElectronSetup
ElectronSetup.window.on(closed, function() 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'); ElectronSetup.window.loadURL('file://' + js.Node.__dirname + '/index.html');

View File

@@ -1,9 +1,10 @@
package; package;
import::APP_MAIN::; import ::APP_MAIN::;
@:access(lime.app.Application) @:access(lime.app.Application)
@:access(lime.system.System) @:access(lime.system.System)
@:dox(hide) class ApplicationMain @:dox(hide) class ApplicationMain
{ {
public static function main() public static function main()
@@ -20,7 +21,7 @@ import::APP_MAIN::;
ManifestResources.init(config); ManifestResources.init(config);
#if !munit #if !munit
var app = new::APP_MAIN::(); var app = new ::APP_MAIN::();
app.meta.set("build", "::meta.buildNumber::"); app.meta.set("build", "::meta.buildNumber::");
app.meta.set("company", "::meta.company::"); app.meta.set("company", "::meta.company::");
app.meta.set("file", "::APP_FILE::"); app.meta.set("file", "::APP_FILE::");
@@ -29,39 +30,38 @@ import::APP_MAIN::;
app.meta.set("version", "::meta.version::"); app.meta.set("version", "::meta.version::");
#if !flash #if !flash
::foreach windows::var attributes:lime.ui.WindowAttributes = ::foreach windows::
var attributes:lime.ui.WindowAttributes =
{ {
allowHighDPI:::allowHighDPI::, allowHighDPI: ::allowHighDPI::,
alwaysOnTop:::alwaysOnTop::, alwaysOnTop: ::alwaysOnTop::,
borderless:::borderless::, borderless: ::borderless::,
// display: ::display::, // display: ::display::,
element: null, element: null,
frameRate:::fps::, frameRate: ::fps::,
#if !web #if !web fullscreen: ::fullscreen::, #end
fullscreen:::fullscreen::, height: ::height::,
#end hidden: #if munit true #else ::hidden:: #end,
height:::height::, maximized: ::maximized::,
hidden: #if munit true #else::hidden:: #end, minimized: ::minimized::,
maximized:::maximized::, parameters: ::parameters::,
minimized:::minimized::, resizable: ::resizable::,
parameters:::parameters::,
resizable:::resizable::,
title: "::title::", title: "::title::",
width:::width::, width: ::width::,
x:::x::, x: ::x::,
y:::y::, y: ::y::,
}; };
attributes.context = attributes.context =
{ {
antialiasing:::antialiasing::, antialiasing: ::antialiasing::,
background:::background::, background: ::background::,
colorDepth:::colorDepth::, colorDepth: ::colorDepth::,
depth:::depthBuffer::, depth: ::depthBuffer::,
hardware:::hardware::, hardware: ::hardware::,
stencil:::stencilBuffer::, stencil: ::stencilBuffer::,
type: null, type: null,
vsync:::vsync:: vsync: ::vsync::
}; };
if (app.window == null) if (app.window == null)
@@ -89,8 +89,10 @@ import::APP_MAIN::;
app.createWindow(attributes); app.createWindow(attributes);
::end:: ::end::
#elseif !air #elseif !air
app.window.context.attributes.background =::WIN_BACKGROUND::;
app.window.frameRate =::WIN_FPS::; app.window.context.attributes.background = ::WIN_BACKGROUND::;
app.window.frameRate = ::WIN_FPS::;
#end #end
#end #end
@@ -116,13 +118,17 @@ import::APP_MAIN::;
public static function start(app:lime.app.Application = null):Void public static function start(app:lime.app.Application = null):Void
{ {
#if !munit #if !munit
var result = app.exec(); var result = app.exec();
#if (sys && !ios && !nodejs && !emscripten) #if (sys && !ios && !nodejs && !emscripten)
lime.system.System.exit(result); lime.system.System.exit(result);
#end #end
#else #else
new::APP_MAIN::();
new ::APP_MAIN::();
#end #end
} }