Advertisement
Guest User

Untitled

a guest
Jan 20th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.19 KB | None | 0 0
  1. -----------------------------------------------
  2. -------------------- Fonts --------------------
  3. -----------------------------------------------
  4. surface.CreateFont( "NexaLightList", {
  5. font = "NexaLight",
  6. extended = false,
  7. size = 30,
  8. weight = 500,
  9. } )
  10.  
  11. surface.CreateFont( "NexaBoldList", {
  12. font = "NexaBold",
  13. extended = false,
  14. size = 40,
  15. weight = 500,
  16. } )
  17.  
  18. surface.CreateFont( "NexaLight123456789", {
  19. font = "NexaLight",
  20. extended = false,
  21. size = 40,
  22. weight = 500,
  23. } )
  24.  
  25. surface.CreateFont( "NexaBold123456789", {
  26. font = "NexaBold",
  27. extended = false,
  28. size = 60,
  29. weight = 500,
  30. } )
  31.  
  32. surface.CreateFont( "NexaBold1234567890", {
  33. font = "NexaBold",
  34. extended = false,
  35. size = 60,
  36. weight = 500,
  37. } )
  38.  
  39. ---------------------------------------------------------
  40. -------------------- Local functions --------------------
  41. ---------------------------------------------------------
  42. local screenwide = ScrW()
  43. local screenheight = ScrH()
  44.  
  45. --Images category
  46. local image_logoutbutton = Material( "adminpanel/images/logout.png" )
  47. local image_ticketicon = Material( "adminpanel/images/ticket-icon.png" )
  48. local image_adminpanelicon = Material( "adminpanel/images/adminpanel-icon.png" )
  49. local image_settingsicon = Material( "adminpanel/images/settings-icon.png" )
  50.  
  51. ---------------------------------------------------
  52. -------------------- Base menu --------------------
  53. ---------------------------------------------------
  54. local MainPanel = vgui.Create("DFrame")
  55. MainPanel:SetTitle("")
  56. MainPanel:SetSize(screenwide,screenheight)
  57. MainPanel:Center()
  58. MainPanel:MakePopup()
  59. MainPanel:ShowCloseButton(false)
  60. MainPanel:IsDraggable(false)
  61. function MainPanel:Paint( w, h )
  62.  
  63. draw.RoundedBox(0,0,0,screenwide,screenheight,Color(236,240,245)) --font blanc/gris
  64.  
  65. draw.RoundedBox(0,0,0,screenwide - 1600,screenheight,Color(34,45,50)) --sidebar
  66.  
  67. draw.RoundedBox(0,0,0,screenwide,screenheight - 1020,Color(64,142,186)) --bar du haut
  68.  
  69. draw.RoundedBox(0,0,0,screenwide - 1600,screenheight - 1020,Color(58,128,167)) --bar du haut foncé
  70.  
  71. draw.SimpleText("ORIGINE","NexaBold123456789",160,30,Color(255,255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER)
  72.  
  73. end
  74.  
  75.  
  76.  
  77. local buttonclose = vgui.Create("DButton", MainPanel)
  78. buttonclose:SetSize(35,35)
  79. buttonclose:SetText("")
  80. buttonclose:SetPos(screenwide - 47.5, 12.5)
  81. function buttonclose:Paint( w, h )
  82. --draw.RoundedBox(0,0,0,w,h,Color(255,0,0,255))
  83. if buttonclose:IsHovered() then
  84. surface.SetDrawColor( 0, 0, 0, 255 )
  85. else
  86. surface.SetDrawColor( 255, 255, 255, 255 )
  87. end
  88. surface.SetMaterial( image_logoutbutton )
  89. surface.DrawTexturedRect( 0, 0, 35, 35 )
  90.  
  91. end
  92. function buttonclose:DoClick()
  93. MainPanel:Close()
  94. end
  95.  
  96.  
  97.  
  98.  
  99.  
  100. --------------------------------------------------------
  101. -------------------- Testing button --------------------
  102. --------------------------------------------------------
  103.  
  104. local function functiontickets()
  105. surface.SetDrawColor( 255, 255, 255, 255 )
  106. surface.SetMaterial( image_ticketicon )
  107. surface.DrawTexturedRect( 37, 35, 30, 30 )
  108. draw.SimpleText("Tickets","NexaLight123456789",90,50,Color(255,255,255,255),TEXT_ALIGN_LEFT,TEXT_ALIGN_CENTER)
  109. end
  110.  
  111.  
  112. local paneltickets = vgui.Create("DPanel", MainPanel )
  113. paneltickets:SetSize(1520,940)
  114. paneltickets:SetPos(360,100)
  115. function paneltickets:Paint( w, h )
  116.  
  117. draw.RoundedBox(0,0,0,w,h,Color(255,255,255,255)) --font blanc/gris
  118.  
  119. end
  120.  
  121.  
  122.  
  123. local buttontickets = vgui.Create("DButton", MainPanel)
  124. buttontickets:SetSize(320,100)
  125. buttontickets:SetText("")
  126. buttontickets:SetPos(0, 100)
  127. buttontickets:SetEnabled( true )
  128. function buttontickets:Paint( w, h )
  129.  
  130. if paneltickets:IsVisible() then
  131. draw.RoundedBox(0,0,0,w,h,Color(30,40,44,255))
  132. draw.RoundedBox(0,0,0,4,h,Color(64,142,186,255))
  133. functiontickets()
  134. else
  135. draw.RoundedBox(0,0,0,w,h,Color(0,0,0,0))
  136. functiontickets()
  137. end
  138.  
  139. end
  140. function buttontickets:DoClick()
  141.  
  142. if paneltickets._panelViewState then
  143. --paneltickets:Hide()
  144. else
  145. paneltickets:Show()
  146. paneladminpanel:Hide()
  147. panelsettings:Hide()
  148. end
  149. paneltickets._panelViewState = not paneltickets._panelViewState
  150.  
  151. end
  152.  
  153.  
  154.  
  155. ----------------------------------------------------------
  156. -------------------- Testing button 2 --------------------
  157. ----------------------------------------------------------
  158.  
  159. local function functionadminpanel()
  160. surface.SetDrawColor( 255, 255, 255, 255 )
  161. surface.SetMaterial( image_adminpanelicon )
  162. surface.DrawTexturedRect( 37, 35, 30, 30 )
  163. draw.SimpleText("Admin Panel","NexaLight123456789",90,50,Color(255,255,255,255),TEXT_ALIGN_LEFT,TEXT_ALIGN_CENTER)
  164. end
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171. local buttonadminpanel = vgui.Create("DButton", MainPanel)
  172. buttonadminpanel:SetSize(320,100)
  173. buttonadminpanel:SetText("")
  174. buttonadminpanel:SetPos(0, 100 + 100)
  175. buttonadminpanel:SetEnabled( true )
  176. function buttonadminpanel:Paint( w, h )
  177.  
  178. if paneladminpanel:IsVisible() then
  179. draw.RoundedBox(0,0,0,w,h,Color(30,40,44,255))
  180. draw.RoundedBox(0,0,0,4,h,Color(64,142,186,255))
  181. functionadminpanel()
  182. else
  183. draw.RoundedBox(0,0,0,w,h,Color(0,0,0,0))
  184. functionadminpanel()
  185. end
  186.  
  187. end
  188. function buttonadminpanel:DoClick()
  189.  
  190. if paneladminpanel._panelViewState then
  191. --paneladminpanel:Hide()
  192. else
  193. paneladminpanel:Show()
  194. paneltickets:Hide()
  195. panelsettings:Hide()
  196. end
  197. paneladminpanel._panelViewState = not paneladminpanel._panelViewState
  198.  
  199. end
  200.  
  201. local function testpanel1( Parent )
  202.  
  203. local TestPanel2 = vgui.Create("DPanel", Parent)
  204. TestPanel2:SetSize(1000,1000)
  205. TestPanel2:SetPos(100,100)
  206.  
  207. end
  208.  
  209. local paneladminpanel = vgui.Create("DPanel", MainPanel )
  210. paneladminpanel:SetSize(1520,940)
  211. paneladminpanel:SetPos(360,100)
  212. function paneladminpanel:Paint( w, h )
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222. draw.RoundedBox(0,0,0,w,h,Color(255,255,255,255)) --font blanc/gris
  223.  
  224. draw.RoundedBox(0,0,48,w - 15,2,Color(58,128,167,255)) --Ligne bleu haut
  225.  
  226. draw.SimpleText("Name:","NexaBoldList",5,50 / 2,Color(0,0,0,255),TEXT_ALIGN_LEFT,TEXT_ALIGN_CENTER)
  227.  
  228. draw.SimpleText("SteamID:","NexaBoldList",w / 2,50 / 2,Color(0,0,0,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER)
  229.  
  230. draw.SimpleText("Rank:","NexaBoldList",w - 20,50 / 2,Color(0,0,0,255),TEXT_ALIGN_RIGHT,TEXT_ALIGN_CENTER)
  231.  
  232.  
  233.  
  234. local PlayerList = nil
  235.  
  236. local PlayerScrollPanel = vgui.Create("DScrollPanel", paneladminpanel)
  237. PlayerScrollPanel:SetSize(w,h - 50)
  238. PlayerScrollPanel:SetPos(0,50)
  239.  
  240. PlayerList = vgui.Create("DListLayout", PlayerScrollPanel)
  241. PlayerList:SetSize(PlayerScrollPanel:GetWide(),PlayerScrollPanel:GetTall())
  242. PlayerList:SetPos(0,0)
  243.  
  244. PlayerList:Clear()
  245.  
  246. for _, v in pairs(player.GetAll()) do
  247. local PlayerButton = vgui.Create("DButton", PlayerList)
  248. PlayerButton:SetSize(PlayerList:GetWide(), 50)
  249. PlayerButton:SetPos(0,0)
  250. PlayerButton:SetText("")
  251. PlayerButton.DoClick = function()
  252. testpanel1(MainPanel)
  253. end
  254. function PlayerButton:Paint( w, h )
  255. draw.RoundedBox(0,0,0,w - 15,h,Color(34,45,50,255))
  256. draw.RoundedBox(0,0,h-2,w - 15,4,Color(64,142,186,255))
  257.  
  258. draw.SimpleText(LocalPlayer():Name(),"NexaLightList",5,h / 2 - 2,Color(255,255,255,255),TEXT_ALIGN_LEFT,TEXT_ALIGN_CENTER)
  259. draw.SimpleText(LocalPlayer():SteamID(),"NexaLightList",w / 2,h / 2 - 2,Color(255,255,255,255),TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER)
  260. draw.SimpleText(LocalPlayer():SteamID(),"NexaLightList",w - 20,h / 2 - 2,Color(255,255,255,255),TEXT_ALIGN_RIGHT,TEXT_ALIGN_CENTER)
  261.  
  262. end
  263. end
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274. end
  275.  
  276.  
  277. ----------------------------------------------------------
  278. -------------------- Testing button 3 --------------------
  279. ----------------------------------------------------------
  280.  
  281. local function functionsettings()
  282. surface.SetDrawColor( 255, 255, 255, 255 )
  283. surface.SetMaterial( image_settingsicon )
  284. surface.DrawTexturedRect( 37, 35, 30, 30 )
  285. draw.SimpleText("Settings","NexaLight123456789",90,50,Color(255,255,255,255),TEXT_ALIGN_LEFT,TEXT_ALIGN_CENTER)
  286. end
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293. buttonsettings = vgui.Create("DButton", MainPanel)
  294. buttonsettings:SetSize(320,100)
  295. buttonsettings:SetText("")
  296. buttonsettings:SetPos(0, 100 + 200)
  297. buttonsettings:SetEnabled( true )
  298. function buttonsettings:Paint( w, h )
  299.  
  300. if panelsettings:IsVisible() then
  301. draw.RoundedBox(0,0,0,w,h,Color(30,40,44,255))
  302. draw.RoundedBox(0,0,0,4,h,Color(64,142,186,255))
  303. functionsettings()
  304. else
  305. draw.RoundedBox(0,0,0,w,h,Color(0,0,0,0))
  306. functionsettings()
  307. end
  308.  
  309. end
  310. function buttonsettings:DoClick()
  311.  
  312. if panelsettings._panelViewState then
  313. --panelsettings:Hide()
  314. else
  315. panelsettings:Show()
  316. paneltickets:Hide()
  317. paneladminpanel:Hide()
  318. end
  319. panelsettings._panelViewState = not panelsettings._panelViewState
  320.  
  321. end
  322.  
  323.  
  324.  
  325.  
  326. panelsettings = vgui.Create("DPanel", MainPanel )
  327. panelsettings:SetSize(1520,940)
  328. panelsettings:SetPos(360,100)
  329. function panelsettings:Paint( w, h )
  330.  
  331. draw.RoundedBox(0,0,0,w,h,Color(255,255,255,255)) --font blanc/gris
  332.  
  333. draw.SimpleText("Cette page est actuellement indisponible!","NexaBold1234567890",w / 2,h / 3,Color(0,0,0,255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
  334.  
  335. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement