Skip to content

Commit

Permalink
Make the BaseScaleform.scaleform obsolete and error
Browse files Browse the repository at this point in the history
  • Loading branch information
justalemon committed Dec 4, 2021
1 parent 1342949 commit e57dd85
Showing 1 changed file with 3 additions and 23 deletions.
26 changes: 3 additions & 23 deletions LemonUI/Scaleform/BaseScaleform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ public abstract class BaseScaleform : IScaleform
/// <summary>
/// The ID of the scaleform.
/// </summary>
[Obsolete("Please use the Handle or Name properties and call the methods manually.")]
[Obsolete("Please use the Handle or Name properties and call the methods manually.", true)]
#endif
#if FIVEM
protected CitizenFX.Core.Scaleform scaleform = null;
protected CitizenFX.Core.Scaleform scaleform = new CitizenFX.Core.Scaleform("");
#elif (SHVDN2 || SHVDN3)
protected GTA.Scaleform scaleform = null;
protected GTA.Scaleform scaleform = new GTA.Scaleform("");
#endif

#endregion
Expand Down Expand Up @@ -73,33 +73,13 @@ public BaseScaleform(string sc)
{
Name = sc;

LoadScaleform();
}

#endregion

#region Protected Functions

/// <summary>
/// Load a given Scaleform
/// </summary>
protected void LoadScaleform()
{
#if FIVEM
Handle = API.RequestScaleformMovie(Name);
#elif RPH
Handle = NativeFunction.CallByHash<int>(0x11FE353CF9733E6F, Name);
#elif (SHVDN2 || SHVDN3)
Handle = Function.Call<int>(Hash.REQUEST_SCALEFORM_MOVIE, Name);
#endif

#pragma warning disable CS0618 // Type or member is obsolete
#if FIVEM
scaleform = new CitizenFX.Core.Scaleform(Name);
#elif (SHVDN2 || SHVDN3)
scaleform = new GTA.Scaleform(Name);
#endif
#pragma warning restore CS0618 // Type or member is obsolete
}

#endregion
Expand Down

0 comments on commit e57dd85

Please sign in to comment.