I would like to see this. Is it buried in FFH2?
Yeah, but I can link the relevant parts here:
in CIV4UnitSchema.xml (additions in bold):
Code:
<ElementType name="bCtrlDown" content="textOnly" dt:type="boolean"/>
[b] <ElementType name="bGraphicalOnly" content="textOnly" dt:type="boolean"/>[/b]
<ElementType name="iHotKeyPriority" content="textOnly" dt:type="int"/>
Code:
<element type="bCtrlDown"/>
[b] <element type="bGraphicalOnly"/>[/b]
<element type="iHotKeyPriority"/>
And in CvPediaUnit.py:
Code:
def getUnitSortedList(self, bHero):
listUnits = []
iCount = 0
for iUnit in range(gc.getNumUnitInfos()):
if (self.getUnitType(iUnit) == bHero and not gc.getUnitInfo(iUnit).isGraphicalOnly()):
listUnits.append(iUnit)
iCount += 1
listSorted = [(0,0)] * iCount
iI = 0
for iUnit in listUnits:
listSorted[iI] = (gc.getUnitInfo(iUnit).getDescription(), iUnit)
iI += 1
listSorted.sort()
return listSorted
Note that the above code is also modified to allow the requester to pass in a bHero flag to tell if we want the returned list to be full of World Units or non-World units. Probably not a big deal for you so you wouldn't want to include that. Instead you probably just want the not gc.getUnitInfo(iUnit).isGraphicalOnly() check.
The magic of this method is that bGraphicalOnly and isGraphicalOnly() are base definitions for all object types. Its not defined in schema for a unit or building, but once you set it up in schema everything works because its already inherited in the SDK. Makes it very simple.