Changeset 487


Ignore:
Timestamp:
02/21/10 21:28:18 (10 years ago)
Author:
b0rland_parpg
Message:

Fixed the options dialog

Location:
trunk/game
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/game/scripts/gui/hud.py

    r480 r487  
    536536         
    537537        # Write all the settings to settings.xml 
    538         self.settings.tree.write('settings.xml') 
     538        self.settings.saveSettings(); 
    539539         
    540540        # If the changes require a restart, popup the dialog telling 
  • trunk/game/settings.py

    r475 r487  
    2727    def readSetting(self, name, type='int', strip=True, text=False, default=None): 
    2828        if not hasattr(self, 'tree'): 
    29             tree = ET.parse('settings.xml') 
    30             self.root_element = tree.getroot() 
     29            self.tree = ET.parse('settings.xml') 
     30            self.root_element = self.tree.getroot() 
    3131        element = self.root_element.find(name) 
    3232        if element is not None: 
     
    6464        else: 
    6565            print 'Setting,', name, 'does not exist!' 
     66             
     67    def saveSettings(self): 
     68        self.tree.write('settings.xml') 
Note: See TracChangeset for help on using the changeset viewer.