Advertisement
Guest User

Untitled

a guest
Feb 20th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.90 KB | None | 0 0
  1. local s = {guiGetScreenSize()}
  2. local box = {300,330}
  3. local pos = {s[1]/2 -box[1]/2,s[2]/2 - box[2]/2}
  4.  
  5. local panel = true
  6. local stop = false
  7. local loadCount = 0
  8. local bar = false
  9. local start = getTickCount()
  10.  
  11. function panelRender()
  12. if panel then
  13. 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)
  14.  
  15. if bar then
  16. if loadCount <= 250 then
  17. local now = getTickCount()
  18. loadCount = loadCount+0.6
  19. end
  20. roundedRectangle(pos[1]-10,pos[2]+125,loadCount,25,tocolor(61, 122, 188,80))
  21. roundedRectangle(pos[1]-12,pos[2]+123,255,30,tocolor(0, 0, 0,80))
  22. local text = interpolateBetween(0,0,0,100,0,0,(loadCount - start) / ((start + loadCount+0.6) - start),"Linear")
  23. end
  24. if bar1 then
  25. roundedRectangle(pos[1]-10,pos[2]+125,2,25,tocolor(61, 122, 188,80))
  26. roundedRectangle(pos[1]-12,pos[2]+123,255,30,tocolor(0, 0, 0,80))
  27. end
  28.  
  29. if isInSlot(pos[1]-10, pos[2]+235, 250, 30) then
  30. roundedRectangle(pos[1]-10, pos[2]+235, 250, 30, tocolor(61, 122, 188, 80)) -- Button
  31. else
  32. roundedRectangle(pos[1]-10, pos[2]+235, 250, 30, tocolor(0,0,0, 80)) -- button
  33. end
  34.  
  35. if isInSlot(pos[1]-10, pos[2]+285, 250, 30) then
  36. roundedRectangle(pos[1]-10, pos[2]+285, 250, 30, tocolor(61, 122, 188, 80)) -- Button
  37. else
  38. roundedRectangle(pos[1]-10, pos[2]+285, 250, 30, tocolor(0, 0, 0, 80)) -- Button
  39. end
  40.  
  41. 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)
  42.  
  43. 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)
  44. 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)
  45. _roundedRectangle(pos[1]-35, pos[2], box[1], 30, tocolor(61, 122, 188, 80)) -- Header
  46.  
  47.  
  48. 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)
  49. if stop then
  50. 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)
  51.  
  52. if isInSlot(pos[1]-10, pos[2]+185, 250, 30) then
  53. roundedRectangle(pos[1]-10, pos[2]+185, 250, 30, tocolor(61, 122, 188, 80)) -- Button
  54. else
  55. roundedRectangle(pos[1]-10, pos[2]+185, 250, 30, tocolor(0, 0, 0, 80)) -- button
  56. end
  57. end
  58. dxDrawImage(pos[1]+60,pos[2]-70, 120, 60, "logo.png", 0, 0, 0, tocolor(255, 255, 255, 180), false)
  59. end
  60. end
  61. addEventHandler("onClientRender", getRootElement(), panelRender)
  62.  
  63. function isPlayerClicked(button, state)
  64. if state == "down" then
  65. if isInSlot(pos[1]-10, pos[2]+185, 250, 30) then
  66. outputChatBox("Megállítás")
  67. panel = false
  68. end
  69. if isInSlot(pos[1]-10, pos[2]+235, 250, 30) then
  70. outputChatBox("Indítás")
  71. stop = true
  72. bar = true
  73.  
  74. end
  75. if isInSlot(pos[1]-10, pos[2]+285, 250, 30) then
  76. panel = false
  77. outputChatBox("baszod bezártam moreee!")
  78. end
  79. end
  80. end
  81. addEventHandler("onClientClick", getRootElement(), isPlayerClicked)
  82.  
  83. function inBox(dX, dY, dSZ, dM, eX, eY)
  84. if(eX >= dX and eX <= dX+dSZ and eY >= dY and eY <= dY+dM) then
  85. return true
  86. else
  87. return false
  88. end
  89. end
  90.  
  91. function isInSlot(xS,yS,wS,hS)
  92. if(isCursorShowing()) then
  93. XY = {guiGetScreenSize()}
  94. local cursorX, cursorY = getCursorPosition()
  95. cursorX, cursorY = cursorX*XY[1], cursorY*XY[2]
  96. if(inBox(xS,yS,wS,hS, cursorX, cursorY)) then
  97. return true
  98. else
  99. return false
  100. end
  101. end
  102. end
  103.  
  104. function roundedRectangle(x, y, w, h, borderColor, bgColor, postGUI)
  105. if (x and y and w and h) then
  106. if (not borderColor) then
  107. borderColor = tocolor(0, 0, 0, 180);
  108. end
  109. if (not bgColor) then
  110. bgColor = borderColor;
  111. end
  112. dxDrawRectangle(x, y, w, h, bgColor, postGUI);
  113. dxDrawRectangle(x + 2, y - 1, w - 4, 1, borderColor, postGUI);
  114. dxDrawRectangle(x + 2, y + h, w - 4, 1, borderColor, postGUI);
  115. dxDrawRectangle(x - 1, y + 2, 1, h - 4, borderColor, postGUI);
  116. dxDrawRectangle(x + w, y + 2, 1, h - 4, borderColor, postGUI);
  117. end
  118. end
  119.  
  120. function _roundedRectangle(x, y, w, h, borderColor, bgColor, postGUI)
  121. if (x and y and w and h) then
  122. if (not borderColor) then
  123. borderColor = tocolor(0, 0, 0, 180);
  124. end
  125. if (not bgColor) then
  126. bgColor = borderColor;
  127. end
  128. dxDrawRectangle(x, y, w, h, bgColor, postGUI);
  129. dxDrawRectangle(x + 2, y - 1, w - 4, 1, borderColor, postGUI);
  130. --dxDrawRectangle(x + 2, y + h, w - 4, 1, borderColor, postGUI);
  131. dxDrawRectangle(x - 1, y + 2, 1, h - 4, borderColor, postGUI);
  132. dxDrawRectangle(x + w, y + 2, 1, h - 4, borderColor, postGUI);
  133. end
  134. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement