racing: you can now purchase karts
This commit is contained in:
parent
f0767c9739
commit
03df90b3e2
3 changed files with 23 additions and 15 deletions
|
@ -455,7 +455,7 @@ CircuitSweepsList = [CircuitSweeps1, CircuitSweeps2, CircuitSweeps3]
|
||||||
CircuitQualList = [CircuitQuals1, CircuitQuals2, CircuitQuals3]
|
CircuitQualList = [CircuitQuals1, CircuitQuals2, CircuitQuals3]
|
||||||
AllQualsList = [SpeedwayQualsList, RuralQualsList, UrbanQualsList]
|
AllQualsList = [SpeedwayQualsList, RuralQualsList, UrbanQualsList]
|
||||||
AllWinsList = [SpeedwayWinsList, RuralWinsList, UrbanWinsList]
|
AllWinsList = [SpeedwayWinsList, RuralWinsList, UrbanWinsList]
|
||||||
TrophiesPerCup = NumTrophies / NumCups
|
TrophiesPerCup = NumTrophies // NumCups
|
||||||
QualifiedRaces = [1, 10, 100]
|
QualifiedRaces = [1, 10, 100]
|
||||||
TotalQualifiedRaces = 100
|
TotalQualifiedRaces = 100
|
||||||
WonRaces = [1, 10, 100]
|
WonRaces = [1, 10, 100]
|
||||||
|
|
|
@ -308,7 +308,7 @@ class ItemSelector(DirectFrame):
|
||||||
def __init__(self, avatar, parent = aspect2d):
|
def __init__(self, avatar, parent = aspect2d):
|
||||||
self.currItem = None
|
self.currItem = None
|
||||||
self.itemList = None
|
self.itemList = None
|
||||||
self.parent = parent
|
self._parent = parent
|
||||||
self.avatar = avatar
|
self.avatar = avatar
|
||||||
self.currAccessoryType = None
|
self.currAccessoryType = None
|
||||||
self.texCount = 1
|
self.texCount = 1
|
||||||
|
@ -322,7 +322,7 @@ class ItemSelector(DirectFrame):
|
||||||
self.leftArrowButton.destroy()
|
self.leftArrowButton.destroy()
|
||||||
self.rightArrowButton.destroy()
|
self.rightArrowButton.destroy()
|
||||||
del self.avatar
|
del self.avatar
|
||||||
del self.parent
|
del self._parent
|
||||||
del self.currItem
|
del self.currItem
|
||||||
del self.itemList
|
del self.itemList
|
||||||
del self.uiBgFrame
|
del self.uiBgFrame
|
||||||
|
@ -516,7 +516,7 @@ class ItemSelector(DirectFrame):
|
||||||
self.__updateViewerUI()
|
self.__updateViewerUI()
|
||||||
self.notify.debug('__handleItemChange: currItem %s' % self.currItem)
|
self.notify.debug('__handleItemChange: currItem %s' % self.currItem)
|
||||||
self.updatedDNA[self.currAccessoryType] = self.currItem
|
self.updatedDNA[self.currAccessoryType] = self.currItem
|
||||||
kart = self.parent.parent.getKartViewer().getKart()
|
kart = self._parent._parent.getKartViewer().getKart()
|
||||||
kart.updateDNAField(self.currAccessoryType, self.currItem)
|
kart.updateDNAField(self.currAccessoryType, self.currItem)
|
||||||
|
|
||||||
def __handleShowItem(self):
|
def __handleShowItem(self):
|
||||||
|
@ -540,7 +540,7 @@ class ItemSelector(DirectFrame):
|
||||||
else:
|
else:
|
||||||
self.uiImagePlane.component('geom0').setColorScale(getAccessory(self.currItem))
|
self.uiImagePlane.component('geom0').setColorScale(getAccessory(self.currItem))
|
||||||
elif self.currAccessoryType == KartDNA.decalType:
|
elif self.currAccessoryType == KartDNA.decalType:
|
||||||
kart = self.parent.parent.getKartViewer().getKart()
|
kart = self._parent._parent.getKartViewer().getKart()
|
||||||
kartDecal = getDecalId(kart.kartDNA[KartDNA.bodyType])
|
kartDecal = getDecalId(kart.kartDNA[KartDNA.bodyType])
|
||||||
texNodePath = getTexCardNode(self.currItem)
|
texNodePath = getTexCardNode(self.currItem)
|
||||||
tex = loader.loadTexture('phase_6/maps/%s.jpg' % texNodePath % kartDecal, 'phase_6/maps/%s_a.rgb' % texNodePath % kartDecal)
|
tex = loader.loadTexture('phase_6/maps/%s.jpg' % texNodePath % kartDecal, 'phase_6/maps/%s_a.rgb' % texNodePath % kartDecal)
|
||||||
|
@ -583,13 +583,13 @@ class ItemSelector(DirectFrame):
|
||||||
if self.updatedDNA[KartDNA.accColor] == deletedItem:
|
if self.updatedDNA[KartDNA.accColor] == deletedItem:
|
||||||
self.avatar.requestKartDNAFieldUpdate(KartDNA.accColor, self.currItem)
|
self.avatar.requestKartDNAFieldUpdate(KartDNA.accColor, self.currItem)
|
||||||
self.updatedDNA[KartDNA.accColor] = self.currItem
|
self.updatedDNA[KartDNA.accColor] = self.currItem
|
||||||
kart = self.parent.parent.getKartViewer().getKart()
|
kart = self._parent._parent.getKartViewer().getKart()
|
||||||
kart.updateDNAField(KartDNA.accColor, self.currItem)
|
kart.updateDNAField(KartDNA.accColor, self.currItem)
|
||||||
elif self.currAccessoryType == KartDNA.accColor:
|
elif self.currAccessoryType == KartDNA.accColor:
|
||||||
if self.updatedDNA[KartDNA.bodyColor] == deletedItem:
|
if self.updatedDNA[KartDNA.bodyColor] == deletedItem:
|
||||||
self.avatar.requestKartDNAFieldUpdate(KartDNA.bodyColor, self.currItem)
|
self.avatar.requestKartDNAFieldUpdate(KartDNA.bodyColor, self.currItem)
|
||||||
self.updatedDNA[KartDNA.bodyColor] = self.currItem
|
self.updatedDNA[KartDNA.bodyColor] = self.currItem
|
||||||
kart = self.parent.parent.getKartViewer().getKart()
|
kart = self._parent._parent.getKartViewer().getKart()
|
||||||
kart.updateDNAField(KartDNA.bodyColor, self.currItem)
|
kart.updateDNAField(KartDNA.bodyColor, self.currItem)
|
||||||
|
|
||||||
self.notify.debug('__handleItemDelete: Delete request on accessory %s' % self.currItem)
|
self.notify.debug('__handleItemDelete: Delete request on accessory %s' % self.currItem)
|
||||||
|
@ -602,7 +602,7 @@ class ItemSelector(DirectFrame):
|
||||||
self.currItem = InvalidEntry
|
self.currItem = InvalidEntry
|
||||||
self.__updateViewerUI()
|
self.__updateViewerUI()
|
||||||
self.updatedDNA[self.currAccessoryType] = self.currItem
|
self.updatedDNA[self.currAccessoryType] = self.currItem
|
||||||
kart = self.parent.parent.getKartViewer().getKart()
|
kart = self._parent._parent.getKartViewer().getKart()
|
||||||
kart.updateDNAField(self.currAccessoryType, self.currItem)
|
kart.updateDNAField(self.currAccessoryType, self.currItem)
|
||||||
if self.avatar.getAccessoryByType(self.currAccessoryType) == deletedItem:
|
if self.avatar.getAccessoryByType(self.currAccessoryType) == deletedItem:
|
||||||
self.avatar.requestKartDNAFieldUpdate(self.currAccessoryType, self.currItem)
|
self.avatar.requestKartDNAFieldUpdate(self.currAccessoryType, self.currItem)
|
||||||
|
@ -617,7 +617,7 @@ class ItemSelector(DirectFrame):
|
||||||
self.avatar = avatar
|
self.avatar = avatar
|
||||||
self.itemViewers = {}
|
self.itemViewers = {}
|
||||||
self.buttonDict = {}
|
self.buttonDict = {}
|
||||||
self.parent = parent
|
self._parent = parent
|
||||||
DirectFrame.__init__(self, parent=parent, relief=None, pos=(0, 0, 0), scale=(1.0, 1.0, 1.0))
|
DirectFrame.__init__(self, parent=parent, relief=None, pos=(0, 0, 0), scale=(1.0, 1.0, 1.0))
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -755,7 +755,7 @@ class KartViewer(DirectFrame):
|
||||||
def __init__(self, dna, parent):
|
def __init__(self, dna, parent):
|
||||||
self.kart = None
|
self.kart = None
|
||||||
self.dna = dna
|
self.dna = dna
|
||||||
self.parent = parent
|
self._parent = parent
|
||||||
self.kartFrame = None
|
self.kartFrame = None
|
||||||
self.bounds = None
|
self.bounds = None
|
||||||
self.colors = None
|
self.colors = None
|
||||||
|
@ -787,7 +787,7 @@ class KartViewer(DirectFrame):
|
||||||
if hasattr(self, 'dna'):
|
if hasattr(self, 'dna'):
|
||||||
del self.dna
|
del self.dna
|
||||||
if hasattr(self, 'parent'):
|
if hasattr(self, 'parent'):
|
||||||
del self.parent
|
del self._parent
|
||||||
DirectFrame.destroy(self)
|
DirectFrame.destroy(self)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
|
@ -16,12 +16,15 @@ class DistributedNPCKartClerk(DistributedNPCToonBase):
|
||||||
self.button = None
|
self.button = None
|
||||||
self.popupInfo = None
|
self.popupInfo = None
|
||||||
self.kartShopGui = None
|
self.kartShopGui = None
|
||||||
|
self.lerpCameraSeq = None
|
||||||
return
|
return
|
||||||
|
|
||||||
def disable(self):
|
def disable(self):
|
||||||
self.ignoreAll()
|
self.ignoreAll()
|
||||||
taskMgr.remove(self.uniqueName('popupKartShopGUI'))
|
taskMgr.remove(self.uniqueName('popupKartShopGUI'))
|
||||||
taskMgr.remove(self.uniqueName('lerpCamera'))
|
if self.lerpCameraSeq:
|
||||||
|
self.lerpCameraSeq.finish()
|
||||||
|
self.lerpCameraSeq = None
|
||||||
if self.popupInfo:
|
if self.popupInfo:
|
||||||
self.popupInfo.destroy()
|
self.popupInfo.destroy()
|
||||||
self.popupInfo = None
|
self.popupInfo = None
|
||||||
|
@ -52,7 +55,9 @@ class DistributedNPCKartClerk(DistributedNPCToonBase):
|
||||||
def resetKartShopClerk(self):
|
def resetKartShopClerk(self):
|
||||||
self.ignoreAll()
|
self.ignoreAll()
|
||||||
taskMgr.remove(self.uniqueName('popupKartShopGUI'))
|
taskMgr.remove(self.uniqueName('popupKartShopGUI'))
|
||||||
taskMgr.remove(self.uniqueName('lerpCamera'))
|
if self.lerpCameraSeq:
|
||||||
|
self.lerpCameraSeq.finish()
|
||||||
|
self.lerpCameraSeq = None
|
||||||
if self.kartShopGui:
|
if self.kartShopGui:
|
||||||
self.kartShopGui.destroy()
|
self.kartShopGui.destroy()
|
||||||
self.kartShopGui = None
|
self.kartShopGui = None
|
||||||
|
@ -76,7 +81,9 @@ class DistributedNPCKartClerk(DistributedNPCToonBase):
|
||||||
if mode == NPCToons.SELL_MOVIE_CLEAR:
|
if mode == NPCToons.SELL_MOVIE_CLEAR:
|
||||||
return
|
return
|
||||||
if mode == NPCToons.SELL_MOVIE_TIMEOUT:
|
if mode == NPCToons.SELL_MOVIE_TIMEOUT:
|
||||||
taskMgr.remove(self.uniqueName('lerpCamera'))
|
if self.lerpCameraSeq:
|
||||||
|
self.lerpCameraSeq.finish()
|
||||||
|
self.lerpCameraSeq = None
|
||||||
if self.isLocalToon:
|
if self.isLocalToon:
|
||||||
self.ignoreEventDict()
|
self.ignoreEventDict()
|
||||||
if self.popupInfo:
|
if self.popupInfo:
|
||||||
|
@ -96,7 +103,8 @@ class DistributedNPCKartClerk(DistributedNPCToonBase):
|
||||||
self.setupAvatars(self.av)
|
self.setupAvatars(self.av)
|
||||||
if self.isLocalToon:
|
if self.isLocalToon:
|
||||||
camera.wrtReparentTo(render)
|
camera.wrtReparentTo(render)
|
||||||
camera.lerpPosHpr(-5, 9, base.localAvatar.getHeight() - 0.5, -150, -2, 0, 1, other=self, blendType='easeOut', task=self.uniqueName('lerpCamera'))
|
self.lerpCameraSeq = camera.posQuatInterval(1, Point3(-5, 9, base.localAvatar.getHeight() - 0.5), Point3(-150, -2, 0), other=self, blendType='easeOut', name=self.uniqueName('lerpCamera'))
|
||||||
|
self.lerpCameraSeq.start()
|
||||||
if self.isLocalToon:
|
if self.isLocalToon:
|
||||||
taskMgr.doMethodLater(1.0, self.popupKartShopGUI, self.uniqueName('popupKartShopGUI'))
|
taskMgr.doMethodLater(1.0, self.popupKartShopGUI, self.uniqueName('popupKartShopGUI'))
|
||||||
elif mode == NPCToons.SELL_MOVIE_COMPLETE:
|
elif mode == NPCToons.SELL_MOVIE_COMPLETE:
|
||||||
|
|
Loading…
Reference in a new issue