Skip to content

Commit

Permalink
🪙 Show item points in tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
tomrijnbeek committed Oct 2, 2023
1 parent 0f84c62 commit d4bee34
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion scenes/main/BottomHud.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,14 @@ public void SetItem(ItemLibrary.ItemType item)
var name = item.ToString();
var desc = item.Description();
var useDesc = item.CombatUse() is { } use ? $"\n{use.Description}" : "";
var scoreDesc = item.Score() switch
{
1 => "\n1 point",
0 => "",
_ => $"\n{item.Score()} points",
};

label.BbcodeText = $"{name}\n[color=silver]{desc}[/color][color=teal]{useDesc}[/color]";
label.BbcodeText = $"{name}\n[color=silver]{desc}[/color][color=teal]{useDesc}[/color][color=yellow]{scoreDesc}[/color]";
frame.RectMinSize = new Vector2(0, label.RectSize.y + 3);
Visible = true;
}
Expand Down

0 comments on commit d4bee34

Please sign in to comment.