Example #1
0
        public static async void LoadingPrompt(string text, int time = 10000, LoadingSpinnerType type = LoadingSpinnerType.RegularClockwise)
        {
            Screen.LoadingPrompt.Show(text, type);
            await Delay(time);

            Screen.LoadingPrompt.Hide();
        }
        /// <summary>
        /// Creates a loading prompt at the bottom right of the screen with the given text and spinner type
        /// </summary>
        /// <param name="loadingText">The text to display next to the spinner</param>
        /// <param name="spinnerType">The style of spinner to draw</param>
        /// <remarks>
        /// <see cref="LoadingSpinnerType.Clockwise1"/>, <see cref="LoadingSpinnerType.Clockwise2"/>, <see cref="LoadingSpinnerType.Clockwise3"/> and <see cref="LoadingSpinnerType.RegularClockwise"/> all see to be the same.
        /// But Rockstar apparently always uses <see cref="LoadingSpinnerType.RegularClockwise"/> in their scripts.
        /// </remarks>
        public static void Show(string loadingText = null, LoadingSpinnerType spinnerType = LoadingSpinnerType.RegularClockwise)
        {
            Hide();

            if (loadingText == null)
            {
                Function.Call(Hash.BEGIN_TEXT_COMMAND_BUSYSPINNER_ON, SHVDN.NativeMemory.NullString);
            }
            else
            {
                Function.Call(Hash.BEGIN_TEXT_COMMAND_BUSYSPINNER_ON, SHVDN.NativeMemory.String);
                Function.Call(Hash.ADD_TEXT_COMPONENT_SUBSTRING_PLAYER_NAME, loadingText);
            }

            Function.Call(Hash.END_TEXT_COMMAND_BUSYSPINNER_ON, spinnerType);
        }
Example #3
0
        /// <summary>
        /// Creates a loading prompt at the bottom right of the screen with the given text and spinner type
        /// </summary>
        /// <param name="loadingText">The text to display next to the spinner</param>
        /// <param name="spinnerType">The style of spinner to draw</param>
        /// <remarks>
        /// <see cref="LoadingSpinnerType.Clockwise1"/>, <see cref="LoadingSpinnerType.Clockwise2"/>, <see cref="LoadingSpinnerType.Clockwise3"/> and <see cref="LoadingSpinnerType.RegularClockwise"/> all see to be the same.
        /// But Rockstar always seem to use the <see cref="LoadingSpinnerType.RegularClockwise"/> in the scripts
        /// </remarks>
        public static void Show(string loadingText = null, LoadingSpinnerType spinnerType = LoadingSpinnerType.RegularClockwise)
        {
            Hide();

            if (loadingText == null)
            {
                Function.Call(Hash._SET_LOADING_PROMPT_TEXT_ENTRY, MemoryAccess.NullString);
            }
            else
            {
                Function.Call(Hash._SET_LOADING_PROMPT_TEXT_ENTRY, MemoryAccess.StringPtr);
                Function.Call(Hash.ADD_TEXT_COMPONENT_SUBSTRING_PLAYER_NAME, loadingText);
            }

            Function.Call(Hash._SHOW_LOADING_PROMPT, spinnerType);
        }
Example #4
0
 public static void Show(string loadingText = null, LoadingSpinnerType spinnerType = LoadingSpinnerType.RegularClockwise)
 {
     if (LoadingPrompt.IsActive)
     {
         LoadingPrompt.Hide();
     }
     if (loadingText == null)
     {
         Function.Call(Hash._SET_LOADING_PROMPT_TEXT_ENTRY, (InputArgument)MemoryAccess.NullString);
     }
     else
     {
         Function.Call(Hash._SET_LOADING_PROMPT_TEXT_ENTRY, (InputArgument)MemoryAccess.StringPtr);
         Function.Call(Hash.ADD_TEXT_COMPONENT_SUBSTRING_PLAYER_NAME, (InputArgument)loadingText);
     }
     Function.Call(Hash._SHOW_LOADING_PROMPT, (InputArgument)(Enum)spinnerType);
 }
Example #5
0
            /// <summary>
            /// Creates a loading prompt at the bottom right of the screen with the given text and spinner type
            /// </summary>
            /// <param name="loadingText">The text to display next to the spinner</param>
            /// <param name="spinnerType">The style of spinner to draw</param>
            /// <remarks>
            /// <see cref="LoadingSpinnerType.Clockwise1"/>, <see cref="LoadingSpinnerType.Clockwise2"/>, <see cref="LoadingSpinnerType.Clockwise3"/> and <see cref="LoadingSpinnerType.RegularClockwise"/> all see to be the same.
            /// But Rockstar always seem to use the <see cref="LoadingSpinnerType.RegularClockwise"/> in the scripts
            /// </remarks>
            public static void Show(string loadingText = null, LoadingSpinnerType spinnerType = LoadingSpinnerType.RegularClockwise)
            {
                if (IsActive)
                {
                    Hide();
                }

                if (loadingText == null)
                {
                    API.BeginTextCommandBusyString(null);
                }
                else
                {
                    API.BeginTextCommandBusyString("STRING");
                    API.AddTextComponentSubstringPlayerName(loadingText);
                }
                API.EndTextCommandBusyString((int)spinnerType);
            }
Example #6
0
 /// <summary>
 /// Creates a loading prompt at the bottom right of the screen with the given text and spinner type
 /// </summary>
 /// <param name="loadingText">The text to display next to the spinner</param>
 /// <param name="spinnerType">The style of spinner to draw</param>
 /// <remarks>
 /// <see cref="LoadingSpinnerType.Clockwise1"/>, <see cref="LoadingSpinnerType.Clockwise2"/>, <see cref="LoadingSpinnerType.Clockwise3"/> and <see cref="LoadingSpinnerType.RegularClockwise"/> all see to be the same.
 /// But Rockstar always seem to use the <see cref="LoadingSpinnerType.RegularClockwise"/> in the scripts
 /// </remarks>
 public static void Show(string loadingText = null, LoadingSpinnerType spinnerType = LoadingSpinnerType.RegularClockwise)
 {
     if (IsActive)
     {
         Hide();
     }
     if (loadingText == null)
     {
         Function.Call((Hash)0xABA17D7CE615ADBF, MemoryAccess.NullString);
     }
     else
     {
         Function.Call((Hash)0xABA17D7CE615ADBF, MemoryAccess.StringPtr);
         //TO DO update this to Hash._SET_LOADING_PROMPT_TEXT_ENTRY when Hash enum next gets rebuilt
         Function.Call(Hash.ADD_TEXT_COMPONENT_SUBSTRING_PLAYER_NAME, loadingText);
     }
     Function.Call((Hash)0xBD12F8228410D9B4, spinnerType);                 //TO DO update to Hash._SHOW_LOADING_PROMPT
 }
Example #7
0
 public static void Show(string loadingText = null, LoadingSpinnerType spinnerType = 5)
 {
     if (IsActive)
     {
         Hide();
     }
     if (loadingText == null)
     {
         InputArgument[] argumentArray1 = new InputArgument[] { MemoryAccess.NullString };
         Function.Call(Hash._SET_LOADING_PROMPT_TEXT_ENTRY, argumentArray1);
     }
     else
     {
         InputArgument[] argumentArray2 = new InputArgument[] { MemoryAccess.StringPtr };
         Function.Call(Hash._SET_LOADING_PROMPT_TEXT_ENTRY, argumentArray2);
         InputArgument[] argumentArray3 = new InputArgument[] { loadingText };
         Function.Call(Hash.ADD_TEXT_COMPONENT_SUBSTRING_PLAYER_NAME, argumentArray3);
     }
     InputArgument[] arguments = new InputArgument[] { spinnerType };
     Function.Call(Hash._SHOW_LOADING_PROMPT, arguments);
 }