Skip to content

Commit 5eb1304

Browse files
committed
Template fix
1 parent 0c163a8 commit 5eb1304

File tree

2 files changed

+62
-56
lines changed

2 files changed

+62
-56
lines changed

templates/electron/haxe/ElectronSetup.hx

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,34 +10,31 @@ class ElectronSetup
1010
electron.main.App.commandLine.appendSwitch('ignore-gpu-blacklist', 'true');
1111

1212
var windows:Array<OpenFLWindow> = [
13-
::foreach
14-
windows::
13+
::foreach windows::
1514
{
16-
allowHighDPI:::allowHighDPI::,
17-
alwaysOnTop:::alwaysOnTop::,
18-
antialiasing:::antialiasing::,
19-
background:::background::,
20-
borderless:::borderless::,
21-
colorDepth:::colorDepth::,
22-
depthBuffer:::depthBuffer::,
23-
display:::display::,
24-
fullscreen:::fullscreen::,
25-
hardware:::hardware::,
26-
height:::height::,
27-
hidden: #if munit true #else::hidden:: #end,
28-
maximized:::maximized::,
29-
minimized:::minimized::,
30-
parameters:::parameters::,
31-
resizable:::resizable::,
32-
stencilBuffer:::stencilBuffer::,
15+
allowHighDPI: ::allowHighDPI::,
16+
alwaysOnTop: ::alwaysOnTop::,
17+
antialiasing: ::antialiasing::,
18+
background: ::background::,
19+
borderless: ::borderless::,
20+
colorDepth: ::colorDepth::,
21+
depthBuffer: ::depthBuffer::,
22+
display: ::display::,
23+
fullscreen: ::fullscreen::,
24+
hardware: ::hardware::,
25+
height: ::height::,
26+
hidden: #if munit true #else ::hidden:: #end,
27+
maximized: ::maximized::,
28+
minimized: ::minimized::,
29+
parameters: ::parameters::,
30+
resizable: ::resizable::,
31+
stencilBuffer: ::stencilBuffer::,
3332
title: "::title::",
34-
vsync:::vsync::,
35-
width:::width::,
36-
x:::x::,
37-
y:::y::
38-
},
39-
::
40-
end::
33+
vsync: ::vsync::,
34+
width: ::width::,
35+
x: ::x::,
36+
y: ::y::
37+
},::end::
4138
];
4239

4340
for (i in 0...windows.length)
@@ -67,7 +64,10 @@ class ElectronSetup
6764

6865
ElectronSetup.window.on(closed, function()
6966
{
70-
if (js.Node.process.platform != 'darwin') electron.main.App.quit();
67+
if (js.Node.process.platform != 'darwin')
68+
{
69+
electron.main.App.quit();
70+
}
7171
});
7272

7373
ElectronSetup.window.loadURL('file://' + js.Node.__dirname + '/index.html');

templates/haxe/ApplicationMain.hx

Lines changed: 35 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
package;
22

3-
import::APP_MAIN::;
3+
import ::APP_MAIN::;
44

55
@:access(lime.app.Application)
66
@:access(lime.system.System)
7+
78
@:dox(hide) class ApplicationMain
89
{
910
public static function main()
@@ -20,7 +21,7 @@ import::APP_MAIN::;
2021
ManifestResources.init(config);
2122

2223
#if !munit
23-
var app = new::APP_MAIN::();
24+
var app = new ::APP_MAIN::();
2425
app.meta.set("build", "::meta.buildNumber::");
2526
app.meta.set("company", "::meta.company::");
2627
app.meta.set("file", "::APP_FILE::");
@@ -29,39 +30,38 @@ import::APP_MAIN::;
2930
app.meta.set("version", "::meta.version::");
3031

3132
#if !flash
32-
::foreach windows::var attributes:lime.ui.WindowAttributes =
33+
::foreach windows::
34+
var attributes:lime.ui.WindowAttributes =
3335
{
34-
allowHighDPI:::allowHighDPI::,
35-
alwaysOnTop:::alwaysOnTop::,
36-
borderless:::borderless::,
36+
allowHighDPI: ::allowHighDPI::,
37+
alwaysOnTop: ::alwaysOnTop::,
38+
borderless: ::borderless::,
3739
// display: ::display::,
3840
element: null,
39-
frameRate:::fps::,
40-
#if !web
41-
fullscreen:::fullscreen::,
42-
#end
43-
height:::height::,
44-
hidden: #if munit true #else::hidden:: #end,
45-
maximized:::maximized::,
46-
minimized:::minimized::,
47-
parameters:::parameters::,
48-
resizable:::resizable::,
41+
frameRate: ::fps::,
42+
#if !web fullscreen: ::fullscreen::, #end
43+
height: ::height::,
44+
hidden: #if munit true #else ::hidden:: #end,
45+
maximized: ::maximized::,
46+
minimized: ::minimized::,
47+
parameters: ::parameters::,
48+
resizable: ::resizable::,
4949
title: "::title::",
50-
width:::width::,
51-
x:::x::,
52-
y:::y::,
50+
width: ::width::,
51+
x: ::x::,
52+
y: ::y::,
5353
};
5454

5555
attributes.context =
5656
{
57-
antialiasing:::antialiasing::,
58-
background:::background::,
59-
colorDepth:::colorDepth::,
60-
depth:::depthBuffer::,
61-
hardware:::hardware::,
62-
stencil:::stencilBuffer::,
57+
antialiasing: ::antialiasing::,
58+
background: ::background::,
59+
colorDepth: ::colorDepth::,
60+
depth: ::depthBuffer::,
61+
hardware: ::hardware::,
62+
stencil: ::stencilBuffer::,
6363
type: null,
64-
vsync:::vsync::
64+
vsync: ::vsync::
6565
};
6666

6767
if (app.window == null)
@@ -89,8 +89,10 @@ import::APP_MAIN::;
8989
app.createWindow(attributes);
9090
::end::
9191
#elseif !air
92-
app.window.context.attributes.background =::WIN_BACKGROUND::;
93-
app.window.frameRate =::WIN_FPS::;
92+
93+
app.window.context.attributes.background = ::WIN_BACKGROUND::;
94+
app.window.frameRate = ::WIN_FPS::;
95+
9496
#end
9597
#end
9698

@@ -116,13 +118,17 @@ import::APP_MAIN::;
116118
public static function start(app:lime.app.Application = null):Void
117119
{
118120
#if !munit
121+
119122
var result = app.exec();
120123

121124
#if (sys && !ios && !nodejs && !emscripten)
122125
lime.system.System.exit(result);
123126
#end
127+
124128
#else
125-
new::APP_MAIN::();
129+
130+
new ::APP_MAIN::();
131+
126132
#end
127133
}
128134

0 commit comments

Comments
 (0)