# Units to construct
[b]# Loops through each unit class type [/b]
for i in range ( g_NumUnitClassInfos ):
[b]# Gets the unit type for the specified civilization. For example:
# If i was unit class UNITCLASS_TANK, then eLoopUnit would
# become UNIT_GERMAN_PANZER for Germany, but become UNIT_TANK
# for everyone else [/b]
eLoopUnit = gc.getCivilizationInfo(pHeadSelectedCity.getCivilizationType()).getCivilizationUnits(i)
if (pHeadSelectedCity.canTrain(eLoopUnit, False, True)):
[b]# If the unit is trainable, it adds the button to the list[/b]
screen.appendMultiListButton( "BottomButtonContainer", gc.getUnitInfo(eLoopUnit).getButton(), iRow, WidgetTypes.WIDGET_TRAIN, i, -1, False )
screen.show( "BottomButtonContainer" )
if ( not pHeadSelectedCity.canTrain(eLoopUnit, False, False) ):
[b]# If the unit is tech-wise trainable, but something else is
# missing, like a resource, this greys out the button.[/b]
screen.disableMultiListButton( "BottomButtonContainer", iRow, iCount, gc.getUnitInfo(eLoopUnit).getButton() )
iCount = iCount + 1
bFound = True
iCount = 0
if (bFound):
iRow = iRow + 1
bFound = False