SetText() public méthode

public SetText ( string text ) : void
text string
Résultat void
        private void descriptionText_OnUpdate(UIElement affectedElement)
        {
            UIText uIText = affectedElement as UIText;
            int    itemIdChecked;
            int    amountWeHave;
            int    amountNeededTotal;
            bool   sacrificeNumbers = Main.CreativeMenu.GetSacrificeNumbers(out itemIdChecked, out amountWeHave, out amountNeededTotal);

            Main.CreativeMenu.ShouldDrawSacrificeArea();
            if (!Main.mouseItem.IsAir)
            {
                ForgetItemSacrifice();
            }
            if (itemIdChecked == 0)
            {
                if (_lastItemIdSacrificed != 0 && _lastItemAmountWeNeededTotal != _lastItemAmountWeHad)
                {
                    uIText.SetText($"({_lastItemAmountWeHad}/{_lastItemAmountWeNeededTotal})");
                }
                else
                {
                    uIText.SetText("???");
                }
                return;
            }
            ForgetItemSacrifice();
            if (!sacrificeNumbers)
            {
                uIText.SetText("X");
            }
            else
            {
                uIText.SetText($"({amountWeHave}/{amountNeededTotal})");
            }
        }
Exemple #2
0
 private void DeleteMouseOver(UIMouseEvent evt, UIElement listeningElement)
 {
     if (_data.IsFavorite)
     {
         _deleteButtonLabel.SetText(Language.GetTextValue("UI.CannotDeleteFavorited"));
     }
     else
     {
         _deleteButtonLabel.SetText(Language.GetTextValue("UI.Delete"));
     }
 }
Exemple #3
0
 private void FavoriteMouseOver(UIMouseEvent evt, UIElement listeningElement)
 {
     if (_data.IsFavorite)
     {
         _buttonLabel.SetText("Unfavorite");
     }
     else
     {
         _buttonLabel.SetText("Favorite");
     }
 }
Exemple #4
0
 private void FavoriteMouseOver(UIMouseEvent evt, UIElement listeningElement)
 {
     if (_data.IsFavorite)
     {
         _buttonLabel.SetText(Language.GetTextValue("UI.Unfavorite"));
     }
     else
     {
         _buttonLabel.SetText(Language.GetTextValue("UI.Favorite"));
     }
 }
Exemple #5
0
 public void SetContents(string name)
 {
     actualContents = name;
     if (string.IsNullOrEmpty(actualContents))
     {
         _text.TextColor = Color.Gray;
         _text.SetText(_textToShowWhenEmpty);
     }
     else
     {
         _text.TextColor = Color.White;
         _text.SetText(actualContents);
     }
     _text.Left = StyleDimension.FromPixels(_title.GetInnerDimensions().Width + DistanceFromTitleToOption);
 }
        private void descriptionText_OnUpdate(UIElement affectedElement)
        {
            UIText uiText = affectedElement as UIText;
            int    itemIdChecked;
            int    amountWeHave;
            int    amountNeededTotal;
            bool   sacrificeNumbers = Main.CreativeMenu.GetSacrificeNumbers(out itemIdChecked, out amountWeHave, out amountNeededTotal);

            Main.CreativeMenu.ShouldDrawSacrificeArea();
            if (!Main.mouseItem.IsAir)
            {
                this.ForgetItemSacrifice();
            }
            if (itemIdChecked == 0)
            {
                if (this._lastItemIdSacrificed != 0 && this._lastItemAmountWeNeededTotal != this._lastItemAmountWeHad)
                {
                    uiText.SetText(string.Format("({0}/{1})", (object)this._lastItemAmountWeHad, (object)this._lastItemAmountWeNeededTotal));
                }
                else
                {
                    uiText.SetText("???");
                }
            }
            else
            {
                this.ForgetItemSacrifice();
                if (!sacrificeNumbers)
                {
                    uiText.SetText("X");
                }
                else
                {
                    uiText.SetText(string.Format("({0}/{1})", (object)amountWeHave, (object)amountNeededTotal));
                }
            }
        }
Exemple #7
0
 private void DeleteMouseOver(UIMouseEvent evt, UIElement listeningElement)
 {
     _deleteButtonLabel.SetText("Delete");
 }