dacubz145
Deity
Ive never messed with schemas, which one is this being borrowed from?Resources right? Also speaking of the python code in there, J provided me with this code that if a unit is only buildable once it goes into seperate sheetSetting one tag on each thing you want to hide is complicated?
Try it with one. If that one disappears from the 'pedia (whichever one you are using) then it works.
As I recall, with the regular Civilopedia it only works for some things without modifications. I don't think it worked at all for the Sevopedia - I had to modify the 'pedia code in FFP to get it to work.
It's a pretty easy change in the Sevopedia to get it to apply to everything since it uses a single function to get the lists of things to display. One line changed in getSortedList and one 2 line member function added to the TraitInfo class it uses to deal with the traits.
Here are the changes you need to add to SevoPediaMain.py. Add the things in red (the comments are what are int he FFP version of this file, which I just copied these from):
Code:def getTraitInfo(self, id): info = gc.getNewConceptInfo(id) if self.isTraitInfo(info): class TraitInfo: def __init__(self, conceptInfo): self.conceptInfo = conceptInfo sKey = conceptInfo.getType() sKey = sKey[sKey.find("TRAIT_"):] self.eTrait = gc.getInfoTypeForString(sKey) self.traitInfo = gc.getTraitInfo(self.eTrait) def getDescription(self): return u"%c %s" % (TraitUtil.getIcon(self.eTrait), self.traitInfo.getDescription()) def getButton(self): return self.traitInfo.getButton() [B][COLOR="DarkRed"]def isGraphicalOnly(self): # FFP : do not show items with bGraphicalOnly set to 1 return self.traitInfo.isGraphicalOnly()[/COLOR][/B] return TraitInfo(info) return None
and
Code:def getSortedList(self, numInfos, getInfo, noSort=False): list = [] for i in range(numInfos): item = getInfo(i) if item [B][COLOR="darkred"]and not item.isGraphicalOnly()[/COLOR][/B]: # FFP : do not show items with bGraphicalOnly set to 1 list.append((item.getDescription(), i)) if self.isSortLists() and not noSort: list.sort() return list
Code:
###world units - part 7
def getSortedUnitList(self, numInfos, getInfo,bWorld):
list1 = []
iNumInfos = 0
for i in range(numInfos):
cvUnit = gc.getUnitInfo(i)
cvUnitClass = gc.getUnitClassInfo(cvUnit.getUnitClassType ())
if cvUnitClass.getMaxGlobalInstances ()=1 and bWorld:
list1.append(i)
iNumInfos += 1
elif cvUnitClass.getMaxGlobalInstances ()!=1 and not bWorld:
list1.append(i)
iNumInfos += 1
list2 = [(0,0)] * iNumInfos
i = 0
for iUnit in list1:
list2[i] = (gc.getUnitInfo(iUnit).getDescription(), iUnit)
i += 1
if self.bSortLists:
list2.sort()
return list2z
###world units - part 7