Add teleport transition toggle button

This commit is contained in:
John 2015-08-01 23:19:18 +03:00
parent 5fb794cf41
commit ab5ae94e17
4 changed files with 20 additions and 3 deletions

View file

@ -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']

View file

@ -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)

View file

@ -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:'

View file

@ -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