From ab5ae94e17326a7732e3265d98f0c2e4efca0786 Mon Sep 17 00:00:00 2001 From: John Date: Sat, 1 Aug 2015 23:19:18 +0300 Subject: [PATCH] Add teleport transition toggle button --- toontown/shtiker/OptionsPage.py | 17 +++++++++++++++-- toontown/toon/Toon.py | 2 +- toontown/toonbase/TTLocalizerEnglish.py | 2 ++ toontown/toonbase/ToontownStart.py | 2 ++ 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/toontown/shtiker/OptionsPage.py b/toontown/shtiker/OptionsPage.py index 5078d570..6da309cb 100755 --- a/toontown/shtiker/OptionsPage.py +++ b/toontown/shtiker/OptionsPage.py @@ -732,6 +732,7 @@ class ExtraOptionsTabPage(DirectFrame): self.speedchatPlus_label = DirectLabel(parent=self, relief=None, text='', text_align=TextNode.ALeft, text_scale=options_text_scale, text_wordwrap=16, pos=(leftMargin, 0, textStartHeight - textRowHeight)) self.trueFriends_label = DirectLabel(parent=self, relief=None, text='', text_align=TextNode.ALeft, text_scale=options_text_scale, text_wordwrap=16, pos=(leftMargin, 0, textStartHeight - 2 * textRowHeight)) self.cogInterface_label = DirectLabel(parent=self, relief=None, text='', text_align=TextNode.ALeft, text_scale=options_text_scale, text_wordwrap=16, pos=(leftMargin, 0, textStartHeight - 3 * textRowHeight)) + self.tpTransition_label = DirectLabel(parent=self, relief=None, text='', text_align=TextNode.ALeft, text_scale=options_text_scale, text_wordwrap=16, pos=(leftMargin, 0, textStartHeight - 4 * textRowHeight)) self.fov_slider = DirectSlider(parent=self, pos=(buttonbase_xcoord, 0.0, buttonbase_ycoord), value=settings['fov'], pageSize=5, range=(ToontownGlobals.DefaultCameraFov, ToontownGlobals.MaxCameraFov), command=self.__doFov, thumb_geom=(circleModel.find('**/tt_t_gui_mat_namePanelCircle')), thumb_relief=None, thumb_geom_scale=2) @@ -739,13 +740,14 @@ class ExtraOptionsTabPage(DirectFrame): self.speedchatPlus_toggleButton = DirectButton(parent=self, relief=None, image=button_image, image_scale=button_image_scale, text='', text_scale=options_text_scale, text_pos=button_textpos, pos=(buttonbase_xcoord, 0.0, buttonbase_ycoord - textRowHeight), command=self.__doToggleSpeedchatPlus) self.trueFriends_toggleButton = DirectButton(parent=self, relief=None, image=button_image, image_scale=button_image_scale, text='', text_scale=options_text_scale, text_pos=button_textpos, pos=(buttonbase_xcoord, 0.0, buttonbase_ycoord - 2 * textRowHeight), command=self.__doToggleTrueFriends) self.cogInterface_toggleButton = DirectButton(parent=self, relief=None, image=button_image, image_scale=button_image_scale, text='', text_scale=options_text_scale, text_pos=button_textpos, pos=(buttonbase_xcoord, 0.0, buttonbase_ycoord - 3 * textRowHeight), command=self.__doToggleCogInterface) + self.tpTransition_toggleButton = DirectButton(parent=self, relief=None, image=button_image, image_scale=button_image_scale, text='', text_scale=options_text_scale, text_pos=button_textpos, pos=(buttonbase_xcoord, 0.0, buttonbase_ycoord - 4 * textRowHeight), command=self.__doToggleTpTransition) self.bugReportButton = DirectButton(parent=self, relief=None, text=TTLocalizer.BugReportButton, image=button_image, image_scale=button_image_scale, text_pos=(0, -0.01), text_fg=(0, 0, 0, 1), command=self.showReportNotice, pos=(0.0, 0.0, -0.6), text_scale=(0.045)) guiButton.removeNode() circleModel.removeNode() - self.optionChoosers['pole'] = OptionChooser.OptionChooser(self, TTLocalizer.FishingPoleLabel, 4, self.__updateFishingPole, [False], self.__applyFishingPole) - self.optionChoosers['nametag_style'] = OptionChooser.OptionChooser(self, TTLocalizer.NametagStyleLabel, 5, self.__updateNametagStyle, [False], self.__applyNametagStyle) + self.optionChoosers['pole'] = OptionChooser.OptionChooser(self, TTLocalizer.FishingPoleLabel, 5, self.__updateFishingPole, [False], self.__applyFishingPole) + self.optionChoosers['nametag_style'] = OptionChooser.OptionChooser(self, TTLocalizer.NametagStyleLabel, 6, self.__updateNametagStyle, [False], self.__applyNametagStyle) def enter(self): self.show() @@ -753,6 +755,7 @@ class ExtraOptionsTabPage(DirectFrame): self.__setSpeedchatPlusButton() self.__setTrueFriendsButton() self.__setCogInterfaceButton() + self.__setTpTransitionButton() self.__updateNametagStyle() self.__updateFishingPole() self.accept('refreshNametagStyle', self.__updateNametagStyle) @@ -826,6 +829,16 @@ class ExtraOptionsTabPage(DirectFrame): def __setTrueFriendsButton(self): self.trueFriends_label['text'] = TTLocalizer.TrueFriendsLabelOn if settings['trueFriends'] else TTLocalizer.TrueFriendsLabelOff self.trueFriends_toggleButton['text'] = TTLocalizer.OptionsPageToggleOff if settings['trueFriends'] else TTLocalizer.OptionsPageToggleOn + + def __doToggleTpTransition(self): + messenger.send('wakeup') + settings['tpTransition'] = not settings['tpTransition'] + self.settingsChanged = 1 + self.__setTpTransitionButton() + + def __setTpTransitionButton(self): + self.tpTransition_label['text'] = TTLocalizer.TpTransitionLabelOn if settings['tpTransition'] else TTLocalizer.TpTransitionLabelOff + self.tpTransition_toggleButton['text'] = TTLocalizer.OptionsPageToggleOff if settings['tpTransition'] else TTLocalizer.OptionsPageToggleOn def __updateNametagStyle(self, resetIndex=True): chooser = self.optionChoosers['nametag_style'] diff --git a/toontown/toon/Toon.py b/toontown/toon/Toon.py index 4dcfe1e9..f61504ca 100755 --- a/toontown/toon/Toon.py +++ b/toontown/toon/Toon.py @@ -1819,7 +1819,7 @@ class Toon(Avatar.Avatar, ToonHead): self.nametag3d.setClipPlane(self.holeClipPath) avHeight = max(self.getHeight(), 3) - if self == base.localAvatar and not ZoneUtil.isDynamicZone(self.zoneId): + if self == base.localAvatar and settings['tpTransition'] and not ZoneUtil.isDynamicZone(self.zoneId): def lerpCam(task): degrees = task.time * 52.941 radians = degrees * (math.pi / 180.0) diff --git a/toontown/toonbase/TTLocalizerEnglish.py b/toontown/toonbase/TTLocalizerEnglish.py index 89d40f1d..1e573563 100755 --- a/toontown/toonbase/TTLocalizerEnglish.py +++ b/toontown/toonbase/TTLocalizerEnglish.py @@ -8505,6 +8505,8 @@ SpeedchatPlusLabelOn = 'Speedchat Plus is on.' SpeedchatPlusLabelOff = 'Speedchat Plus is off.' TrueFriendsLabelOn = 'True Friends is on.' TrueFriendsLabelOff = 'True Friends is off.' +TpTransitionLabelOn = 'The teleport transition is on.' +TpTransitionLabelOff = 'The teleport transition is off.' FieldOfViewLabel = 'Field of View:' NametagStyleLabel = 'Nametag Style:' FishingPoleLabel = 'Fishing Rod:' diff --git a/toontown/toonbase/ToontownStart.py b/toontown/toonbase/ToontownStart.py index 54403947..1b417756 100644 --- a/toontown/toonbase/ToontownStart.py +++ b/toontown/toonbase/ToontownStart.py @@ -98,6 +98,8 @@ if 'speedchatPlus' not in settings: settings['speedchatPlus'] = True if 'trueFriends' not in settings: settings['trueFriends'] = True +if 'tpTransition' not in settings: + settings['tpTransition'] = True if 'fov' not in settings: settings['fov'] = OTPGlobals.DefaultCameraFov