Advertisement
Guest User

Untitled

a guest
Nov 16th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 3.48 KB | None | 0 0
  1.     <Extension()>
  2.     Public Sub PlayMissionCompleteScaleform(scaleform As Scaleform, title As String, subtitle As String, medal As MissionCompleteScaleformMedal, percent As Integer, time As Integer, ParamArray objectives As ObjectiveItem())
  3.         scaleform = New Scaleform("MISSION_COMPLETE")
  4.         Dim timeout As Integer = time
  5.         Dim start = DateTime.Now
  6.         While (Not scaleform.IsLoaded) AndAlso DateTime.Now.Subtract(start).TotalMilliseconds < timeout
  7.             Script.Yield()
  8.         End While
  9.         scaleform.CallFunction("SET_MISSION_TITLE", "", title)
  10.         Dim objIndex As Integer = 0
  11.         For Each obj As ObjectiveItem In objectives
  12.             Select Case obj.Type
  13.                 Case ObjectiveItem.ObjectiveItemType.Time
  14.                     scaleform.CallFunction("SET_DATA_SLOT", objIndex, obj.CheckboxChecked, True, True, 2, CInt(obj.RightLabel), obj.Title)
  15.                 Case ObjectiveItem.ObjectiveItemType.Number
  16.                     scaleform.CallFunction("SET_DATA_SLOT", objIndex, obj.CheckboxChecked, 2, CSng(obj.RightLabel), obj.Title)
  17.                 Case ObjectiveItem.ObjectiveItemType.Task
  18.                     scaleform.CallFunction("SET_DATA_SLOT", objIndex, obj.CheckboxChecked, obj.RightLabel.ToString.Split("/")(0), obj.RightLabel.ToString.Split("/")(1), obj.Title)
  19.                 Case ObjectiveItem.ObjectiveItemType.Percentage
  20.                     scaleform.CallFunction("SET_DATA_SLOT", objIndex, obj.CheckboxChecked, 2, CInt(obj.RightLabel), obj.Title)
  21.                 Case ObjectiveItem.ObjectiveItemType.MoneyMonetized
  22.                     scaleform.CallFunction("SET_DATA_SLOT", objIndex, obj.CheckboxChecked, 8, CInt(obj.RightLabel), obj.Title)
  23.                 Case ObjectiveItem.ObjectiveItemType.MoneyDemonetized
  24.                     scaleform.CallFunction("SET_DATA_SLOT", objIndex, obj.CheckboxChecked, 8, CInt(obj.RightLabel), obj.Title)
  25.                 Case ObjectiveItem.ObjectiveItemType.RP
  26.                     scaleform.CallFunction("SET_DATA_SLOT", objIndex, obj.CheckboxChecked, 8, CInt(obj.RightLabel), obj.Title)
  27.                 Case ObjectiveItem.ObjectiveItemType.Objective
  28.                     scaleform.CallFunction("SET_DATA_SLOT", objIndex, obj.CheckboxChecked, obj.Title)
  29.             End Select
  30.             objIndex += 1
  31.         Next
  32.         scaleform.CallFunction("SET_TOTAL", CInt(medal), percent, subtitle)
  33.         scaleform.CallFunction("DRAW_MENU_LIST")
  34.     End Sub
  35.  
  36.     <Extension()>
  37.     Public Sub DrawMissionCompletedScaleform(scaleform As Scaleform, position As PointF, size As SizeF, color As Color)
  38.         Native.Function.Call(Hash.DRAW_SCALEFORM_MOVIE, scaleform.Handle, position.X, position.Y, size.Width, size.Height, CInt(color.R), CInt(color.G), CInt(color.B), CInt(color.A), 0)
  39.     End Sub
  40.  
  41.     Public Enum MissionCompleteScaleformMedal
  42.         Gold = 1
  43.         Silver
  44.         Bronze
  45.         Skull
  46.         Unk
  47.     End Enum
  48. End Module
  49.  
  50. Public Class ObjectiveItem
  51.  
  52.     Public Property Type As ObjectiveItemType
  53.     Public Property Title As String
  54.     Public Property RightLabel As Object
  55.     Public CheckboxChecked As Integer
  56.  
  57.     Public Enum ObjectiveItemType
  58.         Time
  59.         Number
  60.         Task
  61.         Percentage
  62.         MoneyMonetized
  63.         MoneyDemonetized
  64.         RP
  65.         Objective
  66.     End Enum
  67.  
  68.     Public Sub New(_type As ObjectiveItemType, _title As String, _rightLabel As Object, _checked As Boolean)
  69.         Type = _type
  70.         Title = _title
  71.         RightLabel = _rightLabel
  72.         CheckboxChecked = If(_checked, 1, 0)
  73.     End Sub
  74.  
  75. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement