Seige tower

This commit is contained in:
Ben Calegari 2026-06-23 22:57:15 -07:00
parent 430e66bfbf
commit 4f57499e40
18 changed files with 898 additions and 92 deletions

View file

@ -858,6 +858,15 @@ namespace TD.UI
Debug.LogWarning("[HUDController] No TowerPlacementController assigned.");
});
// Show the tower's thumbnail on the icon placeholder. Falls back to the grey
// placeholder square when no Icon is assigned (see CreatePaintButton for the pattern).
if (def.Icon != null)
{
var icon = btn.Q<VisualElement>(null, "cmd-icon-placeholder");
if (icon != null)
icon.style.backgroundImage = new StyleBackground(def.Icon);
}
btn.RegisterCallback<MouseEnterEvent>(_ => ShowTooltip(def));
btn.RegisterCallback<MouseLeaveEvent>(_ => ClearTooltip());
return btn;