Foreign Advisor Bonus Screen

I thinking of placing dropdown in city screen instead of resources header.
Dropdown with Resources all as a default option.
 
Foreign Advisor Checkbox

I decided to add this into this, since the foreign advisor is more troublesome than it seems.
Although the checkboxes are added to CvForeignAdvisor, codes are triggered in CvExoticForeignAdvisor.
So I might as well merge both together...

ForeignA_zpsb0b93498.jpg


ForeignB_zpsfa25b513.jpg


ForeignC_zpsf088fb99.jpg
 
More Entertainment

HideA_zpsda6f14f7.jpg


HideB_zps527fc24e.jpg


HideC_zps58293613.jpg


A) Hide Vassals: Hide all vassals, showing just masters
B) Hide Team Members: Show Team Leaders only
 
Platy,

Do you have some tip to merge:

Code:
	#xLink = self.DX_LINK / 2;
		# K-Mod
		xLink = 0
		if self.iLanguageLoaded != CyGame().getCurrentLanguage():
			self.LABEL_WIDTH_LIST[:] = []
			width_list = []
			for i in self.ORDER_LIST:
				width_list.append(CyInterface().determineWidth(localText.getText(self.TXT_KEY_DICT[i], ()).upper()) + 20)
			total_width = sum(width_list) + CyInterface().determineWidth(localText.getText("TXT_KEY_PEDIA_SCREEN_EXIT", ()).upper()) + 20;

			for i in width_list:
				self.LABEL_WIDTH_LIST.append((self.X_EXIT * i + total_width/2) / total_width)

			self.iLanguageLoaded = CyGame().getCurrentLanguage()
		# K-Mod end (except that I've used LABEL_WIDTH_DICT below) 

		for i in range (len (self.ORDER_LIST)):
			szScreen = self.ORDER_LIST[i]
# BUG - Glance Tab - start
			if szScreen == "GLANCE" and not AdvisorOpt.isShowGlance():
				continue # skip the GLANCE label
# BUG - Glance Tab - end
			szTextId = self.getNextWidgetName()
			if (self.iScreen != self.SCREEN_DICT[szScreen]):
				screen.setText (szTextId, "", u"<font=4>" + localText.getText (self.TXT_KEY_DICT[szScreen], ()).upper() + u"</font>", CvUtil.FONT_CENTER_JUSTIFY, xLink + self.LABEL_WIDTH_LIST[i]/2, self.Y_LINK, 0, FontTypes.TITLE_FONT, WidgetTypes.WIDGET_FOREIGN_ADVISOR, self.SCREEN_DICT[szScreen], -1)
			else:
				screen.setText (szTextId, "", u"<font=4>" + localText.getColorText (self.TXT_KEY_DICT[szScreen], (), gc.getInfoTypeForString ("COLOR_YELLOW")).upper() + u"</font>", CvUtil.FONT_CENTER_JUSTIFY, xLink + self.LABEL_WIDTH_LIST[i]/2, self.Y_LINK, 0, FontTypes.TITLE_FONT, WidgetTypes.WIDGET_FOREIGN_ADVISOR, -1, -1)
			xLink += self.LABEL_WIDTH_LIST[i]
	
	def drawActive (self, bInitial):

with

Code:
	def drawLinks (self):
		screen = self.getScreen()
		xLink = self.DX_LINK / 2;
		for i in range (len (self.ORDER_LIST)):
			szTextId = self.getNextWidgetName()
			szScreen = self.ORDER_LIST[i]
			if (self.iScreen != self.SCREEN_DICT[szScreen]):
				screen.setText (szTextId, "", u"<font=4>" + localText.getText (self.TXT_KEY_DICT[szScreen], ()).upper() + u"</font>", CvUtil.FONT_CENTER_JUSTIFY, xLink, self.Y_LINK, 0, FontTypes.TITLE_FONT, WidgetTypes.WIDGET_FOREIGN_ADVISOR, self.SCREEN_DICT[szScreen], -1)
			else:
				screen.setText (szTextId, "", u"<font=4>" + localText.getColorText (self.TXT_KEY_DICT[szScreen], (), gc.getInfoTypeForString ("COLOR_YELLOW")).upper() + u"</font>", CvUtil.FONT_CENTER_JUSTIFY, xLink, self.Y_LINK, 0, FontTypes.TITLE_FONT, WidgetTypes.WIDGET_FOREIGN_ADVISOR, -1, -1)
#			xLink += self.DX_LINK
 
Replace the whole chunk after screen = self.getScreen() and see how it goes?
 
CvForeignAdvisor.CvForeignAdvisor.drawActive (self) shouldn't be under def drawContents(self, bInitial):
It should remain under def drawActive (self, bInitial):

It should remain the same way:
Code:
	# Drawing Leaderheads
	def drawContents(self, bInitial):
	
		if (self.iScreen < 0):
			return
						
		self.deleteAllWidgets()
		
		screen = self.getScreen()

		# Header...
		screen.setLabel(self.getNextWidgetName(), "", self.SCREEN_TITLE, CvUtil.FONT_CENTER_JUSTIFY, self.W_SCREEN / 2, self.Y_TITLE, 0, FontTypes.TITLE_FONT, WidgetTypes.WIDGET_GENERAL, -1, -1 )
	
		if (self.REV_SCREEN_DICT.has_key(self.iScreen)):
			self.DRAW_DICT[self.REV_SCREEN_DICT[self.iScreen]] (bInitial)
		else:
			return
## Platy Foreign Start ##
		# Link to other Foreign advisor screens
		self.drawLinks()
## Platy Foreign End ##
	
	def drawActive (self, bInitial):
		CvForeignAdvisor.CvForeignAdvisor.drawActive (self)
 
Told you, it should appear as above.
Remove all the chunk
Code:
		xLink = 0
		if self.iLanguageLoaded != CyGame().getCurrentLanguage():
			self.LABEL_WIDTH_LIST[:] = []
			width_list = []
			for i in self.ORDER_LIST:
				width_list.append(CyInterface().determineWidth(localText.getText(self.TXT_KEY_DICT[i], ()).upper()) + 20)
			total_width = sum(width_list) + CyInterface().determineWidth(localText.getText("TXT_KEY_PEDIA_SCREEN_EXIT", ()).upper()) + 20;

			for i in width_list:
				self.LABEL_WIDTH_LIST.append((self.X_EXIT * i + total_width/2) / total_width)

			self.iLanguageLoaded = CyGame().getCurrentLanguage()
		# K-Mod end (except that I've used LABEL_WIDTH_DICT below) 

		for i in range (len (self.ORDER_LIST)):
			szScreen = self.ORDER_LIST[i]
# BUG - Glance Tab - start
			if szScreen == "GLANCE" and not AdvisorOpt.isShowGlance():
				continue # skip the GLANCE label
# BUG - Glance Tab - end
			szTextId = self.getNextWidgetName()
			if (self.iScreen != self.SCREEN_DICT[szScreen]):
				screen.setText (szTextId, "", u"<font=4>" + localText.getText (self.TXT_KEY_DICT[szScreen], ()).upper() + u"</font>", CvUtil.FONT_CENTER_JUSTIFY, xLink + self.LABEL_WIDTH_LIST[i]/2, self.Y_LINK, 0, FontTypes.TITLE_FONT, WidgetTypes.WIDGET_FOREIGN_ADVISOR, self.SCREEN_DICT[szScreen], -1)
			else:
				screen.setText (szTextId, "", u"<font=4>" + localText.getColorText (self.TXT_KEY_DICT[szScreen], (), gc.getInfoTypeForString ("COLOR_YELLOW")).upper() + u"</font>", CvUtil.FONT_CENTER_JUSTIFY, xLink + self.LABEL_WIDTH_LIST[i]/2, self.Y_LINK, 0, FontTypes.TITLE_FONT, WidgetTypes.WIDGET_FOREIGN_ADVISOR, -1, -1)
			xLink += self.LABEL_WIDTH_LIST[i]

And park it into def drawLinks (self):
 
Ok, new file here. Same error: The Foreign Advisor only opens relations screen (the names of others screens don't show) and just with my face leader, and new buttons - the other leaders doesn't appear. My error can be in CvForeignAdvisor?
 

Attachments

Yeah it is too messy....
I suggest you use my Foreign Advisor screen and plug in K-Mod changes to wherever applicable.
 
Yeah it is too messy....
I suggest you use my Foreign Advisor screen and plug in K-Mod changes to wherever applicable.

Well, it seems that a directly merge isn't possible. Observed that replacing the CvForeignAdvisor file, the other leaders appeared but still lack the buttons for the others screens of Foreign Advisors and new buttons don't work, which seems to be a problem in CvExoticForeignAdvisor file.
 
Because it isn't merged properly either.
I suggest use the most heavily modified files as a base, should be mine.
Test and see how.
Then add bug and test
Then kmod
 
Bug Fix

"Foreign Advisor" Title no longer disappears when hide leaders buttons are activated.
Applied to Ultrapack
 
Civ4ScreenShot0006_zps8364ebd3.jpg


Added Traits, Civilization and Favourite Religion to Info Page
Applied to Ultrapack
 
Updated with No War Data used in Ultrapack
 
Back
Top Bottom