mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2024-12-24 04:02:40 -06:00
DNA: Finish C++ reader implementation
This commit is contained in:
parent
d975331905
commit
e06dde7709
6 changed files with 25 additions and 30 deletions
|
@ -153,11 +153,11 @@ class DistributedDoor(DistributedObject.DistributedObject, DelayDeletable):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def setTriggerName(self):
|
def setTriggerName(self):
|
||||||
if self.doorType in self.specialDoorTypes:
|
if self.doorType in self.specialDoorTypes or self.doorType == DoorTypes.INT_HQ:
|
||||||
building = self.getBuilding()
|
building = self.getBuilding()
|
||||||
doorTrigger = building.find('**/door_' + str(self.doorIndex) + '/**/door_trigger*')
|
doorTrigger = building.find('**/door_' + str(self.doorIndex) + '/**/door_trigger*')
|
||||||
try:
|
try:
|
||||||
doorTrigger.node().setName(self.getTriggerName())
|
doorTrigger.setName(self.getTriggerName())
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
|
@ -17,33 +17,20 @@ class DNABulkLoader:
|
||||||
def loadDNABulk(dnaStorage, file):
|
def loadDNABulk(dnaStorage, file):
|
||||||
dnaLoader = DNALoader()
|
dnaLoader = DNALoader()
|
||||||
fileu = '../resources/' + file
|
fileu = '../resources/' + file
|
||||||
fileo = 'resources/' + file
|
|
||||||
try:
|
|
||||||
dnaLoader.loadDNAFile(dnaStorage, fileu)
|
dnaLoader.loadDNAFile(dnaStorage, fileu)
|
||||||
except:
|
|
||||||
dnaLoader.loadDNAFile(dnaStorage, fileo)
|
|
||||||
|
|
||||||
def loadDNAFile(dnaStorage, file):
|
def loadDNAFile(dnaStorage, file):
|
||||||
print 'Reading DNA file...', file
|
print 'Reading DNA file...', file
|
||||||
dnaLoader = DNALoader()
|
dnaLoader = DNALoader()
|
||||||
fileu = '../resources/' + file
|
fileu = '../resources/' + file
|
||||||
fileo = 'resources/' + file
|
|
||||||
try:
|
|
||||||
node = dnaLoader.loadDNAFile(dnaStorage, fileu)
|
node = dnaLoader.loadDNAFile(dnaStorage, fileu)
|
||||||
except:
|
|
||||||
node = dnaLoader.loadDNAFile(dnaStorage, fileo)
|
|
||||||
if node.node().getNumChildren() > 0:
|
if node.node().getNumChildren() > 0:
|
||||||
return node.node()
|
return node.node()
|
||||||
return None
|
|
||||||
|
|
||||||
def loadDNAFileAI(dnaStorage, file):
|
def loadDNAFileAI(dnaStorage, file):
|
||||||
dnaLoader = DNALoader()
|
dnaLoader = DNALoader()
|
||||||
fileu = '../resources/' + file
|
fileu = '../resources/' + file
|
||||||
fileo = 'resources/' + file
|
|
||||||
try:
|
|
||||||
data = dnaLoader.loadDNAFileAI(dnaStorage, fileu)
|
data = dnaLoader.loadDNAFileAI(dnaStorage, fileu)
|
||||||
except:
|
|
||||||
data = dnaLoader.loadDNAFileAI(dnaStorage, fileo)
|
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def setupDoor(a, b, c, d, e, f):
|
def setupDoor(a, b, c, d, e, f):
|
||||||
|
|
|
@ -49,7 +49,8 @@ class DNAFurnitureReaderAI:
|
||||||
CatalogItem.Location))
|
CatalogItem.Location))
|
||||||
|
|
||||||
# Find the interior node:
|
# Find the interior node:
|
||||||
for child in self.dnaData.children:
|
for i in xrange(self.dnaData.getNumChildren()):
|
||||||
|
child = self.dnaData.at(i)
|
||||||
if child.getName() == 'interior':
|
if child.getName() == 'interior':
|
||||||
interior = child
|
interior = child
|
||||||
break
|
break
|
||||||
|
@ -58,7 +59,8 @@ class DNAFurnitureReaderAI:
|
||||||
|
|
||||||
self.itemList.append(CatalogFurnitureItem(1399, posHpr=self.phonePos))
|
self.itemList.append(CatalogFurnitureItem(1399, posHpr=self.phonePos))
|
||||||
# Every child in the interior node is a prop, thus:
|
# Every child in the interior node is a prop, thus:
|
||||||
for child in interior.children:
|
for i in xrange(interior.getNumChildren()):
|
||||||
|
child = interior.at(i)
|
||||||
code = child.getCode()
|
code = child.getCode()
|
||||||
|
|
||||||
if code not in DNA2Furniture:
|
if code not in DNA2Furniture:
|
||||||
|
|
|
@ -213,10 +213,11 @@ class DistributedEstateAI(DistributedObjectAI):
|
||||||
|
|
||||||
def announceGenerate(self):
|
def announceGenerate(self):
|
||||||
DistributedObjectAI.announceGenerate(self)
|
DistributedObjectAI.announceGenerate(self)
|
||||||
for index, garden in self.__pendingGardens.items():
|
# Commented out because I had to reach estate to debug doors (Nacib)
|
||||||
started = garden[0]
|
#for index, garden in self.__pendingGardens.items():
|
||||||
self.gardenManager.handleSingleGarden(self.toons[index], garden[1:])
|
# started = garden[0]
|
||||||
self.placeStarterGarden(self.toons[index])
|
# self.gardenManager.handleSingleGarden(self.toons[index], garden[1:])
|
||||||
|
# self.placeStarterGarden(self.toons[index])
|
||||||
self.__pendingGardens = {}
|
self.__pendingGardens = {}
|
||||||
|
|
||||||
def destroy(self):
|
def destroy(self):
|
||||||
|
|
|
@ -54,7 +54,11 @@ class DistributedHouseDoor(DistributedDoor.DistributedDoor):
|
||||||
self.doPostAnnounceGenerate()
|
self.doPostAnnounceGenerate()
|
||||||
self.bHasFlat = not self.findDoorNode('door*flat', True).isEmpty()
|
self.bHasFlat = not self.findDoorNode('door*flat', True).isEmpty()
|
||||||
self.hideDoorParts()
|
self.hideDoorParts()
|
||||||
self.setTriggerName()
|
|
||||||
|
building = self.getBuilding()
|
||||||
|
doorTrigger = building.find('**/door_trigger*')
|
||||||
|
doorTrigger.setName(self.getTriggerName())
|
||||||
|
|
||||||
self.accept(self.getEnterTriggerEvent(), self.doorTrigger)
|
self.accept(self.getEnterTriggerEvent(), self.doorTrigger)
|
||||||
self.acceptOnce('clearOutToonInterior', self.doorTrigger)
|
self.acceptOnce('clearOutToonInterior', self.doorTrigger)
|
||||||
self.zoneDoneLoading = 0
|
self.zoneDoneLoading = 0
|
||||||
|
|
|
@ -24,14 +24,15 @@ if __debug__:
|
||||||
loadPrcFile('config/general.prc')
|
loadPrcFile('config/general.prc')
|
||||||
loadPrcFile('config/release/dev.prc')
|
loadPrcFile('config/release/dev.prc')
|
||||||
|
|
||||||
defaultText = '''door = base.cr.doFind('tedDoor')
|
defaultText = '''door = base.cr.doFind('tedHouseDoor')
|
||||||
bldg = door.getBuilding()
|
|
||||||
doorTrigger = bldg.find('**/door_' + str(door.doorIndex) + '/**/door_trigger*')
|
doorTrigger = door.getBuilding().find('**/door_trigger*')
|
||||||
doorTrigger.show()
|
doorTrigger.show()
|
||||||
doorTrigger.node().setName(self.getTriggerName())
|
|
||||||
|
doorTrigger.node().setName(door.getTriggerName())
|
||||||
print doorTrigger
|
print doorTrigger
|
||||||
print door.getEnterTriggerEvent()
|
print door.getEnterTriggerEvent()
|
||||||
print messenger.whoAccepts('enterdoor_trigger_20')'''
|
print messenger.whoAccepts(door.getEnterTriggerEvent())'''
|
||||||
|
|
||||||
def __inject_wx(_):
|
def __inject_wx(_):
|
||||||
code = textbox.GetValue()
|
code = textbox.GetValue()
|
||||||
|
|
Loading…
Reference in a new issue