Skip to content

Class TooltipData

Definition

Namespace: StardewUI.Data
Assembly: StardewUI.dll

Provides data for all known variants of a menu tooltip.

[StardewUI.DuckType]
public record TooltipData : IEquatable<StardewUI.Data.TooltipData>

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

IList


CraftingRecipe

Crafting recipe to show, if the tooltip is for a craftable item.

public StardewValley.CraftingRecipe CraftingRecipe { get; set; }
Property Value

CraftingRecipe


CurrencyAmount

Amount of money associated with the tooltip action, generally a buy or sell price.

public int? CurrencyAmount { get; set; }
Property Value

Nullable<Int32>


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.

public int CurrencySymbol { get; set; }
Property Value

Int32


EqualityContract

protected System.Type EqualityContract { get; }
Property Value

Type


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.

public StardewValley.Item Item { get; set; }
Property Value

Item


RequiredItemAmount

The number of items required, e.g. for trade, when RequiredItemId is specified.

public int RequiredItemAmount { get; set; }
Property Value

Int32


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.

public string RequiredItemId { get; set; }
Property Value

string


Text

The primary description text to display. Tooltips converted from a simple string will have this field populated.

public string Text { get; set; }
Property Value

string


Title

Bolded title to display above the Text, with a separator in between.

public string Title { get; set; }
Property Value

string


Methods

ConstrainTextWidth(int)

Constraints the tooltip to a specified pixel width by breaking lines for the Text and Title.

public StardewUI.Data.TooltipData ConstrainTextWidth(int maxWidth);
Parameters

maxWidth   Int32
The desired maximum pixel width for the displayed tooltip.

Returns

TooltipData

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.