diff --git a/Applications.txt b/Applications.txt index 6a6f8c85..0e7930fa 100644 --- a/Applications.txt +++ b/Applications.txt @@ -344,6 +344,7 @@ ["about"]="IgorTimofeev/OpenComputers/master/Applications/Photoshop/About.txt", ["type"]="Application", ["icon"]="IgorTimofeev/OpenComputers/master/Applications/Photoshop/Icon.pic", + ["createShortcut"] = "dock", ["version"]=1.0, }, { @@ -351,6 +352,7 @@ ["url"]="IgorTimofeev/OpenComputers/master/Applications/Shooting/Shooting.lua", ["type"]="Application", ["icon"]="IgorTimofeev/OpenComputers/master/Applications/Shooting/Icon.pic", + ["createShortcut"] = "desktop", ["version"]=1.0, }, { @@ -358,6 +360,7 @@ ["url"]="IgorTimofeev/OpenComputers/master/Applications/Geoscan/Geoscan.lua", ["type"]="Application", ["icon"]="IgorTimofeev/OpenComputers/master/Applications/Geoscan/Icon.pic", + ["createShortcut"] = "desktop", ["version"]=1.0, }, { @@ -365,6 +368,7 @@ ["url"]="IgorTimofeev/OpenComputers/master/Applications/HoloClock/HoloClock.lua", ["type"]="Application", ["icon"]="IgorTimofeev/OpenComputers/master/Applications/HoloClock/Icon.pic", + ["createShortcut"] = "desktop", ["version"]=1.0, }, { @@ -372,6 +376,7 @@ ["url"]="IgorTimofeev/OpenComputers/master/Applications/Pastebin/Pastebin.lua", ["type"]="Application", ["icon"]="IgorTimofeev/OpenComputers/master/Applications/Pastebin/Icon.pic", + ["createShortcut"] = "desktop", ["version"]=1.0, }, { @@ -379,6 +384,7 @@ ["url"]="IgorTimofeev/OpenComputers/master/Applications/Shop/Shop.lua", ["type"]="Application", ["icon"]="IgorTimofeev/OpenComputers/master/Applications/Shop/Icon.pic", + ["createShortcut"] = "desktop", ["version"]=1.0, }, { @@ -387,6 +393,7 @@ ["about"]="IgorTimofeev/OpenComputers/master/Applications/Finder/About.txt", ["type"]="Application", ["icon"]="IgorTimofeev/OpenComputers/master/Applications/Finder/Icon.pic", + ["createShortcut"] = "dock", ["version"]=1.0, }, { @@ -395,6 +402,7 @@ ["about"]="IgorTimofeev/OpenComputers/master/Applications/Control/About.txt", ["type"]="Application", ["icon"]="IgorTimofeev/OpenComputers/master/Applications/Control/Icon.pic", + ["createShortcut"] = "dock", ["version"]=1.0, }, { @@ -402,6 +410,7 @@ ["url"]="IgorTimofeev/OpenComputers/master/Applications/Piano/Piano.lua", ["type"]="Application", ["icon"]="IgorTimofeev/OpenComputers/master/Applications/Piano/Icon.pic", + ["createShortcut"] = "desktop", ["version"]=1.0, }, { @@ -409,6 +418,7 @@ ["url"]="IgorTimofeev/OpenComputers/master/Applications/Calc/Calc.lua", ["type"]="Application", ["icon"]="IgorTimofeev/OpenComputers/master/Applications/Calc/Icon.pic", + ["createShortcut"] = "desktop", ["version"]=1.0, }, { @@ -417,6 +427,7 @@ ["about"]="IgorTimofeev/OpenComputers/master/Applications/Calendar/About.txt", ["type"]="Application", ["icon"]="IgorTimofeev/OpenComputers/master/Applications/Calendar/Icon.pic", + ["createShortcut"] = "dock", ["version"]=1.0, }, { @@ -424,6 +435,7 @@ ["url"]="IgorTimofeev/OpenComputers/master/Applications/Snake/Snake.lua", ["type"]="Application", ["icon"]="IgorTimofeev/OpenComputers/master/Applications/Snake/Icon.pic", + ["createShortcut"] = "desktop", ["version"]=1.0, }, { @@ -432,6 +444,7 @@ ["about"]="IgorTimofeev/OpenComputers/master/Applications/CodeDoor/About.txt", ["type"]="Application", ["icon"]="IgorTimofeev/OpenComputers/master/Applications/CodeDoor/Icon.pic", + ["createShortcut"] = "desktop", ["version"]=1.0, }, { @@ -440,6 +453,7 @@ ["about"]="IgorTimofeev/OpenComputers/master/Applications/Keyboard/About.txt", ["type"]="Application", ["icon"]="IgorTimofeev/OpenComputers/master/Applications/Keyboard/Icon.pic", + ["createShortcut"] = "desktop", ["version"]=1.0, }, { @@ -448,6 +462,7 @@ ["about"]="IgorTimofeev/OpenComputers/master/Applications/Nano/About.txt", ["type"]="Application", ["icon"]="IgorTimofeev/OpenComputers/master/Applications/Nano/Icon.pic", + ["createShortcut"] = "desktop", ["version"]=1.0, }, { @@ -456,6 +471,7 @@ ["about"]="IgorTimofeev/OpenComputers/master/Applications/Camera/About.txt", ["type"]="Application", ["icon"]="IgorTimofeev/OpenComputers/master/Applications/Camera/Icon.pic", + ["createShortcut"] = "desktop", ["version"]=1.0, }, { @@ -464,6 +480,7 @@ ["about"]="IgorTimofeev/OpenComputers/master/Applications/Autorun/About.txt", ["type"]="Application", ["icon"]="IgorTimofeev/OpenComputers/master/Applications/Autorun/Icon.pic", + ["createShortcut"] = "desktop", ["version"]=1.0, }, { @@ -472,6 +489,7 @@ ["about"]="IgorTimofeev/OpenComputers/master/Applications/Matrix/About.txt", ["type"]="Application", ["icon"]="IgorTimofeev/OpenComputers/master/Applications/Matrix/Icon.pic", + ["createShortcut"] = "desktop", ["version"]=1.0, }, { @@ -480,6 +498,16 @@ ["about"]="IgorTimofeev/OpenComputers/master/Applications/HEX/About.txt", ["type"]="Application", ["icon"]="IgorTimofeev/OpenComputers/master/Applications/HEX/Icon.pic", + ["createShortcut"] = "dock", + ["version"]=1.0, + }, + { + ["name"]="MineOS/Applications/ChristmasTree", + ["url"]="IgorTimofeev/OpenComputers/master/Applications/ChristmasTree/ChristmasTree.lua", + ["about"]="IgorTimofeev/OpenComputers/master/Applications/ChristmasTree/About.txt", + ["type"]="Application", + ["createShortcut"] = "desktop", + ["icon"]="IgorTimofeev/OpenComputers/master/Applications/ChristmasTree/Icon.pic", ["version"]=1.0, }, -- Приложение InfoPanel @@ -489,6 +517,7 @@ ["type"]="Application", ["about"]="IgorTimofeev/OpenComputers/master/Applications/InfoPanel/About.txt", ["icon"]="IgorTimofeev/OpenComputers/master/Applications/InfoPanel/Icon.pic", + ["createShortcut"] = "desktop", ["version"]=1.0, }, { @@ -518,29 +547,13 @@ ----------------------------------------------------- Приложения с ресурсами -------------------------------------------------------------------------- - { - ["name"]="MineOS/Applications/MineCode", - ["url"]="IgorTimofeev/OpenComputers/master/Applications/MineCode/MineCode.lua", - ["type"]="Application", - ["icon"]="IgorTimofeev/OpenComputers/master/Applications/MineCode/Icon.pic", - ["version"]=1.0, - ["resources"]={ - { - ["name"]="English.lang", - ["url"]="IgorTimofeev/OpenComputers/master/Applications/MineCode/English.lang", - }, - { - ["name"]="Russian.lang", - ["url"]="IgorTimofeev/OpenComputers/master/Applications/MineCode/Russian.lang", - }, - }, - }, { ["name"]="MineOS/Applications/Crossword", ["url"]="IgorTimofeev/OpenComputers/master/Applications/Crossword/Crossword.lua", ["about"]="IgorTimofeev/OpenComputers/master/Applications/Crossword/About.txt", ["type"]="Application", ["icon"]="IgorTimofeev/OpenComputers/master/Applications/Crossword/Icon.pic", + ["createShortcut"] = "desktop", ["version"]=1.0, ["resources"]={ { @@ -554,6 +567,7 @@ ["url"]="IgorTimofeev/OpenComputers/master/Applications/Highlight/Highlight.lua", ["type"]="Application", ["icon"]="IgorTimofeev/OpenComputers/master/Applications/Highlight/Icon.pic", + ["createShortcut"] = "desktop", ["version"]=1.0, ["resources"]={ { @@ -567,6 +581,7 @@ ["url"]="IgorTimofeev/OpenComputers/master/Applications/HoloEdit/HoloEdit.lua", ["type"]="Application", ["icon"]="IgorTimofeev/OpenComputers/master/Applications/HoloEdit/Icon.pic", + ["createShortcut"] = "desktop", ["version"]=1.0, ["resources"]={ { @@ -585,6 +600,7 @@ ["about"]="IgorTimofeev/OpenComputers/master/Applications/BufferDemo/About.txt", ["type"]="Application", ["icon"]="IgorTimofeev/OpenComputers/master/Applications/BufferDemo/Icon.pic", + ["createShortcut"] = "desktop", ["version"]=1.0, ["resources"]={ { diff --git a/Applications/ChristmasTree/About.txt b/Applications/ChristmasTree/About.txt new file mode 100644 index 00000000..b0f5477c --- /dev/null +++ b/Applications/ChristmasTree/About.txt @@ -0,0 +1 @@ +Красивая новогодняя программа, написанная разработчиком Doob, сотворяющая атмосферу праздника в любом месте, где бы вы ни находились. \ No newline at end of file diff --git a/Applications/ChristmasTree/ChristmasTree.lua b/Applications/ChristmasTree/ChristmasTree.lua new file mode 100644 index 00000000..14d1d4a0 --- /dev/null +++ b/Applications/ChristmasTree/ChristmasTree.lua @@ -0,0 +1,95 @@ +local component = require("component") +local ecs = require("ECSAPI") +local hologram +local c = 23 + +if not component.isAvailable("hologram") then + ecs.error("Этой программе необходим голографический проектор 2 уровня.") + return +else + hologram = component.hologram +end + +-- создаем модель елки +local tSpruce = {3, 2, 2, 2, 2, 8, 9, 10, 9, 8, 7, 6, 5, 4, 3, 4, 6, 8, 7, 6, 5, 4, 3, 6, 5, 4, 3, 2, 3, 2, 1} + +-- создаем таблицу с падающими снежинками +local tSnow = {} + +-- создаем палитру цветов +hologram.setPaletteColor(1, 0xFFFFFF) -- снег +hologram.setPaletteColor(2, 0x221100) -- ствол +hologram.setPaletteColor(3, 0x005522) -- хвоя + +local function cricle(x0, y, z0, R, i) -- задействуем алгоритм Брезенхэма для рисования кругов + local x = R + local z = 0 + local err = -R + while z <= x do + hologram.set(x + x0, y, z + z0, i) + hologram.set(z + x0, y, x + z0, i) + hologram.set(-x + x0, y, z + z0, i) + hologram.set(-z + x0, y, x + z0, i) + hologram.set(-x + x0, y, -z + z0, i) + hologram.set(-z + x0, y, -x + z0, i) + hologram.set(x + x0, y, -z + z0, i) + hologram.set(z + x0, y, -x + z0, i) + z = z + 1 + if err <= 0 then + err = err + (2 * z + 1) + else + x = x - 1 + err = err + (2 * (z - x) + 1) + end + end +end + +local function spruce() -- рисуем ель + for i = 1, 5 do + cricle(c, i, c, tSpruce[i], 2) -- отрисовываем основание ствола + cricle(c, i, c, tSpruce[i]-1, 2) + end + for j = 5, #tSpruce do + cricle(c, j, c, tSpruce[j]-1, 3) -- отрисовываем хвою + cricle(c, j, c, tSpruce[j]-2, 3) + end +end + +local function gen_snow() -- генерируем снежинку + local x, y, z = math.random(1, 46), 32, math.random(1, 46) + table.insert(tSnow,{x=x,y=y,z=z}) + hologram.set(x, y, z, 1) +end + +local function falling_snow() -- сдвигаем снежинки вниз + local i=1 + while i<=#tSnow do + if tSnow[i].y>1 then + local x,y,z=tSnow[i].x+math.random(-1, 1), tSnow[i].y-1, tSnow[i].z+math.random(-1, 1) + if x<1 then x=1 end + if x>46 then x=46 end + if z<1 then z=1 end + if z>46 then z=46 end + c=hologram.get(x, y, z) + if c==0 or c==1 then + hologram.set(tSnow[i].x, tSnow[i].y, tSnow[i].z, 0) + tSnow[i].x, tSnow[i].y, tSnow[i].z=x,y,z + hologram.set(x, y, z, 1) + i=i+1 + else + table.remove(tSnow,i) + end + else + table.remove(tSnow,i) + end + os.sleep(0) + end +end + +ecs.info("auto", "auto", "", "Счастливого нового года!") +hologram.clear() +spruce() +while 1 do + gen_snow() + falling_snow() +end \ No newline at end of file diff --git a/Applications/ChristmasTree/Icon.pic b/Applications/ChristmasTree/Icon.pic new file mode 100644 index 00000000..65a6b99a Binary files /dev/null and b/Applications/ChristmasTree/Icon.pic differ diff --git a/Installer/Installer.lua b/Installer/Installer.lua index 9031eca6..0a553563 100644 --- a/Installer/Installer.lua +++ b/Installer/Installer.lua @@ -296,6 +296,21 @@ do end end +-------------------------- Подготавливаем файловую систему ---------------------------------- + +--Создаем стартовые пути и прочие мелочи чисто для эстетики +local desktopPath = "MineOS/Desktop/" +local dockPath = "MineOS/System/OS/Dock/" +local applicationsPath = "MineOS/Applications/" +local picturesPath = "MineOS/Pictures/" + +fs.remove(desktopPath) +fs.remove(dockPath) + +fs.makeDirectory(desktopPath .. "My files") +fs.makeDirectory(picturesPath) +fs.makeDirectory(dockPath) + --------------------------СТАДИЯ ЗАГРУЗКИ----------------------------------- do @@ -325,23 +340,35 @@ do --ВСЕ ДЛЯ ЗАГРУЗКИ local path = applications[app]["name"] - if fs.exists(path) then fs.remove(path) end + fs.remove(path .. ".app") --Если тип = приложение if applications[app]["type"] == "Application" then fs.makeDirectory(path..".app/Resources") - getFromGitHubSafely(GitHubUserUrl .. applications[app]["url"], path..".app/"..fs.name(applications[app]["name"]..".lua")) - getFromGitHubSafely(GitHubUserUrl .. applications[app]["icon"], path..".app/Resources/Icon.pic") + getFromGitHubSafely(GitHubUserUrl .. applications[app]["url"], path .. ".app/" .. fs.name(applications[app]["name"] .. ".lua")) + getFromGitHubSafely(GitHubUserUrl .. applications[app]["icon"], path .. ".app/Resources/Icon.pic") + + --Если есть ресурсы, то загружаем ресурсы if applications[app]["resources"] then for i = 1, #applications[app]["resources"] do getFromGitHubSafely(GitHubUserUrl .. applications[app]["resources"][i]["url"], path..".app/Resources/"..applications[app]["resources"][i]["name"]) end end + --Если есть файл "о программе", то грузим и его if applications[app].about then getFromGitHubSafely(GitHubUserUrl .. applications[app].about, path .. ".app/Resources/About.txt") end + --Если имеется режим создания ярлыка, то создаем его + if applications[app].createShortcut then + if applications[app].createShortcut == "dock" then + ecs.createShortCut(dockPath .. fs.name(applications[app].name) .. ".lnk", applications[app].name) + else + ecs.createShortCut(desktopPath .. fs.name(applications[app].name) .. ".lnk", applications[app].name) + end + end + --Если тип = другой, чужой, а мб и свой пастебин elseif applications[app]["type"] == "Pastebin" then fs.remove(applications[app]["name"]) @@ -375,66 +402,11 @@ ecs.centerText("x",yWindowEnd - 5, lang.needToRestart) --Кнопа drawButton(lang.restart, false) - waitForClickOnButton(lang.restart) - ecs.prepareToExit() ---Постподготовка -fs.remove("MineOS/Desktop") -fs.remove("MineOS/System/OS/Dock") - -local apps = { - "Calc.app", - "Crossword.app", - "Geoscan.app", - "Highlight.app", - "HoloClock.app", - "HoloEdit.app", - "MineCode.app", - "Pastebin.app", - "Piano.app", - "Shooting.app", - "Shop.app", - "CodeDoor.app", - "Snake.app", - "Keyboard.app", - "Nano.app", - "Camera.app", - "Autorun.app", - "BufferDemo.app", - "Matrix.app", - "InfoPanel.app", -} - -local dockApps = { - "Finder.app", - "Calendar.app", - "Control.app", - "Photoshop.app", - "HEX.app" -} - -local desktopPath = "MineOS/Desktop/" -local dockPath = "MineOS/System/OS/Dock/" -local applicationsPath = "MineOS/Applications/" -local picturesPath = "MineOS/Pictures/" - -fs.makeDirectory(desktopPath .. "My files") -fs.makeDirectory(picturesPath) - -for i = 1, #apps do - ecs.createShortCut(desktopPath .. ecs.hideFileFormat(apps[i]) .. ".lnk", applicationsPath .. apps[i]) -end - -fs.makeDirectory(dockPath) - -for i = 1, #dockApps do - ecs.createShortCut(dockPath .. ecs.hideFileFormat(dockApps[i]) .. ".lnk", applicationsPath .. dockApps[i]) -end - +--Создаем базовые обои рабочего стола ecs.createShortCut(desktopPath .. "Pictures.lnk", picturesPath) - if downloadWallpapers then ecs.createShortCut("MineOS/System/OS/Wallpaper.lnk", picturesPath .. "AhsokaTano.pic") end --Автозагрузка