From 7e777ca776f80f97696564e469a8bf5d22404ec3 Mon Sep 17 00:00:00 2001 From: John Cote Date: Wed, 27 Nov 2019 23:51:28 -0500 Subject: [PATCH] toon: fix more camera lerps --- toontown/toon/DistributedNPCClerk.py | 2 +- toontown/toon/DistributedNPCPetclerk.py | 16 ++++++++++++---- toontown/toon/DistributedNPCTailor.py | 16 ++++++++++++---- 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/toontown/toon/DistributedNPCClerk.py b/toontown/toon/DistributedNPCClerk.py index 9ce6715..08e9fb5 100644 --- a/toontown/toon/DistributedNPCClerk.py +++ b/toontown/toon/DistributedNPCClerk.py @@ -105,7 +105,7 @@ class DistributedNPCClerk(DistributedNPCToonBase): self.setupAvatars(self.av) if self.isLocalToon: camera.wrtReparentTo(render) - self.lerpCameraSeq = LerpPosQuatInterval(camera, 1, Point3(-5, 9, self.getHeight() - 0.5), Point3(-150, -2, 0), other=self, blendType='easeOut', name=self.uniqueName('lerpCamera')) + self.lerpCameraSeq = camera.posQuatInterval(1, Point3(-5, 9, self.getHeight() - 0.5), Point3(-150, -2, 0), other=self, blendType='easeOut', name=self.uniqueName('lerpCamera')) self.lerpCameraSeq.start() self.setChatAbsolute(TTLocalizer.STOREOWNER_GREETING, CFSpeech | CFTimeout) if self.isLocalToon: diff --git a/toontown/toon/DistributedNPCPetclerk.py b/toontown/toon/DistributedNPCPetclerk.py index fe263c6..feefeb8 100644 --- a/toontown/toon/DistributedNPCPetclerk.py +++ b/toontown/toon/DistributedNPCPetclerk.py @@ -20,12 +20,15 @@ class DistributedNPCPetclerk(DistributedNPCToonBase): self.petshopGui = None self.petSeeds = None self.waitingForPetSeeds = False + self.lerpCameraSeq = None return def disable(self): self.ignoreAll() taskMgr.remove(self.uniqueName('popupPetshopGUI')) - taskMgr.remove(self.uniqueName('lerpCamera')) + if self.lerpCameraSeq: + self.lerpCameraSeq.finish() + self.lerpCameraSeq = None if self.popupInfo: self.popupInfo.destroy() self.popupInfo = None @@ -79,7 +82,9 @@ class DistributedNPCPetclerk(DistributedNPCToonBase): def resetPetshopClerk(self): self.ignoreAll() taskMgr.remove(self.uniqueName('popupPetshopGUI')) - taskMgr.remove(self.uniqueName('lerpCamera')) + if self.lerpCameraSeq: + self.lerpCameraSeq.finish() + self.lerpCameraSeq = None if self.petshopGui: self.petshopGui.destroy() self.petshopGui = None @@ -112,7 +117,9 @@ class DistributedNPCPetclerk(DistributedNPCToonBase): if mode == NPCToons.SELL_MOVIE_CLEAR: return if mode == NPCToons.SELL_MOVIE_TIMEOUT: - taskMgr.remove(self.uniqueName('lerpCamera')) + if self.lerpCameraSeq: + self.lerpCameraSeq.finish() + self.lerpCameraSeq = None if self.isLocalToon: self.ignoreEventDict() if self.popupInfo: @@ -132,7 +139,8 @@ class DistributedNPCPetclerk(DistributedNPCToonBase): self.setupAvatars(self.av) if self.isLocalToon: 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: taskMgr.doMethodLater(1.0, self.popupPetshopGUI, self.uniqueName('popupPetshopGUI')) elif mode == NPCToons.SELL_MOVIE_COMPLETE: diff --git a/toontown/toon/DistributedNPCTailor.py b/toontown/toon/DistributedNPCTailor.py index 34ceab1..7ddeb67 100644 --- a/toontown/toon/DistributedNPCTailor.py +++ b/toontown/toon/DistributedNPCTailor.py @@ -21,12 +21,15 @@ class DistributedNPCTailor(DistributedNPCToonBase): self.roomAvailable = 0 self.button = None self.popupInfo = None + self.lerpCameraSeq = None return def disable(self): self.ignoreAll() taskMgr.remove(self.uniqueName('popupPurchaseGUI')) - taskMgr.remove(self.uniqueName('lerpCamera')) + if self.lerpCameraSeq: + self.lerpCameraSeq.finish() + self.lerpCameraSeq = None if self.clothesGUI: self.clothesGUI.exit() self.clothesGUI.unload() @@ -61,7 +64,9 @@ class DistributedNPCTailor(DistributedNPCToonBase): def resetTailor(self): self.ignoreAll() taskMgr.remove(self.uniqueName('popupPurchaseGUI')) - taskMgr.remove(self.uniqueName('lerpCamera')) + if self.lerpCameraSeq: + self.lerpCameraSeq.finish() + self.lerpCameraSeq = None if self.clothesGUI: self.clothesGUI.hideButtons() self.clothesGUI.exit() @@ -91,7 +96,9 @@ class DistributedNPCTailor(DistributedNPCToonBase): if mode == NPCToons.PURCHASE_MOVIE_CLEAR: return if mode == NPCToons.PURCHASE_MOVIE_TIMEOUT: - taskMgr.remove(self.uniqueName('lerpCamera')) + if self.lerpCameraSeq: + self.lerpCameraSeq.finish() + self.lerpCameraSeq = None if self.isLocalToon: self.ignore(self.purchaseDoneEvent) self.ignore(self.swapEvent) @@ -124,7 +131,8 @@ class DistributedNPCTailor(DistributedNPCToonBase): self.setupAvatars(self.av) if self.isLocalToon: camera.wrtReparentTo(render) - camera.lerpPosHpr(-5, 9, self.getHeight() - 0.5, -150, -2, 0, 1, other=self, blendType='easeOut', task=self.uniqueName('lerpCamera')) + self.lerpCameraSeq = camera.posQuatInterval(1, Point3(-5, 9, self.getHeight() - 0.5), Point3(-150, -2, 0), other=self, blendType='easeOut', name=self.uniqueName('lerpCamera')) + self.lerpCameraSeq.start() if self.browsing == 0: if self.roomAvailable == 0: self.setChatAbsolute(TTLocalizer.STOREOWNER_NOROOM, CFSpeech | CFTimeout)