toon: Fix camera lerp for DistributedNPCFisherman

This commit is contained in:
Open Toontown 2022-01-16 17:15:31 -05:00
parent d2aea84f8a
commit 8f1f46cfae

View file

@ -16,12 +16,15 @@ class DistributedNPCFisherman(DistributedNPCToonBase):
self.button = None self.button = None
self.popupInfo = None self.popupInfo = None
self.fishGui = None self.fishGui = None
self.lerpCameraSeq = None
return return
def disable(self): def disable(self):
self.ignoreAll() self.ignoreAll()
taskMgr.remove(self.uniqueName('popupFishGUI')) taskMgr.remove(self.uniqueName('popupFishGUI'))
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
@ -73,7 +76,9 @@ class DistributedNPCFisherman(DistributedNPCToonBase):
def resetFisherman(self): def resetFisherman(self):
self.ignoreAll() self.ignoreAll()
taskMgr.remove(self.uniqueName('popupFishGUI')) taskMgr.remove(self.uniqueName('popupFishGUI'))
taskMgr.remove(self.uniqueName('lerpCamera')) if self.lerpCameraSeq:
self.lerpCameraSeq.finish()
self.lerpCameraSeq = None
if self.fishGui: if self.fishGui:
self.fishGui.destroy() self.fishGui.destroy()
self.fishGui = None self.fishGui = None
@ -93,7 +98,9 @@ class DistributedNPCFisherman(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.ignore(self.fishGuiDoneEvent) self.ignore(self.fishGuiDoneEvent)
if self.popupInfo: if self.popupInfo:
@ -113,7 +120,10 @@ class DistributedNPCFisherman(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')) quat = Quat()
quat.setHpr((-150, -2, 0))
self.lerpCameraSeq = camera.posQuatInterval(1, Point3(-5, 9, base.localAvatar.getHeight() - 0.5), quat, other=self, blendType='easeOut', name=self.uniqueName('lerpCamera'))
self.lerpCameraSeq.start()
if self.isLocalToon: if self.isLocalToon:
taskMgr.doMethodLater(1.0, self.popupFishGUI, self.uniqueName('popupFishGUI')) taskMgr.doMethodLater(1.0, self.popupFishGUI, self.uniqueName('popupFishGUI'))
elif mode == NPCToons.SELL_MOVIE_COMPLETE: elif mode == NPCToons.SELL_MOVIE_COMPLETE: