diff orpg/main.py @ 26:65c5cb9be59c traipse_dev

This patch fixes the known issue with users not being able to set their name in the settings menu. This version also cleans up the themes settings in main.py and preps for Ornery Orc. Some cleaning was done with orpg_settings.py also
author sirebral
date Fri, 31 Jul 2009 00:44:10 -0500
parents 78407d627cba
children b41ea7d28a9e
line wrap: on
line diff
--- a/orpg/main.py	Thu Jul 30 00:32:05 2009 -0500
+++ b/orpg/main.py	Fri Jul 31 00:44:10 2009 -0500
@@ -216,9 +216,8 @@
         self.mainmenu = MenuBarEx(self, menu)
         if self.settings.get_setting('Heartbeat') == '1':
             self.mainmenu.SetMenuState("GameServerServerHeartbeat", True)
-        tabtheme = self.settings.get_setting('TabTheme') 
 
-        #This change is stable. TaS.
+        tabtheme = self.settings.get_setting('TabTheme')  #This change is stable. TaS.
         self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedColorful", tabtheme == 'slanted&colorful')
         self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedBlackandWhite", tabtheme == 'slanted&bw')
         self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedAqua", tabtheme == 'slanted&aqua')
@@ -239,7 +238,7 @@
         self.pluginMenu.AppendItem(item)
         self.pluginMenu.AppendSeparator()
         self.mainmenu.Insert(2, self.pluginMenu, "&Plugins")
-        self.log.log("Exit orpgFrame->build_menu()", ORPG_DEBUG)
+        self.log.log("Exit orpgFrame->build_menu()", ORPG_DEBUG)       
 
     #################################
     ## All Menu Events
@@ -247,6 +246,16 @@
     #Tab Styles Menus
     def SetTabStyles(self, *args, **kwargs):
         self.log.log("Enter orpgFrame->SetTabStyles(self, *args, **kwargs)", ORPG_DEBUG)
+
+        tabtheme = self.settings.get_setting('TabTheme')  #This change is stable. TaS.
+        self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedColorful", tabtheme == 'slanted&colorful')
+        self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedBlackandWhite", tabtheme == 'slanted&bw')
+        self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedAqua", tabtheme == 'slanted&aqua')
+        self.mainmenu.SetMenuState("OpenRPGTabStylesFlatBlackandWhite", tabtheme == 'flat&bw')
+        self.mainmenu.SetMenuState("OpenRPGTabStylesFlatAqua", tabtheme == 'flat&aqua')
+        self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedCustom", tabtheme == 'customslant')
+        self.mainmenu.SetMenuState("OpenRPGTabStylesFlatCustom", tabtheme == 'customflat')
+
         if kwargs.has_key('style'): newstyle = kwargs['style']
         else:
             try: newstyle = args[1]
@@ -263,18 +272,6 @@
         if kwargs.has_key('textColor'): textColor = kwargs['textColor']
         else: textColor = None
 
-        #Set all menu's to unchecked
-        self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedColorful", False)
-        self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedBlackandWhite", False)
-        self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedAqua", False)
-        self.mainmenu.SetMenuState("OpenRPGTabStylesSlantedCustom", False)
-        self.mainmenu.SetMenuState("OpenRPGTabStylesFlatBlackandWhite", False)
-        self.mainmenu.SetMenuState("OpenRPGTabStylesFlatAqua", False)
-        self.mainmenu.SetMenuState("OpenRPGTabStylesFlatCustom", False)
-
-        #check the proper menu
-        self.mainmenu.SetMenuState(menu, True)
-
         #Run though the current tabbed window list and remove those that have been closed
         tabbedwindows = open_rpg.get_component("tabbedWindows")
         rgbc = orpg.tools.rgbhex.RGBHex()
@@ -333,7 +330,6 @@
 
     def OnMB_OpenRPGTabStylesSlantedCustom(self):
         self.log.log("Enter orpgFrame->OnMB_OpenRPGTabStylesSlantedCustom(self)", ORPG_DEBUG)
-
         if self.mainmenu.GetMenuState("OpenRPGTabStylesSlantedCustom"):
             self.settings.set_setting('TabTheme', 'customslant')
             rgbc = orpg.tools.rgbhex.RGBHex()