Modifying Specialist Chevron to have 2 columns of specialists

draco963

Prince
Joined
Jan 26, 2007
Messages
451
Location
Ottawa
OK, so, because I have added an extra specialist to my game, I'm trying to re-space the specialist into two columns of 4 each. I've managed to re-align all the "+" & "-" buttons, and the transparent specialist widgets that show up when you don't have any of that kind. But I can't move the added specialists, and I can't figure out why...

Some screenies to help make this clear:

All the "non-selected", or transparent, specialists properly aligned, all plus & minus buttons moved too:


As you can see clearly, "selected", or active, specialists are not in two columns:


Despite the screenies, I did just figure out how to fix the issue with the specialists being squeezed in too close together, but I can't get them in two columns...

In the attachement you'll find my changed CvMainInterface. My changes for this are limited to lines 2496-2574, and 4584-4604. Thanks in advance!

Spoiler Lines 2496-2574 :
Code:
####### RichMod - SPECIALIST STACKER	05/02/07	JOHNY 
szHideCitizenList = []

# Angry Citizens
i = 0
for i in range(MAX_ANGRY_CITIZEN_BUTTONS):
	szName = "AngryCitizen" + str(i)
	screen.setImageButton( szName, ArtFileMgr.getInterfaceArtInfo("INTERFACE_ANGRYCITIZEN_TEXTURE").getPath(), xResolution - 74 - (34 * i), yResolution - 241, 30, 30, WidgetTypes.WIDGET_ANGRY_CITIZEN, -1, -1 )
	screen.hide( szName )
g_iAngryCitizensCount = MAX_ANGRY_CITIZEN_BUTTONS
		
iCount = 0

# Increase Specialists...
i = 0
iXShiftVal = 0
iYShiftVal = 0
		
for i in range( gc.getNumSpecialistInfos() ):
	if( i > 3 ):
		iXShiftVal = 110
		iYShiftVal = i - 4
	else:
		iYShiftVal = i
	if (gc.getSpecialistInfo(i).isVisible()):
		szName = "IncreaseSpecialist" + str(i)
		screen.setButtonGFC( szName, u"", "", xResolution - (38+iXShiftVal), (yResolution - 285 - (30 * iYShiftVal)), 19, 19, WidgetTypes.WIDGET_CHANGE_SPECIALIST, i, 1, ButtonStyles.BUTTON_STYLE_CITY_PLUS )
		screen.hide( szName )

		iCount = iCount + 1

iCount = 0

# Decrease specialists
i = 0
iXShiftVal = 0
iYShiftVal = 0

for i in range( gc.getNumSpecialistInfos() ):
	if( i > 3 ):
		iXShiftVal = 110
		iYShiftVal = i - 4
	else:
		iYShiftVal = i

	if (gc.getSpecialistInfo(i).isVisible()):
		szName = "DecreaseSpecialist" + str(i)
		screen.setButtonGFC( szName, u"", "", xResolution - (38+iXShiftVal), (yResolution - 270 - (30 * iYShiftVal)), 19, 19, WidgetTypes.WIDGET_CHANGE_SPECIALIST, i, -1, ButtonStyles.BUTTON_STYLE_CITY_MINUS )
		screen.hide( szName )

		iCount = iCount + 1

iCount = 0

# Citizen Buttons
i = 0
iXShiftVal = 0
iYShiftVal = 0
iCount = 0

for i in range( gc.getNumSpecialistInfos() ):
	if( iCount > 3 ):
		iXShiftVal = 110
		iYShiftVal = iCount - 4
	else:
		iYShiftVal = iCount 
		
	if (gc.getSpecialistInfo(i).isVisible()):
			
		szName = "CitizenDisabledButton" + str(i)
		screen.setImageButton( szName, gc.getSpecialistInfo(i).getTexture(), xResolution + 5 - (74+iXShiftVal), (yResolution - 281 - (30 * iYShiftVal)), 24, 24, WidgetTypes.WIDGET_DISABLED_CITIZEN, i, -1 )
		screen.enable( szName, False )
		screen.hide( szName )

		for j in range(MAX_CITIZEN_BUTTONS):
			szName = "CitizenButton" + str((i * 100) + j)
			screen.addCheckBoxGFC( szName, gc.getSpecialistInfo(i).getTexture(), "", xResolution + 5 - (70+iXShiftVal) - j, (yResolution - 281 - (30 * iYShiftVal)), 24, 24, WidgetTypes.WIDGET_CITIZEN, i, j, ButtonStyles.BUTTON_STYLE_LABEL )
			screen.hide( szName )
		iCount = iCount + 1
Spoiler Lines 4584-4604 :
Code:
xCoord = xResolution - 70 - (15 * j) # RichMod - margin, fixed
yCoord = yResolution - 281 - (30 * i) # RichMod - vertical spacing, fixed

# RichMod - 2nd column of Specialists (doesn't work)
	c = 0
	cXShiftVal = 0
	cYShiftVal = 0
	cCount = 0

	for c in range( gc.getNumSpecialistInfos() ):
		if( cCount > 3 ):
			cXShiftVal = 110
			cYShiftVal = cCount * 30
		else:
			cYShiftVal = 0 
		
	szName = "CitizenButton" + str((i * 100) + j)
	screen.addCheckBoxGFC( szName, gc.getSpecialistInfo(i).getTexture(), "", (xCoord - cXShiftVal), (yCoord - cYShiftVal), 24, 24, WidgetTypes.WIDGET_CITIZEN, i, j, ButtonStyles.BUTTON_STYLE_LABEL )
	screen.show( szName )
				
	cCount = cCount + 1
 

Attachments

  • CvMainInterface.rar
    84.8 KB · Views: 71
Ha! Got it! Nevermind!

Spoiler :
Code:
while (iCount > 0):
	bHandled = True

	c = 0
	yCoord = yResolution - 281 - (30 * i) # RichMod - vertical spacing, fixed

	if( yCoord < 652 ):
		xCoord = xResolution - 179 - (15 * j) # RichMod - 2nd column, fixed
		c = 120 # RichMod - Vertical correction
	else:
		xCoord = xResolution - 69 - (15 * j) # RichMod - margin, fixed
		
	szName = "CitizenButton" + str((i * 100) + j)
	screen.addCheckBoxGFC( szName, gc.getSpecialistInfo(i).getTexture(), "", xCoord, (yCoord + c), 24, 24, WidgetTypes.WIDGET_CITIZEN, i, j, ButtonStyles.BUTTON_STYLE_LABEL )
	screen.show( szName )
 
Top Bottom