2019-11-02 17:27:54 -05:00
|
|
|
from direct.directnotify import DirectNotifyGlobal
|
|
|
|
from direct.distributed.ClockDelta import *
|
|
|
|
from direct.interval.IntervalGlobal import *
|
2019-12-30 00:07:56 -06:00
|
|
|
from . import HolidayDecorator
|
2019-11-02 17:27:54 -05:00
|
|
|
from toontown.toonbase import ToontownGlobals
|
2022-12-16 18:40:57 -06:00
|
|
|
from panda3d.core import Vec4, CSDefault, TransformState, NodePath, TransparencyAttrib
|
2021-07-08 11:52:31 -05:00
|
|
|
from panda3d.toontown import loadDNAFile
|
2019-11-02 17:27:54 -05:00
|
|
|
from toontown.hood import GSHood
|
|
|
|
|
|
|
|
class CrashedLeaderBoardDecorator(HolidayDecorator.HolidayDecorator):
|
|
|
|
notify = DirectNotifyGlobal.directNotify.newCategory('CrashedLeaderBoardDecorator')
|
|
|
|
|
|
|
|
def __init__(self):
|
|
|
|
HolidayDecorator.HolidayDecorator.__init__(self)
|
|
|
|
|
|
|
|
def decorate(self):
|
|
|
|
self.updateHoodDNAStore()
|
|
|
|
self.swapIval = self.getSwapVisibleIval()
|
|
|
|
if self.swapIval:
|
|
|
|
self.swapIval.start()
|
|
|
|
holidayIds = base.cr.newsManager.getDecorationHolidayId()
|
|
|
|
if ToontownGlobals.CRASHED_LEADERBOARD not in holidayIds:
|
|
|
|
return
|
|
|
|
if base.config.GetBool('want-crashedLeaderBoard-Smoke', 1):
|
|
|
|
self.startSmokeEffect()
|
|
|
|
|
|
|
|
def startSmokeEffect(self):
|
|
|
|
if isinstance(base.cr.playGame.getPlace().loader.hood, GSHood.GSHood):
|
|
|
|
base.cr.playGame.getPlace().loader.startSmokeEffect()
|
|
|
|
|
|
|
|
def stopSmokeEffect(self):
|
|
|
|
if isinstance(base.cr.playGame.getPlace().loader.hood, GSHood.GSHood):
|
|
|
|
base.cr.playGame.getPlace().loader.stopSmokeEffect()
|
|
|
|
|
|
|
|
def undecorate(self):
|
|
|
|
if base.config.GetBool('want-crashedLeaderBoard-Smoke', 1):
|
|
|
|
self.stopSmokeEffect()
|
|
|
|
holidayIds = base.cr.newsManager.getDecorationHolidayId()
|
|
|
|
if len(holidayIds) > 0:
|
|
|
|
self.decorate()
|
|
|
|
return
|
|
|
|
storageFile = base.cr.playGame.hood.storageDNAFile
|
|
|
|
if storageFile:
|
|
|
|
loadDNAFile(self.dnaStore, storageFile, CSDefault)
|
|
|
|
self.swapIval = self.getSwapVisibleIval()
|
|
|
|
if self.swapIval:
|
|
|
|
self.swapIval.start()
|