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
|
||||
|
|
|
|||
|
|
@ -12,11 +12,12 @@
|
|||
"com.unity.netcode.gameobjects": "2.11.0",
|
||||
"com.unity.probuilder": "6.0.9",
|
||||
"com.unity.render-pipelines.universal": "17.4.0",
|
||||
"com.unity.sdk.linux-x86_64": "1.0.2",
|
||||
"com.unity.sdk.linux-x86_64": "1.1.0",
|
||||
"com.unity.services.multiplayer": "2.1.3",
|
||||
"com.unity.terrain-tools": "5.3.2",
|
||||
"com.unity.test-framework": "1.6.0",
|
||||
"com.unity.timeline": "1.8.12",
|
||||
"com.unity.toolchain.linux-x86_64-linux": "1.1.0",
|
||||
"com.unity.toolchain.win-x86_64-linux": "1.0.2",
|
||||
"com.unity.ugui": "2.0.0",
|
||||
"com.unity.visualscripting": "1.9.11",
|
||||
|
|
|
|||
|
|
@ -221,11 +221,11 @@
|
|||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.sdk.linux-x86_64": {
|
||||
"version": "1.0.2",
|
||||
"version": "1.1.0",
|
||||
"depth": 0,
|
||||
"source": "registry",
|
||||
"dependencies": {
|
||||
"com.unity.sysroot.base": "1.0.2"
|
||||
"com.unity.sysroot.base": "1.1.0"
|
||||
},
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
|
|
@ -355,7 +355,7 @@
|
|||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.sysroot.base": {
|
||||
"version": "1.0.2",
|
||||
"version": "1.1.0",
|
||||
"depth": 1,
|
||||
"source": "registry",
|
||||
"dependencies": {},
|
||||
|
|
@ -403,6 +403,15 @@
|
|||
},
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.toolchain.linux-x86_64-linux": {
|
||||
"version": "1.1.0",
|
||||
"depth": 0,
|
||||
"source": "registry",
|
||||
"dependencies": {
|
||||
"com.unity.sysroot.base": "1.1.0"
|
||||
},
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.toolchain.win-x86_64-linux": {
|
||||
"version": "1.0.2",
|
||||
"depth": 0,
|
||||
|
|
|
|||
|
|
@ -71,11 +71,6 @@
|
|||
"key": "editor.showSceneInfo",
|
||||
"value": "{\"m_Value\":false}"
|
||||
},
|
||||
{
|
||||
"type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
|
||||
"key": "editor.stripProBuilderScriptsOnBuild",
|
||||
"value": "{\"m_Value\":true}"
|
||||
},
|
||||
{
|
||||
"type": "UnityEngine.Material, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null",
|
||||
"key": "mesh.userMaterial",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue