Beispiel #1
0
 void OnSpeak(DescriptionEvent eventdata)
 {
     if (Visual.color != GetColor(eventdata.TrueSpeaker))
     {
         gameObject.DispatchEvent(Events.Fade, new FadeEvent(GetColor(eventdata.TrueSpeaker), FadeTime));
     }
 }
    void OnScale(DescriptionEvent eventdata)
    {
        if (this == null)
        {
            return;
        }


        if (eventdata.TrueSpeaker == "")
        {
            return;
        }

        if (Scaled)
        {
            if (eventdata.TrueSpeaker != Speaker.Character && eventdata.TrueSpeaker != MCName)
            {
                Scaled = false;

                iTween.ScaleTo(gameObject, Vector3.one, TimeToScale);
            }
        }
        else
        {
            if (eventdata.TrueSpeaker == Speaker.Character)
            {
                Scaled = true;

                Vector3 newscale = transform.localScale * ScaleRatio;
                iTween.ScaleTo(gameObject, newscale, TimeToScale);
            }
        }
    }
    void OnNewLine(DescriptionEvent eventdata)
    {
        if (eventdata.Speaker == "")
        {
            return;
        }

        if (Actors.ContainsKey(eventdata.TrueSpeaker.ToLower()))
        {
            StagePosition pos = Actors[eventdata.TrueSpeaker.ToLower()];
            GetComponent <Animator>().SetBool("Skipping", IsSkipping);
            switch (pos)
            {
            case StagePosition.Left:
                GetComponent <Animator>().SetInteger("Position", 0);
                break;

            case StagePosition.Center:
                GetComponent <Animator>().SetInteger("Position", 1);
                break;

            case StagePosition.Right:
                GetComponent <Animator>().SetInteger("Position", 2);
                break;

            default:
                GetComponent <Animator>().SetInteger("Position", 0);
                break;
            }
        }
        else
        {
            GetComponent <Animator>().SetInteger("Position", 0);
        }
    }
    void UpdateHistory(DescriptionEvent eventdata)
    {
        TextParser.ExtractTextSpeed(ref eventdata.Line);

        TagRemover.KillAllCustomTags(ref eventdata.Line);

        if (eventdata.Speaker != CurrentSpeaker)
        {
            CurrentSpeaker = eventdata.Speaker;

            Color col = SpeakerColors.GetColor(eventdata.TrueSpeaker);

            string Speaker = eventdata.Speaker;

            if (col != Text.color)
            {
                var add = "<#" + ColorUtility.ToHtmlStringRGBA(col) + ">";

                Speaker = add + eventdata.Speaker + "</color>";
            }

            History += Environment.NewLine + TextParser.DynamicEdit(Speaker);
        }

        History += Environment.NewLine + TextParser.DynamicEdit(eventdata.Line);
    }
Beispiel #5
0
    void OnNewLine(DescriptionEvent eventdata)
    {
        if (eventdata.Speaker == "")
        {
            txt.font     = NoSpeakerFont;
            txt.fontSize = NoSpeakerSize;
            return;
        }

        txt.font     = GetFont(eventdata.Speaker);
        txt.fontSize = GetSize(eventdata.Speaker);
    }
    void OnNewLine(DescriptionEvent eventdata)
    {
        if (eventdata.Speaker == "")
        {
            txt.text = "";
            Box.SetActive(false);
            return;
        }

        Box.SetActive(true);


        txt.color = GetColor(eventdata.TrueSpeaker);


        txt.text = TextParser.DynamicEdit(eventdata.Speaker);
    }
    void UpdateDescription(DescriptionEvent eventdata)
    {
        gameObject.SetActive(true);
        //Space.DispatchEvent(Events.OpenUI, new UIEvent(this));
        //dynamically edit the lines so they adhere to certain parameters
        Line = TextParser.DynamicEdit(eventdata.Line);
        Line = QuirkControl.UpdateText(eventdata.Line, eventdata.TrueSpeaker);

        if (!DebugSkipping)
        {
            if (!eventdata.CanSkip && Skipping)
            {
                ToggleSkip();
            }
        }

        Active = true;
        Description.gameObject.DispatchEvent(Events.AutoType, new AutoTypeEvent(Line));
        isFinished = false;
    }