From 992f7b70d1a75e7f3b3878b4fba19b5407bbc3f3 Mon Sep 17 00:00:00 2001 From: 70/V9 Date: Fri, 23 Nov 2018 09:15:25 +0100 Subject: [PATCH] Use electron.main.App.commandLine type `electron.main.App.commandLine` is now defined in electron externs, no need for untyped workaround anymore. --- templates/electron/haxe/ElectronSetup.hx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/templates/electron/haxe/ElectronSetup.hx b/templates/electron/haxe/ElectronSetup.hx index 3deb43790..bb241032a 100644 --- a/templates/electron/haxe/ElectronSetup.hx +++ b/templates/electron/haxe/ElectronSetup.hx @@ -7,7 +7,7 @@ class ElectronSetup { static function main() { - untyped (electron.main.App).commandLine.appendSwitch('ignore-gpu-blacklist', 'true'); + electron.main.App.commandLine.appendSwitch('ignore-gpu-blacklist', 'true'); var windows:Array = [ ::foreach windows:: @@ -46,9 +46,7 @@ class ElectronSetup { if (height == 0) height = 600; var frame:Bool = window.borderless == false; - var commandLine = Reflect.getProperty(electron.main.App, "commandLine"); - var appendSwitch:haxe.Constraints.Function = Reflect.getProperty(commandLine, "appendSwitch"); - appendSwitch('--autoplay-policy','no-user-gesture-required'); + electron.main.App.commandLine.appendSwitch('--autoplay-policy','no-user-gesture-required'); electron.main.App.on( 'ready', function(e) { var config:Dynamic = { @@ -100,4 +98,4 @@ typedef OpenFLWindow = width:Int, x:Int, y:Int -} \ No newline at end of file +}