示例#1
0
 public void Clear()
 {
     fading = false;
     characterDisplayed = false;
     currentMessage = null;
     messages.Clear ();
 }
    public void DispatchMesssage(FSMTransitionType msg, BaseFSM receiverId, bool condition)
    {
        CharacterMessage message = new CharacterMessage(msg, receiverId, condition);

        if (message.condition)
        {
            message.Receiver.PerformTransition(message.Msg);
        }
    }
示例#3
0
 public void Add(string text, string title, string subtitle, string imageUrl, CharacterMessage charMsg, ScreenMessage screenMsg)
 {
     Add(new NotificationState
     {
         ObjectId  = NewId,
         Text      = text,
         Title     = title,
         Subtitle  = subtitle,
         ImageUrl  = imageUrl,
         Date      = DateTime.Now,
         CharMsg   = charMsg,
         ScreenMsg = screenMsg
     });
 }
示例#4
0
        public void Update(GameTime gameTime)
        {
            if (characterDisplayed && this.currentMessage.Timed && !fading)
            {
                this.currentMessage.displayedTime += (float)gameTime.ElapsedGameTime.TotalSeconds;
                if (currentMessage.displayedTime >= currentMessage.Limit)
                    StartFade ();
            }

            if (!characterDisplayed && messages.Count > 0)
            {
                currentMessage = messages.Dequeue ();
                characterDisplayed = true;

                InvalidateCharacterLocation ();
            }

            if (fading)
            {
                fadePassed += (float)gameTime.ElapsedGameTime.TotalSeconds;

                if (fadePassed >= fadeTotal)
                {
                    characterDisplayed = false;
                    fading = false;
                }
            }

            HandleInput ();
        }
示例#5
0
        public void ShowTimed(string name, string text, float time)
        {
            CharacterMessage message = new CharacterMessage
            {
                Message = text,
                Timed = true,
                Limit = time,
                Name = name,
            };

            this.characterDisplayed = true;
            currentMessage = message;
            messages.Clear ();

            InvalidateCharacterLocation ();
        }
示例#6
0
        public void EnqueueTimed(string name, string text, float time)
        {
            CharacterMessage message = new CharacterMessage
            {
                Message = text,
                Timed = true,
                Limit = time,
                Name = name
            };

            messages.Enqueue (message);
        }
示例#7
0
 public void EnqueueMessageBox(string name, string text, Action messageClosed = null)
 {
     CharacterMessage message = new CharacterMessage
     {
         Message = text,
         Action = messageClosed,
         Name = name
     };
     messages.Enqueue (message);
 }
 protected virtual void PushCharacterMessagePanel(ResourceActivationContext context, PlayableContent playable, CharacterMessage charMsg, ResourcePanelData <CharacterMessage> data, Action onClose)
 {
     Push(context, PanelStack, GetCharacterMessagePanel(context, playable), data, onClose);
 }