diff --git a/lib/ECSAPI.lua b/lib/ECSAPI.lua index a07e2be7..32a9da69 100644 --- a/lib/ECSAPI.lua +++ b/lib/ECSAPI.lua @@ -1156,12 +1156,12 @@ function ECSAPI.newApplication(path, startName) if not startName then inputs = ECSAPI.universalWindow("auto", "auto", 30, ECSAPI.windowColors.background, true, {"EmptyLine"}, {"CenterText", 0x262626, "Новое приложение"}, {"EmptyLine"}, {"Input", 0x262626, 0x880000, "Введите имя"}, {"EmptyLine"}, {"Button", {0xbbbbbb, 0xffffff, "OK"}}) end - + if ECSAPI.checkName(inputs[1], path) then local name = path .. inputs[1] .. ".app/Resources" fs.makeDirectory(name) fs.copy("System/OS/Icons/SampleIcon.png", name) - local file = io.open(path .. "/" .. inputs[1] .. ".app/" .. inputs[1]. . ".lua", "w") + 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\", {0xffdb80, 0xffffff, \"Hello!\"}})", "\n") file:close()