Багфиксы

This commit is contained in:
Igor Timofeev 2017-09-22 23:39:08 +03:00
parent 42ad805175
commit ebb8f70bbc
6 changed files with 32 additions and 37 deletions

View File

@ -5,7 +5,7 @@
about="https://raw.githubusercontent.com/IgorTimofeev/OpenComputers/master/MineOS/About/",
type="Script",
forceDownload=true,
version=3.84,
version=3.85,
},
{
path="/MineOS/Pictures/MoonTouch.pic",
@ -229,14 +229,14 @@
path="/lib/MineOSNetwork.lua",
url="https://raw.githubusercontent.com/IgorTimofeev/OpenComputers/master/lib/MineOSNetwork.lua",
type="Library",
version=1.00,
version=1.01,
},
{
path="/lib/advancedLua.lua",
url="https://raw.githubusercontent.com/IgorTimofeev/OpenComputers/master/lib/advancedLua.lua",
type="Library",
preloadFile=true,
version=1.23,
version=1.24,
},
{
path="/lib/web.lua",
@ -249,7 +249,7 @@
path="/lib/event.lua",
url="https://raw.githubusercontent.com/IgorTimofeev/OpenComputers/master/lib/event.lua",
type="Library",
version=1.04,
version=1.05,
},
{
path="/lib/ECSAPI.lua",
@ -289,7 +289,7 @@
url="https://raw.githubusercontent.com/IgorTimofeev/OpenComputers/master/lib/GUI.lua",
type="Library",
preloadFile=true,
version=1.80,
version=1.81,
},
{
path="/lib/rayEngine.lua",
@ -488,7 +488,7 @@
icon="https://raw.githubusercontent.com/IgorTimofeev/OpenComputers/master/Applications/Finder/Icon.pic",
createShortcut="dock",
forceDownload=true,
version=1.18,
version=1.19,
},
{
path="/MineOS/Applications/3DTest",

View File

@ -3,6 +3,7 @@ local GUI = require("GUI")
local MineOSCore = require("MineOSCore")
local MineOSNetwork = require("MineOSNetwork")
local buffer = require("doubleBuffering")
local computer = require("computer")
local fs = require("filesystem")
local event = require("event")
@ -192,7 +193,6 @@ 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]
if window.iconField.yOffset <= 2 then
@ -203,25 +203,22 @@ window.iconField.eventHandler = function(mainContainer, object, eventData)
window.iconField.yOffset = 2
end
if scrollTimerID then
event.cancel(scrollTimerID)
end
scrollTimerID = event.timer(0.2, function()
window.iconField:updateFileList()
mainContainer:draw()
buffer.draw()
end, 1)
mainContainer:draw()
buffer.draw()
elseif eventData[1] == "MineOSCore" then
if eventData[2] == "updateFileList" then
window.iconField:updateFileList()
mainContainer:draw()
buffer.draw()
if scrollTimerID then
event.cancel(scrollTimerID)
scrollTimerID = nil
end
scrollTimerID = event.timer(0.3, function()
computer.pushSignal("Finder", "updateFileList")
end, 1)
elseif (eventData[1] == "MineOSCore" or eventData[1] == "Finder") and eventData[2] == "updateFileList" then
window.iconField:updateFileList()
mainContainer:draw()
buffer.draw()
end
end

View File

@ -466,7 +466,6 @@ end
local function containerReturnData(container, ...)
container.dataToReturn = {...}
computer.pushSignal("containerAction")
end
local function containerStopEventHandling(container)

View File

@ -383,7 +383,7 @@ if not MineOSCore.OSSettings.network then
MineOSCore.OSSettings.network = {
users = {},
enabled = true,
signalStrength = 512,
signalStrength = 512,
}
MineOSCore.saveOSSettings()
end

View File

@ -194,14 +194,14 @@ function filesystem.sortedList(path, sortingMethod, showHiddenFiles)
fileList[i] = {fileList[i], extension}
end
table.sort(fileList, function(a, b) return a[2] < b[2] end)
table.sort(fileList, function(a, b) return unicode.lower(a[2]) < unicode.lower(b[2]) end)
local currentExtensionList, currentExtension = {}, fileList[1][2]
for i = 1, #fileList do
if currentExtension == fileList[i][2] then
table.insert(currentExtensionList, fileList[i][1])
else
table.sort(currentExtensionList, function(a, b) return a < b end)
table.sort(currentExtensionList, function(a, b) return unicode.lower(a) < unicode.lower(b) end)
for j = 1, #currentExtensionList do
table.insert(sortedFileList, currentExtensionList[j])
end
@ -209,19 +209,19 @@ function filesystem.sortedList(path, sortingMethod, showHiddenFiles)
end
end
table.sort(currentExtensionList, function(a, b) return a < b end)
table.sort(currentExtensionList, function(a, b) return unicode.lower(a) < unicode.lower(b) end)
for j = 1, #currentExtensionList do
table.insert(sortedFileList, currentExtensionList[j])
end
elseif sortingMethod == "name" then
sortedFileList = fileList
table.sort(sortedFileList, function(a, b) return a < b end)
table.sort(sortedFileList, function(a, b) return unicode.lower(a) < unicode.lower(b) end)
elseif sortingMethod == "date" then
for i = 1, #fileList do
fileList[i] = {fileList[i], filesystem.lastModified(path .. fileList[i])}
end
table.sort(fileList, function(a, b) return a[2] > b[2] end)
table.sort(fileList, function(a, b) return unicode.lower(a[2]) > unicode.lower(b[2]) end)
for i = 1, #fileList do
table.insert(sortedFileList, fileList[i][1])

View File

@ -43,6 +43,7 @@ function event.register(callback, signalType, times, interval)
end
local handler = {
alive = true,
ID = ID,
signalType = signalType,
callback = callback,
@ -61,7 +62,7 @@ function event.cancel(ID)
for handlerIndex = 1, #event.handlers do
if event.handlers[handlerIndex].ID == ID then
table.remove(event.handlers, handlerIndex)
event.handlers[handlerIndex].alive = false
return true
end
end
@ -90,7 +91,7 @@ function event.ignore(signalType, callback)
for handlerIndex = 1, #event.handlers do
if event.handlers[handlerIndex].signalType == signalType and event.handlers[handlerIndex].callback == callback then
table.remove(event.handlers, handlerIndex)
event.handlers[handlerIndex].alive = false
return true
end
end
@ -105,9 +106,7 @@ function event.timer(interval, callback, times)
checkArg(2, callback, "function")
checkArg(3, times, "number", "nil")
event.register(callback, nil, times, interval)
return event.handlers[#event.handlers].ID
return event.register(callback, nil, times, interval).ID
end
--------------------------------------------------------------------------------------------------------
@ -126,8 +125,8 @@ end
local function eventTick(timeout)
local eventData, handlerIndex, uptime = {computer.pullSignal(timeout)}, 1, computer.uptime()
while handlerIndex <= #event.handlers do
if event.handlers[handlerIndex].times > 0 then
while handlerIndex <= #event.handlers do
if event.handlers[handlerIndex].times > 0 and event.handlers[handlerIndex].alive then
if
(not event.handlers[handlerIndex].signalType or event.handlers[handlerIndex].signalType == eventData[1]) and
(not event.handlers[handlerIndex].nextTriggerTime or event.handlers[handlerIndex].nextTriggerTime <= uptime)