Add description in lathe recipe mouseover tooltip (#22621)
* Add description in lathe recipe mouseover tooltip * Remove old tooltip
This commit is contained in:
@@ -12,18 +12,26 @@ public sealed partial class RecipeControl : Control
|
||||
{
|
||||
public Action<string>? OnButtonPressed;
|
||||
|
||||
public string TooltipText;
|
||||
|
||||
public RecipeControl(LatheRecipePrototype recipe, string tooltip, bool canProduce, Texture? texture = null)
|
||||
{
|
||||
RobustXamlLoader.Load(this);
|
||||
|
||||
RecipeName.Text = recipe.Name;
|
||||
RecipeTexture.Texture = texture;
|
||||
Button.ToolTip = tooltip;
|
||||
Button.Disabled = !canProduce;
|
||||
TooltipText = tooltip;
|
||||
Button.TooltipSupplier = SupplyTooltip;
|
||||
|
||||
Button.OnPressed += (_) =>
|
||||
{
|
||||
OnButtonPressed?.Invoke(recipe.ID);
|
||||
};
|
||||
}
|
||||
|
||||
private Control? SupplyTooltip(Control sender)
|
||||
{
|
||||
return new RecipeTooltip(TooltipText);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user