From da0366d02a5a4ed172a27832be14081feb2279ca Mon Sep 17 00:00:00 2001 From: John Date: Wed, 12 Aug 2015 14:39:31 +0300 Subject: [PATCH] TV proper loop --- toontown/estate/DistributedTV.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/toontown/estate/DistributedTV.py b/toontown/estate/DistributedTV.py index 97d10d71..c15be8d1 100644 --- a/toontown/estate/DistributedTV.py +++ b/toontown/estate/DistributedTV.py @@ -84,14 +84,21 @@ class DistributedTV(DistributedFurnitureItem): base.localAvatar.setSystemMessage(0, TTLocalizer.TVUnknownVideoPack % pack if pack else TTLocalizer.TVUnknownVideo) self.resetScreen() return - + + start = time.time() - startTime movie = loader.loadTexture(video) self.sound = loader.loadSfx(video) + length = self.sound.length() + + if start >= length: + start -= int(start / length) * length + movie.synchronizeTo(self.sound) self.screen.setColor(1, 1, 1, 1) self.screen.setTexture(movie) self.screen.setTexScale(TextureStage.getDefault(), movie.getTexScale()) - self.sound.setTime(min(self.sound.length(), int(time.time() - startTime))) + self.sound.setTime(start) + self.sound.setLoop(True) self.sound.play() def __enterSphere(self, collisionEntry):