Пример #1
0
        public void UpdateValue(int newValue, TextUpdateType updateType)
        {
            if (this.goalValue == newValue)
            {
                return;
            }

            this.goalValue = newValue;

            if (updateType == TextUpdateType.Instant)
            {
                if (this.intValue != newValue)
                {
                    this.intValue  = newValue;
                    this.goalValue = newValue;

                    this.UpdateText();
                }
            }
            else if (updateType == TextUpdateType.Animate)
            {
                this.AnimateToGoal();
            }
            else if (updateType == TextUpdateType.None)
            {
                // do nothing
            }
            else
            {
                Debug.LogErrorFormat("IntText.UpdateValue found unknown TextUpdateType {0}", updateType.ToString());
            }
        }
Пример #2
0
 private void StatusUpdate(bool print, string text, TextUpdateType type)
 {
     if (print)
     {
         StatusUpdate(text, type);
     }
 }
Пример #3
0
        private void StatusUpdate(string text, TextUpdateType type)
        {
            Color     color     = Color.Black;
            FontStyle fontStyle = FontStyle.Regular;
            bool      append    = true;

            switch (type)
            {
            case TextUpdateType.Normal:
                break;

            case TextUpdateType.Success:
                color     = Color.Green;
                fontStyle = FontStyle.Bold;
                break;

            case TextUpdateType.Info:
                color     = Color.Brown;
                fontStyle = FontStyle.Bold;
                break;

            case TextUpdateType.Warning:
                color     = Color.Orange;
                fontStyle = FontStyle.Bold;
                break;

            case TextUpdateType.Error:
                color     = Color.Red;
                fontStyle = FontStyle.Bold;
                break;

            case TextUpdateType.Begin:
                fontStyle = FontStyle.Bold;
                append    = false;
                // Append History Override
                if (CHECKBOX_AppendHistory.Checked)
                {
                    append = true;
                    text   = Environment.NewLine + text;
                }
                break;

            default:
                break;
            }

            StatusUpdate(text, color, fontStyle, append);
        }
Пример #4
0
        private void StatusUpdate(string text, TextUpdateType type)
        {
            Color color = Color.Black;
            FontStyle fontStyle = FontStyle.Regular;
            bool append = true;

            switch (type)
            {
                case TextUpdateType.Normal:
                    break;
                case TextUpdateType.Success:
                    color = Color.Green;
                    fontStyle = FontStyle.Bold;
                    break;
                case TextUpdateType.Info:
                    color = Color.Brown;
                    fontStyle = FontStyle.Bold;
                    break;
                case TextUpdateType.Warning:
                    color = Color.Orange;
                    fontStyle = FontStyle.Bold;
                    break;
                case TextUpdateType.Error:
                    color = Color.Red;
                    fontStyle = FontStyle.Bold;
                    break;
                case TextUpdateType.Begin:
                    fontStyle = FontStyle.Bold;
                    append = false;
                    // Append History Override
                    if (CHECKBOX_AppendHistory.Checked)
                    {
                        append = true;
                        text = Environment.NewLine + text;
                    }
                    break;
                default:
                    break;
            }

            StatusUpdate(text, color, fontStyle, append);
        }
Пример #5
0
 private void StatusUpdate(bool print, string text, TextUpdateType type)
 {
     if (print)
     {
         StatusUpdate(text, type);
     }
 }