Ignore:
Timestamp:
03/09/11 05:23:21 (8 years ago)
Author:
aspidites
Message:

Patch by Aspidites

  • Removed SystemDataDirectory? and UserDataDirectory?
    • it is the the settings module's job to keep track of this sort of thing, not fife or PARPG's
    • consequently, setting.py's command line interface became simple
    • this will also prevent those "I generated a settings file but PARPG doesnt run" complaints
    • I think I'm going to have some helper methods to generate platform-specific paths at run-time
  • User data directory is now properly created
  • added platform_paths(system) which returns the platform-specific paths for the given system
  • if no system is given, it gives the paths for the system that the script was run on
  • changed logic of settings.py so that it is not required to pass a path.
  • not passing a path invokes paltform_paths
File:
1 edited

Legend:

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

    r809 r810  
    111111        """Initialise the instance. 
    112112           @return: None""" 
    113         self._setting = setting.fife 
     113        self._setting = setting 
    114114        self.engine = fife.Engine() 
    115         fonts_dir = os.path.join(self._setting.SystemDataDirectory, 
    116                                  self._setting.FontsDirectory) 
     115        fonts_dir = os.path.join(self._setting.paths['system'], 
     116                                 self._setting.fife.FontsDirectory) 
    117117        self.fonts_directory = fonts_dir 
    118118        self.loadSettings() 
     
    147147                                            self.view,  
    148148                                            self.model) 
    149         #start_map = self._setting.get("PARPG", "Map") 
     149        #start_map = self._setting.fife.get("PARPG", "Map") 
    150150        #self.model.changeMap(start_map) 
    151151 
     
    165165 
    166166        engineSetting = self.engine.getSettings() 
    167         engineSetting.setDefaultFontGlyphs(self._setting.FontGlyphs) 
     167        engineSetting.setDefaultFontGlyphs(self._setting.fife.FontGlyphs) 
    168168        engineSetting.setDefaultFontPath(os.path.join(self.fonts_directory, 
    169                                                        self._setting.Font)) 
    170         engineSetting.setDefaultFontSize(self._setting.DefaultFontSize) 
    171         engineSetting.setBitsPerPixel(self._setting.BitsPerPixel) 
    172         engineSetting.setInitialVolume(self._setting.InitialVolume) 
    173         engineSetting.setSDLRemoveFakeAlpha(self._setting.SDLRemoveFakeAlpha) 
    174         engineSetting.setScreenWidth(self._setting.ScreenWidth) 
    175         engineSetting.setScreenHeight(self._setting.ScreenHeight) 
    176         engineSetting.setRenderBackend(self._setting.RenderBackend) 
    177         engineSetting.setFullScreen(self._setting.FullScreen) 
    178         engineSetting.setVideoDriver(self._setting.VideoDriver) 
    179         engineSetting.setLightingModel(self._setting.Lighting) 
    180         engineSetting.setColorKeyEnabled(self._setting.ColorKeyEnabled) 
     169                                                       self._setting.fife.Font)) 
     170        engineSetting.setDefaultFontSize(self._setting.fife.DefaultFontSize) 
     171        engineSetting.setBitsPerPixel(self._setting.fife.BitsPerPixel) 
     172        engineSetting.setInitialVolume(self._setting.fife.InitialVolume) 
     173        engineSetting.setSDLRemoveFakeAlpha(self._setting.fife.SDLRemoveFakeAlpha) 
     174        engineSetting.setScreenWidth(self._setting.fife.ScreenWidth) 
     175        engineSetting.setScreenHeight(self._setting.fife.ScreenHeight) 
     176        engineSetting.setRenderBackend(self._setting.fife.RenderBackend) 
     177        engineSetting.setFullScreen(self._setting.fife.FullScreen) 
     178        engineSetting.setVideoDriver(self._setting.fife.VideoDriver) 
     179        engineSetting.setLightingModel(self._setting.fife.Lighting) 
     180        engineSetting.setColorKeyEnabled(self._setting.fife.ColorKeyEnabled) 
    181181 
    182182        engineSetting.setColorKey(*[int(digit)  
    183                                     for digit in self._setting.ColorKey]) 
    184  
    185         engineSetting.setWindowTitle(self._setting.WindowTitle) 
    186         engineSetting.setWindowIcon(os.path.join(self._setting.SystemDataDirectory,  
    187                                                  self._setting.IconsDirectory, 
    188                                                  self._setting.WindowIcon)) 
     183                                    for digit in self._setting.fife.ColorKey]) 
     184 
     185        engineSetting.setWindowTitle(self._setting.fife.WindowTitle) 
     186        engineSetting.setWindowIcon(os.path.join(self._setting.paths['system'],  
     187                                                 self._setting.fife.IconsDirectory, 
     188                                                 self._setting.fife.WindowIcon)) 
    189189 
    190190    def createListener(self): 
Note: See TracChangeset for help on using the changeset viewer.