Seige tower
This commit is contained in:
parent
430e66bfbf
commit
4f57499e40
18 changed files with 898 additions and 92 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue