private static void SetMaxTextComponentSubstringMessage(string msg) { int maxLength = 99; for (int i = 0; i < msg.Length; i += maxLength) { Ui.AddTextComponentSubstringPlayerName(msg.Substring(i, Math.Min(maxLength, msg.Length - i))); } }
/// <summary> /// Draws a subtitle to the bottom center of screen. /// </summary> /// <remarks> /// Subtitle("~y~This is a yellow subtitle", 3000); /// </remarks> /// <param name="subtitle"></param> /// <param name="duration"></param> /// <param name="drawImmediatley"></param> public static void ShowSubtitle(string subtitle, int duration = 5000, bool drawImmediatley = true) { Ui.BeginTextCommandPrint("STRING"); Ui.AddTextComponentSubstringPlayerName(subtitle); Ui.EndTextCommandPrint(duration, drawImmediatley); }
protected void DisplayHelpText(string text) { Ui.BeginTextCommandDisplayHelp("STRING"); Ui.AddTextComponentSubstringPlayerName(text); Ui.EndTextCommandDisplayHelp(0, false, true, -1); }