Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local s = {guiGetScreenSize()}
- local box = {300,330}
- local pos = {s[1]/2 -box[1]/2,s[2]/2 - box[2]/2}
- local panel = true
- local stop = false
- local loadCount = 0
- local bar = false
- local start = getTickCount()
- function panelRender()
- if panel then
- roundedRectangle(pos[1]-35, pos[2], box[1], box[2], tocolor(0, 0, 0, 175)) -- pos[1] = x, pos[2] = y, box[1] = a x magassága, box[2] = a kocka y magassáa, aztán szín tocolor(r,g,b,alpha)
- if bar then
- if loadCount <= 250 then
- local now = getTickCount()
- loadCount = loadCount+0.6
- end
- roundedRectangle(pos[1]-10,pos[2]+125,loadCount,25,tocolor(61, 122, 188,80))
- roundedRectangle(pos[1]-12,pos[2]+123,255,30,tocolor(0, 0, 0,80))
- local text = interpolateBetween(0,0,0,100,0,0,(loadCount - start) / ((start + loadCount+0.6) - start),"Linear")
- end
- if bar1 then
- roundedRectangle(pos[1]-10,pos[2]+125,2,25,tocolor(61, 122, 188,80))
- roundedRectangle(pos[1]-12,pos[2]+123,255,30,tocolor(0, 0, 0,80))
- end
- if isInSlot(pos[1]-10, pos[2]+235, 250, 30) then
- roundedRectangle(pos[1]-10, pos[2]+235, 250, 30, tocolor(61, 122, 188, 80)) -- Button
- else
- roundedRectangle(pos[1]-10, pos[2]+235, 250, 30, tocolor(0,0,0, 80)) -- button
- end
- if isInSlot(pos[1]-10, pos[2]+285, 250, 30) then
- roundedRectangle(pos[1]-10, pos[2]+285, 250, 30, tocolor(61, 122, 188, 80)) -- Button
- else
- roundedRectangle(pos[1]-10, pos[2]+285, 250, 30, tocolor(0, 0, 0, 80)) -- Button
- end
- dxDrawText("Panel bezárása", pos[1]+55, pos[2]+288, 0,0, tocolor(255,255,255,255),1.5,"nexa", "left", "top", false, true, true, true)
- dxDrawText("Ezzel a panellel tudod navigálni a\n töltési folyamatot..", pos[1]-2, pos[2]+50, 0,0, tocolor(255,255,255,255),1.3,"nexa", "left", "top", false, true, true, true)
- dxDrawText("Kezelőpanel", pos[1]+75, pos[2]+5, 0,0, tocolor(255,255,255,255),1.3,"nexa", "left", "top", false, true, true, true)
- _roundedRectangle(pos[1]-35, pos[2], box[1], 30, tocolor(61, 122, 188, 80)) -- Header
- dxDrawText("Indítás", pos[1]+87, pos[2]+238, 0,0, tocolor(255,255,255,255),1.5,"nexa", "left", "top", false, true, true, true)
- if stop then
- dxDrawText("Megállítás", pos[1]+73, pos[2]+188, 0,0, tocolor(255,255,255,255),1.5,"nexa", "left", "top", false, true, true, true)
- if isInSlot(pos[1]-10, pos[2]+185, 250, 30) then
- roundedRectangle(pos[1]-10, pos[2]+185, 250, 30, tocolor(61, 122, 188, 80)) -- Button
- else
- roundedRectangle(pos[1]-10, pos[2]+185, 250, 30, tocolor(0, 0, 0, 80)) -- button
- end
- end
- dxDrawImage(pos[1]+60,pos[2]-70, 120, 60, "logo.png", 0, 0, 0, tocolor(255, 255, 255, 180), false)
- end
- end
- addEventHandler("onClientRender", getRootElement(), panelRender)
- function isPlayerClicked(button, state)
- if state == "down" then
- if isInSlot(pos[1]-10, pos[2]+185, 250, 30) then
- outputChatBox("Megállítás")
- panel = false
- end
- if isInSlot(pos[1]-10, pos[2]+235, 250, 30) then
- outputChatBox("Indítás")
- stop = true
- bar = true
- end
- if isInSlot(pos[1]-10, pos[2]+285, 250, 30) then
- panel = false
- outputChatBox("baszod bezártam moreee!")
- end
- end
- end
- addEventHandler("onClientClick", getRootElement(), isPlayerClicked)
- function inBox(dX, dY, dSZ, dM, eX, eY)
- if(eX >= dX and eX <= dX+dSZ and eY >= dY and eY <= dY+dM) then
- return true
- else
- return false
- end
- end
- function isInSlot(xS,yS,wS,hS)
- if(isCursorShowing()) then
- XY = {guiGetScreenSize()}
- local cursorX, cursorY = getCursorPosition()
- cursorX, cursorY = cursorX*XY[1], cursorY*XY[2]
- if(inBox(xS,yS,wS,hS, cursorX, cursorY)) then
- return true
- else
- return false
- end
- end
- end
- function roundedRectangle(x, y, w, h, borderColor, bgColor, postGUI)
- if (x and y and w and h) then
- if (not borderColor) then
- borderColor = tocolor(0, 0, 0, 180);
- end
- if (not bgColor) then
- bgColor = borderColor;
- end
- dxDrawRectangle(x, y, w, h, bgColor, postGUI);
- dxDrawRectangle(x + 2, y - 1, w - 4, 1, borderColor, postGUI);
- dxDrawRectangle(x + 2, y + h, w - 4, 1, borderColor, postGUI);
- dxDrawRectangle(x - 1, y + 2, 1, h - 4, borderColor, postGUI);
- dxDrawRectangle(x + w, y + 2, 1, h - 4, borderColor, postGUI);
- end
- end
- function _roundedRectangle(x, y, w, h, borderColor, bgColor, postGUI)
- if (x and y and w and h) then
- if (not borderColor) then
- borderColor = tocolor(0, 0, 0, 180);
- end
- if (not bgColor) then
- bgColor = borderColor;
- end
- dxDrawRectangle(x, y, w, h, bgColor, postGUI);
- dxDrawRectangle(x + 2, y - 1, w - 4, 1, borderColor, postGUI);
- --dxDrawRectangle(x + 2, y + h, w - 4, 1, borderColor, postGUI);
- dxDrawRectangle(x - 1, y + 2, 1, h - 4, borderColor, postGUI);
- dxDrawRectangle(x + w, y + 2, 1, h - 4, borderColor, postGUI);
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement