Advertisement
bizzyboiii

Untitled

Apr 27th, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.96 KB | None | 0 0
  1. fcd.categories = {}
  2. fcd.modificationSaves = {}
  3.  
  4. local curDealer
  5. local curDealerEnt
  6. local rpnl
  7. local rpnlList
  8. local bg
  9. local mbg
  10. local w, h
  11.  
  12. local vipMat = Material( 'icon16/award_star_bronze_1.png', 'noclamp smooth' )
  13.  
  14. function fcd.clientInit()
  15. if not file.Exists( 'fcd_mods.txt', 'DATA' ) then
  16. file.Write( 'fcd_mods.txt', '' )
  17. end
  18.  
  19. local data = file.Read( 'fcd_mods.txt', 'DATA' )
  20. if not data then return end
  21. if data == '' then return end
  22.  
  23. data = util.JSONToTable( data )
  24.  
  25. for class, mods in pairs( data ) do
  26. fcd.modificationSaves[ class ] = mods
  27. end
  28. end
  29.  
  30. hook.Add( 'Initialize', 'fcd.clientInit', fcd.clientInit )
  31.  
  32. function fcd.saveModifications()
  33. file.Write( 'fcd_mods.txt', util.TableToJSON( fcd.modificationSaves ) )
  34. end
  35.  
  36. function fcd.dealerMenu()
  37. curDealer = net.ReadString()
  38. if not fcd.getDealerByID( curDealer ) then return end
  39.  
  40. curDealerEnt = fcd.getDealerByID( curDealer )
  41.  
  42. local spawned = net.ReadBool() or false
  43.  
  44. w, h = ScrW() * 0.95, ScrH() * 0.95
  45.  
  46. if spawned then
  47. fcd.returnCheck()
  48. else
  49. fcd.openDealerMenu()
  50. end
  51. end
  52.  
  53. function fcd.returnCheck()
  54. local bg = vgui.Create( 'fcdCheck' )
  55. bg.question = 'Return current vehicle?'
  56.  
  57. bg.yes.onYesClicked = function()
  58. bg:Remove()
  59.  
  60. net.Start( 'fcd.returnVehicle' )
  61. net.WriteString( curDealer )
  62. net.SendToServer()
  63. end
  64. end
  65.  
  66. function fcd.openDealerMenu()
  67. local mw, mh = w / 10, h - 37
  68.  
  69. local lw, lh = mw * 1.5, mh
  70. local lx, ly = 5, 30
  71.  
  72. local rw, rh = mw * 8.5 - 15, mh
  73. local rx, ry = lx + lw + 5, 30
  74.  
  75. bg = vgui.Create( 'fcdDFrame' )
  76. bg:SetSize( w, h )
  77. bg:SetPos( ScrW() / 2 - ( w / 2 ), ScrH() / 2 - ( h / 2 ) )
  78. bg.title = fcd.getDealerName( curDealerEnt ) .. ' - Main Menu'
  79.  
  80. mbg = bg:Add( 'fcdDPanel' )
  81. mbg:SetSize( w, h )
  82. mbg:SetPos( 0, 0 )
  83.  
  84. bg:addCloseButton()
  85.  
  86. function mbg:Paint( w, h )
  87.  
  88. end
  89.  
  90. local lpnl = mbg:Add( 'fcdDPanel' )
  91. lpnl:SetSize( lw, lh )
  92. lpnl:SetPos( lx, ly )
  93. lpnl.drawTitle = true
  94. lpnl.title = 'Categories'
  95.  
  96. local lpnlList = lpnl:Add( 'DScrollPanel' )
  97. lpnlList:SetSize( lw, lh - 20 )
  98. lpnlList:SetPos( 0, 25 )
  99. lpnlList.VBar:SetWide( 0 )
  100.  
  101. local yPos = 0
  102.  
  103. local all = lpnlList:Add( 'fcdDButton' )
  104. all:SetSize( lw, 25 )
  105. all:SetPos( 0, yPos )
  106. all.text = 'Show all'
  107. all.id = 0
  108.  
  109. function all:DoClick()
  110. if not self.clickable then return end
  111.  
  112. fcd.displayCategory( self.id, curDealerEnt:GetisSpecific() )
  113. rpnl.title = 'Vehicles'
  114. end
  115.  
  116. yPos = yPos + 28
  117.  
  118. for k, v in pairs( fcd.categories or {} ) do
  119. local cat = lpnlList:Add( 'fcdDButton' )
  120. cat:SetSize( lw, 25 )
  121. cat:SetPos( 0, yPos )
  122. cat.text = v
  123. cat.id = k
  124.  
  125. function cat:DoClick()
  126. if not self.clickable then return end
  127.  
  128. fcd.displayCategory( self.id, curDealerEnt:GetisSpecific() )
  129. rpnl.title = 'Vehicles ( ' .. v .. ' )'
  130. end
  131.  
  132. yPos = yPos + 28
  133. end
  134.  
  135. rpnl = mbg:Add( 'fcdDPanel' )
  136. rpnl:SetSize( rw, rh )
  137. rpnl:SetPos( rx, ry )
  138. rpnl.drawTitle = true
  139. rpnl.title = 'Vehicles'
  140.  
  141. rpnlList = rpnl:Add( 'DScrollPanel' )
  142. rpnlList:SetSize( rw, rh - 25 )
  143. rpnlList:SetPos( 0, 25 )
  144. rpnlList.VBar:SetWide( 0 )
  145.  
  146. if curDealerEnt:GetisSpecific() then
  147. fcd.displayCategory( 'curDealer' )
  148. else
  149. fcd.displayCategory( 0 )
  150. end
  151. end
  152.  
  153. function fcd.displayCategory( id, specific )
  154. local data = {}
  155.  
  156. local w, h = rpnl:GetWide() / 2 - 7.5, 100
  157. local x, y = 5, 0
  158. local count = 0
  159.  
  160. if id == 0 then
  161. for k, v in pairs( fcd.dataVehicles or {} ) do
  162.  
  163. if specific then
  164. if v.specificDealer then
  165. if table.HasValue( v.specificDealer, curDealer ) then
  166. table.insert( data, v )
  167. end
  168. end
  169. else
  170. if v.specificDealer then continue end
  171. table.insert( data, v )
  172. end
  173. end
  174. elseif id == 'curDealer' then
  175. for k, v in pairs( fcd.dataVehicles or {} ) do
  176. if v.specificDealer then
  177. if table.HasValue( v.specificDealer, curDealer ) then
  178. table.insert( data, v )
  179. end
  180. end
  181. end
  182. else
  183. local category = fcd.categories[ id ]
  184. if not category then category = fcd.dataVehicles end
  185.  
  186. for k, v in pairs( fcd.dataVehicles or {} ) do
  187. if v.category then
  188. if v.category == category then
  189. if not specific then
  190. if v.specificDealer then continue end
  191. end
  192.  
  193. if specific then
  194. if v.specificDealer then
  195. if table.HasValue( v.specificDealer, curDealer ) then
  196. table.insert( data, v )
  197. end
  198. end
  199. else
  200. table.insert( data, v )
  201. end
  202. end
  203. end
  204. end
  205. end
  206.  
  207. rpnlList:Clear()
  208.  
  209. for i, v in pairs( data or {} ) do
  210. v.owned = ( table.HasValue( fcd.owned, v.class ) ) and 1 or 0
  211. end
  212.  
  213. local i = 0
  214.  
  215. for k, v in SortedPairsByMemberValue( data, 'owned', true ) do
  216. i = i + 1
  217.  
  218. timer.Simple(0.05 * i, function()
  219. local purch = true
  220.  
  221. count = count + 1
  222.  
  223. local info = list.Get( 'Vehicles' )[ v.class ]
  224. if not info then return end
  225.  
  226. local reg = fcd.registeredVehicles[ v.class ]
  227. if not reg then return end
  228.  
  229. if reg.rankRestrict then
  230. if reg.rankRestrict( LocalPlayer() ) then
  231. purch = true
  232. else
  233. purch = false
  234. end
  235. end
  236.  
  237. if reg.jobRestrict then
  238. if reg.jobRestrict( LocalPlayer() ) then
  239. purch = true
  240. else
  241. purch = false
  242. end
  243. end
  244.  
  245. v.owned = table.HasValue( fcd.owned, v.class )
  246.  
  247. local pnl = rpnlList:Add( 'fcdDPanel' )
  248. pnl:SetSize( w, h )
  249. pnl:SetPos( x, y )
  250. pnl.title = info.Name or ''
  251.  
  252. function pnl:PaintOver( w, h )
  253. draw.SimpleText( 'Price: ' .. DarkRP.formatMoney( v.price ) or 'nil', 'fcd_font_20', w / 4, 15, fcd.clientVal( 'mainTextColor' ) )
  254.  
  255. if v.owned then
  256. draw.SimpleText( 'Owned: Yes', 'fcd_font_20', w / 4, 40, fcd.clientVal( 'mainTextColor' ) )
  257. else
  258. draw.SimpleText( 'Owned: No', 'fcd_font_20', w / 4, 40, fcd.clientVal( 'mainTextColor' ) )
  259. end
  260.  
  261. if purch then
  262. draw.SimpleText( 'Purchasable: Yes', 'fcd_font_20', w / 4, 65, fcd.clientVal( 'mainTextColor' ) )
  263. else
  264. draw.SimpleText( 'Purchasable: No', 'fcd_font_20', w / 4, 65, fcd.clientVal( 'mainTextColor' ) )
  265. end
  266.  
  267. if v.isVip then
  268. surface.SetDrawColor( Color( 255, 255, 255 ) )
  269. surface.SetMaterial( vipMat )
  270. surface.DrawTexturedRect( w - ( w * 0.3 ) - 5 - 25, 5, 20, 25 )
  271. end
  272. end
  273.  
  274. local select = pnl:Add( 'fcdDButton' )
  275. select:SetSize( w * 0.3, h / 2 - 7.5 )
  276. select:SetPos( w - ( w * 0.3 ) - 5, 5 )
  277. select.text = 'Select'
  278. select.textSize = 20
  279.  
  280. function select:DoClick()
  281. fcd.displayVehicle( v.class )
  282. end
  283.  
  284. local quick = pnl:Add( 'fcdDButton' )
  285. quick:SetSize( w * 0.3, h / 2 - 7.5 )
  286. quick:SetPos( w - ( w * 0.3 ) - 5, 10 + h / 2 - 7.5 )
  287. quick.text = 'Quick Buy'
  288. quick.textSize = 20
  289.  
  290. function quick:DoClick()
  291. net.Start( 'fcd.purchaseVehicle' )
  292. net.WriteString( v.class )
  293. net.SendToServer()
  294.  
  295. bg:Remove()
  296. end
  297.  
  298. if v.owned then
  299. quick.text = 'Spawn'
  300. quick.textSize = 40
  301.  
  302. function quick:DoClick()
  303. net.Start( 'fcd.quickSpawnVehicle' )
  304. net.WriteString( v.class )
  305. net.WriteString( curDealer )
  306. net.SendToServer()
  307.  
  308. bg:Remove()
  309. end
  310. end
  311.  
  312. local mdl = pnl:Add( 'DModelPanel' )
  313. mdl:SetSize( w / 4, h )
  314. mdl:SetPos( 1, 1 )
  315. mdl:SetModel( info.Model )
  316.  
  317. fcd.fixMdlPos( mdl )
  318.  
  319. if count >= 2 then
  320. y = y + h + 5
  321. x = 5
  322. count = 0
  323. else
  324. x = x + w + 5
  325. end
  326. end)
  327. end
  328. end
  329.  
  330. function fcd.displayVehicle( class )
  331. if not class then return end
  332. if not fcd.dataVehicles[ class ] then return end
  333.  
  334. local vClr = Color( 255, 255, 255 )
  335.  
  336. local nW, nH = w - 10, h - 37
  337. local mW, mH = nW / 2 - 10, nH / 2 - 10
  338.  
  339. local sendData = {}
  340. sendData.dealerID = curDealer
  341. sendData.class = class
  342.  
  343. local data = list.Get( 'Vehicles' )[ class ]
  344. if not data then return end
  345.  
  346. mbg:SizeTo( 0, 0, fcd.clientVal( 'animationSpeed' ) )
  347.  
  348. local nbg = bg:Add( 'fcdDPanel' )
  349. nbg:SetSize( 0, 0 )
  350. nbg:SetPos( 5, 30 )
  351. nbg.drawTitle = true
  352. nbg.title = data.Name or ''
  353.  
  354. local back = nbg:Add( 'fcdDButton' )
  355. back:SetSize( 50, 20 )
  356. back:SetPos( nW - 50, 0 )
  357. back.text = 'Back'
  358. back.textSize = 18
  359.  
  360. function back:DoClick()
  361. nbg:SizeTo( 0, 0, fcd.clientVal( 'animationSpeed' ) )
  362.  
  363. timer.Simple( fcd.clientVal( 'animationSpeed' ), function()
  364. mbg:SizeTo( w, h, fcd.clientVal( 'animationSpeed' ) )
  365. nbg:Remove()
  366. end )
  367. end
  368.  
  369. timer.Simple( fcd.clientVal( 'animationSpeed' ), function()
  370. nbg:SizeTo( nW, nH, fcd.clientVal( 'animationSpeed' ) )
  371. end )
  372.  
  373. local mdlPnl = nbg:Add( 'fcdDPanel' )
  374. mdlPnl:SetSize( mW, mH )
  375. mdlPnl:SetPos( 5, 25 )
  376. mdlPnl.title = 'Model'
  377.  
  378. local mdl = mdlPnl:Add( 'DModelPanel' )
  379. mdl:SetSize( mW, mH )
  380. mdl:SetPos( 0, 0 )
  381. mdl:SetModel( data.Model or '' )
  382.  
  383. local mdlThink = true
  384.  
  385. function mdl:Think()
  386. if mdlThink then
  387. self:SetColor( vClr )
  388. end
  389. end
  390.  
  391. fcd.fixMdlPos( mdl )
  392. mdl:SetFOV( 60 )
  393.  
  394. local modPnl = nbg:Add( 'fcdDPanel' )
  395. modPnl:SetSize( mW, mH )
  396. modPnl:SetPos( 15 + mW, 25 )
  397. modPnl.title = 'Modifications'
  398.  
  399. local cW, cH = mW / 2 - 10, mH / 2 - 25
  400.  
  401. local clr = modPnl:Add( 'DColorMixer' )
  402. clr:SetSize( cW, cH )
  403. clr:SetPos( 5, 20 )
  404. clr:SetWangs(false)
  405. clr:SetAlphaBar(false)
  406. clr:SetPalette(false)
  407.  
  408. function clr:ValueChanged()
  409. vClr = self:GetColor()
  410. sendData.clr = self:GetColor()
  411.  
  412. mdlThink = true
  413. end
  414.  
  415. local check = modPnl:Add( 'DCheckBoxLabel' )
  416. check:SetPos( 5, 25 + cH)
  417. check:SetSize( 20, 20 )
  418. check:SetFont( 'fcd_font_18' )
  419. check:SetText( 'Enable vehicle under lights?' )
  420.  
  421. if fcd.modificationSaves[ class ] then
  422. if fcd.modificationSaves[ class ].bGroups then
  423. for _, v in pairs( fcd.modificationSaves[ class ].bGroups ) do
  424. mdl.Entity:SetBodygroup( _, v )
  425. end
  426. sendData.bGroups = fcd.modificationSaves[ class ].bGroups
  427. end
  428.  
  429. if fcd.modificationSaves[ class ].skin then
  430. mdl.Entity:SetSkin( fcd.modificationSaves[ class ].skin )
  431. sendData.skin = fcd.modificationSaves[ class ].skin
  432. end
  433.  
  434. if fcd.modificationSaves[ class ].clr then
  435. local clr = fcd.modificationSaves[ class ].clr
  436.  
  437. mdlThink = false
  438.  
  439. mdl:SetColor( Color( clr.r, clr.g, clr.b ) )
  440. sendData.clr = fcd.modificationSaves[ class ].clr
  441. end
  442.  
  443. if fcd.modificationSaves[ class ].underLightColor then
  444. check:SetValue( 1 )
  445. sendData.underLightColor = fcd.modificationSaves[ class ].underLightColor
  446. sendData.underLight = true
  447. end
  448. end
  449.  
  450. local underClr = modPnl:Add( 'DColorMixer' )
  451. underClr:SetSize( cW, cH )
  452. underClr:SetPos( 5, 20 + cH + 25 )
  453. underClr:SetWangs(false)
  454. underClr:SetAlphaBar(false)
  455. underClr:SetPalette(false)
  456.  
  457. function underClr:ValueChanged()
  458. sendData.underLightColor = self:GetColor()
  459. end
  460.  
  461. function check:OnChange( bool )
  462. if bool then
  463. sendData.underLight = true
  464. sendData.underLightColor = underClr:GetColor()
  465. else
  466. sendData.underLight = false
  467. end
  468. end
  469.  
  470. if not fcd.cfg.underLights then
  471. local coverPnl = modPnl:Add( 'fcdDPanel' )
  472. coverPnl:SetSize( cW, cH + 30 )
  473. coverPnl:SetPos( 5, 25 + cH )
  474.  
  475. function coverPnl:Paint( w, h )
  476. fcd.drawBlur( self, 6 )
  477.  
  478. draw.SimpleText( 'Under Lights Disabled', 'fcd_font_19', w / 2, h / 2, fcd.clientVal( 'mainTextColor' ), 1, 1 )
  479. end
  480. end
  481.  
  482. local yPos = 20
  483.  
  484. local skinChoose = modPnl:Add( 'fcdDComboBox' )
  485. skinChoose:SetSize( cW, 25 )
  486. skinChoose:SetPos( 15 + cW, yPos )
  487. skinChoose:SetValue( 'Set Skin' )
  488.  
  489. for i = 0, mdl.Entity:SkinCount() do
  490. skinChoose:AddChoice( tostring( i ) )
  491. end
  492.  
  493. function skinChoose:OnSelect()
  494. mdl.Entity:SetSkin( self:GetValue() )
  495. sendData.skin = tonumber( self:GetValue() )
  496.  
  497. self:SetValue( 'Skin: ' .. self:GetValue() )
  498. end
  499.  
  500. yPos = yPos + 25 + 5
  501.  
  502. for _, bGroup in pairs( mdl.Entity:GetBodyGroups() ) do
  503. if not ( bGroup.num >= 2 ) then continue end
  504.  
  505. local bMod = modPnl:Add( 'fcdDComboBox' )
  506. bMod:SetSize( cW, 25 )
  507. bMod:SetPos( 15 + cW, yPos )
  508. bMod:SetValue( bGroup.name or '' )
  509.  
  510. for i = 0, bGroup.num - 1 do
  511. bMod:AddChoice( tostring( i ) )
  512. end
  513.  
  514. function bMod:OnSelect()
  515. mdl.Entity:SetBodygroup( bGroup.id, tonumber( self:GetValue() ) )
  516.  
  517. sendData.bGroups = sendData.bGroups or {}
  518. sendData.bGroups[ bGroup.id ] = tonumber( self:GetValue() )
  519.  
  520. self:SetValue( ( bGroup.name or '' ) .. ': ' .. self:GetValue() )
  521. end
  522.  
  523. yPos = yPos + 25 + 5
  524. end
  525.  
  526. if not fcd.cfg.Modules[ 'vehicleModifications' ] then
  527. local modPnlHide = modPnl:Add( 'fcdDPanel' )
  528. modPnlHide:SetSize( mW, mH )
  529. modPnlHide:SetPos( 0, 0 )
  530.  
  531. function modPnlHide:Paint( w, h )
  532. fcd.drawBlur( self, 6 )
  533.  
  534. draw.SimpleText( 'Modifications Disabled', 'fcd_font_19', w / 2, h / 2, fcd.clientVal( 'mainTextColor' ), 1, 1 )
  535. end
  536. end
  537.  
  538. local vehStats = nbg:Add( 'fcdDPanel' )
  539. vehStats:SetSize( mW, mH - 20 )
  540. vehStats:SetPos( 5, 35 + mH )
  541. vehStats.drawTitle = false
  542. vehStats.title = 'Data'
  543.  
  544. local vehData = fcd.dataVehicles[ class ]
  545.  
  546. local barAmt = mW / 25
  547. local barH = mH / 3 - 25 - 30
  548.  
  549. local spdBar = 130 / barAmt
  550. local rpmBar = 5000 / barAmt
  551. local horseBar = 1200 / barAmt
  552.  
  553. if vehData.maxSpeed and vehData.maxRPM and vehData.horsePower then
  554. local vehSpd = vehData.maxSpeed / spdBar
  555. local vehRPM = vehData.maxRPM / rpmBar
  556. local vehHorsePower = vehData.horsePower / horseBar
  557.  
  558. function vehStats:PaintOver( w, h )
  559. local yPos = 25
  560. local xPos = 5
  561.  
  562. local barX = 5
  563.  
  564. draw.SimpleText( 'Max Speed: ', 'fcd_font_25', 5, yPos, fcd.clientVal( 'mainTextColor' ) )
  565.  
  566. yPos = yPos + 30
  567.  
  568. for i = 1, barAmt do
  569.  
  570. local clr = Color( 10, 10, 10, 200 )
  571.  
  572. if i <= vehSpd then
  573. clr = Color( 25, 255, 25 )
  574. end
  575.  
  576. draw.RoundedBox( 0, barX, yPos, 15, barH, clr )
  577. barX = barX + 25
  578. end
  579.  
  580. yPos = yPos + barH + 5
  581.  
  582. draw.SimpleText( 'Max RPM: ', 'fcd_font_25', 5, yPos, fcd.clientVal( 'mainTextColor' ) )
  583.  
  584. yPos = yPos + 30
  585. barX = 5
  586.  
  587. for i = 1, barAmt do
  588.  
  589. local clr = Color( 10, 10, 10, 200 )
  590.  
  591. if i <= vehRPM then
  592. clr = Color( 25, 255, 25 )
  593. end
  594.  
  595. draw.RoundedBox( 0, barX, yPos, 15, barH, clr )
  596. barX = barX + 25
  597. end
  598.  
  599. yPos = yPos + barH + 5
  600.  
  601. draw.SimpleText( 'Horse Power: ', 'fcd_font_25', 5, yPos, fcd.clientVal( 'mainTextColor' ) )
  602.  
  603. yPos = yPos + 30
  604. barX = 5
  605.  
  606. for i = 1, barAmt do
  607.  
  608. local clr = Color( 10, 10, 10, 200 )
  609.  
  610. if i <= vehHorsePower then
  611. clr = Color( 25, 255, 25 )
  612. end
  613.  
  614. draw.RoundedBox( 0, barX, yPos, 15, barH, clr )
  615. barX = barX + 25
  616. end
  617. end
  618. else
  619. local vehStatsC = vehStats:Add( 'fcdDPanel' )
  620. vehStatsC:SetSize( mW, mH - 20 )
  621. vehStatsC:SetPos( 0, 0 )
  622.  
  623. function vehStatsC:Paint( w, h )
  624. fcd.drawBlur( self, 6 )
  625.  
  626. draw.SimpleText( 'Stats Not Available', 'fcd_font_19', w / 2, h / 2, fcd.clientVal( 'mainTextColor' ), 1, 1 )
  627. end
  628. end
  629.  
  630. local manage = nbg:Add( 'fcdDPanel' )
  631. manage:SetSize( mW, mH - 20 )
  632. manage:SetPos( 15 + mW, 35 + mH )
  633. manage.drawTitle = false
  634. manage.title = 'Manage'
  635.  
  636. local clicka = true
  637. if vehData.owned then
  638. clicka = false
  639. end
  640.  
  641. local btns = {}
  642.  
  643. btns[ 1 ] = {
  644. txt = 'Purchase',
  645. clickable = clicka,
  646. click = function()
  647. net.Start( 'fcd.purchaseVehicle' )
  648. net.WriteString( class )
  649. net.SendToServer()
  650. end
  651. }
  652. btns[ 2 ] = {
  653. txt = 'Sell',
  654. clickable = vehData.owned and true or false,
  655. click = function()
  656. net.Start( 'fcd.sellVehicle' )
  657. net.WriteString( class )
  658. net.SendToServer()
  659. end
  660. }
  661. btns[ 3 ] = {
  662. txt = 'Spawn',
  663. clickable = vehData.owned and true or false,
  664. click = function()
  665. net.Start( 'fcd.spawnVehicle' )
  666. net.WriteTable( sendData )
  667. net.SendToServer()
  668.  
  669. fcd.modificationSaves[ class ] = sendData
  670. fcd.saveModifications()
  671. end
  672. }
  673.  
  674. local yPos = 20
  675.  
  676. for i = 1, #btns do
  677. local data = btns[ i ]
  678.  
  679. local w, h = mW, ( mH - 15 ) / #btns - 7.5
  680.  
  681. local btn = manage:Add( 'fcdDButton' )
  682. btn:SetSize( w, h )
  683. btn:SetPos( 5, yPos)
  684. btn.text = data.txt
  685. btn.textSize = 20
  686. btn.clickable = data.clickable
  687.  
  688. function btn:DoClick()
  689. if not self.clickable then return end
  690.  
  691. data.click()
  692. bg:Remove()
  693. end
  694.  
  695. yPos = yPos + h + 5
  696. end
  697. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement