letsplayordy

GTA IV VB ScriptHook .NET GetRadarRectangle

Jul 2nd, 2015
218
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ' GTA.Graphics
  2. Public Function GetRadarRectangle(Scaling As FontScaling) As RectangleF
  3.     Dim num As Single = CSng(AddressOf Game.Resolution.Width)
  4.     Dim num2 As Single = CSng(AddressOf Game.Resolution.Height)
  5.     Dim num3 As Single = Math.Min(num * 0.156F, CSng((CDec(num2) * 0.20000000298023224)))
  6.     Dim result As RectangleF = Nothing
  7.     Dim width As Single
  8.     If FontScaling.Pixel = Scaling Then
  9.         width = num3
  10.     Else
  11.         If Scaling <> FontScaling.FontSize Then
  12.             If Scaling <> FontScaling.ScreenUnits Then
  13.                 width = num3
  14.             Else
  15.                 width = Graphics.ConvertPixelToUnitsX(num3)
  16.             End If
  17.         Else
  18.             width = Graphics.ConvertPixelToFontX(num3)
  19.         End If End If
  20.     result.Width = width
  21.     Dim height As Single
  22.     If FontScaling.Pixel = Scaling Then
  23.         height = num3
  24.     Else
  25.         If Scaling <> FontScaling.FontSize Then
  26.             If Scaling <> FontScaling.ScreenUnits Then
  27.                 height = num3
  28.             Else
  29.                 height = Graphics.ConvertPixelToUnitsY(num3)
  30.             End If
  31.         Else
  32.             height = Graphics.ConvertPixelToFontY(num3)
  33.         End If End If
  34.     result.Height = height
  35.     result.X = CSng((CDec(result.Width) * 0.44999998807907104))
  36.     Dim resolution As Size = AddressOf Game.Resolution
  37.     Dim resolution2 As Size = AddressOf Game.Resolution
  38.     If resolution.Width >= resolution2.Height Then
  39.         Dim y As Single
  40.         If FontScaling.ScreenUnits = Scaling Then
  41.             y = 0.75F
  42.         Else
  43.             If Scaling <> FontScaling.FontSize Then
  44.                 If Scaling <> FontScaling.Pixel Then
  45.                     y = 0.75F
  46.                 Else
  47.                     y = Graphics.ConvertUnitsToPixelY(0.75F)
  48.                 End If
  49.             Else
  50.                 y = 15F
  51.             End If End If
  52.         result.Y = y
  53.     Else
  54.         Dim num4 As Single = CSng((CDec(num2) - CDec(num3) - CDec(num2) * 0.05000000074505806))
  55.         Dim y2 As Single
  56.         If FontScaling.Pixel = Scaling Then
  57.             y2 = num4
  58.         Else
  59.             If Scaling <> FontScaling.FontSize Then
  60.                 If Scaling <> FontScaling.ScreenUnits Then
  61.                     y2 = num4
  62.                 Else
  63.                     y2 = Graphics.ConvertPixelToUnitsY(num4)
  64.                 End If
  65.             Else
  66.                 y2 = Graphics.ConvertPixelToFontY(num4)
  67.             End If End If
  68.         result.Y = y2
  69.     End If
  70.     Return result
  71. End Function
RAW Paste Data