mirror of
https://github.com/IgorTimofeev/MineOS.git
synced 2026-01-09 12:42:39 +01:00
Начинаем йоба-обнову без /Resources/
This commit is contained in:
parent
91943b9821
commit
647c060c5f
@ -1 +0,0 @@
|
||||
One of the main system applications, allows you to check for available updates, and download the most beautiful programs created specifically for MineOS.
|
||||
@ -1 +0,0 @@
|
||||
Одно из главных системных приложений, позволяющее проверять наличие необходимых обновлений, а также загружать красивейшие программы, созданные специально для MineOS.
|
||||
@ -30,7 +30,7 @@ local configPath = appMarketPath .. "Config.cfg"
|
||||
local userPath = appMarketPath .. "User.cfg"
|
||||
local iconCachePath = appMarketPath .. "Cache/"
|
||||
|
||||
local resourcesPath = MineOSCore.getCurrentApplicationResourcesDirectory()
|
||||
local resourcesPath = MineOSCore.getCurrentScriptDirectory()
|
||||
local localization = MineOSCore.getLocalization(resourcesPath .. "Localizations/")
|
||||
|
||||
local categories = {
|
||||
@ -409,7 +409,7 @@ local function getDependencyPath(mainFilePath, dependency)
|
||||
path = dependency.path
|
||||
-- Ресурсы по релятивному пути
|
||||
else
|
||||
path = getApplicationPathFromVersions(mainFilePath) .. "/Resources/" .. dependency.path
|
||||
path = getApplicationPathFromVersions(mainFilePath) .. "/" .. dependency.path
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@ -13,7 +13,7 @@ local MineOSInterface = require("MineOSInterface")
|
||||
|
||||
----------------------------------------------------------------------------------------------------------------
|
||||
|
||||
local resourcesPath = MineOSCore.getCurrentApplicationResourcesDirectory()
|
||||
local resourcesPath = MineOSCore.getCurrentScriptDirectory()
|
||||
local modulesPath = resourcesPath .. "Modules/"
|
||||
local localization = MineOSCore.getLocalization(resourcesPath .. "Localizations/")
|
||||
|
||||
|
||||
@ -1 +0,0 @@
|
||||
Finder is an analogue to Windows Explorer. It allows you to easily navigate though filesystem, to copy/paste/delete files and folders, to create shortcuts and sort them whatever you want, to navigate through list of mounted devices, to set up MineOS wallpapers and more, more...
|
||||
@ -1 +0,0 @@
|
||||
Finder - это аналог проводника в Windows. Он позволяет удобно осуществлять навигацию по файловой системе, копировать, вставлять, удалять файлы и папки, создавать ярлыки, сортировать содержимое папкок по имени, дате изменения и типу файлов, просматривать список монтированных устройств, устанавливать обои для OS и многое другое.
|
||||
@ -26,8 +26,8 @@ local favourites = {
|
||||
{text = "System", path = MineOSPaths.system},
|
||||
{text = "Trash", path = MineOSPaths.trash},
|
||||
}
|
||||
local resourcesPath = MineOSCore.getCurrentApplicationResourcesDirectory()
|
||||
local favouritesPath = resourcesPath .. "Favourites.cfg"
|
||||
local resourcesPath = MineOSCore.getCurrentScriptDirectory()
|
||||
local favouritesPath = MineOSPaths.applicationData .. "Finder/Favourites.cfg"
|
||||
|
||||
if fs.exists(favouritesPath) then
|
||||
favourites = table.fromFile(favouritesPath)
|
||||
@ -160,14 +160,14 @@ local function updateSidebar()
|
||||
end
|
||||
end
|
||||
|
||||
window.titlePanel = window:addChild(GUI.panel(1, 1, 1, 3, 0xDDDDDD))
|
||||
window.titlePanel = window:addChild(GUI.panel(1, 1, 1, 3, 0xE1E1E1))
|
||||
|
||||
window.prevButton = window:addChild(GUI.adaptiveRoundedButton(9, 2, 1, 0, 0xFFFFFF, 0x3C3C3C, 0x3C3C3C, 0xFFFFFF, "<"))
|
||||
window.prevButton.onTouch = function()
|
||||
prevOrNextWorkpath(false)
|
||||
end
|
||||
window.prevButton.colors.disabled.background = window.prevButton.colors.default.background
|
||||
window.prevButton.colors.disabled.text = 0xCCCCCC
|
||||
window.prevButton.colors.disabled.text = 0xC3C3C3
|
||||
|
||||
window.nextButton = window:addChild(GUI.adaptiveRoundedButton(14, 2, 1, 0, 0xFFFFFF, 0x3C3C3C, 0x3C3C3C, 0xFFFFFF, ">"))
|
||||
window.nextButton.onTouch = function()
|
||||
@ -186,32 +186,6 @@ window.iconField = window:addChild(
|
||||
)
|
||||
)
|
||||
|
||||
window.iconField.launchers.directory = function(icon)
|
||||
addWorkpath(icon.path)
|
||||
updateFileListAndDraw()
|
||||
end
|
||||
|
||||
window.iconField.launchers.showPackageContent = function(icon)
|
||||
addWorkpath(icon.path)
|
||||
updateFileListAndDraw()
|
||||
end
|
||||
|
||||
window.iconField.launchers.showContainingFolder = function(icon)
|
||||
addWorkpath(fs.path(MineOSCore.readShortcut(icon.path)))
|
||||
updateFileListAndDraw()
|
||||
end
|
||||
|
||||
window.scrollBar = window:addChild(GUI.scrollBar(1, 4, 1, 1, 0xC3C3C3, 0x444444, iconFieldYOffset, 1, 1, 1, 1, true))
|
||||
|
||||
window.searchInput = window:addChild(GUI.input(1, 2, 36, 1, 0xFFFFFF, 0x666666, 0xAAAAAA, 0xFFFFFF, 0x2D2D2D, nil, "Search", true))
|
||||
window.searchInput.onInputFinished = function()
|
||||
window.iconField.filenameMatcher = window.searchInput.text
|
||||
window.iconField.fromFile = 1
|
||||
window.iconField.yOffset = iconFieldYOffset
|
||||
|
||||
updateFileListAndDraw()
|
||||
end
|
||||
|
||||
local function updateScrollBar()
|
||||
local shownFilesCount = #window.iconField.fileList - window.iconField.fromFile + 1
|
||||
|
||||
@ -233,16 +207,9 @@ local function updateScrollBar()
|
||||
end
|
||||
end
|
||||
|
||||
local overrideUpdateFileList = window.iconField.updateFileList
|
||||
window.iconField.updateFileList = function(...)
|
||||
overrideUpdateFileList(...)
|
||||
updateScrollBar()
|
||||
end
|
||||
|
||||
window.iconField.eventHandler = function(mainContainer, object, eventData)
|
||||
if eventData[1] == "scroll" then
|
||||
eventData[5] = eventData[5] * 2
|
||||
window.iconField.yOffset = window.iconField.yOffset + eventData[5]
|
||||
window.iconField.yOffset = window.iconField.yOffset + eventData[5] * 2
|
||||
|
||||
updateScrollBar()
|
||||
|
||||
@ -270,6 +237,38 @@ window.iconField.eventHandler = function(mainContainer, object, eventData)
|
||||
end
|
||||
end
|
||||
|
||||
window.iconField.launchers.directory = function(icon)
|
||||
addWorkpath(icon.path)
|
||||
updateFileListAndDraw()
|
||||
end
|
||||
|
||||
window.iconField.launchers.showPackageContent = function(icon)
|
||||
addWorkpath(icon.path)
|
||||
updateFileListAndDraw()
|
||||
end
|
||||
|
||||
window.iconField.launchers.showContainingFolder = function(icon)
|
||||
addWorkpath(fs.path(MineOSCore.readShortcut(icon.path)))
|
||||
updateFileListAndDraw()
|
||||
end
|
||||
|
||||
window.scrollBar = window:addChild(GUI.scrollBar(1, 4, 1, 1, 0xC3C3C3, 0x444444, iconFieldYOffset, 1, 1, 1, 1, true))
|
||||
|
||||
window.searchInput = window:addChild(GUI.input(1, 2, 36, 1, 0xFFFFFF, 0x696969, 0xA5A5A5, 0xFFFFFF, 0x2D2D2D, nil, "Search", true))
|
||||
window.searchInput.onInputFinished = function()
|
||||
window.iconField.filenameMatcher = window.searchInput.text
|
||||
window.iconField.fromFile = 1
|
||||
window.iconField.yOffset = iconFieldYOffset
|
||||
|
||||
updateFileListAndDraw()
|
||||
end
|
||||
|
||||
local overrideUpdateFileList = window.iconField.updateFileList
|
||||
window.iconField.updateFileList = function(...)
|
||||
overrideUpdateFileList(...)
|
||||
updateScrollBar()
|
||||
end
|
||||
|
||||
window.statusBar = window:addChild(GUI.object(1, 1, 1, 1))
|
||||
window.statusBar.draw = function(object)
|
||||
buffer.square(object.x, object.y, object.width, object.height, 0xFFFFFF, 0x3C3C3C, " ")
|
||||
@ -320,7 +319,6 @@ local function calculateSizes(width, height)
|
||||
window.iconField.width = window.backgroundPanel.width
|
||||
window.iconField.height = height + 4
|
||||
window.iconField.localX = window.backgroundPanel.localX
|
||||
window.iconField.localY = window.backgroundPanel.localY
|
||||
|
||||
window.scrollBar.localX = window.width
|
||||
window.scrollBar.height = window.backgroundPanel.height
|
||||
|
||||
@ -1 +0,0 @@
|
||||
Popular game now right on your computer in Minecraft! Enjoy incredible graphics and butthurts from frequent deaths.
|
||||
@ -1 +0,0 @@
|
||||
Популярная игра теперь прямо в вашем компьютере в Minecraft! Наслаждайтесь невероятной графикой и баттхертами от частых смертей.
|
||||
@ -40,7 +40,7 @@ local colors = {
|
||||
local columns = {}
|
||||
|
||||
local pathToHighScores = MineOSPaths.applicationData .. "/FlappyBird/Scores.cfg"
|
||||
local pathToFlappyImage = MineOSCore.getCurrentApplicationResourcesDirectory() .. "Flappy.pic"
|
||||
local pathToFlappyImage = MineOSCore.getCurrentScriptDirectory() .. "Flappy.pic"
|
||||
local bird = image.load(pathToFlappyImage)
|
||||
local xBird, yBird = 8, math.floor(bufferHeight / 2 - 3)
|
||||
local birdIsAlive = true
|
||||
|
||||
@ -20,7 +20,7 @@ component.gpu.setResolution(component.gpu.maxResolution())
|
||||
buffer.flush()
|
||||
local bufferWidth, bufferHeight = buffer.getResolution()
|
||||
|
||||
local resourcesDirectory = MineOSCore.getCurrentApplicationResourcesDirectory()
|
||||
local resourcesDirectory = MineOSCore.getCurrentScriptDirectory()
|
||||
local earthImage = image.load(resourcesDirectory .. "Earth.pic")
|
||||
|
||||
local onScreenDataXOffset, onScreenDataYOffset = math.floor(bufferWidth / 2), bufferHeight
|
||||
|
||||
@ -1,193 +0,0 @@
|
||||
local c = require("component")
|
||||
local event = require("event")
|
||||
local geo, holo
|
||||
local gpu = c.gpu
|
||||
local ecs = require("ECSAPI")
|
||||
local palette = require("palette")
|
||||
local computer = require("computer")
|
||||
|
||||
local args = {...}
|
||||
|
||||
--Проверка на наличие нужных устройств
|
||||
if not c.isAvailable("geolyzer") or not c.isAvailable("hologram") then
|
||||
ecs.error("Подключите геоанализатор и голографический проектор 2-ого уровня")
|
||||
return
|
||||
else
|
||||
geo = c.geolyzer
|
||||
holo = c.hologram
|
||||
end
|
||||
|
||||
-------------------------
|
||||
|
||||
local massiv = {}
|
||||
|
||||
local yModifyer = -20
|
||||
local scales = {0.33, 0.75, 1, 1.5, 2, 2.5, 3}
|
||||
local currentScale = 1
|
||||
local countOfScales = #scales
|
||||
|
||||
local xScanFrom = tonumber(args[1]) or -24
|
||||
local xScanTo = tonumber(args[2]) or 23
|
||||
local zScanFrom, zScanTo = xScanFrom, xScanTo
|
||||
|
||||
local xSize, ySize = gpu.getResolution()
|
||||
local yCenter = math.floor(ySize / 2)
|
||||
|
||||
---------------------------------------
|
||||
|
||||
local function clear()
|
||||
holo.clear()
|
||||
end
|
||||
|
||||
local function getMemory()
|
||||
local totalMemory = computer.totalMemory() / 1024
|
||||
local freeMemory = computer.freeMemory() / 1024
|
||||
local usedMemory = totalMemory - freeMemory
|
||||
|
||||
local stro4ka = math.ceil(usedMemory).."/"..math.floor(totalMemory).."KB"
|
||||
|
||||
totalMemory, freeMemory, usedMemory = nil, nil, nil
|
||||
|
||||
return stro4ka
|
||||
end
|
||||
|
||||
local function changeScale()
|
||||
if currentScale < countOfScales then
|
||||
currentScale = currentScale + 1
|
||||
else
|
||||
currentScale = 1
|
||||
end
|
||||
|
||||
holo.setScale(scales[currentScale])
|
||||
end
|
||||
|
||||
local function displayRow(x, yModifyer, z, tablica)
|
||||
local color
|
||||
for i = 1, #tablica do
|
||||
|
||||
massiv[x][z][i] = math.ceil(massiv[x][z][i])
|
||||
|
||||
if tablica[i] > 0 then
|
||||
|
||||
color = 1
|
||||
|
||||
if tablica[i] > 4 then
|
||||
color = 2
|
||||
end
|
||||
|
||||
if tablica[i + yModifyer] then
|
||||
holo.set(xScanTo - x + 1, i + yModifyer, zScanTo - z + 1, color)
|
||||
end
|
||||
end
|
||||
end
|
||||
color = nil
|
||||
tablica = nil
|
||||
end
|
||||
|
||||
local function displayAllRows()
|
||||
clear()
|
||||
for x, val in pairs(massiv) do
|
||||
for z, val2 in pairs(massiv[x]) do
|
||||
displayRow(x, yModifyer, z, val2)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function scan()
|
||||
clear()
|
||||
ecs.clearScreen(0xffffff)
|
||||
local barWidth = math.floor(xSize / 3 * 2)
|
||||
local percent = 0
|
||||
local xBar, yBar = math.floor(xSize/2 - barWidth / 2), yCenter
|
||||
local countOfAll = (math.abs(xScanFrom) + math.abs(xScanTo) + 1) ^ 2
|
||||
|
||||
local counter = 0
|
||||
for x = xScanFrom, xScanTo do
|
||||
massiv[x] = {}
|
||||
for z = zScanFrom, zScanTo do
|
||||
|
||||
massiv[x][z] = geo.scan(x, z, true)
|
||||
for i = 1, #massiv[x][z] do
|
||||
displayRow(x, yModifyer, z, massiv[x][z])
|
||||
end
|
||||
percent = counter / countOfAll * 100
|
||||
ecs.progressBar(xBar, yBar, barWidth, 1, 0xcccccc, ecs.colors.blue, percent)
|
||||
gpu.setForeground(0x444444)
|
||||
gpu.setBackground(0xffffff)
|
||||
ecs.centerText("x", yBar + 1, " Сканирование стека на x = "..x..", z = "..z.." ")
|
||||
ecs.centerText("x", yBar + 3, " "..math.floor(percent).."% завершено ")
|
||||
ecs.centerText("x", yBar + 2, " "..getMemory().." RAM ")
|
||||
counter = counter + 1
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local obj = {}
|
||||
local function newObj(class, name, ...)
|
||||
obj[class] = obj[class] or {}
|
||||
obj[class][name] = {...}
|
||||
end
|
||||
|
||||
local currentHoloColor = ecs.colors.lime
|
||||
|
||||
local function changeColorTo(color)
|
||||
currentHoloColor = color
|
||||
holo.setPaletteColor(1, color)
|
||||
holo.setPaletteColor(2, 0xffffff - color)
|
||||
end
|
||||
|
||||
|
||||
local function main()
|
||||
ecs.clearScreen(0xffffff)
|
||||
local yPos = yCenter - 14
|
||||
newObj("buttons", "Сканировать местность", ecs.drawAdaptiveButton("auto", yPos, 3, 1, "Сканировать местность", 0x444444, 0xffffff)); yPos = yPos + 4
|
||||
newObj("buttons", "Масштаб", ecs.drawAdaptiveButton("auto", yPos, 3, 1, "Масштаб", 0x444444, 0xffffff)); yPos = yPos + 4
|
||||
newObj("buttons", "Перерисовать голограмму", ecs.drawAdaptiveButton("auto", yPos, 3, 1, "Перерисовать голограмму", 0x444444, 0xffffff)); yPos = yPos + 4
|
||||
newObj("buttons", "+ 10 блоков", ecs.drawAdaptiveButton("auto", yPos, 3, 1, "+ 10 блоков", 0x444444, 0xffffff)); yPos = yPos + 4
|
||||
newObj("buttons", "- 10 блоков", ecs.drawAdaptiveButton("auto", yPos, 3, 1, "- 10 блоков", 0x444444, 0xffffff)); yPos = yPos + 4
|
||||
newObj("buttons", "Изменить цвет", ecs.drawAdaptiveButton("auto", yPos, 3, 1, "Изменить цвет", currentHoloColor, 0xffffff)); yPos = yPos + 4
|
||||
newObj("buttons", "Выйти", ecs.drawAdaptiveButton("auto", yPos, 3, 1, "Выйти", 0x666666, 0xffffff)); yPos = yPos + 4
|
||||
gpu.setBackground(0xffffff)
|
||||
gpu.setForeground(0x444444)
|
||||
ecs.centerText("x", yPos, "Модификатор высоты: "..yModifyer)
|
||||
end
|
||||
|
||||
----------------------------
|
||||
|
||||
changeColorTo(0x009900)
|
||||
changeScale()
|
||||
main()
|
||||
|
||||
while true do
|
||||
local e = {event.pull()}
|
||||
if e[1] == "touch" then
|
||||
for key, val in pairs(obj["buttons"]) do
|
||||
if ecs.clickedAtArea(e[3], e[4], obj["buttons"][key][1], obj["buttons"][key][2], obj["buttons"][key][3], obj["buttons"][key][4]) then
|
||||
ecs.drawAdaptiveButton(obj["buttons"][key][1], obj["buttons"][key][2], 3, 1, key, ecs.colors.green, 0xffffff)
|
||||
os.sleep(0.3)
|
||||
if key == "Сканировать местность" then
|
||||
scan()
|
||||
elseif key == "Масштаб" then
|
||||
changeScale()
|
||||
elseif key == "Перерисовать голограмму" then
|
||||
displayAllRows()
|
||||
elseif key == "+ 10 блоков" then
|
||||
yModifyer = yModifyer - 10
|
||||
elseif key == "- 10 блоков" then
|
||||
yModifyer = yModifyer + 10
|
||||
elseif key == "Выйти" then
|
||||
ecs.prepareToExit()
|
||||
return 0
|
||||
elseif key == "Изменить цвет" then
|
||||
local color = palette.draw("auto", "auto", currentHoloColor)
|
||||
if color ~= nil then
|
||||
changeColorTo(color)
|
||||
end
|
||||
end
|
||||
main()
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Binary file not shown.
@ -1,244 +0,0 @@
|
||||
|
||||
_G.buffer = require("doubleBuffering")
|
||||
buffer.start()
|
||||
_G.unicode = require("unicode")
|
||||
_G.event = require("event")
|
||||
_G.ecs = require("ECSAPI")
|
||||
|
||||
local xGraph, yGraph = math.floor(buffer.width / 2), buffer.height
|
||||
local yDependencyString = "math.sin(x) * 5"
|
||||
local graphScale = 4
|
||||
local graphResizeSpeed = 0.4
|
||||
local renderRange = 40
|
||||
local renderAccuracy = 0.4
|
||||
local axisColor = 0x333333
|
||||
local graphColor = 0x88FF88
|
||||
local selectionPointLineColor = 0x555555
|
||||
local selectionPointColor = 0x5555FF
|
||||
local selectionTooltipTextColor = 0xFFFFFF
|
||||
local buttonColor = 0xEEEEEE
|
||||
local backgroundColor = 0x1b1b1b
|
||||
local buttonTextColor = 0x1b1b1b
|
||||
local buttonWidth = 20
|
||||
local selectedPoints = {{x = -5, y = 2}}
|
||||
local showCornerPoints = false
|
||||
|
||||
------------------------------------------------------------------------------------------------------------------------------------------
|
||||
local buttons = {}
|
||||
|
||||
local function assertString(x, yDependencyString)
|
||||
local stro4ka = "local x = " .. x .. "; local y = " .. yDependencyString .. "; return y"
|
||||
return pcall(load(stro4ka))
|
||||
end
|
||||
|
||||
local function drawButtons()
|
||||
buttons = {}
|
||||
local buttonNames = {"Функция", "Масштаб", "Очистить точки", "Выход"}
|
||||
local x, y = math.floor(buffer.width / 2 - (#buttonNames * (buttonWidth + 2) - 2) / 2), buffer.height - 4
|
||||
|
||||
for i = 1, #buttonNames do
|
||||
buttons[buttonNames[i]] = { buffer.button(x, y, buttonWidth, 3, buttonColor, buttonTextColor, buttonNames[i]) }
|
||||
x = x + buttonWidth + 2
|
||||
end
|
||||
end
|
||||
|
||||
local function drawHorizontalLine(x, y, x2, color)
|
||||
for i = x, x2 do buffer.semiPixelSet(i, y, color) end
|
||||
end
|
||||
|
||||
local function drawVerticalLine(x, y, y2, color)
|
||||
for i = y, y2 do buffer.semiPixelSet(x, i, color) end
|
||||
end
|
||||
|
||||
local function drawAxis()
|
||||
drawHorizontalLine(1, yGraph, buffer.width, axisColor)
|
||||
drawVerticalLine(xGraph, 1, buffer.height * 2, axisColor)
|
||||
end
|
||||
|
||||
local function limit(n)
|
||||
if n > -500 and n < 500 then return true end
|
||||
end
|
||||
|
||||
local keyPoints = {}
|
||||
local function calculateKeyPoints()
|
||||
keyPoints = {}
|
||||
local xOld, yOld, xNew, yNew = math.huge, math.huge
|
||||
for x = -renderRange, renderRange, renderAccuracy do
|
||||
local success, result = assertString(x, yDependencyString)
|
||||
if success then
|
||||
if not (result ~= result) then
|
||||
xNew, yNew = math.floor(x * graphScale), math.floor(result * graphScale)
|
||||
|
||||
if limit(xOld) and limit(yOld) and limit(xNew) and limit(yNew) then
|
||||
table.insert(keyPoints, {x = xOld, y = yOld, x2 = xNew, y2 = yNew})
|
||||
-- buffer.semiPixelLine(xOld, yOld, xNew, yNew, graphColor)
|
||||
end
|
||||
|
||||
xOld, yOld = xNew, yNew
|
||||
end
|
||||
-- else
|
||||
-- error(result)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function drawGraph()
|
||||
for i = 1, #keyPoints do
|
||||
buffer.semiPixelLine(xGraph + keyPoints[i].x, yGraph - keyPoints[i].y, xGraph + keyPoints[i].x2, yGraph - keyPoints[i].y2, graphColor)
|
||||
if showCornerPoints then buffer.semiPixelSet(xGraph + keyPoints[i].x, yGraph - keyPoints[i].y, 0x00A8FF) end
|
||||
end
|
||||
end
|
||||
|
||||
local function tooltip(x, y, tooltipColor, textColor, ...)
|
||||
local stringArray = {...}
|
||||
local maxTextLength = 0; for i = 1, #stringArray do maxTextLength = math.max(maxTextLength, unicode.len(stringArray[i])) end
|
||||
|
||||
buffer.square(x, y, maxTextLength + 2, #stringArray, tooltipColor, textColor, " ")
|
||||
x = x + 1
|
||||
for i = 1, #stringArray do
|
||||
buffer.text(x, y, textColor, stringArray[i])
|
||||
y = y + 1
|
||||
end
|
||||
end
|
||||
|
||||
local function drawSelectedPoint(x, y, pointNumber)
|
||||
local xOnScreen, yOnScreen = math.floor(xGraph + x * graphScale), math.floor(yGraph - y * graphScale)
|
||||
|
||||
if xOnScreen <= xGraph then drawHorizontalLine(xOnScreen, yOnScreen, xGraph - 1, selectionPointLineColor) else drawHorizontalLine(xGraph + 1, yOnScreen, xOnScreen, selectionPointLineColor) end
|
||||
if yOnScreen <= yGraph then drawVerticalLine(xOnScreen, yOnScreen, yGraph - 1, selectionPointLineColor) else drawVerticalLine(xOnScreen, yGraph + 1, yOnScreen, selectionPointLineColor) end
|
||||
|
||||
buffer.semiPixelSet(xOnScreen, yOnScreen, selectionPointColor)
|
||||
|
||||
yOnScreen = math.ceil(yOnScreen / 2)
|
||||
|
||||
tooltip(xOnScreen + 3, yOnScreen + 2, selectionPointLineColor, selectionTooltipTextColor, "Точка #" .. pointNumber, "x: " .. x, "y: " .. y)
|
||||
end
|
||||
|
||||
local function drawSelectedPoints()
|
||||
if selectedPoints then
|
||||
for i = 1, #selectedPoints do
|
||||
drawSelectedPoint(selectedPoints[i].x, selectedPoints[i].y, i)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function drawAll()
|
||||
buffer.clear(backgroundColor)
|
||||
drawAxis()
|
||||
drawGraph()
|
||||
drawSelectedPoints()
|
||||
drawButtons()
|
||||
buffer.draw()
|
||||
end
|
||||
|
||||
local function clicked(x, y, object)
|
||||
if x >= object[1] and y >= object[2] and x <= object[3] and y <= object[4] then return true end
|
||||
end
|
||||
|
||||
------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
calculateKeyPoints()
|
||||
drawAll()
|
||||
|
||||
local xMove, yMove
|
||||
while true do
|
||||
local e = {event.pull()}
|
||||
if e[1] == "touch" then
|
||||
if e[5] == 1 then
|
||||
selectedPoints = selectedPoints or {}
|
||||
table.insert(selectedPoints, { x = math.floor((e[3] - xGraph) / graphScale), y = math.floor((yGraph - e[4] * 2) / graphScale) })
|
||||
drawAll()
|
||||
else
|
||||
xMove, yMove = e[3], e[4]
|
||||
|
||||
for key in pairs(buttons) do
|
||||
if clicked(e[3], e[4], buttons[key]) then
|
||||
buffer.button(buttons[key][1], buttons[key][2], buttonWidth, 3, graphColor, backgroundColor, key)
|
||||
buffer.draw()
|
||||
os.sleep(0.2)
|
||||
drawAll()
|
||||
|
||||
if key == "Функция" then
|
||||
local data = ecs.universalWindow("auto", "auto", 36, 0x262626, true,
|
||||
{"EmptyLine"},
|
||||
{"CenterText", ecs.colors.orange, "Функция"},
|
||||
{"EmptyLine"},
|
||||
{"Input", 0xFFFFFF, ecs.colors.orange, yDependencyString},
|
||||
{"EmptyLine"},
|
||||
{"CenterText", ecs.colors.orange, "Параметры рендера"},
|
||||
{"Slider", 0xFFFFFF, ecs.colors.orange, 1, 100, renderRange, "Диапазон: ", ""},
|
||||
{"Slider", 0xFFFFFF, ecs.colors.orange, 1, 100, 101 - renderAccuracy * 100, "Точность: ", ""},
|
||||
{"EmptyLine"},
|
||||
{"Switch", ecs.colors.orange, 0xffffff, 0xFFFFFF, "Показывать квант-точки", showCornerPoints},
|
||||
{"EmptyLine"},
|
||||
{"Button", {ecs.colors.orange, 0xffffff, "OK"}, {0x999999, 0xffffff, "Отмена"}}
|
||||
)
|
||||
if data[5] == "OK" then
|
||||
yDependencyString = data[1]
|
||||
renderRange = tonumber(data[2])
|
||||
renderAccuracy = (101 - tonumber(data[3])) / 100
|
||||
showCornerPoints = data[4]
|
||||
calculateKeyPoints()
|
||||
drawAll()
|
||||
end
|
||||
elseif key == "Масштаб" then
|
||||
local data = ecs.universalWindow("auto", "auto", 36, 0x262626, true,
|
||||
{"EmptyLine"},
|
||||
{"CenterText", ecs.colors.orange, "Масштаб"},
|
||||
{"EmptyLine"},
|
||||
{"Slider", 0xFFFFFF, ecs.colors.orange, 1, 3000, math.floor(graphScale * 100), "", "%"},
|
||||
{"EmptyLine"},
|
||||
{"Button", {ecs.colors.orange, 0xffffff, "OK"}, {0x999999, 0xffffff, "Отмена"}}
|
||||
)
|
||||
|
||||
if data[2] == "OK" then
|
||||
graphScale = data[1] / 100
|
||||
calculateKeyPoints()
|
||||
drawAll()
|
||||
end
|
||||
elseif key == "Очистить точки" then
|
||||
selectedPoints = nil
|
||||
drawAll()
|
||||
elseif key == "Выход" then
|
||||
buffer.clear(0x262626)
|
||||
buffer.draw()
|
||||
return
|
||||
end
|
||||
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
elseif e[1] == "drag" then
|
||||
if e[5] ~= 1 then
|
||||
local xDifference, yDifference = e[3] - xMove, e[4] - yMove
|
||||
xGraph, yGraph = xGraph + xDifference, yGraph + yDifference * 2
|
||||
xMove, yMove = e[3], e[4]
|
||||
drawAll()
|
||||
end
|
||||
elseif e[1] == "scroll" then
|
||||
if e[5] == 1 then
|
||||
graphScale = graphScale + graphResizeSpeed
|
||||
calculateKeyPoints()
|
||||
else
|
||||
graphScale = graphScale - graphResizeSpeed
|
||||
if graphScale < graphResizeSpeed then graphScale = graphResizeSpeed end
|
||||
calculateKeyPoints()
|
||||
end
|
||||
drawAll()
|
||||
elseif e[1] == "key_down" then
|
||||
if e[4] == 28 then
|
||||
selectedPoints = nil
|
||||
drawAll()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
@ -11,7 +11,7 @@ local fs = require('filesystem')
|
||||
local com = require('component')
|
||||
local gpu = com.gpu
|
||||
|
||||
local lang = MineOSCore.getCurrentApplicationLocalization()
|
||||
local lang = MineOSCore.getCurrentScriptLocalization()
|
||||
|
||||
-- Константы --
|
||||
HOLOH = 32
|
||||
|
||||
@ -1,29 +0,0 @@
|
||||
{
|
||||
badGPU = "[ERROR] Your monitor/GPU doesn't support required resolution.",
|
||||
palette = "[ Palette ]",
|
||||
control = "[ Control ]",
|
||||
layer = "[ Layer ]",
|
||||
level = "Hologram level:",
|
||||
mainLevel = "Main level:",
|
||||
quit = "Exit: 'Q' or ",
|
||||
developers = "Developers: ",
|
||||
contact = "Contact",
|
||||
savingFile = "Saving file...",
|
||||
loadingFile = "Loading file...",
|
||||
attention = "[ Attention ]",
|
||||
complete = "[ Done! ]",
|
||||
exit = "Quit",
|
||||
refresh = "Refresh",
|
||||
fromUp = "Top",
|
||||
fromFront = "Front",
|
||||
fromSide = "Side",
|
||||
upper = "Upper",
|
||||
lower = "Lower",
|
||||
clear = "Clear",
|
||||
fill = "Fill",
|
||||
toProjector = "To projector",
|
||||
save = "Save",
|
||||
load = "Load",
|
||||
new = "New file",
|
||||
enterFileName = "Enter file name here:",
|
||||
}
|
||||
@ -1,29 +0,0 @@
|
||||
{
|
||||
badGPU = "[ОШИБКА] Ваш монитор/видеокарта не поддерживает требуемое разрешение.",
|
||||
palette = "[ Палитра ]",
|
||||
control = "[ Управление ]",
|
||||
layer = "[ Слой ]",
|
||||
level = "Уровень голограммы:",
|
||||
mainLevel = "Направляющий уровень:",
|
||||
quit = "Выход: 'Q' или ",
|
||||
developers = "Разработчики: ",
|
||||
contact = "Контакты:",
|
||||
savingFile = "Сохраняю файл...",
|
||||
loadingFile = "Загружаю файл...",
|
||||
attention = "[ Внимание ]",
|
||||
complete = "[ Файл сохранен! ]",
|
||||
exit = "Выход",
|
||||
refresh = "Обновить",
|
||||
fromUp = "Сверху",
|
||||
fromFront = "Спереди",
|
||||
fromSide = "Сбоку",
|
||||
upper = "Выше",
|
||||
lower = "Ниже",
|
||||
clear = "Очистить",
|
||||
fill = "Залить",
|
||||
toProjector = "На проектор",
|
||||
save = "Сохранить",
|
||||
load = "Загрузить",
|
||||
new = "Новый файл",
|
||||
enterFileName = "Введите сюда имя файла",
|
||||
}
|
||||
@ -1 +0,0 @@
|
||||
MineCode IDE is a powerful tool for developing any app you want. It supports Lua syntax highlighting, text selection and copy/pasting, user-defined color schemes and beautiful integrated file manager.
|
||||
@ -1 +0,0 @@
|
||||
MineCode IDE - это мощный инстурмент для разработки приложений с богатым функционалом: от подсветки синтаксиса Lua, выделения текста и работы с буфером обмена до поддержки пользовательских цветовых схем. Удобный файловый менеджер также прилагается.
|
||||
@ -118,7 +118,7 @@ local cursor = {
|
||||
}
|
||||
|
||||
local scriptCoroutine
|
||||
local resourcesPath = MineOSCore.getCurrentApplicationResourcesDirectory()
|
||||
local resourcesPath = MineOSCore.getCurrentScriptDirectory()
|
||||
local configPath = MineOSPaths.applicationData .. "MineCode IDE/Config.cfg"
|
||||
local localization = MineOSCore.getLocalization(resourcesPath .. "Localizations/")
|
||||
local findStartFrom
|
||||
|
||||
@ -1 +0,0 @@
|
||||
Photoshop - это мощный графический редактор, написанный специально для работы с нашей ОС. Он поддерживает работу с кистями, прозрачностью, имеет функции заливки, выбора цвета из красочной палитры, позволяет создавать настоящие мини-шедевры прямо на вашем ПК. Вся графика в нашей ОС нарисована именно в этой программе.
|
||||
@ -1 +0,0 @@
|
||||
Photoshop - это мощный графический редактор, написанный специально для работы с нашей ОС. Он поддерживает работу с кистями, прозрачностью, имеет функции заливки, выбора цвета из красочной палитры, позволяет создавать настоящие мини-шедевры прямо на вашем ПК. Вся графика в нашей ОС нарисована именно в этой программе.
|
||||
@ -23,7 +23,7 @@ local event = require("event")
|
||||
buffer.flush()
|
||||
|
||||
--Массив локалиации
|
||||
local localization = MineOSCore.getCurrentApplicationLocalization()
|
||||
local localization = MineOSCore.getCurrentScriptLocalization()
|
||||
|
||||
--Массив инфы о выделении
|
||||
local selection
|
||||
|
||||
@ -1 +0,0 @@
|
||||
This application demonstrates the power of our tribleBuffering library, power of RayEngine and OOP-based windows library that allows us to render graphics like in a DOOM and Wolfenstein.
|
||||
@ -1 +0,0 @@
|
||||
Это приложение - вершина графических возможностей OpenComputers! Оно демонстрирует всю мощь нашей библиотеки тройной буферизации, игрового движка RayEngine, а также объектно-ориентированной оконной библиотеки windows, которые в совокупности позволяют рендерить графику на уровне Wolfenstein и DOOM.
|
||||
@ -12,7 +12,7 @@ local event = require("event")
|
||||
|
||||
----------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
local applicationResourcesDirectory = MineOSCore.getCurrentApplicationResourcesDirectory()
|
||||
local applicationResourcesDirectory = MineOSCore.getCurrentScriptDirectory()
|
||||
local localization = MineOSCore.getLocalization(applicationResourcesDirectory .. "Localizations/")
|
||||
local worldsPath = applicationResourcesDirectory .. "Worlds/"
|
||||
local rayWalkVersion = "RayWalk Tech Demo v3.5"
|
||||
|
||||
@ -16,7 +16,7 @@ local stargate = component.stargate
|
||||
|
||||
---------------------------------------------------------------------------------------------
|
||||
|
||||
local resources = MineOSCore.getCurrentApplicationResourcesDirectory()
|
||||
local resources = MineOSCore.getCurrentScriptDirectory()
|
||||
local pathToContacts = MineOSPaths.applicationData .. "Stargate/Contacts.cfg"
|
||||
local contacts = {}
|
||||
local Ch1Image = image.load(resources .. "Ch1.pic")
|
||||
|
||||
@ -1 +0,0 @@
|
||||
Fully functional Yandex translate tool that supports almost all existing languages
|
||||
@ -1 +0,0 @@
|
||||
Полноценный онлайн-переводчик, основанный на Yandex API, поддерживающий практически все существующие языки мира
|
||||
@ -10,7 +10,7 @@ local unicode = require("unicode")
|
||||
|
||||
------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
local resourcesPath = fs.path(getCurrentScript()) .. "/Resources/"
|
||||
local resourcesPath = fs.path(getCurrentScript())
|
||||
local configPath = resourcesPath .. "Config.cfg"
|
||||
local config = {
|
||||
APIKey = "trnsl.1.1.20170831T153247Z.6ecf9d7198504994.8ce5a3aa9f9a2ecbe7b2377af37ffe5ad379f4ca",
|
||||
|
||||
@ -1 +0,0 @@
|
||||
Explore weather information directly from Minecraft world! Just enter the name of the city and enjoy a pleasant interface that decorates any home.
|
||||
@ -1 +0,0 @@
|
||||
Просматривайте информацию о погоде прямо из мира Minecraft! Просто введите название города и наслаждайтесь приятным интерфейсом, украшающим любое жилище.
|
||||
@ -21,7 +21,7 @@ window.backgroundPanel.colors.transparency = 0.2
|
||||
local weatherContainer = window:addChild(GUI.container(1, 1, 1, 23))
|
||||
|
||||
local configPath = MineOSPaths.applicationData .. "Weather/Config.cfg"
|
||||
local resources = MineOSCore.getCurrentApplicationResourcesDirectory()
|
||||
local resources = MineOSCore.getCurrentScriptDirectory()
|
||||
local weatherIcons = {
|
||||
sunny = image.load(resources .. "Sunny.pic"),
|
||||
sunnyAndCloudy = image.load(resources .. "Icon.pic"),
|
||||
|
||||
34
Files.cfg
34
Files.cfg
@ -253,15 +253,15 @@
|
||||
fileID=164,
|
||||
},
|
||||
{
|
||||
path="/MineOS/Applications/App Market.app/Resources/Icon.pic",
|
||||
path="/MineOS/Applications/App Market.app/Icon.pic",
|
||||
url="https://raw.githubusercontent.com/IgorTimofeev/OpenComputers/master/Applications/AppMarket/Icon.pic",
|
||||
},
|
||||
{
|
||||
path="/MineOS/Applications/App Market.app/Resources/Localizations/Russian.lang",
|
||||
path="/MineOS/Applications/App Market.app/Localizations/Russian.lang",
|
||||
url="https://raw.githubusercontent.com/IgorTimofeev/OpenComputers/master/Applications/AppMarket/Localization/Russian.lang",
|
||||
},
|
||||
{
|
||||
path="/MineOS/Applications/App Market.app/Resources/Localizations/English.lang",
|
||||
path="/MineOS/Applications/App Market.app/Localizations/English.lang",
|
||||
url="https://raw.githubusercontent.com/IgorTimofeev/OpenComputers/master/Applications/AppMarket/Localization/English.lang",
|
||||
},
|
||||
--
|
||||
@ -271,15 +271,15 @@
|
||||
fileID=169,
|
||||
},
|
||||
{
|
||||
path="/MineOS/Applications/MineCode IDE.app/Resources/Icon.pic",
|
||||
path="/MineOS/Applications/MineCode IDE.app/Icon.pic",
|
||||
url="https://raw.githubusercontent.com/IgorTimofeev/OpenComputers/master/Applications/MineCodeIDE/Icon.pic",
|
||||
},
|
||||
{
|
||||
path="/MineOS/Applications/MineCode IDE.app/Resources/Localizations/Russian.lang",
|
||||
path="/MineOS/Applications/MineCode IDE.app/Localizations/Russian.lang",
|
||||
url="https://raw.githubusercontent.com/IgorTimofeev/OpenComputers/master/Applications/MineCodeIDE/Localization/Russian.lang",
|
||||
},
|
||||
{
|
||||
path="/MineOS/Applications/MineCode IDE.app/Resources/Localizations/English.lang",
|
||||
path="/MineOS/Applications/MineCode IDE.app/Localizations/English.lang",
|
||||
url="https://raw.githubusercontent.com/IgorTimofeev/OpenComputers/master/Applications/MineCodeIDE/Localization/English.lang",
|
||||
},
|
||||
--
|
||||
@ -289,15 +289,15 @@
|
||||
fileID=381,
|
||||
},
|
||||
{
|
||||
path="/MineOS/Applications/Photoshop.app/Resources/Icon.pic",
|
||||
path="/MineOS/Applications/Photoshop.app/Icon.pic",
|
||||
url="https://raw.githubusercontent.com/IgorTimofeev/OpenComputers/master/Applications/Photoshop/Icon.pic",
|
||||
},
|
||||
{
|
||||
path="/MineOS/Applications/Photoshop.app/Resources/Localizations/Russian.lang",
|
||||
path="/MineOS/Applications/Photoshop.app/Localizations/Russian.lang",
|
||||
url="https://raw.githubusercontent.com/IgorTimofeev/OpenComputers/master/Applications/Photoshop/Localization/Russian.lang",
|
||||
},
|
||||
{
|
||||
path="/MineOS/Applications/Photoshop.app/Resources/Localizations/English.lang",
|
||||
path="/MineOS/Applications/Photoshop.app/Localizations/English.lang",
|
||||
url="https://raw.githubusercontent.com/IgorTimofeev/OpenComputers/master/Applications/Photoshop/Localization/English.lang",
|
||||
},
|
||||
--
|
||||
@ -307,31 +307,31 @@
|
||||
fileID=292,
|
||||
},
|
||||
{
|
||||
path="/MineOS/Applications/Control.app/Resources/Icon.pic",
|
||||
path="/MineOS/Applications/Control.app/Icon.pic",
|
||||
url="https://raw.githubusercontent.com/IgorTimofeev/OpenComputers/master/Applications/Control/Icon.pic",
|
||||
},
|
||||
{
|
||||
path="/MineOS/Applications/Control.app/Resources/Localizations/Russian.lang",
|
||||
path="/MineOS/Applications/Control.app/Localizations/Russian.lang",
|
||||
url="https://raw.githubusercontent.com/IgorTimofeev/OpenComputers/master/Applications/Control/Localization/Russian.lang",
|
||||
},
|
||||
{
|
||||
path="/MineOS/Applications/Control.app/Resources/Localizations/English.lang",
|
||||
path="/MineOS/Applications/Control.app/Localizations/English.lang",
|
||||
url="https://raw.githubusercontent.com/IgorTimofeev/OpenComputers/master/Applications/Control/Localization/English.lang",
|
||||
},
|
||||
{
|
||||
path="/MineOS/Applications/Control.app/Resources/Modules/1.lua",
|
||||
path="/MineOS/Applications/Control.app/Modules/1.lua",
|
||||
url="https://raw.githubusercontent.com/IgorTimofeev/OpenComputers/master/Applications/Control/Modules/1.lua",
|
||||
},
|
||||
{
|
||||
path="/MineOS/Applications/Control.app/Resources/Modules/2.lua",
|
||||
path="/MineOS/Applications/Control.app/Modules/2.lua",
|
||||
url="https://raw.githubusercontent.com/IgorTimofeev/OpenComputers/master/Applications/Control/Modules/2.lua",
|
||||
},
|
||||
{
|
||||
path="/MineOS/Applications/Control.app/Resources/Modules/3.lua",
|
||||
path="/MineOS/Applications/Control.app/Modules/3.lua",
|
||||
url="https://raw.githubusercontent.com/IgorTimofeev/OpenComputers/master/Applications/Control/Modules/3.lua",
|
||||
},
|
||||
{
|
||||
path="/MineOS/Applications/Control.app/Resources/Modules/4.lua",
|
||||
path="/MineOS/Applications/Control.app/Modules/4.lua",
|
||||
url="https://raw.githubusercontent.com/IgorTimofeev/OpenComputers/master/Applications/Control/Modules/4.lua",
|
||||
},
|
||||
--
|
||||
@ -341,7 +341,7 @@
|
||||
fileID=175,
|
||||
},
|
||||
{
|
||||
path="/MineOS/Applications/Finder.app/Resources/Icon.pic",
|
||||
path="/MineOS/Applications/Finder.app/Icon.pic",
|
||||
url="https://raw.githubusercontent.com/IgorTimofeev/OpenComputers/master/Applications/Finder/Icon.pic",
|
||||
},
|
||||
},
|
||||
|
||||
@ -20,10 +20,6 @@ function MineOSCore.getCurrentScriptDirectory()
|
||||
return filesystem.path(getCurrentScript())
|
||||
end
|
||||
|
||||
function MineOSCore.getCurrentApplicationResourcesDirectory()
|
||||
return MineOSCore.getCurrentScriptDirectory() .. "/Resources/"
|
||||
end
|
||||
|
||||
function MineOSCore.getLocalization(pathToLocalizationFolder)
|
||||
local localizationFileName = pathToLocalizationFolder .. MineOSCore.properties.language .. ".lang"
|
||||
if filesystem.exists(localizationFileName) then
|
||||
@ -33,8 +29,8 @@ function MineOSCore.getLocalization(pathToLocalizationFolder)
|
||||
end
|
||||
end
|
||||
|
||||
function MineOSCore.getCurrentApplicationLocalization()
|
||||
return MineOSCore.getLocalization(MineOSCore.getCurrentApplicationResourcesDirectory() .. "Localizations/")
|
||||
function MineOSCore.getCurrentScriptLocalization()
|
||||
return MineOSCore.getLocalization(MineOSCore.getCurrentScriptDirectory() .. "Localizations/")
|
||||
end
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------
|
||||
@ -258,111 +254,6 @@ end
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
function MineOSCore.downloadApplication(application, language, createShortcut)
|
||||
if application.type == "Application" then
|
||||
filesystem.remove(application.path .. ".app")
|
||||
|
||||
web.download(application.url, application.path .. ".app/Main.lua")
|
||||
web.download(application.icon, application.path .. ".app/Resources/Icon.pic")
|
||||
|
||||
if application.resources then
|
||||
for i = 1, #application.resources do
|
||||
web.download(application.resources[i].url, application.path .. ".app/Resources/" .. application.resources[i].path)
|
||||
end
|
||||
end
|
||||
|
||||
if application.about then
|
||||
web.download(application.about .. language .. ".txt", application.path .. ".app/Resources/About/" .. language .. ".txt")
|
||||
end
|
||||
|
||||
if application.createShortcut or createShortcut then
|
||||
MineOSCore.createShortcut(MineOSPaths.desktop .. filesystem.name(application.path) .. ".lnk", application.path .. ".app/")
|
||||
end
|
||||
else
|
||||
web.download(application.url, application.path)
|
||||
end
|
||||
end
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
function MineOSCore.loadImageFromString(bytes)
|
||||
bytes = {string.byte(bytes, 1, #bytes)}
|
||||
|
||||
local signature = string.char(bytes[1], bytes[2], bytes[3], bytes[4])
|
||||
if signature == "OCIF" then
|
||||
local encodingMethod = bytes[5]
|
||||
if encodingMethod == 6 then
|
||||
local width, height = bytes[6], bytes[7]
|
||||
local picture = {width, height}
|
||||
|
||||
local i = 8
|
||||
while i <= #bytes do
|
||||
local alphaSize = bytes[i]
|
||||
i = i + 1
|
||||
|
||||
for a = 1, alphaSize do
|
||||
local alpha = bytes[i] / 255
|
||||
local symbolSize = bit32.bor(bit32.lshift(bytes[i + 1], 8), bytes[i + 2])
|
||||
i = i + 3
|
||||
|
||||
for s = 1, symbolSize do
|
||||
local utf8CharSize = 1
|
||||
for j = 7, 1, -1 do
|
||||
if bit32.band(bit32.rshift(bytes[i], j), 1) == 0 then
|
||||
utf8CharSize = 8 - j
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
local symbol
|
||||
if utf8CharSize == 1 then
|
||||
symbol = string.char(bytes[i])
|
||||
i = i + 1
|
||||
else
|
||||
symbol = string.char(table.unpack(bytes, i, i + utf8CharSize - 2))
|
||||
i = i + utf8CharSize - 1
|
||||
end
|
||||
|
||||
local backgroundSize = bytes[i]
|
||||
i = i + 1
|
||||
|
||||
for b = 1, backgroundSize do
|
||||
local background = color.to24Bit(bytes[i])
|
||||
local foregroundSize = bytes[i + 1]
|
||||
i = i + 2
|
||||
|
||||
for f = 1, foregroundSize do
|
||||
local foreground = color.to24Bit(bytes[i])
|
||||
local ySize = bytes[i + 1]
|
||||
i = i + 2
|
||||
|
||||
for ys = 1, ySize do
|
||||
local y = bytes[i]
|
||||
local xSize = bytes[i + 1]
|
||||
i = i + 2
|
||||
|
||||
for xs = 1, xSize do
|
||||
image.set(picture, bytes[i], y, background, foreground, alpha, symbol)
|
||||
i = i + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return picture
|
||||
else
|
||||
return false, "Unsupported encoding method: " .. encodingMethod
|
||||
end
|
||||
else
|
||||
return false, "Unsupported signature: " .. signature
|
||||
end
|
||||
end
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
MineOSCore.loadPropeties()
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
@ -215,10 +215,10 @@ local function iconAnalyseExtension(icon)
|
||||
if icon.isDirectory then
|
||||
if icon.extension == ".app" then
|
||||
if MineOSCore.properties.showApplicationIcons then
|
||||
if fs.exists(icon.path .. "/Resources/Icon.pic") then
|
||||
icon.image = image.load(icon.path .. "/Resources/Icon.pic")
|
||||
elseif fs.exists(icon.path .. "/Resources/Icon.lua") then
|
||||
local data, reason = loadfile(icon.path .. "/Resources/Icon.lua")
|
||||
if fs.exists(icon.path .. "Icon.pic") then
|
||||
icon.image = image.load(icon.path .. "Icon.pic")
|
||||
elseif fs.exists(icon.path .. "Icon.lua") then
|
||||
local data, reason = loadfile(icon.path .. "Icon.lua")
|
||||
if data then
|
||||
data, reason = data()
|
||||
if data then
|
||||
@ -365,7 +365,7 @@ function MineOSInterface.iconLaunchers.application(icon)
|
||||
|
||||
local function onExit()
|
||||
container:delete()
|
||||
MineOSInterface.safeLaunch((icon.shortcutPath or icon.path) .. "/Main.lua")
|
||||
MineOSInterface.safeLaunch((icon.shortcutPath or icon.path) .. "Main.lua")
|
||||
end
|
||||
|
||||
container.panel.eventHandler = function(mainContainer, object, eventData)
|
||||
@ -380,7 +380,7 @@ function MineOSInterface.iconLaunchers.application(icon)
|
||||
onExit()
|
||||
end
|
||||
else
|
||||
MineOSInterface.safeLaunch(icon.path .. "/Main.lua")
|
||||
MineOSInterface.safeLaunch(icon.path .. "Main.lua")
|
||||
end
|
||||
end
|
||||
|
||||
@ -1065,8 +1065,7 @@ function MineOSInterface.newApplication(parentWindow, iconField, x, y, path)
|
||||
if container.inputField.text then
|
||||
local finalPath = path .. container.inputField.text .. ".app/"
|
||||
if checkFileToExists(container, finalPath) then
|
||||
fs.makeDirectory(finalPath .. "/Resources/")
|
||||
fs.copy(filesystemChooser.path or MineOSPaths.icons .. "SampleIcon.pic", finalPath .. "/Resources/Icon.pic")
|
||||
fs.copy(filesystemChooser.path or MineOSPaths.icons .. "SampleIcon.pic", finalPath .. "Icon.pic")
|
||||
|
||||
local file = io.open(finalPath .. "Main.lua", "w")
|
||||
file:write("require(\"GUI\").error(\"Hello world\")")
|
||||
|
||||
0
lib/vector.lua
Normal file → Executable file
0
lib/vector.lua
Normal file → Executable file
Loading…
x
Reference in New Issue
Block a user