Fix GUI errors on broken entities with no icons. Delete some bogus icon sheet references.

This was SVN commit r7905.
This commit is contained in:
Ykkrosh
2010-08-11 10:54:08 +00:00
parent b2c06651d9
commit 0dc50ea1cd
3 changed files with 10 additions and 4 deletions
@@ -111,8 +111,16 @@ function displayGeneralInfo(playerState, entState, template)
}
// Icon
getGUIObjectByName("sdIconImage").sprite = template.icon_sheet;
getGUIObjectByName("sdIconImage").cell_id = template.icon_cell;
if (template.icon_sheet && typeof template.icon_cell != "undefined")
{
getGUIObjectByName("sdIconImage").sprite = template.icon_sheet;
getGUIObjectByName("sdIconImage").cell_id = template.icon_cell;
}
else
{
// TODO: we should require all entities to have icons, so this case never occurs
getGUIObjectByName("sdIconImage").sprite = "bkFillBlack";
}
getGUIObjectByName("sdIcon").tooltip = iconTooltip;
//getGUIObjectByName("sdIconOutline"); // Need to change color of icon outline with the playerColor
@@ -2,7 +2,6 @@
<Entity parent="template_entity_full">
<Identity>
<GenericName>Structure</GenericName>
<IconSheet>PortraitSheet</IconSheet>
</Identity>
<BuildRestrictions>
<PlacementType>standard</PlacementType>
@@ -2,7 +2,6 @@
<Entity parent="template_entity_full">
<Identity>
<GenericName>Unit</GenericName>
<IconSheet>PortraitSheet</IconSheet>
</Identity>
<Minimap>
<Type>unit</Type>