Advertisement
TheVideoVolcano

VB.NET GTA V (AB) Menu Code

Jul 23rd, 2015
554
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 6.27 KB | None | 0 0
  1.  
  2. Private activeLineIndexMain As Int32 = 0
  3.  
  4.     Private Sub processMAIN()
  5.  
  6.         Const LineWidth As Single = 500.0 '250.0
  7.         Const LineCount As Int16 = 4
  8.  
  9.         Dim Caption As String = "PED COSTUME SELECTOR"
  10.  
  11.         Dim lineCaption(LineCount) As String
  12.  
  13.         lineCaption(0) = "CLOTHING TYPE"
  14.         lineCaption(1) = "VARIATION"
  15.         lineCaption(2) = "TEXTURE"
  16.         lineCaption(3) = "PALETTE"
  17.  
  18.         Dim waitTime As Int32 = 150
  19.  
  20.         ' While True
  21.  
  22.         Dim maxTickCount As Int32 = GetTickCount() + waitTime
  23.  
  24.         Do
  25.             DrawMenuLine(Caption, LineWidth, 15.0, 18.0, 500.0, 5.0, False, True)
  26.  
  27.             For i = 0 To LineCount - 1 Step 1
  28.                 '  If (Not i = activeLineIndexMain) Then DrawMenuLine(lineCaption(i), LineWidth, 9.0, 60.0 + i * 36.0, 0.0, 9.0, False, False)
  29.                 If (Not i = activeLineIndexMain) Then DrawMenuLine(lineCaption(i), LineWidth, 9.0, 60.0 + i * 36.0, 500.0, 9.0, False, False)
  30.             Next
  31.  
  32.             DrawMenuLine(lineCaption(activeLineIndexMain), LineWidth + 1.0, 11.0, 56.0 + activeLineIndexMain * 36.0, 500.0, 7.0, True, False)
  33.  
  34.             Wait(1)
  35.  
  36.         Loop While (GetTickCount() < maxTickCount)
  37.  
  38.         waitTime = 0
  39.  
  40.         Dim bSelect, bBack, bUp, bDown, bMenu As Boolean
  41.  
  42.         bSelect = Game.IsKeyPressed(Keys.NumPad5)
  43.         bBack = Game.IsKeyPressed(Keys.NumPad0)
  44.         bUp = Game.IsKeyPressed(Keys.NumPad8)
  45.         bDown = Game.IsKeyPressed(Keys.NumPad2)
  46.         bMenu = Game.IsKeyPressed(Keys.F12)
  47.  
  48.         If (bSelect) Then
  49.             menu_beep()
  50.  
  51.             Select Case activeLineIndexMain
  52.  
  53.                 Case 0
  54.  
  55.                     'DO STUFF
  56.                 Case 1
  57.                     'DO STUFF
  58.                 Case 2
  59.                     'DO STUFF
  60.                 Case 3
  61.                     'DO STUFF
  62.                 Case 4
  63.                     'DO STUFF
  64.                 Case 5
  65.                     'DO STUFF
  66.                 Case 6
  67.                     menu_beep()
  68.                     Exit Select
  69.             End Select
  70.  
  71.             waitTime = 200
  72.         ElseIf (bMenu) Then
  73.  
  74.             '  bSon = False
  75.             ' waitTime = 150
  76.             menu_beep()
  77.             ' Exit While
  78.  
  79.         ElseIf (bBack) Then
  80.  
  81.             bSon = False
  82.             menu_beep()
  83.             '  Exit While
  84.         ElseIf (bUp) Then
  85.  
  86.             menu_beep()
  87.  
  88.             If activeLineIndexMain = 0 Then activeLineIndexMain = LineCount
  89.             activeLineIndexMain -= 1
  90.             waitTime = 150
  91.  
  92.         ElseIf (bDown) Then
  93.             menu_beep()
  94.  
  95.             activeLineIndexMain += 1
  96.             If activeLineIndexMain = LineCount Then activeLineIndexMain = 0
  97.             waitTime = 150
  98.  
  99.         End If
  100.  
  101.         ' End While
  102.     End Sub
  103.  
  104.  
  105.   Private Sub DrawMenuLine(Caption As String, LineWidth As Single, LineHeight As Single, LineTop As Single, LineLeft As Single, TextLeft As Single, Active As Boolean, Title As Boolean, Optional RescaleText As Boolean = True)
  106.  
  107.         'DEFAULT VALUES
  108.         Dim textCol As Int32() = {255, 255, 255, 255}
  109.         Dim rectCol As Int32() = {231, 76, 60, 255} '{70, 95, 95, 255} '255
  110.         Dim textScale As Single = 0.35
  111.         Dim font As Int16 = 0
  112.  
  113.         'CORRECTING VALUES FOR ACTIVE LINE
  114.         If (Active) Then
  115.             textCol(0) = 17 '0
  116.             textCol(1) = 17 '0
  117.             textCol(2) = 17 '0
  118.  
  119.             rectCol(0) = 218
  120.             rectCol(1) = 242
  121.             rectCol(2) = 216
  122.  
  123.             ' If (RescaleText) Then textScale = 0.4
  124.             If (RescaleText) Then textScale = 0.5
  125.         End If
  126.  
  127.         If (Title) Then
  128.  
  129.             rectCol(0) = 192 '0
  130.             rectCol(1) = 57 '0
  131.             rectCol(2) = 43 '0
  132.  
  133.             If (RescaleText) Then textScale = 0.45
  134.             font = 7
  135.  
  136.         End If
  137.  
  138.         Dim screenW, screenH As Int32
  139.         Dim _screen As Size = Game.ScreenResolution()
  140.  
  141.         screenW = _screen.Width
  142.         screenH = _screen.Height
  143.  
  144.         TextLeft += LineLeft
  145.  
  146.         Dim lineWidthScaled As Single = LineWidth / Convert.ToSingle(screenW) 'LINE WIDTH
  147.         Dim lineTopScaled As Single = LineTop / Convert.ToSingle(screenH) 'LINE TOP OFFSET
  148.         Dim textLeftScaled As Single = TextLeft / Convert.ToSingle(screenW) 'LEFT OFFSET
  149.         Dim lineHeightScaled = LineHeight / Convert.ToSingle(screenH) 'LINE HEIGHT
  150.  
  151.         Dim lineLeftScaled = LineLeft / Convert.ToSingle(screenW)
  152.  
  153.         'UPPER
  154.         Native.Function.Call(Native.Hash.SET_TEXT_FONT, font)
  155.         Native.Function.Call(Native.Hash.SET_TEXT_SCALE, 0.0, textScale)
  156.         Native.Function.Call(Native.Hash.SET_TEXT_COLOUR, textCol(0), textCol(1), textCol(2), textCol(3))
  157.         Native.Function.Call(Native.Hash.SET_TEXT_CENTRE, 0)
  158.         Native.Function.Call(Native.Hash.SET_TEXT_DROPSHADOW, 0, 0, 0, 0, 0)
  159.         Native.Function.Call(Native.Hash.SET_TEXT_EDGE, 0, 0, 0, 0, 0)
  160.         Native.Function.Call(Native.Hash._SET_TEXT_ENTRY, "STRING")
  161.         Native.Function.Call(Native.Hash._ADD_TEXT_COMPONENT_STRING, Caption)
  162.         Native.Function.Call(Native.Hash._DRAW_TEXT, textLeftScaled, (((lineTopScaled + 0.00278F) + lineHeightScaled) - 0.005F))
  163.  
  164.         'LOWER
  165.         Native.Function.Call(Native.Hash.SET_TEXT_FONT, font)
  166.         Native.Function.Call(Native.Hash.SET_TEXT_SCALE, 0.0, textScale)
  167.         Native.Function.Call(Native.Hash.SET_TEXT_COLOUR, textCol(0), textCol(1), textCol(2), textCol(3))
  168.         Native.Function.Call(Native.Hash.SET_TEXT_CENTRE, 0)
  169.         Native.Function.Call(Native.Hash.SET_TEXT_DROPSHADOW, 0, 0, 0, 0, 0)
  170.         Native.Function.Call(Native.Hash.SET_TEXT_EDGE, 0, 0, 0, 0, 0)
  171.         Native.Function.Call(Native.Hash._SET_TEXT_GXT_ENTRY, "STRING")
  172.         Native.Function.Call(Native.Hash._ADD_TEXT_COMPONENT_STRING, Caption)
  173.         Dim num25 As Int32 = Native.Function.Call(Of Int32)(Native.Hash._0x9040DFB09BE75706, textLeftScaled, (((lineTopScaled + 0.00278F) + lineHeightScaled) - 0.005F))
  174.  
  175.         Dim unk As Single = Native.Function.Call(Of Single)(Native.Hash._0xDB88A37483346780, textScale, 0)
  176.         'RECT
  177.         draw_rect(lineLeftScaled, lineTopScaled + (0.00278F), lineWidthScaled, (Convert.ToSingle(((num25 * unk) + (lineHeightScaled * 2.0F)) + 0.005F)), rectCol(0), rectCol(1), rectCol(2), rectCol(3))
  178.  
  179.  
  180.     End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement