Class TooltipData
Definition
Namespace: StardewUI.Data
Assembly: StardewUI.dll
Provides data for all known variants of a menu tooltip.
Inheritance
Object ⇦ TooltipData
Implements
IEquatable<TooltipData>
Members
Constructors
Name | Description |
---|---|
TooltipData(string, string, Item, Int32?, Int32, string, Int32, CraftingRecipe, IList<Item>) | Provides data for all known variants of a menu tooltip. |
Properties
Name | Description |
---|---|
AdditionalCraftingMaterials | List of additional items required for crafting that are not included in the CraftingRecipe. |
CraftingRecipe | Crafting recipe to show, if the tooltip is for a craftable item. |
CurrencyAmount | Amount of money associated with the tooltip action, generally a buy or sell price. |
CurrencySymbol | The currency associated with any CurrencyAmount; has no effect unless CurrencyAmount is also specified. |
The meaning of each value is dependent on game implementation, but at the time of writing the available options are: 0
= coins, 1
= star tokens (silver star), 2
= casino tokens, and 4
= Qi gems.
| | EqualityContract | | | Item | The specific game item, if any, that is the "topic" of this tooltip, used to show additional item-specific information such as buffs, durations and recovery values. | | RequiredItemAmount | The number of items required, e.g. for trade, when RequiredItemId is specified. | | RequiredItemId | Item ID to show as a required item, usually used as an alternative to CurrencySymbol for non-currency trades, such as the Desert Trader. | | Text | The primary description text to display. Tooltips converted from a simple string will have this field populated. | | Title | Bolded title to display above the Text, with a separator in between. |
Methods
Name | Description |
---|---|
ConstrainTextWidth(Int32) | Constraints the tooltip to a specified pixel width by breaking lines for the Text and Title. |
Details
Constructors
TooltipData(string, string, Item, int?, int, string, int, CraftingRecipe, IList<Item>)
Provides data for all known variants of a menu tooltip.
public TooltipData(string Text, string Title, StardewValley.Item Item, int? CurrencyAmount, int CurrencySymbol, string RequiredItemId, int RequiredItemAmount, StardewValley.CraftingRecipe CraftingRecipe, System.Collections.Generic.IList<StardewValley.Item> AdditionalCraftingMaterials);
Parameters
Text
string
The primary description text to display. Tooltips converted from a simple string will have this field populated.
Title
string
Bolded title to display above the Text, with a separator in between.
Item
Item
The specific game item, if any, that is the "topic" of this tooltip, used to show additional item-specific information such as buffs, durations and recovery values.
CurrencyAmount
Nullable<Int32>
Amount of money associated with the tooltip action, generally a buy or sell price.
CurrencySymbol
Int32
The currency associated with any CurrencyAmount; has no effect unless CurrencyAmount is also specified.
The meaning of each value is dependent on game implementation, but at the time of writing the available options are: 0
= coins, 1
= star tokens (silver star), 2
= casino tokens, and 4
= Qi gems.
RequiredItemId
string
Item ID to show as a required item, usually used as an alternative to CurrencySymbol for non-currency trades, such as the Desert Trader.
RequiredItemAmount
Int32
The number of items required, e.g. for trade, when RequiredItemId is specified.
CraftingRecipe
CraftingRecipe
Crafting recipe to show, if the tooltip is for a craftable item.
AdditionalCraftingMaterials
IList
List of additional items required for crafting that are not included in the CraftingRecipe.
Properties
AdditionalCraftingMaterials
List of additional items required for crafting that are not included in the CraftingRecipe.
public System.Collections.Generic.IList<StardewValley.Item> AdditionalCraftingMaterials { get; set; }
Property Value
CraftingRecipe
Crafting recipe to show, if the tooltip is for a craftable item.
Property Value
CraftingRecipe
CurrencyAmount
Amount of money associated with the tooltip action, generally a buy or sell price.
Property Value
CurrencySymbol
The currency associated with any CurrencyAmount; has no effect unless CurrencyAmount is also specified.
The meaning of each value is dependent on game implementation, but at the time of writing the available options are: 0
= coins, 1
= star tokens (silver star), 2
= casino tokens, and 4
= Qi gems.
Property Value
EqualityContract
Property Value
Item
The specific game item, if any, that is the "topic" of this tooltip, used to show additional item-specific information such as buffs, durations and recovery values.
Property Value
Item
RequiredItemAmount
The number of items required, e.g. for trade, when RequiredItemId is specified.
Property Value
RequiredItemId
Item ID to show as a required item, usually used as an alternative to CurrencySymbol for non-currency trades, such as the Desert Trader.
Property Value
Text
The primary description text to display. Tooltips converted from a simple string will have this field populated.
Property Value
Title
Bolded title to display above the Text, with a separator in between.
Property Value
Methods
ConstrainTextWidth(int)
Constraints the tooltip to a specified pixel width by breaking lines for the Text and Title.
Parameters
maxWidth
Int32
The desired maximum pixel width for the displayed tooltip.
Returns
A TooltipData instance with any necessary line breaks added to its text properties in order to keep the displayed width equal to or less than maxWidth
.