Advertisement
Bolodefchoco_LUAXML

[UI] ui.smart

Sep 26th, 2015
452
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.17 KB | None | 0 0
  1. --Creator: Bolodefchoco
  2. --Made in: 26/09/2015
  3. --Last update: 26/12/2016
  4. --[[ Notes:
  5.     Does:
  6.         Adiciona uma textarea personalizada.
  7.     Args:
  8.         id --> Id da textarea
  9.         player --> O jogador que verá a ui (pode ser nil)
  10.         title --> Título da ui
  11.         text --> Texto da ui
  12.         x --> Posição horizontal da ui
  13.         y --> Posição vertical da ui
  14.         w --> Largura da ui
  15.         h --> Altura da ui
  16.         alpha --> Opacidade
  17.         closeButton --> Caso true, terá um botão de fechar
  18.         border --> Caso true, terá borda
  19.         fixed --> Caso true, será livre pelo scroll, caso contrário, será fixo
  20.         u --> Se for true, haverá sublinhado manual no título
  21. ]]--
  22.  
  23. ui.smart = function(id,player,title,text,x,y,w,h,alpha,closeButton,border,fixed,u)
  24.     id = id or 0
  25.     alpha,text = alpha or 1,text or ""
  26.     title = title~='' and ("<p align='center'><font size='15' face='verdana' ><V><B>"..title:upper().."</B></p></font>"..(u and "<R>"..("_"):rep(w/6/2) or "").."<p align='left'><font size='12' /><N>\n"..(u and "\n" or "")) or ("<p align='center'><font size='2'>\n</font>")
  27.     x,y,w,h = x or 10,y or 15,w or 100,h or 100
  28.     if border then
  29.         ui.addTextArea(id + 0,"",player,x-2,y+18,w+24,h+14,0x1B252E,0x1B252E,alpha,fixed)
  30.         ui.addTextArea(id + 1,"",player,x-1,y+19,w+22,h+12,0x1F6381,0x1F6381,alpha,fixed)
  31.         ui.addTextArea(id + 2,"",player,x+2,y+22,w+16,h+6,0x111517,0x111517,alpha,fixed)
  32.     end
  33.     ui.addTextArea(id + 3,"",player,x+3,y+23,w+14,h+4,0x0C191C,0x0C191C,alpha,fixed)
  34.     ui.addTextArea(id + 4,"",player,x+4,y+24,w+12,h+2,0x24474D,0x24474D,alpha,fixed)
  35.     ui.addTextArea(id + 5,"",player,x+5,y+25,w+10,h,0x183337,0x183337,alpha,fixed)
  36.     ui.addTextArea(id + 6,title..text,player,x+6,y+26,w+8,h-2,0x122528,0x122528,alpha,fixed)
  37.     if closeButton then
  38.         ui.addTextArea(id + 7,"",player,x+15,y+h+5,w-10,15,0x5D7D90,0x5D7D90,alpha,fixed)
  39.         ui.addTextArea(id + 8,"",player,x+15,y+h+7,w-10,15,0x11171C,0x11171C,alpha,fixed)
  40.         ui.addTextArea(id + 9,"<p align='center'><a href='event:closeUiSmart'><N>Close</a>",player,x+15,y+h+6,w-10,15,0x3C5064,0x3C5064,alpha,fixed)
  41.     end
  42. end
  43.  
  44. eventTextAreaCallback=function(id,name,callback)
  45.     if callback == "closeUiSmart" then
  46.         for i = id,id-9,-1 do
  47.             ui.removeTextArea(i,name)
  48.         end
  49.     end
  50. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement