neural + copy file path

This commit is contained in:
kepler155c@gmail.com 2018-02-19 22:19:49 -05:00
parent 00461483e1
commit fc9981bff0
2 changed files with 9 additions and 2 deletions

View File

@ -48,6 +48,7 @@ local Browser = UI.Page {
{ text = 'Edit', dropdown = {
{ text = 'Cut ^x', event = 'cut' },
{ text = 'Copy ^c', event = 'copy' },
{ text = 'Copy path ', event = 'copy_path' },
{ text = 'Paste ^v', event = 'paste' },
UI.MenuBar.spacer,
{ text = 'Mark m', event = 'mark' },
@ -228,7 +229,6 @@ function Browser:updateDirectory(dir)
end
function Browser:setDir(dirName, noStatus)
self:unmarkAll()
if self.dir then
@ -379,6 +379,11 @@ function Browser:eventHandler(event)
self:setStatus('Copied %d file(s)', Util.size(copied))
end
elseif event.type == 'copy_path' then
if file then
os.queueEvent('clipboard_copy', file.fullName)
end
elseif event.type == 'paste' then
for _,m in pairs(copied) do
local s, m = pcall(function()

View File

@ -149,7 +149,9 @@ local function sendInfo()
if device.neuralInterface then
info.status = device.neuralInterface.status
if not info.status and device.neuralInterface.getMetaOwner then
info.status = 'health: ' .. device.neuralInterface.getMetaOwner().health
info.status = 'health: ' ..
math.floor(device.neuralInterface.getMetaOwner().health /
device.neuralInterface.getMetaOwner().maxHealth * 100)
end
end
device.wireless_modem.transmit(999, os.getComputerID(), info)