1
0
forked from 0ad/0ad

disable the delete button when less than 50% cp, fixes #3300, patch by bb

This was SVN commit r16877.
This commit is contained in:
mimo 2015-07-22 17:06:06 +00:00
parent eb47670cd1
commit edd03ad557
2 changed files with 9 additions and 3 deletions

Binary file not shown.

View File

@ -660,7 +660,7 @@ var unitActions =
/**
* Info and actions for the entity commands
* Currently displayed in the bottom of the central pane
* Currently displayed in the bottom of the central panel
*/
var g_EntityCommands =
{
@ -696,13 +696,13 @@ var g_EntityCommands =
if (entState.mirage)
return {
"tooltip": translate("You cannot destroy this entity because it is in the fog-of-war"),
"icon": "kill_small.png"
"icon": "kill_small_disabled.png"
};
if (entState.capturePoints && entState.capturePoints[entState.player] < entState.maxCapturePoints / 2)
return {
"tooltip": translate("You cannot destroy this entity as you own less than half the capture points"),
"icon": "kill_small.png"
"icon": "kill_small_disabled.png"
};
@ -716,6 +716,9 @@ var g_EntityCommands =
if (entState.mirage)
return;
if (entState.capturePoints && entState.capturePoints[entState.player] < entState.maxCapturePoints / 2)
return;
var selection = g_Selection.toList();
if (selection.length < 1)
return;