From 77dc787c4baa17859534639df8c823de46ae089c Mon Sep 17 00:00:00 2001 From: Hannele Ruiz Date: Sat, 16 Dec 2023 04:30:22 -0300 Subject: [PATCH] Added basics of the Bink Video class --- LemonUI/Elements/ScaledBink.cs | 67 ++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 LemonUI/Elements/ScaledBink.cs diff --git a/LemonUI/Elements/ScaledBink.cs b/LemonUI/Elements/ScaledBink.cs new file mode 100644 index 0000000..9e723f9 --- /dev/null +++ b/LemonUI/Elements/ScaledBink.cs @@ -0,0 +1,67 @@ +#if ALTV +using AltV.Net.Client; +#elif FIVEM +using CitizenFX.Core.Native; +#elif RAGEMP +using RAGE.Game; +#elif RPH +using Rage.Native; +#elif SHVDN3 || SHVDNC +using GTA.Native; +#endif +using System; +using System.Drawing; + +namespace LemonUI.Elements +{ + /// + /// A Bink Video file. + /// + public class ScaledBink : BaseElement + { + #region Fields + + private string name = string.Empty; + private int id = 0; + + #endregion + + #region Constructors + + /// + /// Creates a new Bink Video playback. + /// + /// The name of the bik file. + /// The position of the video window. + /// The size of the video window. + public ScaledBink(string name, PointF pos, SizeF size) : base(pos, size) + { + this.name = name ?? throw new ArgumentNullException(nameof(name)); + +#if ALTV + id = Alt.Natives.SetBinkMovie(name); +#elif FIVEM + id = API.SetBinkMovie(name); +#elif RAGEMP + id = Invoker.Invoke(0xfc36643f7a64338f, name); +#elif RPH + id = NativeFunction.CallByHash(0xfc36643f7a64338f, name); +#elif SHVDN3 || SHVDNC + id = Function.Call(Hash.SET_BINK_MOVIE, name); +#endif + } + + #endregion + + #region Functions + + /// + /// Draws the Bink Movie at the specified location. + /// + public override void Draw() + { + } + + #endregion + } +}