private IEnumerator Clean()
        {
            control.text = UITools.StripRPGMakerCodes(control.text);
            yield return(null);

            control.text = UITools.StripRPGMakerCodes(control.text);
        }
Ejemplo n.º 2
0
        private IEnumerator Clean()
        {
            text.text = UITools.StripRPGMakerCodes(text.text);
            yield return(null);

            text.text = UITools.StripRPGMakerCodes(text.text);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Stops the effect.
 /// </summary>
 public override void Stop()
 {
     if (isPlaying)
     {
         onEnd.Invoke();
     }
     Sequencer.Message(SequencerMessages.Typed);
     StopTypewriterCoroutine();
     if (control != null)
     {
         control.text = UITools.StripRPGMakerCodes(frontSkippedText + original);
     }
     original = null;
     if (autoScrollSettings.autoScrollEnabled)
     {
         if (current != null && autoScrollSettings.sizerText != null)
         {
             current = new StringBuilder(control.text);
             if (enabled && gameObject.activeInHierarchy)
             {
                 StartCoroutine(HandleAutoScrollAfterOneFrame()); // Need to give Unity UI one frame to update.
             }
         }
         HandleAutoScroll();
     }
 }
 /// <summary>
 /// Sets a label with formatted text.
 /// </summary>
 /// <param name='label'>
 /// Label to set.
 /// </param>
 /// <param name='formattedText'>
 /// Formatted text.
 /// </param>
 private void SetFormattedText(UnityEngine.UI.Text label, FormattedText formattedText)
 {
     if (label != null)
     {
         if (formattedText != null)
         {
             var text = UITools.GetUIFormattedText(formattedText);
             if (ignorePauseCodes)
             {
                 text = UITools.StripRPGMakerCodes(text);
             }
             label.text = text;
             UITools.SendTextChangeMessage(label);
             if (!m_haveSavedOriginalColor)
             {
                 m_originalColor          = label.color;
                 m_haveSavedOriginalColor = true;
             }
             label.color = (formattedText.emphases.Length > 0) ? formattedText.emphases[0].color : m_originalColor;
         }
         else
         {
             label.text = string.Empty;
         }
     }
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Sets the content of the panel. Assumes the panel is already open.
        /// </summary>
        public virtual void SetContent(Subtitle subtitle)
        {
            if (subtitle == null)
            {
                return;
            }
            currentSubtitle = subtitle;
            CheckSubtitleAnimator(subtitle);
            if (!onlyShowNPCPortraits || subtitle.speakerInfo.isNPC)
            {
                if (portraitImage != null)
                {
                    var sprite = subtitle.GetSpeakerPortrait();
                    portraitImage.sprite = sprite;
                    Tools.SetGameObjectActive(portraitImage, sprite != null);
                }
                portraitActorName = subtitle.speakerInfo.nameInDatabase;
                portraitName.text = subtitle.speakerInfo.Name;
                UITools.SendTextChangeMessage(portraitName);
            }
            TypewriterUtility.StopTyping(subtitleText);
            var previousText  = accumulateText ? m_accumulatedText : string.Empty;
            var previousChars = accumulateText ? UITools.StripRPGMakerCodes(Tools.StripTextMeshProTags(Tools.StripRichTextCodes(previousText))).Length : 0;

            SetFormattedText(subtitleText, previousText, subtitle.formattedText);
            if (accumulateText)
            {
                m_accumulatedText = subtitleText.text + "\n";
            }
            if (delayTypewriterUntilOpen && !hasFocus)
            {
                StartCoroutine(StartTypingWhenFocused(subtitleText, subtitleText.text, previousChars));
            }
            else
            {
                TypewriterUtility.StartTyping(subtitleText, subtitleText.text, previousChars);
            }
            frameLastSetContent = Time.frameCount;
        }
Ejemplo n.º 6
0
 public static string StripRPGMakerCodes(string s) // Moved to UITools, but kept for compatibility with third party code.
 {
     return(UITools.StripRPGMakerCodes(s));
 }