mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2024-12-24 20:22:33 -06:00
Add base.localAvatar check to lerpCam and add createTalkSequence
This commit is contained in:
parent
32cb6371ac
commit
83e859ae4c
3 changed files with 28 additions and 26 deletions
|
@ -41,15 +41,8 @@ class DDSafeZoneLoader(SafeZoneLoader.SafeZoneLoader):
|
||||||
self.donald.reparentTo(self.boat)
|
self.donald.reparentTo(self.boat)
|
||||||
self.donald.setHat(48, 0, 0)
|
self.donald.setHat(48, 0, 0)
|
||||||
|
|
||||||
self.donaldSpeech = Sequence()
|
|
||||||
random.shuffle(TTLocalizer.DonaldChatter)
|
random.shuffle(TTLocalizer.DonaldChatter)
|
||||||
|
self.donaldSpeech = self.donald.createTalkSequence(TTLocalizer.DonaldChatter, 15)
|
||||||
for speechText in TTLocalizer.DonaldChatter:
|
|
||||||
self.donaldSpeech.append(Func(self.donald.setChatAbsolute, speechText, CFSpeech))
|
|
||||||
self.donaldSpeech.append(Wait(len(speechText.split(' '))))
|
|
||||||
self.donaldSpeech.append(Func(self.donald.clearChat))
|
|
||||||
self.donaldSpeech.append(Wait(15))
|
|
||||||
|
|
||||||
self.donaldSpeech.loop(0)
|
self.donaldSpeech.loop(0)
|
||||||
|
|
||||||
def unload(self):
|
def unload(self):
|
||||||
|
|
|
@ -1790,6 +1790,8 @@ class Toon(Avatar.Avatar, ToonHead):
|
||||||
self.getGeomNode().setClipPlane(self.holeClipPath)
|
self.getGeomNode().setClipPlane(self.holeClipPath)
|
||||||
self.nametag3d.setClipPlane(self.holeClipPath)
|
self.nametag3d.setClipPlane(self.holeClipPath)
|
||||||
avHeight = max(self.getHeight(), 3)
|
avHeight = max(self.getHeight(), 3)
|
||||||
|
|
||||||
|
if self == base.localAvatar:
|
||||||
def lerpCam(task):
|
def lerpCam(task):
|
||||||
degrees = task.time * 52.941
|
degrees = task.time * 52.941
|
||||||
radians = degrees * (math.pi / 180.0)
|
radians = degrees * (math.pi / 180.0)
|
||||||
|
@ -1802,6 +1804,7 @@ class Toon(Avatar.Avatar, ToonHead):
|
||||||
return Task.done
|
return Task.done
|
||||||
return Task.cont
|
return Task.cont
|
||||||
taskMgr.add(lerpCam, 'lerpCam')
|
taskMgr.add(lerpCam, 'lerpCam')
|
||||||
|
|
||||||
self.track.start(ts)
|
self.track.start(ts)
|
||||||
self.setActiveShadow(0)
|
self.setActiveShadow(0)
|
||||||
|
|
||||||
|
@ -2990,8 +2993,6 @@ class Toon(Avatar.Avatar, ToonHead):
|
||||||
|
|
||||||
def enterScientistJealous(self, animMultiplier = 1, ts = 0, callback = None, extraArgs = []):
|
def enterScientistJealous(self, animMultiplier = 1, ts = 0, callback = None, extraArgs = []):
|
||||||
self.loop('scientistJealous')
|
self.loop('scientistJealous')
|
||||||
if hasattr(self, 'showScientistProp'):
|
|
||||||
self.showScientistProp()
|
|
||||||
|
|
||||||
def exitScientistJealous(self):
|
def exitScientistJealous(self):
|
||||||
self.stop()
|
self.stop()
|
||||||
|
@ -3016,12 +3017,20 @@ class Toon(Avatar.Avatar, ToonHead):
|
||||||
|
|
||||||
def enterScientistPlay(self, animMultiplier = 1, ts = 0, callback = None, extraArgs = []):
|
def enterScientistPlay(self, animMultiplier = 1, ts = 0, callback = None, extraArgs = []):
|
||||||
self.loop('scientistGame')
|
self.loop('scientistGame')
|
||||||
if hasattr(self, 'scientistPlay'):
|
|
||||||
self.scientistPlay()
|
|
||||||
|
|
||||||
def exitScientistPlay(self):
|
def exitScientistPlay(self):
|
||||||
self.stop()
|
self.stop()
|
||||||
|
|
||||||
|
def createTalkSequence(self, speech, waitTime):
|
||||||
|
sequence = Sequence()
|
||||||
|
|
||||||
|
for text in speech:
|
||||||
|
sequence.append(Func(self.setChatAbsolute, text, CFSpeech))
|
||||||
|
sequence.append(Wait(len(text.split(' '))))
|
||||||
|
sequence.append(Func(self.clearChat))
|
||||||
|
sequence.append(Wait(waitTime))
|
||||||
|
|
||||||
|
return sequence
|
||||||
|
|
||||||
loadModels()
|
loadModels()
|
||||||
compileGlobalAnimList()
|
compileGlobalAnimList()
|
||||||
|
|
Loading…
Reference in a new issue