Advertisement
jackluciano

Untitled

Jan 4th, 2025
7
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.76 KB | None | 0 0
  1. adminUI:addElement(UIElement({
  2. name = dataName .. "Scroll",
  3. parent = dataName .. "Background",
  4. type = "scrollbar",
  5. maxVisibile = maxRows,
  6. total = #tickets,
  7. changeByScroll = 1,
  8. startIndex = scrollRow,
  9. position = {width - respc(30), respc(10) + lineHeight},
  10. size = {respc(5), height - respc(80) - lineHeight},
  11. color = {255, 255, 255, 255},
  12. callBack = function()
  13. if (not adminUI or not adminUI.findElement) then return end
  14.  
  15. local id, element = adminUI:findElement(dataName .. "Scroll");
  16. if (not element) then return end
  17.  
  18. renders.admin.datas[dataName].scrollRow = element:getValue();
  19. renders.admin.template(tickets, dataName);
  20. end,
  21. }), true);
  22.  
  23. for key = scrollRow + 1, (scrollRow + maxRows) do
  24. local ticket = tickets[key];
  25. if (ticket) then
  26. local ticketType = ticket.ticketDatas.type or 1;
  27. if (checkTicket(ticket)) then
  28. local parentName = dataName .. "ticket" .. key;
  29.  
  30. local x = respc(5);
  31. local minus = x * 2;
  32. if (dataName ~= "closed") then
  33. if (maxRows < #tickets) then
  34. minus = minus * 2;
  35. end
  36. end
  37.  
  38. local lineWidth = width - respc(20) - minus;
  39.  
  40. adminUI:addElement(UIElement({
  41. name = parentName,
  42. type = "rectangle",
  43. parent = dataName .. "Background",
  44. position = {x, y},
  45. size = {lineWidth, lineHeight},
  46. color = {31, 31, 31, 255},
  47. isRounded = true,
  48. radius = {120, 120, 120, 120}
  49. }));
  50.  
  51. adminUI:addElement(UIElement({
  52. name = dataName .. "ticketText1" .. key,
  53. type = "text",
  54. text = ticket.playerName .. " (" .. ticket.playerId .. ")",
  55. parent = parentName,
  56. horizontalAlign = "left",
  57. verticalAlign = "top",
  58. font = "RobotoCondensed-Bold",
  59. position = {respc(7.5), respc(1)},
  60. fontSize = respc(12),
  61. color = {225, 225, 225, 230},
  62. colorCoded = true,
  63. }));
  64.  
  65. adminUI:addElement(UIElement({
  66. name = dataName .. "ticketText2" .. key,
  67. type = "text",
  68. text = "#cc6866" .. topics[ticket.ticketDatas.type][1] .. "#e1e1e1 - #" .. ticket.dbid,
  69. parent = parentName,
  70. horizontalAlign = "left",
  71. verticalAlign = "top",
  72. font = "RobotoCondensed-Regular",
  73. position = {respc(7.5), respc(20)},
  74. fontSize = respc(9),
  75. color = {225, 225, 225, 230},
  76. colorCoded = true,
  77. }));
  78.  
  79. adminUI:addElement(UIElement({
  80. name = dataName .. "ticketText3" .. key,
  81. type = "text",
  82. text = ticket.ticketDatas.title,
  83. parent = parentName,
  84. horizontalAlign = "left",
  85. verticalAlign = "bottom",
  86. font = "RobotoCondensed-Regular",
  87. position = {respc(7.5), -respc(1.5)},
  88. fontSize = respc(11),
  89. color = {200, 200, 200, 230},
  90. colorCoded = true,
  91. }));
  92.  
  93. adminUI:addElement(UIElement({
  94. name = dataName .. "ticketText4" .. key,
  95. type = "text",
  96. text = "#26b3ff" .. ticket.created,
  97. parent = parentName,
  98. horizontalAlign = "right",
  99. verticalAlign = "bottom",
  100. font = "RobotoCondensed-Bold",
  101. position = {-respc(5), -respc(1)},
  102. fontSize = respc(10),
  103. color = {225, 225, 225, 230},
  104. colorCoded = true,
  105. }));
  106.  
  107. adminUI:addElement(UIElement({
  108. name = dataName .. "ticketButton" .. key,
  109. parent = parentName,
  110. type = "button",
  111. isRounded = true,
  112. text = "",
  113. font = "AwesomeFont",
  114. fontSize = respc(11),
  115. horizontalAlign = "center",
  116. verticalAlign = "center",
  117. textPosition = {0, 0},
  118. textColor = {210, 210, 210, 230},
  119. textHoverColor = {205, 105, 38, 230},
  120. position = {lineWidth - respc(25) - respc(10), respc(10)},
  121. size = {respc(25), respc(24)},
  122. color = {0, 0, 0, 0},
  123. onClick = function()
  124. if (datas and datas.page) then
  125. OPENED_CACHE_TICKET = ticket;
  126. else
  127. OPENED_TICKET_ID = ticket.dbid;
  128. end
  129. renders.admin.initialize();
  130. end,
  131. tooltip = {"Segítségkérés megtekintése", "Megtekintéshez kattints ide!"}
  132. }))
  133.  
  134. y = y + lineHeight + padding;
  135. end
  136. end
  137. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement