Commit f6b9a1aa authored by Danny SMc's avatar Danny SMc

Updated most files, fixed chat

parents 0839560b 2ff0adfd
ew0KICB7DQogICAgZmlsZW5hbWUgPSAiZmlsZW1hbmFnZXIubHVhIiwNCiAgICBuYW1lID0gIkZpbGVNYW5hZ2VyIiwNCiAgICByZWxlYXNlZCA9ICIxOC8wNy8yMDE2IiwNCiAgfSwNCn0=
\ No newline at end of file
--[[
Name: FileManager Plugin
Desc: A powerful file manager
Auth: DannySMc
]]
-- @base filemanager
-- @func entry
Plugin.filemanager = {};
function Plugin.filemanager.entry()
local filemanagericon = {
{"a:a: ","a:a: ","a:a: ","a:a: ","a:a: ","a:a: ","a:a: ","a:a: ","a:a: ","a:a: ","a:a: ","a:a: ","a:a: ","a:a: "};
{"a:a: ","0:a:F","0:a:i","0:a:l","0:a:e","0:a: ","0:a: ","0:a: ","0:a: ","0:a: ","a:4: ","a:5: ","a:5: ","0:a: "};
{"a:a: ","0:a: ","0:a:M","0:a:a","0:a:n","0:a:a","0:a:g","0:a:e","0:a:r","0:a: ","0:4: ","a:4: ","a:4: ","a:a: "};
{"a:a: ","a:a: ","a:a: ","a:a: ","a:a: ","a:a: ","a:a: ","a:a: ","a:a: ","a:a: ","a:a: ","a:a: ","a:a: ","a:a: "};
};
DiscoverApp.Register.MenuIcon("FileManager", filemanagericon);
DiscoverApp.Register.MenuEntry("FileManager", "filemanager", "main", "Files", false);
end
function program.filemanager.main()
base.screen.colour("white")
program.draw.menubar("Files: Main")
base.draw.box(1, 51, 19, 1, " ", "grey", "grey")
base.draw.textr("Exit ", 19, false, "red", "grey")
local scroll = 0;
local path = "/";
local history = {};
local fileList = {};
base.draw.textl(" < >", 3, false, "lightBlue", "white")
base.draw.texta("::" .. tostring(path):sub(1, 42), 6, 3, false, "lightGrey", "white")
local function parse(path)
if fs.exists(path) then
table.insert(history, path)
end
local list = fs.list(path)
local new = {}
for _,v in ipairs(list) do
if fs.isDir(fs.combine(path, v)) then
table.insert(new, "+" .. tostring(v))
end
end
for _,v in ipairs(list) do
if not fs.isDir(fs.combine(path, v)) then
table.insert(new, "-" .. tostring(v))
end
end
fileList = new;
return new;
end
local function render(data)
base.draw.texta("::" .. tostring(path):sub(1, 42), 6, 3, false, "lightGrey", "white")
for i=1, 13 do
base.draw.box(1, 30, i+4, 1, " ", "white", "white")
if i+scroll <= #data then
if data[i+scroll]:sub(1,1) == "+" then
base.draw.textl(" " .. tostring(data[i+scroll]:sub(2)), i+4, false, "blue", "white")
elseif data[i+scroll]:sub(1,1) == "-" then
base.draw.textl(" " .. tostring(data[i+scroll]:sub(2)), i+4, false, "lightGrey", "white")
end
end
end
end
render(parse(path));
while true do
local args = { os.pullEvent() }
if args[1] == "timer" then
program.draw.menubar("Files: Main")
elseif args[1] == "mouse_click" then
if args[4] >= 1 and args[4] <= 2 then
program.draw.menu.handler("Files: Main", args[3], args[4])
elseif (args[3] >= 47 and args[3] <= 50) and (args[4] == 19) then
base.thread.remove("Files")
base.thread.switch("Home")
elseif (args[3] >= 2 and args[3] <= 40) and (args[4] >= 5 and args[4] <= 17) then
local id = args[4] - 4 + scroll
if #fileList >= id then
local newpath = fs.combine(path, fileList[id])
if fs.isDir(newpath) then
path = newpath;
render(parse(path))
else
end
end
end
elseif args[1] == "mouse_scroll" then
if args[2] == -1 then
if scroll > 0 then
scroll = scroll - 1
render(parse(path))
end
elseif args[2] == 1 then
if scroll+13 < #fileList then
scroll = scroll + 1
render(parse(path))
end
end
end
end
end
\ No newline at end of file
--[[
Name: chat.personal
Desc: Main chat personal viewer
--]]
function program.chat.personal()
if screen == "list" then
base.screen.colour("white")
program.draw.menubar("Chat: Personal")
base.draw.box(1, 51, 19, 1, " ", "grey", "grey")
base.draw.textr("Exit ", 19, false, "red", "grey")
while true do
local args = { os.pullEvent() }
if args[1] == "timer" then
program.draw.menubar("Chat: Personal")
elseif args[1] == "mouse_click" then
if args[4] >= 1 and args[4] <= 2 then
program.draw.menu.handler("Chat: Personal", args[3], args[4])
elseif (args[3] >= 47 and args[3] <= 50) and args[4] == 19 then
base.thread.remove("Profile")
base.thread.switch("Home")
end
end
end
elseif screen == "view" then
base.screen.colour("white")
program.draw.menubar("Chat: Personal::View")
base.draw.box(1, 51, 19, 1, " ", "grey", "grey")
base.draw.textr("Exit ", 19, false, "red", "grey")
while true do
local args = { os.pullEvent() }
if args[1] == "timer" then
program.draw.menubar("Chat: Personal::View")
elseif args[1] == "mouse_click" then
if args[4] >= 1 and args[4] <= 2 then
program.draw.menu.handler("Chat: Personal::View", args[3], args[4])
elseif (args[3] >= 47 and args[3] <= 50) and args[4] == 19 then
base.thread.remove("Profile")
base.thread.switch("Home")
end
end
end
end
end
\ No newline at end of file
print('LOLOLOLOLO')
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment