diff --git a/lib/ECSAPI.lua b/lib/ECSAPI.lua index 77853a37..d7253ced 100755 --- a/lib/ECSAPI.lua +++ b/lib/ECSAPI.lua @@ -1179,7 +1179,7 @@ function ecs.newFile(path) if ecs.checkName(inputs[1], path) then local MineOSCore = require("MineOSCore") - MineOSCore.safeLaunch(MineOSCore.paths.applications .. "/MineCode IDE.app/MineCode IDE.lua", "open", path .. inputs[1]) + MineOSCore.safeLaunch(MineOSCore.paths.applications .. "/MineCode IDE.app/Main.lua", "open", path .. inputs[1]) end end @@ -1195,9 +1195,8 @@ function ecs.newApplication(path, startName) local name = path .. inputs[1] .. ".app/Resources/" fs.makeDirectory(name) fs.copy("MineOS/System/OS/Icons/SampleIcon.pic", name .. "Icon.pic") - local file = io.open(path .. inputs[1] .. ".app/" .. inputs[1] .. ".lua", "w") - file:write("local ecs = require(\"ECSAPI\")", "\n") - file:write("ecs.universalWindow(\"auto\", \"auto\", 30, 0xeeeeee, true, {\"EmptyLine\"}, {\"CenterText\", 0x262626, \"Hello world!\"}, {\"EmptyLine\"}, {\"Button\", {0x880000, 0xffffff, \"Hello!\"}})", "\n") + local file = io.open(path .. inputs[1] .. ".app/Main.lua", "w") + file:write("require('GUI').error('Hello world')") file:close() end end diff --git a/lib/MineOSCore.lua b/lib/MineOSCore.lua index 9c1efd3a..b4a12c08 100755 --- a/lib/MineOSCore.lua +++ b/lib/MineOSCore.lua @@ -16,6 +16,7 @@ local keyboard = require("keyboard") ---------------------------------------------- Core constants ------------------------------------------------------------------------ local MineOSCore = {} +local gpu = component.gpu MineOSCore.showApplicationIcons = true MineOSCore.iconWidth = 12 @@ -660,7 +661,7 @@ function MineOSCore.safeLaunch(path, ...) end end end - + local runSuccess, runReason = xpcall(launchMethod, tracebackMethod) if type(runReason) == "string" then GUI.error(runReason, {title = {color = 0xFFDB40, text = "Warning"}}) @@ -684,7 +685,7 @@ function MineOSCore.safeLaunch(path, ...) end component.screen.setPrecise(false) - component.gpu.setResolution(oldResolutionWidth, oldResolutionHeight) + gpu.setResolution(oldResolutionWidth, oldResolutionHeight) buffer.start() return finalSuccess, finalPath, finalLine, finalTraceback