Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- verze = "21.1016.R3"
- w,h = term.getSize()
- function loadLogo(obrazek, px, py)
- for i=1, #obrazek do
- local pic = paintutils.parseImage(obrazek[i])
- paintutils.drawImage(pic, px, py-1+i)
- end
- end
- local function bgc(barvaP) term.setBackgroundColor(barvaP) end
- local function txc(barvaP) term.setTextColor(barvaP) end
- local function curs(xi,yi) term.setCursorPos(xi,yi) end
- function loadingS(px, py, opak, cb, cf)
- local pozy = {2, 1, 1, 2, 3, 4, 4, 3, 2, 1, 1, 2, 3, 4, 4, 3,}
- local pozx = {1,2,3,4,4,3,2,1,1,2,3,4,4,3,2,1}
- paintutils.drawFilledBox(px, py, px+4, py+4, cb)
- for o=1, opak do
- for i=1, 8 do
- curs(pozx[i]+px, pozy[i]+py) bgc(cb) txc(cf) write(" ")
- curs(pozx[i+1]+px, pozy[i+1]+py) bgc(cb) txc(cf) write("·")
- curs(pozx[i+2]+px, pozy[i+2]+py) bgc(cb) txc(cf) write("·")
- curs(pozx[i+3]+px, pozy[i+3]+py) txc(cf) write("·")
- curs(pozx[i+4]+px, pozy[i+4]+py) bgc(cb) txc(cf) write("·")
- curs(pozx[i+5]+px, pozy[i+5]+py) bgc(cb) txc(cf) write("·")
- sleep(0.1)
- end
- end
- paintutils.drawPixel(px, py, cb)
- end
- iconApp = {
- " 3330333 ",
- " 3303033 ",
- " 3303033 ",
- " 3000003 ",
- " 3033303 "}
- function dialog(bgc,txc, nadpis,dtext1,dtext2,autoclose)
- if nadpis == nil then nadpis = "" end
- if dtext1 == nil then dtext1 = "" end
- if dtext2 == nil then dtext2 = "" end
- if autoclose == nil then autoclose = "close" end
- myWindow = window.create(term.current(),w/2-8,h/2-2,20,7)
- myWindow.setBackgroundColor(colors.white)
- myWindow.setTextColor(colors.white)
- myWindow.clear()
- myWindow.setBackgroundColor(colors.red)
- myWindow.setCursorPos (20, 1)
- myWindow.write"×"
- myWindow.setCursorPos (1, 1)
- myWindow.setBackgroundColor(bgc)
- myWindow.setTextColor(txc)
- myWindow.write(" ")
- myWindow.setCursorPos (2, 1)
- myWindow.write(nadpis)
- myWindow.setBackgroundColor(colors.white)
- myWindow.setTextColor(colors.black)
- myWindow.setCursorPos (2, 3)
- myWindow.write(dtext1)
- myWindow.setCursorPos (2, 4)
- myWindow.write(dtext2)
- myWindow.setTextColor(colors.black)
- myWindow.setBackgroundColor(colors.lightGray)
- myWindow.setCursorPos (9, 6)
- myWindow.write" OK "
- if autoclose == "close" then sleep (1) return end
- if autoclose == "return" then return end
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- if event == "mouse_click" and x == math.floor(w/2+11) and y == math.floor(h/2-2) and button == 1 then
- return
- elseif event == "mouse_click" and x >= math.floor(w/2) and x <= math.floor(w/2+3) and y == math.floor(h/2+3) and button == 1 then
- myWindow.setBackgroundColor(colors.gray)
- myWindow.setCursorPos (9, 6)
- myWindow.write" OK "
- sleep(0.1)
- return
- end
- end
- end
- --- nefunk?ní
- function Aplikace()
- if fs.exists ("/C/system/Users/"..user.."/Registry/.menuColor") then BPozadi = (nastaveni.barva) Btext = (text.barva) CCM = true else CCM = false BPozadi = (colors.gray) Btext = (colors.white) end
- local AppW = window.create(term.current(),18,h-12,5,5) AppW.setBackgroundColor(BPozadi) sleep(0.1)
- AppW = window.create(term.current(),18,h-14,10,10) AppW.setBackgroundColor(BPozadi) sleep(0.1)
- AppW = window.create(term.current(),18,2,w-18,h-2) AppW.setBackgroundColor(BPozadi) AppW.setTextColor(Btext) AppW.clear() sleep(0.1)
- AppW.setCursorPos(2,1)
- AppW.write("Application")
- loadLogo(iconApp, 20, 4)
- while true do
- local event, button, x, y = os.pullEvent("mouse_click")
- if x >= 18 and x <= w-18 and y >= 2 and y >= h-2 and button == 1 then
- else
- plocha()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement