get rid of useless button implementation
This commit is contained in:
parent
1bc518824c
commit
6f7af39a8e
4 changed files with 14 additions and 39 deletions
|
|
@ -697,12 +697,6 @@ namespace TD.UI
|
|||
i++;
|
||||
}
|
||||
}
|
||||
else if (selection is TowerInstance tower)
|
||||
{
|
||||
// WC3 layout convention: primary action top-left (Q), sell bottom-right (B).
|
||||
cells[0] = CreateUpgradeButton(tower, HotkeyLayout[0]);
|
||||
cells[GRID_MAX - 1] = CreateSellButton(tower, HotkeyLayout[GRID_MAX - 1]);
|
||||
}
|
||||
else if (selection is BuildSiteVisual bsv)
|
||||
{
|
||||
// Cancel is the only action available on an in-progress build.
|
||||
|
|
@ -795,31 +789,7 @@ namespace TD.UI
|
|||
return btn;
|
||||
}
|
||||
|
||||
// Upgrade and Sell — visuals + hotkeys wired; click is a no-op because the
|
||||
// upgrade/sell systems aren't built yet. Buttons are SetEnabled(false) so the
|
||||
// hotkey handler also skips them (it gates on enabledSelf).
|
||||
private VisualElement CreateUpgradeButton(TowerInstance tower, Key hotkey)
|
||||
{
|
||||
var btn = CreateActionButton(
|
||||
costText: "", // tier cost unknown until upgrade system lands
|
||||
hotkey: hotkey,
|
||||
onClick: () => { /* TODO: upgrade flow */ });
|
||||
btn.SetEnabled(false);
|
||||
return btn;
|
||||
}
|
||||
|
||||
private VisualElement CreateSellButton(TowerInstance tower, Key hotkey)
|
||||
{
|
||||
int sellValue = tower.Definition != null
|
||||
? Mathf.RoundToInt(tower.Definition.GoldCost * 0.7f)
|
||||
: 0;
|
||||
var btn = CreateActionButton(
|
||||
costText: sellValue > 0 ? $"+{sellValue}g" : "",
|
||||
hotkey: hotkey,
|
||||
onClick: () => { /* TODO: sell flow */ });
|
||||
btn.SetEnabled(false);
|
||||
return btn;
|
||||
}
|
||||
|
||||
// Cancel action for an in-progress build. Fires the owner-only RPC; the
|
||||
// server cancels the matching job (or, for shelved sites, refunds + despawns
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue