Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local fs = require("filesystem")
- local gp,threads
- if not fs.isDirectory("/lib/GPAPI.lua") then
- os.execute("pastebin get ZV2gqMJH /lib/GPAPI.lua")
- end
- if not fs.isDirectory("/lib/thread.lua") then
- os.execute("pastebin get E0SzJcCx /lib/thread.lua")
- end
- local gp = require("GPAPI")
- local com,gpu,term,color,comp = gp.require()
- local thread = require("thread")
- --Графические преднастройки--
- local OldB,OldF,OldW,OldH = gp.saveOld()
- gpu.setBackground(color.gray,true)
- gpu.setForeground(color.silver,true)
- gpu.setResolution(160,42)
- term.clear()
- --Переменные--
- W,H = 160,42
- --Функции--
- function option(sX,sY,x,y,weidth,height,colorB,colorF,hex)
- local w = weidth
- local h = height
- local dX,dY = w,h
- gp.cnsColor(colorB,colorF,hex)
- if sX >= x and sX < x + weidth then
- if sY >= y and sY < y + height then
- while true do
- local oldX,oldY = sX,sY
- --Левый верхний угол--
- if sX >= x and sX < x + 2 then
- if sY >= y and sY < y + 2 then
- if sX < oldX then
- dX = dX - 1
- end
- if sY > oldY then
- dY = dY + 1
- end
- end
- end
- gpu.fill(x,y,dX,dY," ")
- end
- else
- goto Exit
- end
- end
- ::Exit::
- end
- --Статичный интерфейс
- gp.textbox(150,41,"Выйти",_,color.gray,color.red)
- --Главный цикл--
- while true do
- local type,_,x,y,button,_ = comp.pullSignal() --Касания, удержания, бросания
- --Кнопички--
- --Прочее--
- option(x,y,30,10,7,3)
- if sX >= 150 and sX < 155 then
- if sY >= 41 and sY < 42 then
- break
- end
- end
- end
- --Возвращение настроек--
- gp.setOld(OldB,OldF,OldW,OldH)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement