mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2025-01-09 17:53:50 +00:00
Clean up more options page, add strings to the localizer, add new strings to the more options page, add cogLevel settings properly.
This commit is contained in:
parent
73dbf43edb
commit
b6cf9c8f22
6 changed files with 21 additions and 34 deletions
|
@ -732,8 +732,8 @@ class MoreOptionsTabPage(DirectFrame):
|
||||||
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)
|
||||||
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.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.cogLevel_label = DirectLabel(parent=self, relief=None, text='', text_align=TextNode.ALeft, text_scale=options_text_scale, text_wordwrap=16, pos=(leftMargin, 0, textStartHeight))
|
||||||
gui.removeNode()
|
gui.removeNode()
|
||||||
guiButton.removeNode()
|
guiButton.removeNode()
|
||||||
|
|
||||||
|
@ -747,36 +747,17 @@ class MoreOptionsTabPage(DirectFrame):
|
||||||
self.hide()
|
self.hide()
|
||||||
|
|
||||||
def unload(self):
|
def unload(self):
|
||||||
self.CogLevel_Label.destroy()
|
self.cogLevel_label.destroy()
|
||||||
del self.CogLevel_Label
|
del self.cogLevel_label
|
||||||
self.CogLevel_toggleButton.destroy()
|
self.cogLevel_toggleButton.destroy()
|
||||||
del self.CogLevel_toggleButton
|
del self.cogLevel_toggleButton
|
||||||
|
|
||||||
def __doToggleCogLevelGui(self):
|
def __doToggleCogLevelGui(self):
|
||||||
messenger.send('wakeup')
|
messenger.send('wakeup')
|
||||||
if base.wantCogLevelGui:
|
settings['cogLevel'] = not settings['cogLevel']
|
||||||
base.wantCogLevelGui = False
|
|
||||||
settings['want-Cog-Level-GUI'] = False
|
|
||||||
else:
|
|
||||||
base.wantCogLevelGui = True
|
|
||||||
settings['want-Cog-Level-GUI'] = True
|
|
||||||
self.settingsChanged = 1
|
self.settingsChanged = 1
|
||||||
self.__setCogLevelGuiButton()
|
self.__setCogLevelGuiButton()
|
||||||
|
|
||||||
def __setCogLevelGuiButton(self):
|
def __setCogLevelGuiButton(self):
|
||||||
if base.wantCogLevelGui:
|
self.cogLevel_label['text'] = TTLocalizer.CogLevelLabelOn if settings['cogLevel'] else TTLocalizer.CogLevelLabelOff
|
||||||
self.CogLevel_Label['text'] = 'Cog Level GUI In-Battle:'
|
self.cogLevel_toggleButton['text'] = TTLocalizer.OptionsPageToggleOff if settings['cogLevel'] else TTLocalizer.OptionsPageToggleOn
|
||||||
self.CogLevel_toggleButton['text'] = 'On'
|
|
||||||
else:
|
|
||||||
self.CogLevel_Label['text'] = 'Cog Level GUI In-Battle:'
|
|
||||||
self.CogLevel_toggleButton['text'] = 'Off'
|
|
||||||
|
|
||||||
def __doToggleAntialiasing(self):
|
|
||||||
# To toggle anti-aliasing in the future.
|
|
||||||
pass
|
|
||||||
|
|
||||||
def __setAntialiasingGuiButton(self):
|
|
||||||
# More anti-aliasing stuff.
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
|
@ -828,7 +828,7 @@ class Toon(Avatar.Avatar, ToonHead):
|
||||||
if headStyle > -1:
|
if headStyle > -1:
|
||||||
self.style.head = headStyle
|
self.style.head = headStyle
|
||||||
if laughingMan > -1:
|
if laughingMan > -1:
|
||||||
self.style.laughingMan = True if laughingMan else self.getWantLaughingMan()
|
self.style.laughingMan = True if laughingMan else self.getWantLaughingManHoliday()
|
||||||
self.generateToonHead(copy)
|
self.generateToonHead(copy)
|
||||||
self.generateToonColor()
|
self.generateToonColor()
|
||||||
self.parentToonParts()
|
self.parentToonParts()
|
||||||
|
@ -1149,7 +1149,10 @@ class Toon(Avatar.Avatar, ToonHead):
|
||||||
return self.hat
|
return self.hat
|
||||||
|
|
||||||
def getWantLaughingMan(self):
|
def getWantLaughingMan(self):
|
||||||
return self.style.laughingMan or (base.cr.newsManager and base.cr.newsManager.isHolidayRunning(ToontownGlobals.LAUGHING_MAN))
|
return self.style.laughingMan or self.getWantLaughingManHoliday()
|
||||||
|
|
||||||
|
def getWantLaughingManHoliday(self):
|
||||||
|
return base.cr.newsManager and base.cr.newsManager.isHolidayRunning(ToontownGlobals.LAUGHING_MAN)
|
||||||
|
|
||||||
def setGlasses(self, glassesIdx, textureIdx, colorIdx, fromRTM = False):
|
def setGlasses(self, glassesIdx, textureIdx, colorIdx, fromRTM = False):
|
||||||
self.glasses = (glassesIdx, textureIdx, colorIdx)
|
self.glasses = (glassesIdx, textureIdx, colorIdx)
|
||||||
|
|
|
@ -83,6 +83,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:
|
||||||
|
settings['cogLevel'] = True
|
||||||
loadPrcFileData('Settings: res', 'win-size %d %d' % tuple(settings.get('res', (800, 600))))
|
loadPrcFileData('Settings: res', 'win-size %d %d' % tuple(settings.get('res', (800, 600))))
|
||||||
loadPrcFileData('Settings: fullscreen', 'fullscreen %s' % settings['fullscreen'])
|
loadPrcFileData('Settings: fullscreen', 'fullscreen %s' % settings['fullscreen'])
|
||||||
loadPrcFileData('Settings: music', 'audio-music-active %s' % settings['music'])
|
loadPrcFileData('Settings: music', 'audio-music-active %s' % settings['music'])
|
||||||
|
@ -92,6 +94,7 @@ loadPrcFileData('Settings: sfxVol', 'audio-master-sfx-volume %s' % settings['sfx
|
||||||
loadPrcFileData('Settings: loadDisplay', 'load-display %s' % settings['loadDisplay'])
|
loadPrcFileData('Settings: loadDisplay', 'load-display %s' % settings['loadDisplay'])
|
||||||
loadPrcFileData('Settings: toonChatSounds', 'toon-chat-sounds %s' % settings['toonChatSounds'])
|
loadPrcFileData('Settings: toonChatSounds', 'toon-chat-sounds %s' % settings['toonChatSounds'])
|
||||||
loadPrcFileData('Settings: language', 'language %s' % settings['language'])
|
loadPrcFileData('Settings: language', 'language %s' % settings['language'])
|
||||||
|
loadPrcFileData('Settings: cogLevel', 'cogLevel %s' % settings['cogLevel'])
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
|
@ -8984,6 +8984,8 @@ LanguageSelectorSameLanguage = "You're already using that language!"
|
||||||
PickTrackTitle = 'Pick your third track!'
|
PickTrackTitle = 'Pick your third track!'
|
||||||
PickTrackNotice = 'Choose a track!'
|
PickTrackNotice = 'Choose a track!'
|
||||||
UnknownTrack = 'None'
|
UnknownTrack = 'None'
|
||||||
|
CogLevelLabelOn = 'The cog level GUI is on.'
|
||||||
|
CogLevelLabelOff = 'The cog level GUI is off.'
|
||||||
|
|
||||||
HouseNames = ("Bungalow", "Tiki", "Teepee", "Castle", "Cupcake", "Cabin")
|
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?"
|
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?"
|
||||||
|
|
|
@ -235,8 +235,6 @@ class ToonBase(OTPBase.OTPBase):
|
||||||
|
|
||||||
self.filters = CommonFilters(self.win, self.cam)
|
self.filters = CommonFilters(self.win, self.cam)
|
||||||
|
|
||||||
self.wantCogLevelGui = settings.get('want-Cog-Level-GUI', 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)
|
||||||
self.setCursorAndIcon()
|
self.setCursorAndIcon()
|
||||||
|
|
|
@ -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 base.wantCogLevelGui:
|
if settings['cogLevel']:
|
||||||
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 base.wantCogLevelGui:
|
if settings['cogLevel']:
|
||||||
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])
|
||||||
|
|
Loading…
Reference in a new issue