Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- adminUI:addElement(UIElement({
- name = dataName .. "Scroll",
- parent = dataName .. "Background",
- type = "scrollbar",
- maxVisibile = maxRows,
- total = #tickets,
- changeByScroll = 1,
- startIndex = scrollRow,
- position = {width - respc(30), respc(10) + lineHeight},
- size = {respc(5), height - respc(80) - lineHeight},
- color = {255, 255, 255, 255},
- callBack = function()
- if (not adminUI or not adminUI.findElement) then return end
- local id, element = adminUI:findElement(dataName .. "Scroll");
- if (not element) then return end
- renders.admin.datas[dataName].scrollRow = element:getValue();
- renders.admin.template(tickets, dataName);
- end,
- }), true);
- for key = scrollRow + 1, (scrollRow + maxRows) do
- local ticket = tickets[key];
- if (ticket) then
- local ticketType = ticket.ticketDatas.type or 1;
- if (checkTicket(ticket)) then
- local parentName = dataName .. "ticket" .. key;
- local x = respc(5);
- local minus = x * 2;
- if (dataName ~= "closed") then
- if (maxRows < #tickets) then
- minus = minus * 2;
- end
- end
- local lineWidth = width - respc(20) - minus;
- adminUI:addElement(UIElement({
- name = parentName,
- type = "rectangle",
- parent = dataName .. "Background",
- position = {x, y},
- size = {lineWidth, lineHeight},
- color = {31, 31, 31, 255},
- isRounded = true,
- radius = {120, 120, 120, 120}
- }));
- adminUI:addElement(UIElement({
- name = dataName .. "ticketText1" .. key,
- type = "text",
- text = ticket.playerName .. " (" .. ticket.playerId .. ")",
- parent = parentName,
- horizontalAlign = "left",
- verticalAlign = "top",
- font = "RobotoCondensed-Bold",
- position = {respc(7.5), respc(1)},
- fontSize = respc(12),
- color = {225, 225, 225, 230},
- colorCoded = true,
- }));
- adminUI:addElement(UIElement({
- name = dataName .. "ticketText2" .. key,
- type = "text",
- text = "#cc6866" .. topics[ticket.ticketDatas.type][1] .. "#e1e1e1 - #" .. ticket.dbid,
- parent = parentName,
- horizontalAlign = "left",
- verticalAlign = "top",
- font = "RobotoCondensed-Regular",
- position = {respc(7.5), respc(20)},
- fontSize = respc(9),
- color = {225, 225, 225, 230},
- colorCoded = true,
- }));
- adminUI:addElement(UIElement({
- name = dataName .. "ticketText3" .. key,
- type = "text",
- text = ticket.ticketDatas.title,
- parent = parentName,
- horizontalAlign = "left",
- verticalAlign = "bottom",
- font = "RobotoCondensed-Regular",
- position = {respc(7.5), -respc(1.5)},
- fontSize = respc(11),
- color = {200, 200, 200, 230},
- colorCoded = true,
- }));
- adminUI:addElement(UIElement({
- name = dataName .. "ticketText4" .. key,
- type = "text",
- text = "#26b3ff" .. ticket.created,
- parent = parentName,
- horizontalAlign = "right",
- verticalAlign = "bottom",
- font = "RobotoCondensed-Bold",
- position = {-respc(5), -respc(1)},
- fontSize = respc(10),
- color = {225, 225, 225, 230},
- colorCoded = true,
- }));
- adminUI:addElement(UIElement({
- name = dataName .. "ticketButton" .. key,
- parent = parentName,
- type = "button",
- isRounded = true,
- text = "",
- font = "AwesomeFont",
- fontSize = respc(11),
- horizontalAlign = "center",
- verticalAlign = "center",
- textPosition = {0, 0},
- textColor = {210, 210, 210, 230},
- textHoverColor = {205, 105, 38, 230},
- position = {lineWidth - respc(25) - respc(10), respc(10)},
- size = {respc(25), respc(24)},
- color = {0, 0, 0, 0},
- onClick = function()
- if (datas and datas.page) then
- OPENED_CACHE_TICKET = ticket;
- else
- OPENED_TICKET_ID = ticket.dbid;
- end
- renders.admin.initialize();
- end,
- tooltip = {"Segítségkérés megtekintése", "Megtekintéshez kattints ide!"}
- }))
- y = y + lineHeight + padding;
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement