1
1
forked from 0ad/0ad

* Fixed minor glitch which was causing the garrison icon to not appear. (Temporarily moved garrison value into command cell sheet, then changed mind and swapped it back to having its own sheet, since it'd probably need to be coloured to match the nearby supply icon.)

This was SVN commit r3673.
This commit is contained in:
Acumen 2006-03-22 18:21:27 +00:00
parent 8dd3a61a3a
commit c802dc3152
3 changed files with 71 additions and 4 deletions

View File

@ -1,3 +1 @@
garrison,Garrison,
unload,Unload,
unloadtotarget,Unload to Target,

View File

@ -97,12 +97,13 @@ textCaption += '[font=verdana10][color="' + Math.round(selection[0].player.getCo
// Update garrison capacity.
if( shouldUpdateStat( "traits.garrison" ) )
{
// Update Supply/Garrison
var guiObject = getGUIObjectByName("snStatusPaneGarrison");
guiObject.caption = '';
if (selection[0].traits.garrison)
{
// Set garrison icon.
getGUIObjectByName ("snStatusPaneGarrisonIcon").cell_id = cellGroup["Garrison"]["garrison"].id;
if (selection[0].traits.garrison.curr && selection[0].traits.garrison.max)
{
guiObject.caption += '[color="blue"]' + selection[0].traits.garrison.curr + '/' + selection[0].traits.garrison.max + '[/color] ';
@ -116,6 +117,7 @@ textCaption += '[font=verdana10][color="' + Math.round(selection[0].player.getCo
getGUIObjectByName ("snStatusPaneGarrisonIcon").hidden = true;
}
}
if( shouldUpdateStat( "traits.supply" ) )
{
guiObject = getGUIObjectByName("snStatusPaneSupply");
@ -126,7 +128,7 @@ textCaption += '[font=verdana10][color="' + Math.round(selection[0].player.getCo
if (selection[0].traits.supply.curr && selection[0].traits.supply.max && selection[0].traits.supply.type)
{
// Set resource icon.
getGUIObjectByName ("snStatusPaneSupplyIcon").cell_id = cellGroup["Resource"][selection[0].traits.supply.type];
getGUIObjectByName ("snStatusPaneSupplyIcon").cell_id = cellGroup["Resource"][selection[0].traits.supply.type].id;
// Special case for infinity.
if (selection[0].traits.supply.curr == "0" && selection[0].traits.supply.max == "0")
guiObject.caption += '[color="brown"] [icon="iconInfinity"] [/color] ';

View File

@ -1859,6 +1859,73 @@
size="0 0 100% 100%"
/>
</sprite>
<!--
==========================================
SESSION GUI - ICON SHEETS - GARRISON
==========================================
-->
<sprite name="snIconSheetGarrison">
<image texture="session/icons/sheets/garrison.dds"
cell_size="64 64"
size="0 0 100% 100%"
/>
</sprite>
<sprite name="snIconSheetGarrisonOver">
<effect add_color="42 42 42 0"/>
<image texture="session/icons/sheets/garrison.dds"
cell_size="64 64"
size="0 0 100% 100%"
/>
</sprite>
<sprite name="snIconSheetGarrisonDisabled">
<image texture="session/icons/sheets/garrison.dds"
cell_size="64 64"
size="0 0 100% 100%"
/>
</sprite>
<sprite name="snIconSheetGarrisonButton">
<image texture="session/icons/bkg/command_outer.dds"
size="0 0 100% 100%"
/>
<image texture="session/icons/bkg/command_inner.dds"
size="0 0 100% 100%"
/>
<image texture="session/icons/sheets/garrison.dds"
cell_size="64 64"
size="0 0 100% 100%"
/>
</sprite>
<sprite name="snIconSheetGarrisonButtonOver">
<image texture="session/icons/bkg/command_outer.dds"
size="0 0 100% 100%"
/>
<image
texture="session/icons/bkg/command_inner.dds"
size="0 0 100% 100%"
>
<effect add_color="42 42 42 0"/>
</image>
<image texture="session/icons/sheets/garrison.dds"
cell_size="64 64"
size="0 0 100% 100%"
/>
</sprite>
<sprite name="snIconSheetGarrisonButtonDisabled">
<image texture="session/icons/bkg/command_outer.dds"
size="0 0 100% 100%"
/>
<image texture="session/icons/bkg/command_inner.dds"
size="0 0 100% 100%"
/>
<image texture="session/icons/sheets/garrison.dds"
cell_size="64 64"
size="0 0 100% 100%"
/>
</sprite>
<!--
==========================================