mirror of
https://github.com/IgorTimofeev/MineOS.git
synced 2025-12-20 02:59:20 +01:00
ЖукоПравки
This commit is contained in:
parent
406b6e121c
commit
fd035c57c2
@ -514,7 +514,7 @@ local function download(publication)
|
||||
callLastMethod()
|
||||
|
||||
if not shortcutSwitchAndLabel.hidden and shortcutSwitchAndLabel.switch.state then
|
||||
system.createShortcut(paths.user.desktop .. filesystem.hideExtension(filesystem.name(filesystemChooser.path)) .. ".lnk", filesystemChooser.path .. "/")
|
||||
system.createShortcut(paths.user.desktop .. filesystem.hideExtension(filesystem.name(filesystemChooser.path)), filesystemChooser.path .. "/")
|
||||
end
|
||||
|
||||
computer.pushSignal("system", "updateFileList")
|
||||
|
||||
@ -56,7 +56,7 @@ local function filesystemPath(path)
|
||||
end
|
||||
|
||||
local function filesystemName(path)
|
||||
return path:match("%/?([^%/]+)%/?$")
|
||||
return path:match("%/?([^%/]+%/?)$")
|
||||
end
|
||||
|
||||
local function filesystemHideExtension(path)
|
||||
@ -504,11 +504,11 @@ addStage(function()
|
||||
workspace:draw()
|
||||
|
||||
-- Switching to selected filesystem proxy for performing system library operations
|
||||
filesystem.setProxy(selectedFilesystemProxy)
|
||||
|
||||
-- Creating system paths
|
||||
paths.create(paths.system)
|
||||
filesystem.setProxy(selectedFilesystemProxy)
|
||||
|
||||
paths.create(paths.system)
|
||||
local userProperties, userPaths = system.createUser(
|
||||
usernameInput.text,
|
||||
filesystemHideExtension(filesystemName(files.localizations[localizationComboBox.selectedItem])),
|
||||
@ -517,10 +517,6 @@ addStage(function()
|
||||
screensaversSwitchAndLabel.switch.state
|
||||
)
|
||||
|
||||
-- Renaming HDD
|
||||
temporaryFilesystemProxy.setLabel("MineOS HDD")
|
||||
|
||||
-- Switching back to temporary fileystem proxy
|
||||
filesystem.setProxy(temporaryFilesystemProxy)
|
||||
|
||||
-- Flashing EEPROM
|
||||
@ -580,10 +576,14 @@ addStage(function()
|
||||
|
||||
-- Create shortcut if possible
|
||||
if shortcut then
|
||||
filesystem.setProxy(selectedFilesystemProxy)
|
||||
|
||||
system.createShortcut(
|
||||
userPaths.desktop .. filesystemHideExtension(filesystemName(filesystemPath(path)) .. "/") .. ".lnk",
|
||||
userPaths.desktop .. filesystemHideExtension(filesystemName(filesystemPath(path))),
|
||||
OSPath .. filesystemPath(path)
|
||||
)
|
||||
|
||||
filesystem.setProxy(temporaryFilesystemProxy)
|
||||
end
|
||||
|
||||
progressBar.value = math.floor(i / #downloadList * 100)
|
||||
|
||||
@ -13,15 +13,3 @@ end
|
||||
function component.isAvailable(type)
|
||||
return component.list(type)() and true or false
|
||||
end
|
||||
|
||||
-- Allows writing component.gpu.set(...) instead of component.get("gpu").set(...)
|
||||
setmetatable(component, {
|
||||
__index = function(_, key)
|
||||
local proxy, reason = component.get(key)
|
||||
if proxy then
|
||||
return proxy
|
||||
else
|
||||
error(reason)
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
@ -52,7 +52,7 @@ function event.skip(signalType)
|
||||
end
|
||||
|
||||
function event.pull(preferredTimeout)
|
||||
local uptime = computerUptime()
|
||||
local uptime, signalData = computerUptime()
|
||||
local deadline = uptime + (preferredTimeout or mathHuge)
|
||||
|
||||
repeat
|
||||
|
||||
@ -540,7 +540,7 @@ local function newModemProxy(address)
|
||||
return request("read", "", ...)
|
||||
end
|
||||
|
||||
write = function(handle, data)
|
||||
proxy.write = function(handle, data)
|
||||
local maxPacketSize = network.modemProxy.maxPacketSize() - network.modemPacketReserve
|
||||
repeat
|
||||
if not request("write", false, handle, data:sub(1, maxPacketSize)) then
|
||||
@ -681,7 +681,7 @@ function network.update()
|
||||
end
|
||||
end
|
||||
|
||||
proxy = newModemProxy(eventData[3])
|
||||
local proxy = newModemProxy(eventData[3])
|
||||
proxy.name = eventData[8]
|
||||
filesystem.mount(proxy, paths.system.mounts .. eventData[3] .. "/")
|
||||
|
||||
|
||||
@ -106,7 +106,7 @@ end
|
||||
|
||||
function system.createShortcut(where, forWhat)
|
||||
filesystem.makeDirectory(filesystem.path(where))
|
||||
filesystem.write(where, forWhat)
|
||||
filesystem.write(where .. ".lnk", forWhat)
|
||||
end
|
||||
|
||||
function system.parseArguments(...)
|
||||
@ -827,7 +827,7 @@ local function iconOnRightClick(icon, e1, e2, e3, e4)
|
||||
for i = 1, #selectedIcons do
|
||||
if not selectedIcons[i].isShortcut then
|
||||
system.createShortcut(
|
||||
filesystem.path(selectedIcons[i].path) .. selectedIcons[i].nameWithoutExtension .. ".lnk",
|
||||
filesystem.path(selectedIcons[i].path) .. selectedIcons[i].nameWithoutExtension,
|
||||
selectedIcons[i].path
|
||||
)
|
||||
end
|
||||
@ -840,7 +840,7 @@ local function iconOnRightClick(icon, e1, e2, e3, e4)
|
||||
for i = 1, #selectedIcons do
|
||||
if not selectedIcons[i].isShortcut then
|
||||
system.createShortcut(
|
||||
paths.user.desktop .. selectedIcons[i].nameWithoutExtension .. ".lnk",
|
||||
paths.user.desktop .. selectedIcons[i].nameWithoutExtension,
|
||||
selectedIcons[i].path
|
||||
)
|
||||
end
|
||||
|
||||
6
OS.lua
6
OS.lua
@ -33,9 +33,11 @@ end
|
||||
|
||||
-- Initializing global package system
|
||||
package = {
|
||||
paths = {["/Libraries/"] = true},
|
||||
paths = {
|
||||
["/Libraries/"] = true
|
||||
},
|
||||
loaded = {},
|
||||
loading = {},
|
||||
loading = {}
|
||||
}
|
||||
|
||||
-- Checks existense of specified path. It will be overriden after filesystem library initialization
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user