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})"); } }
private void DeleteMouseOver(UIMouseEvent evt, UIElement listeningElement) { if (_data.IsFavorite) { _deleteButtonLabel.SetText(Language.GetTextValue("UI.CannotDeleteFavorited")); } else { _deleteButtonLabel.SetText(Language.GetTextValue("UI.Delete")); } }
private void FavoriteMouseOver(UIMouseEvent evt, UIElement listeningElement) { if (_data.IsFavorite) { _buttonLabel.SetText("Unfavorite"); } else { _buttonLabel.SetText("Favorite"); } }
private void FavoriteMouseOver(UIMouseEvent evt, UIElement listeningElement) { if (_data.IsFavorite) { _buttonLabel.SetText(Language.GetTextValue("UI.Unfavorite")); } else { _buttonLabel.SetText(Language.GetTextValue("UI.Favorite")); } }
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)); } } }
private void DeleteMouseOver(UIMouseEvent evt, UIElement listeningElement) { _deleteButtonLabel.SetText("Delete"); }