diff --git a/toontown/shtiker/DisplaySettingsDialog.py b/toontown/shtiker/DisplaySettingsDialog.py index cf0eb5b0..10aa6c5d 100644 --- a/toontown/shtiker/DisplaySettingsDialog.py +++ b/toontown/shtiker/DisplaySettingsDialog.py @@ -43,7 +43,6 @@ class DisplaySettingsDialog(DirectFrame, StateData.StateData): self.isLoaded = 1 self.anyChanged = 0 - self.apiChanged = 0 if len(base.resDict[base.nativeRatio]) > 1: # We have resolutions that match our native ratio and fit it: @@ -87,8 +86,6 @@ class DisplaySettingsDialog(DirectFrame, StateData.StateData): self.introText = DirectLabel(parent=self, relief=None, scale=TTLocalizer.DSDintroText, text=TTLocalizer.DisplaySettingsIntro, text_wordwrap=TTLocalizer.DSDintroTextWordwrap, text_align=TextNode.ALeft, pos=(-0.725, 0, 0.3)) self.introTextSimple = DirectLabel(parent=self, relief=None, scale=0.06, text=TTLocalizer.DisplaySettingsIntroSimple, text_wordwrap=25, text_align=TextNode.ALeft, pos=(-0.725, 0, 0.3)) - self.apiLabel = DirectLabel(parent=self, relief=None, scale=0.06, text=TTLocalizer.DisplaySettingsApi, text_align=TextNode.ARight, pos=(-0.08, 0, 0)) - self.apiMenu = DirectOptionMenu(parent=self, relief=DGG.RAISED, scale=0.06, items=['x'], pos=(0, 0, 0)) self.screenSizeLabel = DirectLabel(parent=self, relief=None, scale=0.06, text=TTLocalizer.DisplaySettingsResolution, text_align=TextNode.ARight, pos=(-0.08, 0, -0.1)) self.screenSizeLeftArrow = DirectButton(parent=self, relief=None, image=(gui.find('**/Horiz_Arrow_UP'), gui.find('**/Horiz_Arrow_DN'), gui.find('**/Horiz_Arrow_Rllvr'), gui.find('**/Horiz_Arrow_UP')), scale=(-1.0, 1.0, 1.0), pos=(0.04, 0, -0.085), command=self.__doScreenSizeLeft) self.screenSizeRightArrow = DirectButton(parent=self, relief=None, image=(gui.find('**/Horiz_Arrow_UP'), gui.find('**/Horiz_Arrow_DN'), gui.find('**/Horiz_Arrow_Rllvr'), gui.find('**/Horiz_Arrow_UP')), pos=(0.54, 0, -0.085), command=self.__doScreenSizeRight) @@ -105,7 +102,7 @@ class DisplaySettingsDialog(DirectFrame, StateData.StateData): self.hide() - def enter(self, changeDisplaySettings, changeDisplayAPI): + def enter(self, changeDisplaySettings): if self.isEntered == 1: return @@ -130,19 +127,12 @@ class DisplaySettingsDialog(DirectFrame, StateData.StateData): else: self.displayMode = self.WindowedMode - self.updateApiMenu(changeDisplaySettings, changeDisplayAPI) self.updateWindowed() self.updateScreenSize() if changeDisplaySettings: self.introText.show() self.introTextSimple.hide() - if changeDisplayAPI and len(self.apis) > 1: - self.apiLabel.show() - self.apiMenu.show() - else: - self.apiLabel.hide() - self.apiMenu.hide() self.c1b.show() self.windowedButton.show() self.c2b.show() @@ -151,8 +141,6 @@ class DisplaySettingsDialog(DirectFrame, StateData.StateData): else: self.introText.hide() self.introTextSimple.show() - self.apiLabel.hide() - self.apiMenu.hide() self.windowedButton.hide() self.fullscreenButton.hide() self.c1b.hide() @@ -160,7 +148,6 @@ class DisplaySettingsDialog(DirectFrame, StateData.StateData): self.c3b.hide() self.anyChanged = 0 - self.apiChanged = 0 self.show() @@ -177,7 +164,7 @@ class DisplaySettingsDialog(DirectFrame, StateData.StateData): self.ignoreAll() self.hide() - messenger.send(self.doneEvent, [self.anyChanged, self.apiChanged]) + messenger.send(self.doneEvent, [self.anyChanged]) def cleanupDialogs(self): if self.applyDialog is not None: @@ -193,19 +180,6 @@ class DisplaySettingsDialog(DirectFrame, StateData.StateData): self.revertDialog.cleanup() self.revertDialog = None - def updateApiMenu(self, changeDisplaySettings, changeDisplayAPI): - self.apis = [] - self.apiPipes = [] - if changeDisplayAPI: - base.makeAllPipes() - for pipe in base.pipeList: - if pipe.isValid(): - self.apiPipes.append(pipe) - self.apis.append(pipe.getInterfaceName()) - - self.apiMenu['items'] = self.apis - self.apiMenu.set(base.pipe.getInterfaceName()) - def updateWindowed(self): if self.displayMode == self.FullscreenMode: self.windowedButton['indicatorValue'] = 0 @@ -275,15 +249,13 @@ class DisplaySettingsDialog(DirectFrame, StateData.StateData): base.transitions.fadeScreen(0.5) if command != DGG.DIALOG_OK: return - self.origPipe = base.pipe self.origProperties = base.win.getProperties() - pipe = self.apiPipes[self.apiMenu.selectedIndex] properties = WindowProperties() xSize, ySize = self.screenSizes[self.screenSizeIndex] properties.setSize(xSize, ySize) properties.setFullscreen(self.displayMode == self.FullscreenMode) fullscreen = self.displayMode == self.FullscreenMode - if not self.changeDisplayProperties(pipe, xSize, ySize, fullscreen): + if not self.changeDisplayProperties(xSize, ySize, fullscreen): self.__revertBack(1) return self.clearBin() @@ -293,12 +265,11 @@ class DisplaySettingsDialog(DirectFrame, StateData.StateData): self.timeoutStart = None taskMgr.add(self.__timeoutCountdown, self.TimeoutCountdownTask) - def changeDisplayProperties(self, pipe, width, height, fullscreen = False): + def changeDisplayProperties(self, width, height, fullscreen = False): result = False - self.current_pipe = base.pipe self.current_properties = WindowProperties(base.win.getProperties()) properties = self.current_properties - if self.current_pipe == pipe and self.current_properties.getFullscreen() == fullscreen and self.current_properties.getXSize() == width and self.current_properties.getYSize() == height: + if self.current_properties.getFullscreen() == fullscreen and self.current_properties.getXSize() == width and self.current_properties.getYSize() == height: self.notify.info('DISPLAY NO CHANGE REQUIRED') state = True else: @@ -322,7 +293,7 @@ class DisplaySettingsDialog(DirectFrame, StateData.StateData): properties.setFullscreen(fullscreen) properties.setParentWindow(0) original_sort = base.win.getSort() - if self.resetDisplayProperties(pipe, properties): + if self.resetDisplayProperties(properties): properties = base.win.getProperties() if properties.getFullscreen() == fullscreen and properties.getXSize() == width and properties.getYSize() == height: self.notify.info('DISPLAY CHANGE VERIFIED') @@ -362,7 +333,7 @@ class DisplaySettingsDialog(DirectFrame, StateData.StateData): self.__revertBack(0) def __revertBack(self, reason): - if not self.resetDisplayProperties(self.origPipe, self.origProperties): + if not self.resetDisplayProperties(self.origProperties): self.notify.warning("Couldn't restore original display settings!") base.panda3dRenderError() self.clearBin() @@ -382,7 +353,7 @@ class DisplaySettingsDialog(DirectFrame, StateData.StateData): def __cancel(self): self.exit() - def resetDisplayProperties(self, pipe, properties): + def resetDisplayProperties(self, properties): if base.win: currentProperties = base.win.getProperties() gsg = base.win.getGsg() @@ -391,13 +362,9 @@ class DisplaySettingsDialog(DirectFrame, StateData.StateData): gsg = None newProperties = WindowProperties(currentProperties) newProperties.addProperties(properties) - if base.pipe != pipe: - self.apiChanged = 1 - gsg = None if gsg == None or currentProperties.getFullscreen() != newProperties.getFullscreen() or currentProperties.getParentWindow() != newProperties.getParentWindow(): self.notify.debug('window properties: %s' % properties) self.notify.debug('gsg: %s' % gsg) - base.pipe = pipe if not base.openMainWindow(props=properties, gsg=gsg, keepCamera=True): self.notify.warning('OPEN MAIN WINDOW FAILED') return 0 diff --git a/toontown/shtiker/OptionsPage.py b/toontown/shtiker/OptionsPage.py index 6ab80ebd..78430dad 100644 --- a/toontown/shtiker/OptionsPage.py +++ b/toontown/shtiker/OptionsPage.py @@ -259,7 +259,6 @@ class OptionsTabPage(DirectFrame): DisplaySettingsTaskName = 'save-display-settings' DisplaySettingsDelay = 60 ChangeDisplaySettings = base.config.GetBool('change-display-settings', 1) - ChangeDisplayAPI = base.config.GetBool('change-display-api', 0) def __init__(self, parent = aspect2d): self.parent = parent @@ -279,8 +278,6 @@ class OptionsTabPage(DirectFrame): self.displaySettingsChanged = 0 self.displaySettingsSize = (None, None) self.displaySettingsFullscreen = None - self.displaySettingsApi = None - self.displaySettingsApiChanged = 0 guiButton = loader.loadModel('phase_3/models/gui/quit_button') gui = loader.loadModel('phase_3.5/models/gui/friendslist_gui') titleHeight = 0.61 @@ -293,6 +290,8 @@ class OptionsTabPage(DirectFrame): button_textpos = (0, -0.02) options_text_scale = 0.052 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')) + arrow_image = (gui.find('**/Horiz_Arrow_UP'), gui.find('**/Horiz_Arrow_DN'), gui.find('**/Horiz_Arrow_Rllvr'), gui.find('**/Horiz_Arrow_UP')) self.speed_chat_scale = 0.055 self.Music_Label = DirectLabel(parent=self, relief=None, text='', text_align=TextNode.ALeft, text_scale=options_text_scale, pos=(leftMargin, 0, textStartHeight)) self.SoundFX_Label = DirectLabel(parent=self, relief=None, text='', text_align=TextNode.ALeft, text_scale=options_text_scale, text_wordwrap=16, pos=(leftMargin, 0, textStartHeight - textRowHeight)) @@ -302,29 +301,20 @@ class OptionsTabPage(DirectFrame): self.SpeedChatStyle_Label = DirectLabel(parent=self, relief=None, text=TTLocalizer.OptionsPageSpeedChatStyleLabel, text_align=TextNode.ALeft, text_scale=options_text_scale, text_wordwrap=10, pos=(leftMargin, 0, textStartHeight - 6 * textRowHeight)) self.ToonChatSounds_Label = DirectLabel(parent=self, relief=None, text='', text_align=TextNode.ALeft, text_scale=options_text_scale, text_wordwrap=15, pos=(leftMargin, 0, textStartHeight - 2 * textRowHeight + 0.025)) self.ToonChatSounds_Label.setScale(0.9) - self.Music_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.__doToggleMusic) - self.SoundFX_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 - textRowHeight), command=self.__doToggleSfx) - self.Friends_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 - textRowHeight * 3), command=self.__doToggleAcceptFriends) - self.Whispers_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 - textRowHeight * 4), command=self.__doToggleAcceptWhispers) - self.DisplaySettingsButton = DirectButton(parent=self, relief=None, image=(guiButton.find('**/QuitBtn_UP'), guiButton.find('**/QuitBtn_DN'), guiButton.find('**/QuitBtn_RLVR')), image3_color=Vec4(0.5, 0.5, 0.5, 0.5), image_scale=button_image_scale, text=TTLocalizer.OptionsPageChange, text3_fg=(0.5, 0.5, 0.5, 0.75), text_scale=options_text_scale, text_pos=button_textpos, pos=(buttonbase_xcoord, 0.0, buttonbase_ycoord - textRowHeight * 5), command=self.__doDisplaySettings) - self.speedChatStyleLeftArrow = DirectButton(parent=self, relief=None, image=(gui.find('**/Horiz_Arrow_UP'), - gui.find('**/Horiz_Arrow_DN'), - gui.find('**/Horiz_Arrow_Rllvr'), - gui.find('**/Horiz_Arrow_UP')), image3_color=Vec4(1, 1, 1, 0.5), scale=(-1.0, 1.0, 1.0), pos=(0.25, 0, buttonbase_ycoord - textRowHeight * 6), command=self.__doSpeedChatStyleLeft) - self.speedChatStyleRightArrow = DirectButton(parent=self, relief=None, image=(gui.find('**/Horiz_Arrow_UP'), - gui.find('**/Horiz_Arrow_DN'), - gui.find('**/Horiz_Arrow_Rllvr'), - gui.find('**/Horiz_Arrow_UP')), image3_color=Vec4(1, 1, 1, 0.5), pos=(0.65, 0, buttonbase_ycoord - textRowHeight * 6), command=self.__doSpeedChatStyleRight) - self.ToonChatSounds_toggleButton = DirectButton(parent=self, relief=None, image=(guiButton.find('**/QuitBtn_UP'), - guiButton.find('**/QuitBtn_DN'), - guiButton.find('**/QuitBtn_RLVR'), - guiButton.find('**/QuitBtn_UP')), image3_color=Vec4(0.5, 0.5, 0.5, 0.5), image_scale=button_image_scale, text='', text3_fg=(0.5, 0.5, 0.5, 0.75), text_scale=options_text_scale, text_pos=button_textpos, pos=(buttonbase_xcoord, 0.0, buttonbase_ycoord - textRowHeight * 2 + 0.025), command=self.__doToggleToonChatSounds) + self.Music_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.__doToggleMusic) + self.SoundFX_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.__doToggleSfx) + self.Friends_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 * 3), command=self.__doToggleAcceptFriends) + self.Whispers_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 * 4), command=self.__doToggleAcceptWhispers) + self.DisplaySettingsButton = DirectButton(parent=self, relief=None, image=button_image, image3_color=Vec4(0.5, 0.5, 0.5, 0.5), image_scale=button_image_scale, text=TTLocalizer.OptionsPageChange, text3_fg=(0.5, 0.5, 0.5, 0.75), text_scale=options_text_scale, text_pos=button_textpos, pos=(buttonbase_xcoord, 0.0, buttonbase_ycoord - textRowHeight * 5), command=self.__doDisplaySettings) + self.speedChatStyleLeftArrow = DirectButton(parent=self, relief=None, image=arrow_image, image3_color=Vec4(1, 1, 1, 0.5), scale=(-1.0, 1.0, 1.0), pos=(0.25, 0, buttonbase_ycoord - textRowHeight * 6), command=self.__doSpeedChatStyleLeft) + self.speedChatStyleRightArrow = DirectButton(parent=self, relief=None, image=arrow_image, image3_color=Vec4(1, 1, 1, 0.5), pos=(0.65, 0, buttonbase_ycoord - textRowHeight * 6), command=self.__doSpeedChatStyleRight) + self.ToonChatSounds_toggleButton = DirectButton(parent=self, relief=None, image=button_image, image3_color=Vec4(0.5, 0.5, 0.5, 0.5), image_scale=button_image_scale, text='', text3_fg=(0.5, 0.5, 0.5, 0.75), text_scale=options_text_scale, text_pos=button_textpos, pos=(buttonbase_xcoord, 0.0, buttonbase_ycoord - textRowHeight * 2 + 0.025), command=self.__doToggleToonChatSounds) self.ToonChatSounds_toggleButton.setScale(0.8) self.speedChatStyleText = SpeedChat.SpeedChat(name='OptionsPageStyleText', structure=[2000], backgroundModelName='phase_3/models/gui/ChatPanel', guiModelName='phase_3.5/models/gui/speedChatGui') self.speedChatStyleText.setScale(self.speed_chat_scale) self.speedChatStyleText.setPos(0.37, 0, buttonbase_ycoord - textRowHeight * 6 + 0.03) self.speedChatStyleText.reparentTo(self, DGG.FOREGROUND_SORT_INDEX) - self.exitButton = DirectButton(parent=self, relief=None, image=(guiButton.find('**/QuitBtn_UP'), guiButton.find('**/QuitBtn_DN'), guiButton.find('**/QuitBtn_RLVR')), image_scale=1.15, text=TTLocalizer.OptionsPageExitToontown, text_scale=options_text_scale, text_pos=button_textpos, textMayChange=0, pos=(0.45, 0, -0.6), command=self.__handleExitShowWithConfirm) + self.exitButton = DirectButton(parent=self, relief=None, image=button_image, image_scale=1.15, text=TTLocalizer.OptionsPageExitToontown, text_scale=options_text_scale, text_pos=button_textpos, textMayChange=0, pos=(0.45, 0, -0.6), command=self.__handleExitShowWithConfirm) guiButton.removeNode() gui.removeNode() @@ -496,17 +486,15 @@ class OptionsTabPage(DirectFrame): self.displaySettings = DisplaySettingsDialog.DisplaySettingsDialog() self.displaySettings.load() self.accept(self.displaySettings.doneEvent, self.__doneDisplaySettings) - self.displaySettings.enter(self.ChangeDisplaySettings, self.ChangeDisplayAPI) + self.displaySettings.enter(self.ChangeDisplaySettings) - def __doneDisplaySettings(self, anyChanged, apiChanged): + def __doneDisplaySettings(self, anyChanged): if anyChanged: self.__setDisplaySettings() properties = base.win.getProperties() self.displaySettingsChanged = 1 self.displaySettingsSize = (properties.getXSize(), properties.getYSize()) self.displaySettingsFullscreen = properties.getFullscreen() - self.displaySettingsApi = base.pipe.getInterfaceName() - self.displaySettingsApiChanged = apiChanged def __setDisplaySettings(self): properties = base.win.getProperties() @@ -514,16 +502,7 @@ class OptionsTabPage(DirectFrame): screensize = '%s x %s' % (properties.getXSize(), properties.getYSize()) else: screensize = TTLocalizer.OptionsPageDisplayWindowed - api = base.pipe.getInterfaceName() - settings = {'screensize': screensize, - 'api': api} - if self.ChangeDisplayAPI: - OptionsPage.notify.debug('change display settings...') - text = TTLocalizer.OptionsPageDisplaySettings % settings - else: - OptionsPage.notify.debug('no change display settings...') - text = TTLocalizer.OptionsPageDisplaySettingsNoApi % settings - self.DisplaySettings_Label['text'] = text + self.DisplaySettings_Label['text'] = TTLocalizer.OptionsPageDisplaySettings % screensize def __doSpeedChatStyleLeft(self): if self.speedChatStyleIndex > 0: @@ -594,7 +573,7 @@ class CodesTabPage(DirectFrame): return def load(self): - self.notice = DirectLabel(parent=self, relief=None, text='NOTICE: All codes can only be entered once!', text_scale=0.06, pos=(0.0, 0, 0.53), text_fg=Vec4(1.0, 0, 0, 1)) + self.notice = DirectLabel(parent=self, relief=None, text=TTLocalizer.CodeRedemptionWarning, text_scale=0.06, pos=(0.0, 0, 0.53), text_fg=Vec4(1.0, 0, 0, 1)) cdrGui = loader.loadModel('phase_3.5/models/gui/tt_m_gui_sbk_codeRedemptionGui') instructionGui = cdrGui.find('**/tt_t_gui_sbk_cdrPresent') flippyGui = cdrGui.find('**/tt_t_gui_sbk_cdrFlippy') @@ -713,7 +692,6 @@ class ExtraOptionsTabPage(DirectFrame): def __init__(self, parent = aspect2d): self.parent = parent 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)) @@ -721,16 +699,10 @@ class ExtraOptionsTabPage(DirectFrame): def destroy(self): self.parent = None - - if self.dialog: - self.dialog.destroy() - - del self.dialog DirectFrame.destroy(self) def load(self): guiButton = loader.loadModel('phase_3/models/gui/quit_button') - gui = loader.loadModel('phase_3.5/models/gui/friendslist_gui') titleHeight = 0.61 textStartHeight = 0.45 textRowHeight = 0.145 @@ -741,45 +713,82 @@ class ExtraOptionsTabPage(DirectFrame): button_textpos = (0, -0.02) options_text_scale = 0.052 disabled_arrow_color = Vec4(0.6, 0.6, 0.6, 1.0) - 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.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.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), + button_image = (guiButton.find('**/QuitBtn_UP'), guiButton.find('**/QuitBtn_DN'), guiButton.find('**/QuitBtn_RLVR')) + self.speed_chat_scale = 0.055 + 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.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.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)) - gui.removeNode() guiButton.removeNode() def enter(self): self.show() self.settingsChanged = 0 - self.__setCogLevelGuiButton() + self.__setSpeedchatPlusButton() + self.__setTrueFriendsButton() + self.__setCogInterfaceButton() def exit(self): self.ignore('confirmDone') + self.destroyReportNotice() self.hide() def unload(self): - self.cogLevel_label.destroy() - del self.cogLevel_label - self.cogLevel_toggleButton.destroy() - del self.cogLevel_toggleButton + self.speedchatPlus_label.destroy() + del self.speedchatPlus_label + self.trueFriends_label.destroy() + 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') - settings['cogLevel'] = not settings['cogLevel'] + settings['cogInterface'] = not settings['cogInterface'] self.settingsChanged = 1 - self.__setCogLevelGuiButton() + self.__setCogInterfaceButton() - 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 __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): + messenger.send('wakeup') + settings['speedchatPlus'] = not settings['speedchatPlus'] + self.settingsChanged = 1 + self.__setSpeedchatPlusButton() + def __setSpeedchatPlusButton(self): + self.speedchatPlus_label['text'] = TTLocalizer.SpeedchatPlusLabelOn if settings['speedchatPlus'] else TTLocalizer.SpeedchatPlusLabelOff + self.speedchatPlus_toggleButton['text'] = TTLocalizer.OptionsPageToggleOff if settings['speedchatPlus'] else TTLocalizer.OptionsPageToggleOn + + def __doToggleTrueFriends(self): + messenger.send('wakeup') + settings['trueFriends'] = not settings['trueFriends'] + self.settingsChanged = 1 + self.__setTrueFriendsButton() + + 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 destroyReportNotice(self): + if hasattr(self, 'dialog'): + self.dialog.destroy() + del self.dialog + def showReportNotice(self): + self.destroyReportNotice() self.dialog = TTDialog.TTDialog(style=TTDialog.YesNo, text=TTLocalizer.BugReportNotice, command=self.confirmBugReport) self.dialog.show() def confirmBugReport(self, value): - if value > 0: - webbrowser.open(ToontownGlobals.BugReportSite, new=2, autoraise=True) + self.destroyReportNotice() - self.dialog.destroy() \ No newline at end of file + if value > 0: + webbrowser.open(ToontownGlobals.BugReportSite, new=2, autoraise=True) \ No newline at end of file diff --git a/toontown/toonbase/ClientStart.py b/toontown/toonbase/ClientStart.py index d6ceb630..d65c5e59 100644 --- a/toontown/toonbase/ClientStart.py +++ b/toontown/toonbase/ClientStart.py @@ -13,10 +13,8 @@ from direct.extensions_native import VBase3_extensions from direct.extensions_native import VBase4_extensions from direct.extensions_native import NodePath_extensions - from panda3d.core import loadPrcFile - if __debug__: import wx, sys from direct.stdpy import threading @@ -75,8 +73,8 @@ if 'toonChatSounds' not in settings: settings['toonChatSounds'] = True if 'language' not in settings: settings['language'] = 'English' -if 'cogLevel' not in settings: - settings['cogLevel'] = True +if 'cogInterface' not in settings: + settings['cogInterface'] = True if 'speedchatPlus' not in settings: settings['speedchatPlus'] = True if 'trueFriends' not in settings: diff --git a/toontown/toonbase/TTLocalizerEnglish.py b/toontown/toonbase/TTLocalizerEnglish.py index b4468e08..719e5e49 100644 --- a/toontown/toonbase/TTLocalizerEnglish.py +++ b/toontown/toonbase/TTLocalizerEnglish.py @@ -3793,13 +3793,11 @@ OptionsPageSelect = 'Select' OptionsPageToggleOn = 'Turn On' OptionsPageToggleOff = 'Turn Off' OptionsPageChange = 'Change' -OptionsPageDisplaySettings = 'Display: %(screensize)s, %(api)s' -OptionsPageDisplaySettingsNoApi = 'Display: %(screensize)s' +OptionsPageDisplaySettings = 'Display: %s' OptionsPageExitConfirm = 'Exit Toontown?' DisplaySettingsTitle = 'Display Settings' DisplaySettingsIntro = 'The following settings are used to configure the way Toontown is displayed on your computer. It is usually unnecessary to adjust these unless you are experiencing a problem.' DisplaySettingsIntroSimple = 'You may adjust the screen resolution to a higher value to improve the clarity of text and graphics in Toontown, but depending on your graphics card, some higher values may make the game run less smoothly or may not work at all.' -DisplaySettingsApi = 'Graphics API:' DisplaySettingsResolution = 'Resolution:' DisplaySettingsWindowed = 'In a window' DisplaySettingsFullscreen = 'Full screen' @@ -8344,13 +8342,19 @@ LanguageSelectorConfirm = 'Are you sure you want to change your language to %s? LanguageSelectorSameLanguage = "You're already using that language!" PickTrackTitle = 'Pick your third track!' PickTrackNotice = 'Choose a track!' -CogLevelLabelOn = 'The cog level GUI is on.' -CogLevelLabelOff = 'The cog level GUI is off.' +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.' HouseNames = ("Bungalow", "Tiki", "Teepee", "Castle", "Cupcake", "Cabin") CatalogPurchaseHouseType = "When you buy a new house type, the current one is replaced by it. To recover the old type, you'll need to buy it back. Continue?" 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!' + # Buffs buffIdStrings = { diff --git a/toontown/town/TownBattle.py b/toontown/town/TownBattle.py index d981f96d..481e73fa 100644 --- a/toontown/town/TownBattle.py +++ b/toontown/town/TownBattle.py @@ -368,7 +368,7 @@ class TownBattle(StateData.StateData): def exitOff(self): if self.isLoaded: self.__enterPanels(self.numToons, self.localNum) - if settings['cogLevel']: + if settings['cogInterface']: self.__enterCogPanels(self.numCogs) self.timer.show() self.track = -1 @@ -516,7 +516,7 @@ class TownBattle(StateData.StateData): for i in xrange(len(toons)): self.toonPanels[i].setLaffMeter(toons[i]) - if settings['cogLevel']: + if settings['cogInterface']: self.__enterCogPanels(self.numCogs) for i in xrange(len(cogs)): self.cogPanels[i].setSuit(cogs[i])