mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2024-12-24 12:12:36 -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.setHat(48, 0, 0)
|
||||
|
||||
self.donaldSpeech = Sequence()
|
||||
random.shuffle(TTLocalizer.DonaldChatter)
|
||||
|
||||
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 = self.donald.createTalkSequence(TTLocalizer.DonaldChatter, 15)
|
||||
self.donaldSpeech.loop(0)
|
||||
|
||||
def unload(self):
|
||||
|
|
|
@ -1790,18 +1790,21 @@ class Toon(Avatar.Avatar, ToonHead):
|
|||
self.getGeomNode().setClipPlane(self.holeClipPath)
|
||||
self.nametag3d.setClipPlane(self.holeClipPath)
|
||||
avHeight = max(self.getHeight(), 3)
|
||||
def lerpCam(task):
|
||||
degrees = task.time * 52.941
|
||||
radians = degrees * (math.pi / 180.0)
|
||||
x = -12 * math.sin(radians)
|
||||
y = -12 * math.cos(radians)
|
||||
z = base.localAvatar.getHeight()
|
||||
camera.setPos(x, y, z)
|
||||
camera.setH(-degrees)
|
||||
if task.time > 3.4:
|
||||
return Task.done
|
||||
return Task.cont
|
||||
taskMgr.add(lerpCam, 'lerpCam')
|
||||
|
||||
if self == base.localAvatar:
|
||||
def lerpCam(task):
|
||||
degrees = task.time * 52.941
|
||||
radians = degrees * (math.pi / 180.0)
|
||||
x = -12 * math.sin(radians)
|
||||
y = -12 * math.cos(radians)
|
||||
z = base.localAvatar.getHeight()
|
||||
camera.setPos(x, y, z)
|
||||
camera.setH(-degrees)
|
||||
if task.time > 3.4:
|
||||
return Task.done
|
||||
return Task.cont
|
||||
taskMgr.add(lerpCam, 'lerpCam')
|
||||
|
||||
self.track.start(ts)
|
||||
self.setActiveShadow(0)
|
||||
|
||||
|
@ -2990,8 +2993,6 @@ class Toon(Avatar.Avatar, ToonHead):
|
|||
|
||||
def enterScientistJealous(self, animMultiplier = 1, ts = 0, callback = None, extraArgs = []):
|
||||
self.loop('scientistJealous')
|
||||
if hasattr(self, 'showScientistProp'):
|
||||
self.showScientistProp()
|
||||
|
||||
def exitScientistJealous(self):
|
||||
self.stop()
|
||||
|
@ -3016,12 +3017,20 @@ class Toon(Avatar.Avatar, ToonHead):
|
|||
|
||||
def enterScientistPlay(self, animMultiplier = 1, ts = 0, callback = None, extraArgs = []):
|
||||
self.loop('scientistGame')
|
||||
if hasattr(self, 'scientistPlay'):
|
||||
self.scientistPlay()
|
||||
|
||||
def exitScientistPlay(self):
|
||||
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()
|
||||
compileGlobalAnimList()
|
||||
|
|
Loading…
Reference in a new issue