Skip to content

File LoadingScreen.cs

File List > LemonUI > LemonUI > Scaleform > LoadingScreen.cs

Go to the documentation of this file


using System;

namespace LemonUI.Scaleform
{
    public class LoadingScreen : BaseScaleform
    {
        private string title;
        private string subtitle;
        private string description;

        #region Properties

        public string Title
        {
            get => title;
            set => title = value ?? throw new ArgumentNullException(nameof(value));
        }
        public string Subtitle
        {
            get => subtitle;
            set => subtitle = value ?? throw new ArgumentNullException(nameof(value));
        }
        public string Description
        {
            get => description;
            set => description = value ?? throw new ArgumentNullException(nameof(value));
        }
        public string Dictionary { get; private set; }
        public string Texture { get; private set; }

        #endregion

        #region Constructors

        public LoadingScreen(string title, string subtitle, string description) : this(title, subtitle, description, string.Empty, string.Empty)
        {
        }
        public LoadingScreen(string title, string subtitle, string description, string dictionary, string texture) : base("GTAV_ONLINE")
        {
            // Tell the Scaleform to use the online loading screen
            CallFunction("HIDE_ONLINE_LOGO");
            CallFunction("SETUP_BIGFEED", false);
            // Save the values
            Title = title;
            Subtitle = subtitle;
            Description = description;
            Dictionary = dictionary;
            Texture = texture;
            // And send them back to the scaleform
            Update();
        }

        #endregion

        #region Functions

        public void ChangeTexture(string dictionary, string texture)
        {
            Dictionary = dictionary;
            Texture = texture;
            Update();
        }
        public override void Update()
        {
            CallFunction("SET_BIGFEED_INFO", "footerStr", Description, 0, Dictionary, Texture, Subtitle, "urlDeprecated", Title);
        }

        #endregion
    }
}