Changeset 283


Ignore:
Timestamp:
09/16/09 02:18:07 (10 years ago)
Author:
orlandov
Message:

Ticket #96: Patch by amo-ej1 (with addition from or1andov) fixes[s:trac, t:96]

Location:
trunk/game
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/game/run.py

    r281 r283  
    114114                                                      strip=False))) 
    115115        eSet.setDefaultFontPath(str(TDS.readSetting("Font"))) 
     116        eSet.setDefaultFontSize(int(TDS.readSetting("FontSize", default=12))) 
    116117        eSet.setBitsPerPixel(int(TDS.readSetting("BitsPerPixel"))) 
    117118        eSet.setInitialVolume(float(TDS.readSetting("InitialVolume"))) 
  • trunk/game/settings-dist.xml

    r96 r283  
    1414        <Font> fonts/samanata.ttf </Font> 
    1515        <FontGlyphs> abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,!?-+/():;%&amp;`'*#=[]\"</FontGlyphs> 
     16        <FontSize>12</FontSize> 
    1617        <LogModules> controller </LogModules> 
    1718        <LogToPrompt> 0 </LogToPrompt> 
  • trunk/game/settings.py

    r147 r283  
    2929        self.changesRequireRestart = True 
    3030 
    31     def readSetting(self, name, type='int', strip=True, text=False): 
     31    def readSetting(self, name, type='int', strip=True, text=False, default=None): 
    3232        if not hasattr(self, 'tree'): 
    3333            self.tree = ET.parse('settings.xml') 
     
    6060            print 'Setting,', name, 'does not exist!' 
    6161 
     62        return default 
     63 
    6264    def setSetting(self, name, value): 
    6365        element = self.root_element.find(name) 
Note: See TracChangeset for help on using the changeset viewer.