Units buttons in city screen

MaxRiga

Emperor
Joined
Feb 1, 2004
Messages
1,274
Location
Riga/Montreal
i have managed all units of my mod in my civ4unitsinfos file one by one but in the city screen its still chaose. what should i do to let it goes one by one as i wish !?

attached - screen from my mod, on the left side picture from worldbuilder of all units and on the right is a city screen
 

Attachments

  • units.JPG
    units.JPG
    172.8 KB · Views: 67
MaxRiga said:
i have managed all units of my mod in my civ4unitsinfos file one by one but in the city screen its still chaose. what should i do to let it goes one by one as i wish !?

attached - screen from my mod, on the left side picture from worldbuilder of all units and on the right is a city screen

I'm not sure I completely understand the question. What do you mean by allowing them to go "one by one"?
 
sry for my english :(((

look at the picture , there is plane unit after rockets in city screen but i've managed this unit to be with planes ( not with rockets ) and you can see it on the same picture from left ( all planes together and separately from rockets ). So, why units are managed by groups in my unitinfos file ( and world builder shows it perfectly ) but it's still chaotically in city screen ?
 
MaxRiga said:
sry for my english :(((

look at the picture , there is plane unit after rockets in city screen but i've managed this unit to be with planes ( not with rockets ) and you can see it on the same picture from left ( all planes together and separately from rockets ). So, why units are managed by groups in my unitinfos file ( and world builder shows it perfectly ) but it's still chaotically in city screen ?


Ah, I see what you mean.

The function in CvMainInterface.py that puts the buttons into the bottom of the screen in order of unit class type, not unit type. So, the order is dependent upon the order of the classes in CIV4UnitClassInfos.xml, not CIV4UnitInfos.xml.

Hope that helps!
 
MaxRiga said:
some units are upsand in infoclass! like russian cossacks, for example! so, how it's possible? maybe CIV4ArtDefines_Unit.xml ?

I'm sorry, I'm not sure what you mean by "upsand". Just note that the order in the unit buttons are shown in the city list go by the unit class type. The order that the units are shown in the world builder list go by unit type.

Here is the code that makes that list, my comments added in bold:

Code:
# 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
 
Top Bottom