How to hide craphical only and unplayable features and civs?

NotSoGood

Emperor
Joined
Jan 25, 2009
Messages
1,077
Location
Finland
I have encouraged myself and started to "fix" some things in sevopedia that I don't like. The first thing I did was to remove the stats box from the leader head page. I attached a screen shot just for fun. No I have bigger screen for the leader head! :eek:

But the one minor thing I want to change is that currently it shows all craphical only improvements and unplayable civs and leaders. I tried to look in the BTS' CvPediaImprovement and CvPediaLeader but because I'm not an awesome python modder, I have no idea how it's done there. Some might call it as feature but I consider it as "bug".
So if anyone could possibly help me, or even push me to the right direction, I would be thankfull.
 
This is from the sevopedia for RevDCM (I believe that the sevopedia is located in different mods so yours could possibly be different).

Here's what you could try for the non playable civs.

change getCivilizationList in SevoPediaMain.py to:

Code:
	def getCivilizationList(self):
		list = self.getSortedList(gc.getNumCivilizationInfos(), gc.getCivilizationInfo)
		for item in list:
			if not gc.getCivilizationInfo(item[1]).isPlayable():
				list.remove(item)
		return list

I didn't test this but it should work.

For the LeaderHeads it would be a little more complicated. You would have to edit getLeaderList. You would have to get the list of leaders and the list of civilizations. Then loop through the civilizations and for each one that is not playable, loop through the civ's leaders and remove them from the leaders list.

For graphical only improvements try:

Code:
	def getImprovementList(self):
		list = self.getSortedList(gc.getNumImprovementInfos(), gc.getImprovementInfo)
		for item in list:
			if gc.getImprovementInfo(item[1]).isGraphicalOnly():
				list.remove(item)
		return list

Again, I didn't test this, but I believe it should work.
 
Hmm, seems like I'm using different version of sevopedia. This gets troublesome. :sad: I don't have SevoPediaMain.py in my mod, but the closest one is PediaMain which has placeImprovements function
Code:
	def placeImprovements(self):
		self.list = self.getSortedList(gc.getNumImprovementInfos(), gc.getImprovementInfo)
		self.placeItems(WidgetTypes.WIDGET_PEDIA_JUMP_TO_IMPROVEMENT, gc.getImprovementInfo)
Again i have to say that I'm not a good python modder. But because I have some kind of basic knowledge :mischief: it seems to me that in RevDCM's sevopedia that function has been just splitted in half (placeImprovements and getImprovementList).
So, is it possible to change your code to work with mine? If I put it there without changing it, I get an python error when trying to look improvements page
Code:
Traceback (most recent call last):

  File "CvScreensInterface", line 211, in pediaMain

  File "CvPediaMain", line 207, in pediaJump

  File "CvPediaMain", line 423, in placeImprovements

TypeError: iteration over non-sequence
ERR: Python function pediaMain failed, module CvScreensInterface
 
Hmm, seems like I'm using different version of sevopedia. This gets troublesome. I don't have SevoPediaMain.py in my mod, but the closest one is PediaMain which has placeImprovements function

In my version of RevDCM, which is where I looked for the Sevopedia code. The Sevopedia files where not located where normal screens are located. The CivPediaMain.py file is located in Python/Screens like normal, but all of the Sevopedia files (including SevoPediaMain.py) are located in Python\Contrib\Sevopedia.
 
Top Bottom