Ignore:
Timestamp:
08/06/10 08:45:53 (9 years ago)
Author:
beliar
Message:

Patch by Beliar.

  • Added SettingsVersion? to settings. This contains the version (currently a date of the last change) of the settings. The version will be checked with the version in settings-dist.xml and if the versions don't match the settings.xml file will be renamed to settings-old.xml. The version string has to be set manually when editing settings-dist.xml.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/game/scripts/objects/actors.py

    r623 r627  
    1616#   along with PARPG.  If not, see <http://www.gnu.org/licenses/>. 
    1717 
     18from random import randrange 
     19 
     20 
    1821from fife import fife 
     22 
    1923from base import GameObject, Living, Scriptable, CharStats 
    20 from fife.extensions.fife_settings import Setting 
    2124from composed import CarryableItem 
    2225from scripts.inventory import Inventory 
    23 from random import randrange 
     26from scripts.common.utils import loadSettings 
    2427 
    2528"""All actors go here. Concrete classes only.""" 
     
    2730__all__ = ["PlayerCharacter", "NonPlayerCharacter",] 
    2831 
    29 TDS = Setting(app_name="PARPG", 
    30               settings_file="./settings.xml",  
    31               settings_gui_xml="") 
     32Settings = loadSettings() 
     33 
    3234_AGENT_STATE_NONE, _AGENT_STATE_IDLE, _AGENT_STATE_APPROACH, _AGENT_STATE_RUN, _AGENT_STATE_WANDER, _AGENT_STATE_TALK = xrange(6) 
    3335 
     
    5153        self.state = _AGENT_STATE_NONE 
    5254        # TODO: rework/improve 
    53         self.speed = TDS.get("PARPG", "PCSpeed")-1 
     55        self.speed = Settings.get("PARPG", "PCSpeed")-1 
    5456         
    5557    def getX(self): 
     
    8991        self.idle_counter = 1 
    9092        # TODO: rework/improve 
    91         self.speed = TDS.get("PARPG", "PCSpeed") 
     93        self.speed = Settings.get("PARPG", "PCSpeed") 
    9294        self.nextAction = None 
    9395        self.agent = None 
Note: See TracChangeset for help on using the changeset viewer.