Misc Fixes (prepare your asshole for daniels commits)

This commit is contained in:
Loudrob 2015-06-17 11:24:52 -04:00
parent 8c37436706
commit b05d274158
6 changed files with 52 additions and 32 deletions

View file

@ -706,7 +706,6 @@ class ExtraOptionsTabPage(DirectFrame):
def __init__(self, parent = aspect2d): def __init__(self, parent = aspect2d):
self.parent = parent self.parent = parent
self.currentSizeIndex = None self.currentSizeIndex = None
self.dialog = None
DirectFrame.__init__(self, parent=self.parent, relief=None, pos=(0.0, 0.0, 0.0), scale=(1.0, 1.0, 1.0)) DirectFrame.__init__(self, parent=self.parent, relief=None, pos=(0.0, 0.0, 0.0), scale=(1.0, 1.0, 1.0))
@ -714,16 +713,10 @@ class ExtraOptionsTabPage(DirectFrame):
def destroy(self): def destroy(self):
self.parent = None self.parent = None
if self.dialog:
self.dialog.destroy()
del self.dialog
DirectFrame.destroy(self) DirectFrame.destroy(self)
def load(self): def load(self):
guiButton = loader.loadModel('phase_3/models/gui/quit_button') guiButton = loader.loadModel('phase_3/models/gui/quit_button')
gui = loader.loadModel('phase_3.5/models/gui/friendslist_gui')
titleHeight = 0.61 titleHeight = 0.61
textStartHeight = 0.45 textStartHeight = 0.45
textRowHeight = 0.145 textRowHeight = 0.145
@ -734,34 +727,49 @@ class ExtraOptionsTabPage(DirectFrame):
button_textpos = (0, -0.02) button_textpos = (0, -0.02)
options_text_scale = 0.052 options_text_scale = 0.052
disabled_arrow_color = Vec4(0.6, 0.6, 0.6, 1.0) disabled_arrow_color = Vec4(0.6, 0.6, 0.6, 1.0)
button_image = (guiButton.find('**/QuitBtn_UP'), guiButton.find('**/QuitBtn_DN'), guiButton.find('**/QuitBtn_RLVR'))
self.speed_chat_scale = 0.055 self.speed_chat_scale = 0.055
self.cogLevel_toggleButton = DirectButton(parent=self, relief=None, image=(guiButton.find('**/QuitBtn_UP'), guiButton.find('**/QuitBtn_DN'), guiButton.find('**/QuitBtn_RLVR')), image_scale=button_image_scale, text='', text_scale=options_text_scale, text_pos=button_textpos, pos=(buttonbase_xcoord, 0.0, buttonbase_ycoord), command=self.__doToggleCogLevelGui) 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))
self.cogLevel_label = DirectLabel(parent=self, relief=None, text='', text_align=TextNode.ALeft, text_scale=options_text_scale, text_wordwrap=16, pos=(leftMargin, 0, textStartHeight)) 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 - textRowHeight))
self.bugReportButton = DirectButton(parent=self, relief=None, text=TTLocalizer.BugReportButton, image=(guiButton.find('**/QuitBtn_UP'), guiButton.find('**/QuitBtn_DN'), guiButton.find('**/QuitBtn_RLVR')), image_scale=button_image_scale, text_pos=(0, -0.01), text_fg=(0, 0, 0, 1), 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 - 2 * textRowHeight))
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), 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 - 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 - 2 * textRowHeight), command=self.__doToggleCogInterface)
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)) command=self.showReportNotice, pos=(0.0, 0.0, -0.6), text_scale=(0.045))
gui.removeNode()
guiButton.removeNode() guiButton.removeNode()
def enter(self): def enter(self):
self.show() self.show()
self.settingsChanged = 0 self.settingsChanged = 0
self.__setCogLevelGuiButton() self.__setSpeedchatPlusButton()
self.__setTrueFriendsButton()
self.__setCogInterfaceButton()
def exit(self): def exit(self):
self.ignore('confirmDone') self.ignore('confirmDone')
self.destroyReportNotice()
self.hide() self.hide()
def unload(self): def unload(self):
self.cogLevel_label.destroy() self.speedchatPlus_label.destroy()
del self.cogLevel_label del self.speedchatPlus_label
self.cogLevel_toggleButton.destroy() self.trueFriends_label.destroy()
del self.cogLevel_toggleButton del self.trueFriends_label
self.cogInterface_label.destroy()
del self.cogInterface_label
self.cogInterface_toggleButton.destroy()
del self.cogInterface_toggleButton
def __doToggleCogLevelGui(self): def __doToggleCogInterface(self):
messenger.send('wakeup') messenger.send('wakeup')
settings['cogLevel'] = not settings['cogLevel'] settings['cogInterface'] = not settings['cogInterface']
self.settingsChanged = 1 self.settingsChanged = 1
self.__setCogLevelGuiButton() self.__setCogInterfaceButton()
def __setCogInterfaceButton(self):
self.cogInterface_label['text'] = TTLocalizer.CogInterfaceLabelOn if settings['cogInterface'] else TTLocalizer.CogInterfaceLabelOff
self.cogInterface_toggleButton['text'] = TTLocalizer.OptionsPageToggleOff if settings['cogInterface'] else TTLocalizer.OptionsPageToggleOn
def __doToggleSpeedchatPlus(self): def __doToggleSpeedchatPlus(self):
messenger.send('wakeup') messenger.send('wakeup')
@ -770,10 +778,6 @@ class ExtraOptionsTabPage(DirectFrame):
self.settingsChanged = 1 self.settingsChanged = 1
self.__setSpeedchatPlusButton() self.__setSpeedchatPlusButton()
def __setCogLevelGuiButton(self):
self.cogLevel_label['text'] = TTLocalizer.CogLevelLabelOn if settings['cogLevel'] else TTLocalizer.CogLevelLabelOff
self.cogLevel_toggleButton['text'] = TTLocalizer.OptionsPageToggleOff if settings['cogLevel'] else TTLocalizer.OptionsPageToggleOn
def __setSpeedchatPlusButton(self): def __setSpeedchatPlusButton(self):
self.speedchatPlus_label['text'] = TTLocalizer.SpeedchatPlusLabelOn if settings['speedchatPlus'] else TTLocalizer.SpeedchatPlusLabelOff self.speedchatPlus_label['text'] = TTLocalizer.SpeedchatPlusLabelOn if settings['speedchatPlus'] else TTLocalizer.SpeedchatPlusLabelOff
self.speedchatPlus_toggleButton['text'] = TTLocalizer.OptionsPageToggleOff if settings['speedchatPlus'] else TTLocalizer.OptionsPageToggleOn self.speedchatPlus_toggleButton['text'] = TTLocalizer.OptionsPageToggleOff if settings['speedchatPlus'] else TTLocalizer.OptionsPageToggleOn
@ -789,12 +793,18 @@ class ExtraOptionsTabPage(DirectFrame):
self.trueFriends_label['text'] = TTLocalizer.TrueFriendsLabelOn if settings['trueFriends'] else TTLocalizer.TrueFriendsLabelOff self.trueFriends_label['text'] = TTLocalizer.TrueFriendsLabelOn if settings['trueFriends'] else TTLocalizer.TrueFriendsLabelOff
self.trueFriends_toggleButton['text'] = TTLocalizer.OptionsPageToggleOff if settings['trueFriends'] else TTLocalizer.OptionsPageToggleOn self.trueFriends_toggleButton['text'] = TTLocalizer.OptionsPageToggleOff if settings['trueFriends'] else TTLocalizer.OptionsPageToggleOn
def destroyReportNotice(self):
if hasattr(self, 'dialog'):
self.dialog.destroy()
del self.dialog
def showReportNotice(self): def showReportNotice(self):
self.destroyReportNotice()
self.dialog = TTDialog.TTDialog(style=TTDialog.YesNo, text=TTLocalizer.BugReportNotice, command=self.confirmBugReport) self.dialog = TTDialog.TTDialog(style=TTDialog.YesNo, text=TTLocalizer.BugReportNotice, command=self.confirmBugReport)
self.dialog.show() self.dialog.show()
def confirmBugReport(self, value): def confirmBugReport(self, value):
self.destroyReportNotice()
if value > 0: if value > 0:
webbrowser.open(ToontownGlobals.BugReportSite, new=2, autoraise=True) webbrowser.open(ToontownGlobals.BugReportSite, new=2, autoraise=True)
self.dialog.destroy()

View file

@ -219,7 +219,6 @@ class ToonAvatarPanel(AvatarPanelBase.AvatarPanelBase):
command=self.handleReport) command=self.handleReport)
if avatar.isAdmin(): if avatar.isAdmin():
self.trueFriendsButton['state'] = DGG.DISABLED
self.ignoreButton['state'] = DGG.DISABLED self.ignoreButton['state'] = DGG.DISABLED
self.reportButton['state'] = DGG.DISABLED self.reportButton['state'] = DGG.DISABLED
elif base.localAvatar.isIgnored(self.avId): elif base.localAvatar.isIgnored(self.avId):

View file

@ -92,8 +92,8 @@ if 'toonChatSounds' not in settings:
settings['toonChatSounds'] = True settings['toonChatSounds'] = True
if 'language' not in settings: if 'language' not in settings:
settings['language'] = 'English' settings['language'] = 'English'
if 'cogLevel' not in settings: if 'cogInterface' not in settings:
settings['cogLevel'] = True settings['cogInterface'] = True
if 'speedchatPlus' not in settings: if 'speedchatPlus' not in settings:
settings['speedchatPlus'] = True settings['speedchatPlus'] = True
if 'trueFriends' not in settings: if 'trueFriends' not in settings:

View file

@ -8481,3 +8481,13 @@ def convertSecondsToDate(seconds):
return '%d:%02d:%02d' % (h, m, s) return '%d:%02d:%02d' % (h, m, s)
ToonDefeatedMessage = '%s was defeated!' ToonDefeatedMessage = '%s was defeated!'
BugReportButton = 'Report a Bug'
BugReportNotice = 'Attention!\n\nThis button will open a browser which will send you to a third party bug tracker website. This site requires an Ubuntu One account to login. It may ask you to create an account.\n\nAre you sure you want to continue?'
CodeRedemptionWarning = 'NOTICE: All codes can only be entered once!'
CogInterfaceLabelOn = 'The cog battle interface is on.'
CogInterfaceLabelOff = 'The cog battle interface is off.'
SpeedchatPlusLabelOn = 'Speedchat Plus is on.'
SpeedchatPlusLabelOff = 'Speedchat Plus is off.'
TrueFriendsLabelOn = 'True Friends is on.'
TrueFriendsLabelOff = 'True Friends is off.'

View file

@ -145,6 +145,7 @@ class ToonBase(OTPBase.OTPBase):
self.localAvatarStyle = None self.localAvatarStyle = None
self.filters = CommonFilters(self.win, self.cam) self.filters = CommonFilters(self.win, self.cam)
self.wantCogInterface = settings.get('cogInterface', True)
def openMainWindow(self, *args, **kw): def openMainWindow(self, *args, **kw):
result = OTPBase.OTPBase.openMainWindow(self, *args, **kw) result = OTPBase.OTPBase.openMainWindow(self, *args, **kw)

View file

@ -368,7 +368,7 @@ class TownBattle(StateData.StateData):
def exitOff(self): def exitOff(self):
if self.isLoaded: if self.isLoaded:
self.__enterPanels(self.numToons, self.localNum) self.__enterPanels(self.numToons, self.localNum)
if settings['cogLevel']: if settings['cogInterface']:
self.__enterCogPanels(self.numCogs) self.__enterCogPanels(self.numCogs)
self.timer.show() self.timer.show()
self.track = -1 self.track = -1
@ -516,7 +516,7 @@ class TownBattle(StateData.StateData):
for i in xrange(len(toons)): for i in xrange(len(toons)):
self.toonPanels[i].setLaffMeter(toons[i]) self.toonPanels[i].setLaffMeter(toons[i])
if settings['cogLevel']: if settings['cogInterface']:
self.__enterCogPanels(self.numCogs) self.__enterCogPanels(self.numCogs)
for i in xrange(len(cogs)): for i in xrange(len(cogs)):
self.cogPanels[i].setSuit(cogs[i]) self.cogPanels[i].setSuit(cogs[i])