Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private activeLineIndexMain As Int32 = 0
- Private Sub processMAIN()
- Const LineWidth As Single = 500.0 '250.0
- Const LineCount As Int16 = 4
- Dim Caption As String = "PED COSTUME SELECTOR"
- Dim lineCaption(LineCount) As String
- lineCaption(0) = "CLOTHING TYPE"
- lineCaption(1) = "VARIATION"
- lineCaption(2) = "TEXTURE"
- lineCaption(3) = "PALETTE"
- Dim waitTime As Int32 = 150
- ' While True
- Dim maxTickCount As Int32 = GetTickCount() + waitTime
- Do
- DrawMenuLine(Caption, LineWidth, 15.0, 18.0, 500.0, 5.0, False, True)
- For i = 0 To LineCount - 1 Step 1
- ' If (Not i = activeLineIndexMain) Then DrawMenuLine(lineCaption(i), LineWidth, 9.0, 60.0 + i * 36.0, 0.0, 9.0, False, False)
- If (Not i = activeLineIndexMain) Then DrawMenuLine(lineCaption(i), LineWidth, 9.0, 60.0 + i * 36.0, 500.0, 9.0, False, False)
- Next
- DrawMenuLine(lineCaption(activeLineIndexMain), LineWidth + 1.0, 11.0, 56.0 + activeLineIndexMain * 36.0, 500.0, 7.0, True, False)
- Wait(1)
- Loop While (GetTickCount() < maxTickCount)
- waitTime = 0
- Dim bSelect, bBack, bUp, bDown, bMenu As Boolean
- bSelect = Game.IsKeyPressed(Keys.NumPad5)
- bBack = Game.IsKeyPressed(Keys.NumPad0)
- bUp = Game.IsKeyPressed(Keys.NumPad8)
- bDown = Game.IsKeyPressed(Keys.NumPad2)
- bMenu = Game.IsKeyPressed(Keys.F12)
- If (bSelect) Then
- menu_beep()
- Select Case activeLineIndexMain
- Case 0
- 'DO STUFF
- Case 1
- 'DO STUFF
- Case 2
- 'DO STUFF
- Case 3
- 'DO STUFF
- Case 4
- 'DO STUFF
- Case 5
- 'DO STUFF
- Case 6
- menu_beep()
- Exit Select
- End Select
- waitTime = 200
- ElseIf (bMenu) Then
- ' bSon = False
- ' waitTime = 150
- menu_beep()
- ' Exit While
- ElseIf (bBack) Then
- bSon = False
- menu_beep()
- ' Exit While
- ElseIf (bUp) Then
- menu_beep()
- If activeLineIndexMain = 0 Then activeLineIndexMain = LineCount
- activeLineIndexMain -= 1
- waitTime = 150
- ElseIf (bDown) Then
- menu_beep()
- activeLineIndexMain += 1
- If activeLineIndexMain = LineCount Then activeLineIndexMain = 0
- waitTime = 150
- End If
- ' End While
- End Sub
- 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)
- 'DEFAULT VALUES
- Dim textCol As Int32() = {255, 255, 255, 255}
- Dim rectCol As Int32() = {231, 76, 60, 255} '{70, 95, 95, 255} '255
- Dim textScale As Single = 0.35
- Dim font As Int16 = 0
- 'CORRECTING VALUES FOR ACTIVE LINE
- If (Active) Then
- textCol(0) = 17 '0
- textCol(1) = 17 '0
- textCol(2) = 17 '0
- rectCol(0) = 218
- rectCol(1) = 242
- rectCol(2) = 216
- ' If (RescaleText) Then textScale = 0.4
- If (RescaleText) Then textScale = 0.5
- End If
- If (Title) Then
- rectCol(0) = 192 '0
- rectCol(1) = 57 '0
- rectCol(2) = 43 '0
- If (RescaleText) Then textScale = 0.45
- font = 7
- End If
- Dim screenW, screenH As Int32
- Dim _screen As Size = Game.ScreenResolution()
- screenW = _screen.Width
- screenH = _screen.Height
- TextLeft += LineLeft
- Dim lineWidthScaled As Single = LineWidth / Convert.ToSingle(screenW) 'LINE WIDTH
- Dim lineTopScaled As Single = LineTop / Convert.ToSingle(screenH) 'LINE TOP OFFSET
- Dim textLeftScaled As Single = TextLeft / Convert.ToSingle(screenW) 'LEFT OFFSET
- Dim lineHeightScaled = LineHeight / Convert.ToSingle(screenH) 'LINE HEIGHT
- Dim lineLeftScaled = LineLeft / Convert.ToSingle(screenW)
- 'UPPER
- Native.Function.Call(Native.Hash.SET_TEXT_FONT, font)
- Native.Function.Call(Native.Hash.SET_TEXT_SCALE, 0.0, textScale)
- Native.Function.Call(Native.Hash.SET_TEXT_COLOUR, textCol(0), textCol(1), textCol(2), textCol(3))
- Native.Function.Call(Native.Hash.SET_TEXT_CENTRE, 0)
- Native.Function.Call(Native.Hash.SET_TEXT_DROPSHADOW, 0, 0, 0, 0, 0)
- Native.Function.Call(Native.Hash.SET_TEXT_EDGE, 0, 0, 0, 0, 0)
- Native.Function.Call(Native.Hash._SET_TEXT_ENTRY, "STRING")
- Native.Function.Call(Native.Hash._ADD_TEXT_COMPONENT_STRING, Caption)
- Native.Function.Call(Native.Hash._DRAW_TEXT, textLeftScaled, (((lineTopScaled + 0.00278F) + lineHeightScaled) - 0.005F))
- 'LOWER
- Native.Function.Call(Native.Hash.SET_TEXT_FONT, font)
- Native.Function.Call(Native.Hash.SET_TEXT_SCALE, 0.0, textScale)
- Native.Function.Call(Native.Hash.SET_TEXT_COLOUR, textCol(0), textCol(1), textCol(2), textCol(3))
- Native.Function.Call(Native.Hash.SET_TEXT_CENTRE, 0)
- Native.Function.Call(Native.Hash.SET_TEXT_DROPSHADOW, 0, 0, 0, 0, 0)
- Native.Function.Call(Native.Hash.SET_TEXT_EDGE, 0, 0, 0, 0, 0)
- Native.Function.Call(Native.Hash._SET_TEXT_GXT_ENTRY, "STRING")
- Native.Function.Call(Native.Hash._ADD_TEXT_COMPONENT_STRING, Caption)
- Dim num25 As Int32 = Native.Function.Call(Of Int32)(Native.Hash._0x9040DFB09BE75706, textLeftScaled, (((lineTopScaled + 0.00278F) + lineHeightScaled) - 0.005F))
- Dim unk As Single = Native.Function.Call(Of Single)(Native.Hash._0xDB88A37483346780, textScale, 0)
- 'RECT
- draw_rect(lineLeftScaled, lineTopScaled + (0.00278F), lineWidthScaled, (Convert.ToSingle(((num25 * unk) + (lineHeightScaled * 2.0F)) + 0.005F)), rectCol(0), rectCol(1), rectCol(2), rectCol(3))
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement