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/gamemodel.py

    r809 r810  
    5858        @return: None""" 
    5959        self.settings = settings 
    60         data_dir = self.settings.fife.SystemDataDirectory 
    6160 
    6261        self.map_change = False 
    6362        self.load_saver = False 
    6463        self.savegame = None 
    65         quests_directory = os.path.join(data_dir, 
     64        quests_directory = os.path.join(self.settings.paths['system'], 
    6665                                        self.settings.parpg.QuestsDirectory) 
    6766        self.game_state = GameState(quests_dir=quests_directory) 
     
    8079 
    8180        # set values from settings 
    82         maps_file = os.path.join(data_dir, self.settings.parpg.MapsDirectory, 
     81        maps_file = os.path.join(self.settings.paths['system'],  
     82                                 self.settings.parpg.MapsDirectory, 
    8383                                 self.settings.parpg.MapsFile) 
    8484        self.game_state.maps_file = maps_file 
    85         all_agents_file = os.path.join(data_dir,  
     85        all_agents_file = os.path.join(self.settings.paths['system'], 
    8686                                       self.settings.parpg.MapsDirectory, 
    8787                                       self.settings.parpg.AllAgentsFile) 
    8888        self.all_agents_file = all_agents_file 
    89         objects_dir = os.path.join(data_dir, 
     89        objects_dir = os.path.join(self.settings.paths['system'], 
    9090                                    self.settings.parpg.ObjectsDirectory) 
    9191        self.objects_directory = objects_dir 
     
    9393                                      self.settings.parpg.ObjectDatabaseFile) 
    9494        self.object_db_file = object_db_file 
    95         dialogues_dir = os.path.join(data_dir,  
     95        dialogues_dir = os.path.join(self.settings.paths['system'],  
    9696                                     self.settings.parpg.DialoguesDirectory) 
    9797        self.dialogues_directory = dialogues_dir 
Note: See TracChangeset for help on using the changeset viewer.