예제 #1
0
    private void ProcessText()
    {
        base.ChangedAuto();
        this.mLastText = this.mText;
        this.markups.Clear();
        string mProcessedText = this.mProcessedText;

        this.mProcessedText = this.mText;
        if (this.mPassword)
        {
            this.mProcessedText = this.mFont.WrapText(this.markups, this.mProcessedText, 100000f, 1, false, UIFont.SymbolStyle.None);
            string str2 = string.Empty;
            if (this.mShowLastChar)
            {
                int num    = 1;
                int length = this.mProcessedText.Length;
                while (num < length)
                {
                    str2 = str2 + "*";
                    num++;
                }
                if (this.mProcessedText.Length > 0)
                {
                    str2 = str2 + this.mProcessedText[this.mProcessedText.Length - 1];
                }
            }
            else
            {
                int num3 = 0;
                int num4 = this.mProcessedText.Length;
                while (num3 < num4)
                {
                    str2 = str2 + "*";
                    num3++;
                }
            }
            this.mProcessedText = str2;
        }
        else if (this.mMaxLineWidth > 0)
        {
            this.mProcessedText = this.mFont.WrapText(this.markups, this.mProcessedText, ((float)this.mMaxLineWidth) / base.cachedTransform.localScale.x, this.mMaxLineCount, this.mEncoding, this.mSymbols);
        }
        else if (this.mMaxLineCount > 0)
        {
            this.mProcessedText = this.mFont.WrapText(this.markups, this.mProcessedText, 100000f, this.mMaxLineCount, this.mEncoding, this.mSymbols);
        }
        this.mSize = string.IsNullOrEmpty(this.mProcessedText) ? ((Vector3)Vector2.one) : ((Vector3)this.mFont.CalculatePrintedSize(this.mProcessedText, this.mEncoding, this.mSymbols));
        float x = base.cachedTransform.localScale.x;

        this.mSize.x = Mathf.Max(this.mSize.x, ((this.mFont == null) || (x <= 1f)) ? 1f : (((float)this.lineWidth) / x));
        this.mSize.y = Mathf.Max(this.mSize.y, 1f);
        if (mProcessedText != this.mProcessedText)
        {
            this.mSelection = new UITextSelection();
        }
        this.ApplyChanges();
    }
예제 #2
0
    public UITextSelection ConvertUnprocessedSelection(int carratPos, int selectPos)
    {
        UITextSelection uITextSelection = new UITextSelection();

        uITextSelection.carratPos = this.ConvertUnprocessedPosition(carratPos);
        if (carratPos != selectPos)
        {
            uITextSelection.selectPos = this.ConvertUnprocessedPosition(selectPos);
        }
        else
        {
            uITextSelection.selectPos = uITextSelection.carratPos;
        }
        return(uITextSelection);
    }
예제 #3
0
 public UITextSelection.Change GetChangesTo(ref UITextSelection value)
 {
     UITextSelection.Change change;
     if (!this.carratPos.valid)
     {
         if (!value.carratPos.valid)
         {
             change = UITextSelection.Change.None;
         }
         else
         {
             change = (!value.hasSelection ? UITextSelection.Change.NoneToCarrat : UITextSelection.Change.NoneToSelection);
         }
     }
     else if (!value.carratPos.valid)
     {
         change = (!this.hasSelection ? UITextSelection.Change.CarratToNone : UITextSelection.Change.SelectionToNone);
     }
     else if (this.hasSelection)
     {
         if (value.hasSelection)
         {
             change = (value.carratPos.position != this.carratPos.position || value.selectPos.position != this.selectPos.position ? UITextSelection.Change.SelectionAdjusted : UITextSelection.Change.None);
         }
         else
         {
             change = UITextSelection.Change.SelectionToCarrat;
         }
     }
     else if (!value.hasSelection)
     {
         change = (value.carratPos.position == this.carratPos.position ? UITextSelection.Change.None : UITextSelection.Change.CarratMove);
     }
     else
     {
         change = UITextSelection.Change.CarratToSelection;
     }
     return(change);
 }
예제 #4
0
 public Change GetChangesTo(ref UITextSelection value)
 {
     if (this.carratPos.valid)
     {
         if (!value.carratPos.valid)
         {
             return(!this.hasSelection ? Change.CarratToNone : Change.SelectionToNone);
         }
         if (this.hasSelection)
         {
             if (!value.hasSelection)
             {
                 return(Change.SelectionToCarrat);
             }
             if ((value.carratPos.position != this.carratPos.position) || (value.selectPos.position != this.selectPos.position))
             {
                 return(Change.SelectionAdjusted);
             }
             return(Change.None);
         }
         if (value.hasSelection)
         {
             return(Change.CarratToSelection);
         }
         if (value.carratPos.position != this.carratPos.position)
         {
             return(Change.CarratMove);
         }
         return(Change.None);
     }
     if (value.carratPos.valid)
     {
         return(!value.hasSelection ? Change.NoneToCarrat : Change.NoneToSelection);
     }
     return(Change.None);
 }
예제 #5
0
 public UITextSelection ConvertUnprocessedSelection(int carratPos, int selectPos)
 {
     UITextSelection uITextSelection = new UITextSelection();
     uITextSelection.carratPos = this.ConvertUnprocessedPosition(carratPos);
     if (carratPos != selectPos)
     {
         uITextSelection.selectPos = this.ConvertUnprocessedPosition(selectPos);
     }
     else
     {
         uITextSelection.selectPos = uITextSelection.carratPos;
     }
     return uITextSelection;
 }
예제 #6
0
 private void ProcessText()
 {
     float single;
     base.ChangedAuto();
     this.mLastText = this.mText;
     this.markups.Clear();
     string str = this.mProcessedText;
     this.mProcessedText = this.mText;
     if (this.mPassword)
     {
         this.mProcessedText = this.mFont.WrapText(this.markups, this.mProcessedText, 100000f, 1, false, UIFont.SymbolStyle.None);
         string empty = string.Empty;
         if (!this.mShowLastChar)
         {
             int num = 0;
             int length = this.mProcessedText.Length;
             while (num < length)
             {
                 empty = string.Concat(empty, "*");
                 num++;
             }
         }
         else
         {
             int num1 = 1;
             int length1 = this.mProcessedText.Length;
             while (num1 < length1)
             {
                 empty = string.Concat(empty, "*");
                 num1++;
             }
             if (this.mProcessedText.Length > 0)
             {
                 empty = string.Concat(empty, this.mProcessedText[this.mProcessedText.Length - 1]);
             }
         }
         this.mProcessedText = empty;
     }
     else if (this.mMaxLineWidth > 0)
     {
         UIFont uIFont = this.mFont;
         List<UITextMarkup> uITextMarkups = this.markups;
         string str1 = this.mProcessedText;
         float single1 = (float)this.mMaxLineWidth;
         Vector3 vector3 = base.cachedTransform.localScale;
         this.mProcessedText = uIFont.WrapText(uITextMarkups, str1, single1 / vector3.x, this.mMaxLineCount, this.mEncoding, this.mSymbols);
     }
     else if (this.mMaxLineCount > 0)
     {
         this.mProcessedText = this.mFont.WrapText(this.markups, this.mProcessedText, 100000f, this.mMaxLineCount, this.mEncoding, this.mSymbols);
     }
     this.mSize = (string.IsNullOrEmpty(this.mProcessedText) ? Vector2.one : this.mFont.CalculatePrintedSize(this.mProcessedText, this.mEncoding, this.mSymbols));
     float single2 = base.cachedTransform.localScale.x;
     float single3 = this.mSize.x;
     single = (!(this.mFont != null) || single2 <= 1f ? 1f : (float)this.lineWidth / single2);
     this.mSize.x = Mathf.Max(single3, single);
     this.mSize.y = Mathf.Max(this.mSize.y, 1f);
     if (str != this.mProcessedText)
     {
         this.mSelection = new UITextSelection();
     }
     this.ApplyChanges();
 }
예제 #7
0
    private void ProcessText()
    {
        float single;

        base.ChangedAuto();
        this.mLastText = this.mText;
        this.markups.Clear();
        string str = this.mProcessedText;

        this.mProcessedText = this.mText;
        if (this.mPassword)
        {
            this.mProcessedText = this.mFont.WrapText(this.markups, this.mProcessedText, 100000f, 1, false, UIFont.SymbolStyle.None);
            string empty = string.Empty;
            if (!this.mShowLastChar)
            {
                int num    = 0;
                int length = this.mProcessedText.Length;
                while (num < length)
                {
                    empty = string.Concat(empty, "*");
                    num++;
                }
            }
            else
            {
                int num1    = 1;
                int length1 = this.mProcessedText.Length;
                while (num1 < length1)
                {
                    empty = string.Concat(empty, "*");
                    num1++;
                }
                if (this.mProcessedText.Length > 0)
                {
                    empty = string.Concat(empty, this.mProcessedText[this.mProcessedText.Length - 1]);
                }
            }
            this.mProcessedText = empty;
        }
        else if (this.mMaxLineWidth > 0)
        {
            UIFont uIFont = this.mFont;
            List <UITextMarkup> uITextMarkups = this.markups;
            string  str1    = this.mProcessedText;
            float   single1 = (float)this.mMaxLineWidth;
            Vector3 vector3 = base.cachedTransform.localScale;
            this.mProcessedText = uIFont.WrapText(uITextMarkups, str1, single1 / vector3.x, this.mMaxLineCount, this.mEncoding, this.mSymbols);
        }
        else if (this.mMaxLineCount > 0)
        {
            this.mProcessedText = this.mFont.WrapText(this.markups, this.mProcessedText, 100000f, this.mMaxLineCount, this.mEncoding, this.mSymbols);
        }
        this.mSize = (string.IsNullOrEmpty(this.mProcessedText) ? Vector2.one : this.mFont.CalculatePrintedSize(this.mProcessedText, this.mEncoding, this.mSymbols));
        float single2 = base.cachedTransform.localScale.x;
        float single3 = this.mSize.x;

        single       = (!(this.mFont != null) || single2 <= 1f ? 1f : (float)this.lineWidth / single2);
        this.mSize.x = Mathf.Max(single3, single);
        this.mSize.y = Mathf.Max(this.mSize.y, 1f);
        if (str != this.mProcessedText)
        {
            this.mSelection = new UITextSelection();
        }
        this.ApplyChanges();
    }
예제 #8
0
 public UITextSelection.Change GetChangesTo(ref UITextSelection value)
 {
     UITextSelection.Change change;
     if (!this.carratPos.valid)
     {
         if (!value.carratPos.valid)
         {
             change = UITextSelection.Change.None;
         }
         else
         {
             change = (!value.hasSelection ? UITextSelection.Change.NoneToCarrat : UITextSelection.Change.NoneToSelection);
         }
     }
     else if (!value.carratPos.valid)
     {
         change = (!this.hasSelection ? UITextSelection.Change.CarratToNone : UITextSelection.Change.SelectionToNone);
     }
     else if (this.hasSelection)
     {
         if (value.hasSelection)
         {
             change = (value.carratPos.position != this.carratPos.position || value.selectPos.position != this.selectPos.position ? UITextSelection.Change.SelectionAdjusted : UITextSelection.Change.None);
         }
         else
         {
             change = UITextSelection.Change.SelectionToCarrat;
         }
     }
     else if (!value.hasSelection)
     {
         change = (value.carratPos.position == this.carratPos.position ? UITextSelection.Change.None : UITextSelection.Change.CarratMove);
     }
     else
     {
         change = UITextSelection.Change.CarratToSelection;
     }
     return change;
 }