Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local sx,sy = guiGetScreenSize()
- local sw,sh = 1360,768
- local draw = {}
- appPos = {
- {980,664,262,36},
- {1014,471,48,45},
- {1086,471,48,45},
- {1158,471,48,45},
- {1014,534,48,45},
- {1086,534,48,45},
- {1158,534,48,45},
- {1014,598,48,45},
- {1086,598,48,45},
- {1158,598,48,45}
- }
- function dxRect(...)
- arg[1],arg[2],arg[3],arg[4] = arg[1]/sw*sx,arg[2]/sh*sy,arg[3]/sw*sx,arg[4]/sh*sy
- return dxDrawRectangle(unpack(arg))
- end
- function dxImage(...)
- arg[1],arg[2],arg[3],arg[4] = arg[1]/sw*sx,arg[2]/sh*sy,arg[3]/sw*sx,arg[4]/sh*sy
- return dxDrawImage(unpack(arg))
- end
- function dxText(...)
- arg[2],arg[3],arg[4],arg[5],arg[7] = arg[2]/sw*sx,arg[3]/sh*sy,arg[4]/sw*sx,arg[5]/sh*sy,(arg[7] or 1)/sw*sx
- return dxDrawText(unpack(arg))
- end
- function createPhone()
- local self = {}
- self.visible = true
- self.draw = function()
- if self.visible then
- self.topColor = dxRect(988,392,247,44,tocolor(255,255,255,255))
- self.bottomColor = dxRect(985,709,235,28,tocolor(100,100,100,255))
- self.phoneBase = dxImage(972,375,277,388,'phone.png')
- self.background = dxImage(980,438,260,262,'background.png')
- self.bar = dxRect(appPos[1][1],appPos[1][2],appPos[1][3],appPos[1][4],tocolor(0,0,0,255))
- local x1,y1,w1,h1,x2,y2,w2,h2,x3,y3,w3,h3 = appPos[2][1],appPos[2][2],appPos[2][3],appPos[2][4],appPos[3][1],appPos[3][2],appPos[3][3],appPos[3][4],appPos[4][1],appPos[4][2],appPos[4][3],appPos[4][4]
- self.emailApp = dxImage(x1,y1,w1,h1,'/img/email.png')
- self.messengerApp = dxImage(x2,y2,w2,h2,'/img/messenger.png')
- self.contactsApp = dxImage(x3,y3,w3,h3,'/img/contacts.png')
- local x4,y4,w4,h4,x5,y5,w5,h5,x6,y6,w6,h6 = appPos[5][1],appPos[5][2],appPos[5][3],appPos[5][4],appPos[6][1],appPos[6][2],appPos[6][3],appPos[6][4],appPos[7][1],appPos[7][2],appPos[7][3],appPos[7][4]
- self.cameraApp = dxImage(x4,y4,w4,h4,'/img/camera.png')
- self.missionsApp = dxImage(x5,y5,w5,h5,'/img/missions.png')
- self.internetApp = dxImage(x6,y6,w6,h6,'/img/internet.png')
- local x7,y7,w7,h7,x8,y8,w8,h8 = appPos[8][1],appPos[8][2],appPos[8][3],appPos[8][4],appPos[9][1],appPos[9][2],appPos[9][3],appPos[9][4]
- self.settingsApp = dxImage(x8,y8,w8,h8,'/img/settings.png')
- if selection then
- --self.overlay = dxRect(selection[3],selection[4],selection[5],selection[6],tocolor(255,0,0,255))
- dxDrawLine(selection[3],selection[4],selection[3]+selection[5],selection[4],tocolor(255,0,0,255),2)
- dxDrawLine(selection[3],selection[4]+selection[6],selection[3]+selection[5],selection[4]+selection[6],tocolor(255,0,0,255),2)
- dxDrawLine(selection[3],selection[4],selection[3],selection[4]+selection[6],tocolor(255,0,0,255),2)
- dxDrawLine(selection[3]+selection[5],selection[4],selection[3]+selection[5],selection[4]+selection[6],tocolor(255,0,0,255),2)
- self.selection = dxText(selection[1],980,437,1241,469,tocolor(255,0,0,255),1.00,'pricedown','center','center',false,false,true,false,false)
- end
- end
- end
- table.insert(draw,self)
- return self
- end
- phone = createPhone()
- addEventHandler('onClientRender',root,function()
- for i,render in ipairs(draw) do
- render.draw()
- end
- dxText(tostring(sx)..','..tostring(sy)..'/'..tostring(sw)..','..tostring(sh),1200,131,223,25)
- end)
- local selections = {
- {'Email',phone.emailApp,1014,471,48,45},
- {'Messenger',phone.messengerApp,1086,471,48,45},
- {'Contacts',phone.contactsApp,1158,471,48,45},
- {'Camera',phone.cameraApp,1014,534,48,45},
- {'Missions',phone.missionsApp,1086,534,48,45},
- {'Internet',phone.internetApp,1158,534,48,45},
- {'Settings',phone.settingsApp,1086,598,48,45}
- }
- selection = selections[5]
- addEventHandler('onClientKey',root,function(key,press)
- if press then
- if key == 'arrow_u' then
- -- row 2
- if selection == selections[5] then
- selection = selections[2]
- elseif selection == selections[2] then
- selection = selections[7]
- elseif selection == selections[7] then
- selection = selections[5]
- -- row 1
- elseif selection == selections[4] then
- selection = selections[1]
- elseif selection == selections[1] then
- selection = selections[4]
- -- row 3
- elseif selection == selections[6] then
- selection = selections[3]
- elseif selection == selections[3] then
- selection = selections[6]
- end
- elseif key == 'arrow_d' then
- -- row 2
- if selection == selections[5] then
- selection = selections[7]
- elseif selection == selections[7] then
- selection = selections[2]
- elseif selection == selections[2] then
- selection = selections[5]
- -- row 1
- elseif selection == selections[4] then
- selection = selections[1]
- elseif selection == selections[1] then
- selection = selections[4]
- -- row 3
- elseif selection == selections[6] then
- selection = selections[3]
- elseif selection == selections[3] then
- selection = selections[6]
- end
- elseif key == 'arrow_l' then
- -- row 2
- if selection == selections[5] then
- selection = selections[4]
- elseif selection == selections[4] then
- selection = selections[6]
- elseif selection == selections[6] then
- selection = selections[5]
- -- row 1
- elseif selection == selections[2] then
- selection = selections[1]
- elseif selection == selections[1] then
- selection = selections[3]
- elseif selection == selections[3] then
- selection = selections[2]
- -- row 3
- elseif selection == selections[7] then
- selection = selections[7]
- end
- elseif key == 'arrow_r' then
- -- row 2
- if selection == selections[5] then
- selection = selections[6]
- elseif selection == selections[6] then
- selection = selections[4]
- elseif selection == selections[4] then
- selection = selections[5]
- -- row 1
- elseif selection == selections[2] then
- selection = selections[3]
- elseif selection == selections[3] then
- selection = selections[1]
- elseif selection == selections[1] then
- selection = selections[2]
- -- row 3
- elseif selection == selections[7] then
- selection = selections[7]
- end
- end
- end
- end)
- bindKey('f2','down',function()
- if phone.visible then
- phone.visible = false
- else
- phone.visible = true
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement