Exemplo n.º 1
0
            public override IEnumerator Update(TalkComponent component, MessageBox messageBox)
            {
                messageBox.Index = Index;
                messageBox.Name  = CharacterImage.Name;
                var animation = new Animation();

                animation.Move(new asd.Vector2DF(Index < 2 ? -500 - CharacterImage.Texture.Size.X : ScalingLayer2D.OriginDisplaySize.X + 500, 280),
                               new asd.Vector2DF(GetXByIndex(), 280), 30, Animation.Easing.OutSine);
                CharacterImage.Animation.AddAnimation(CharacterImage, animation);
                while (CharacterImage.Animation.IsAnimating)
                {
                    yield return(0);
                }
                component.Index[Index] = CharacterImage;
                yield return(0);
            }
Exemplo n.º 2
0
 public override IEnumerator Update(TalkComponent component, MessageBox messageBox)
 {
     if (component.Index.ContainsValue(CharacterImage))
     {
         int index          = component.Index.First(obj => obj.Value == CharacterImage).Key;
         var targetPosition = new asd.Vector2DF(index < 2 ? -500 - CharacterImage.Texture.Size.X : ScalingLayer2D.OriginDisplaySize.X + 500, 280);
         var animation      = new Animation();
         animation.MoveTo(targetPosition, 30, Animation.Easing.OutSine);
         CharacterImage.Animation.AddAnimation(CharacterImage, animation);
         while (CharacterImage.Animation.IsAnimating)
         {
             yield return(0);
         }
         component.Index.Remove(index);
     }
     yield return(0);
 }
Exemplo n.º 3
0
        public static TalkComponent LoadTalkComponent(TalkComponentIO talkComponentIO, List <CharacterImage> characterImages)
        {
            var component = new TalkComponent(characterImages);

            foreach (TalkComponentIO.BaseTalkElementIO item in talkComponentIO.TalkElements)
            {
                if (item is TalkComponentIO.ShowCharacterElementIO)
                {
                    component.TalkElements.Add(
                        new ShowCharacterElement()
                    {
                        Index          = ((TalkComponentIO.ShowCharacterElementIO)item).Index,
                        CharacterImage = component.CharacterImages.First(obj => obj.Name == item.CharacterName),
                    });
                }
                if (item is TalkComponentIO.TalkElementIO)
                {
                    component.TalkElements.Add(
                        new TalkElement()
                    {
                        Text           = ((TalkComponentIO.TalkElementIO)item).Text,
                        CharacterImage = component.CharacterImages.First(obj => obj.Name == item.CharacterName),
                    });
                }
                if (item is TalkComponentIO.ChangeDiffElementIO)
                {
                    component.TalkElements.Add(
                        new ChangeDiffElement()
                    {
                        DiffImage      = ((TalkComponentIO.ChangeDiffElementIO)item).DiffImage,
                        CharacterImage = component.CharacterImages.First(obj => obj.Name == item.CharacterName),
                    });
                }
                if (item is TalkComponentIO.HideCharacterElementIO)
                {
                    component.TalkElements.Add(
                        new HideCharacterElement()
                    {
                        CharacterImage = component.CharacterImages.First(obj => obj.Name == item.CharacterName),
                    });
                }
            }
            return(component);
        }
Exemplo n.º 4
0
            public override IEnumerator Update(TalkComponent component, MessageBox messageBox)
            {
                messageBox.SetMessage(Text);
                if (component.Index.Any(obj => obj.Value == CharacterImage))
                {
                    messageBox.Name  = CharacterImage.Name;
                    messageBox.Index = component.Index.First(obj => obj.Value == CharacterImage).Key;
                }
                else
                {
                    messageBox.Name  = new string('?', CharacterImage.Name.Length);
                    messageBox.Index = 3;
                }
                var iterator = messageBox.ShowText();

                while (iterator.MoveNext())
                {
                    if (messageBox.NameOutput.Color.A < 255)
                    {
                        var temp = messageBox.NameOutput.Color;
                        int v    = temp.A > 235 ? 255 : temp.A + 20;
                        temp.A = (byte)v;
                        messageBox.NameOutput.Color = temp;
                    }
                    yield return(0);
                }
                while (Input.GetInputState(Inputs.A) != 1)
                {
                    if (messageBox.NameOutput.Color.A < 255)
                    {
                        var temp = messageBox.NameOutput.Color;
                        int v    = temp.A > 235 ? 255 : temp.A + 20;
                        temp.A = (byte)v;
                        messageBox.NameOutput.Color = temp;
                    }
                    yield return(0);
                }
                yield return(0);
            }
Exemplo n.º 5
0
 public override IEnumerator Update(TalkComponent component, MessageBox messageBox)
 {
     CharacterImage.SelectedDiff = DiffImage;
     yield return(0);
 }
Exemplo n.º 6
0
 public virtual IEnumerator Update(TalkComponent component, MessageBox messageBox)
 {
     yield return(0);
 }