Пример #1
0
        /// <summary>
        /// Handles a received message
        /// </summary>
        /// <param name="message">The message to handle</param>
        /// <returns>If the message was handled</returns>
        protected virtual bool HandleMessage(QdmsMessage message)
        {
            if (message is SubtitleMessage)
            {
                SubtitleMessage subMessage = (SubtitleMessage)message;
                if (subMessage.Priority >= SubtitlePriority)
                {
                    SubtitlePriority  = subMessage.Priority;
                    SubtitleTimer     = subMessage.HoldTime;
                    SubtitleText.text = subMessage.UseSubstitution ? Sub.Macro(subMessage.Contents) : subMessage.Contents;
                }
                return(true);
            }
            else if (message is HUDClearMessage)
            {
                ClearHudMessages();
            }
            else if (message is HUDPushMessage)
            {
                AppendHudMessage(Sub.Macro(((HUDPushMessage)message).Contents));
                return(true);
            }

            return(false);
        }
Пример #2
0
        /// <summary>
        /// Handles a received message
        /// </summary>
        /// <param name="message">The message to handle</param>
        /// <returns>If the message was handled</returns>
        protected virtual bool HandleMessage(QdmsMessage message)
        {
            if (message is SubtitleMessage)
            {
                SubtitleMessage subMessage = (SubtitleMessage)message;
                if (subMessage.Priority >= SubtitlePriority)
                {
                    SubtitlePriority  = subMessage.Priority;
                    SubtitleTimer     = subMessage.HoldTime;
                    SubtitleText.text = subMessage.UseSubstitution ? Sub.Macro(subMessage.Contents) : subMessage.Contents;
                }
                return(true);
            }

            return(false);
        }