Ejemplo n.º 1
0
        private void FlushText()
        {
            string mTextQueue = this.mTextQueue;

            this.mTextQueue = (string)null;
            if (this.mCharacters == null || this.mCharacters.Length < mTextQueue.Length)
            {
                this.mCharacters = new EventDialogBubbleCustom.Character[mTextQueue.Length * 2];
            }
            string str      = "REPLACE_PLAYER_NAME";
            string newValue = string.Empty;

            if (Object.op_Inequality((Object)MonoSingleton <GameManager> .GetInstanceDirect(), (Object)null))
            {
                newValue = MonoSingleton <GameManager> .GetInstanceDirect().Player.Name;
            }
            string s = mTextQueue.Replace("<p_name>", str).Replace("<br>", "\n");

            EventAction_Dialog.TextSpeedTypes speed = EventAction_Dialog.TextSpeedTypes.Normal;
            int n = 0;

            EventDialogBubbleCustom.Ctx ctx = new EventDialogBubbleCustom.Ctx();
            ctx.Interval        = speed.ToFloat();
            ctx.Color           = Color32.op_Implicit(!Object.op_Inequality((Object)this.BodyText, (Object)null) ? Color.get_black() : ((Graphic)this.BodyText).get_color());
            this.mNumCharacters = 0;
            EventDialogBubbleCustom.Element[] c = EventDialogBubbleCustom.SplitTags(s);
            for (int index = 0; index < c.Length; ++index)
            {
                if (c[index] != null)
                {
                    c[index].Value = c[index].Value.Replace(str, newValue);
                }
            }
            this.Parse(c, ref n, (string)null, ctx);
            if (Object.op_Inequality((Object)this.BodyText, (Object)null))
            {
                this.BodyText.set_text(string.Empty);
            }
            this.mStartTime       = Time.get_time() + this.FadeInTime;
            this.mTextNeedsUpdate = this.mNumCharacters > 0;
            this.mFadingOut       = false;
            if (string.IsNullOrEmpty(this.VoiceSheetName) || string.IsNullOrEmpty(this.VoiceCueName))
            {
                this.FadeOutVoice();
            }
            else
            {
                this.mVoice = new MySound.Voice(this.VoiceSheetName, (string)null, (string)null);
                this.mVoice.Play(this.VoiceCueName, 0.0f);
                this.VoiceCueName = (string)null;
            }
        }
Ejemplo n.º 2
0
    public static float ToFloat(this EventAction_Dialog.TextSpeedTypes speed)
    {
        switch (speed)
        {
        case EventAction_Dialog.TextSpeedTypes.Slow:
            return(0.2f);

        case EventAction_Dialog.TextSpeedTypes.Fast:
            return(0.01f);

        default:
            return(0.05f);
        }
    }
Ejemplo n.º 3
0
        private void FlushText()
        {
            string mTextQueue = this.mTextQueue;

            this.mTextQueue = (string)null;
            if (this.mCharacters == null || this.mCharacters.Length < mTextQueue.Length)
            {
                this.mCharacters = new EventTelopBubble.Character[mTextQueue.Length * 2];
            }
            string s = mTextQueue.Replace("<br>", "\n");

            EventAction_Dialog.TextSpeedTypes speed = EventAction_Dialog.TextSpeedTypes.Normal;
            int n = 0;

            EventTelopBubble.Ctx ctx = new EventTelopBubble.Ctx();
            ctx.Interval = speed.ToFloat();
            ctx.Color    = Color32.op_Implicit(!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.BodyText, (UnityEngine.Object)null) ? Color.get_black() : ((Graphic)this.BodyText).get_color());
            if (this.TextColor)
            {
                ctx.Color = Color32.op_Implicit(Color.get_white());
            }
            if (this.TextPosition == Event2dAction_Telop.TextPositionTypes.Center)
            {
                this.BodyText.set_alignment((TextAnchor)4);
            }
            else if (this.TextPosition == Event2dAction_Telop.TextPositionTypes.Right)
            {
                this.BodyText.set_alignment((TextAnchor)5);
            }
            else
            {
                this.BodyText.set_alignment((TextAnchor)3);
            }
            this.mNumCharacters = 0;
            this.Parse(EventTelopBubble.SplitTags(s), ref n, (string)null, ctx);
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.BodyText, (UnityEngine.Object)null))
            {
                this.BodyText.set_text(string.Empty);
            }
            this.mStartTime       = Time.get_time() + this.FadeInTime;
            this.mTextNeedsUpdate = this.mNumCharacters > 0;
            this.mFadingOut       = false;
        }
Ejemplo n.º 4
0
        private void FlushText()
        {
            string mTextQueue = this.mTextQueue;

            this.mTextQueue = (string)null;
            if (this.mCharacters == null || this.mCharacters.Length < mTextQueue.Length)
            {
                this.mCharacters = new EventDialogBubble.Character[mTextQueue.Length * 2];
            }
            string s = mTextQueue.Replace("<br>", "\n");

            EventAction_Dialog.TextSpeedTypes speed = EventAction_Dialog.TextSpeedTypes.Normal;
            int n = 0;

            EventDialogBubble.Ctx ctx = new EventDialogBubble.Ctx();
            ctx.Interval        = speed.ToFloat();
            ctx.Color           = Color32.op_Implicit(!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.BodyText, (UnityEngine.Object)null) ? Color.get_black() : ((Graphic)this.BodyText).get_color());
            this.mNumCharacters = 0;
            this.Parse(EventDialogBubble.SplitTags(s), ref n, (string)null, ctx);
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.BodyText, (UnityEngine.Object)null))
            {
                this.BodyText.set_text(string.Empty);
            }
            this.mStartTime       = Time.get_time() + this.FadeInTime;
            this.mTextNeedsUpdate = this.mNumCharacters > 0;
            this.mFadingOut       = false;
            this.mCurrentEmotion  = this.Emotion;
            if (string.IsNullOrEmpty(this.VoiceSheetName) || string.IsNullOrEmpty(this.VoiceCueName))
            {
                this.FadeOutVoice();
            }
            else
            {
                this.mVoice = new MySound.Voice(this.VoiceSheetName, (string)null, (string)null, EventAction.IsUnManagedAssets(this.VoiceSheetName, false));
                this.mVoice.Play(this.VoiceCueName, 0.0f, false);
                this.VoiceCueName = (string)null;
            }
        }