Ignore:
Timestamp:
03/01/11 21:31:17 (8 years ago)
Author:
aspidites
Message:

Patch by Aspidites

+ added new module to gui package called menus
+ moved context_menu class to this module
+ added SettingsMenu? class to this module

  • removed all references to settings_menu from hud and mainmenuview modules, replacing with SettingsMenu? instance + all controls in the in game settings menu are functional now.
Location:
branches/active/character_customization/game/parpg
Files:
1 added
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • branches/active/character_customization/game/parpg/gui/hud.py

    r765 r767  
    1919 
    2020from parpg.gui.filebrowser import FileBrowser 
    21 from parpg.gui.context_menu import ContextMenu 
     21from parpg.gui.menus import ContextMenu, SettingsMenu 
    2222from parpg.gui import inventorygui 
    2323from parpg.gui.popups import ExaminePopup 
     
    178178           @return: None""" 
    179179        self.context_menu = ContextMenu (self.engine, [], (0, 0)) 
    180         self.context_menu.hide() 
    181180 
    182181    def showContextMenu(self, data, pos): 
     
    188187           @return: None""" 
    189188        self.context_menu = ContextMenu(self.engine, data, pos) 
     189        self.context_menu.show() 
    190190 
    191191    def hideContextMenu(self): 
     
    226226        self.enabled = True 
    227227 
    228     def initializeSettingsMenu(self, refresh=False): 
    229         if not refresh: 
    230             self.settings_menu = pychan.loadXML("gui/settings_menu.xml") 
    231             events = {'okButton': self.saveSettings, 
    232                       'cancelButton': self.hideSettings, 
    233                       'defaultButton': self.resetSettings} 
    234             self.settings_menu.mapEvents(events) 
    235  
    236     def hideSettings(self): 
    237         self.settings_menu.hide() 
    238  
    239     def saveSettings(self): 
    240         self.settings.write() 
    241         self.settings_menu.hide() 
    242  
    243     def resetSettings(self): 
    244         settings.load(path=settings.paths[0]) 
    245         self.initializeSettingsMenu() 
     228    def initializeSettingsMenu(self): 
     229        self.settings_menu = SettingsMenu(self.settings) 
    246230 
    247231    def displaySettings(self): 
  • branches/active/character_customization/game/parpg/mainmenuview.py

    r765 r767  
    2020from viewbase import ViewBase 
    2121from parpg.gui.filebrowser import FileBrowser 
     22from parpg.gui.menus import SettingsMenu 
    2223 
    2324class MainMenuView(ViewBase): 
     
    123124        self.quit_window.show() 
    124125 
    125     def initializeSettingsMenu(self, refresh=False): 
    126         if not refresh: 
    127             self.settings_menu = pychan.loadXML("gui/settings_menu.xml") 
    128             events = {'okButton': self.saveSettings, 
    129                       'cancelButton': self.hideSettings, 
    130                       'defaultButton': self.resetSettings} 
    131             self.settings_menu.mapEvents(events) 
    132  
    133     def hideSettings(self): 
    134         self.settings_menu.hide() 
    135  
    136     def saveSettings(self): 
    137         self.model.settings.write() 
    138         self.settings_menu.hide() 
    139  
    140     def resetSettings(self): 
    141         self.model.settings.load(path=self.model.settings.paths[0]) 
    142         self.initializeSettingsMenu() 
     126    def initializeSettingsMenu(self): 
     127        self.settings_menu = SettingsMenu(self.model.settings) 
    143128 
    144129    def displaySettings(self): 
  • branches/active/character_customization/game/parpg/settings.py

    r765 r767  
    5858            @type value: int, float, string, boolean, or list 
    5959        """ 
     60 
     61        value = str(value) 
    6062        if (value.startswith("\"") and value.endswith("\"") or 
    6163            value.startswith("\'") and value.endswith("\'")): 
Note: See TracChangeset for help on using the changeset viewer.