comparison gamemodel.py @ 167:b3b82c2aebee

Using fife settings module again instead of our own.
author Beliar <KarstenBock@gmx.net>
date Mon, 20 Feb 2012 16:50:10 +0100
parents d224bbce512a
children 0296f5f74a0f
comparison
equal deleted inserted replaced
166:a6bbb732b27b 167:b3b82c2aebee
66 self.settings = settings 66 self.settings = settings
67 67
68 self.map_change = False 68 self.map_change = False
69 self.load_saver = False 69 self.load_saver = False
70 self.savegame = None 70 self.savegame = None
71 quests_directory = settings.parpg.QuestsPath 71 quests_directory = settings.get("parpg", "QuestsPath")
72 self.game_state = GameState(quests_dir=quests_directory) 72 self.game_state = GameState(quests_dir=quests_directory)
73 #self.game_state.quest_engine = 73 #self.game_state.quest_engine =
74 #self.game_state.quest_engine.readQuests() 74 #self.game_state.quest_engine.readQuests()
75 self.pc_run = 1 75 self.pc_run = 1
76 self.target_position = None 76 self.target_position = None
83 self.items = {} 83 self.items = {}
84 self.engine = engine 84 self.engine = engine
85 self.fife_model = engine.getModel() 85 self.fife_model = engine.getModel()
86 86
87 # set values from settings 87 # set values from settings
88 maps_directory = settings.parpg.MapsPath 88 maps_directory = settings.get("parpg", "MapsPath")
89 self.game_state.maps_file = '/'.join([maps_directory, 89 self.game_state.maps_file = '/'.join([maps_directory,
90 settings.parpg.MapsFile]) 90 settings.get("parpg", "MapsFile")])
91 self.all_agents_file = '/'.join([maps_directory, 91 self.all_agents_file = '/'.join([maps_directory,
92 settings.parpg.AllAgentsFile]) 92 settings.get("parpg", "AllAgentsFile")])
93 objects_directory = self.settings.parpg.ObjectsPath 93 objects_directory = self.settings.get("parpg", "ObjectsPath")
94 self.objects_directory = objects_directory 94 self.objects_directory = objects_directory
95 self.object_db_file = '/'.join([objects_directory, 95 self.object_db_file = '/'.join([objects_directory,
96 settings.parpg.ObjectDatabaseFile]) 96 settings.get("parpg", "ObjectDatabaseFile")])
97 self.dialogue_directory = settings.parpg.DialoguesPath 97 self.dialogue_directory = settings.get("parpg", "DialoguesPath")
98 self.dialogues = {} 98 self.dialogues = {}
99 self.agent_import_files = {} 99 self.agent_import_files = {}
100 self.obj_loader = XMLObjectLoader(self.engine) 100 self.obj_loader = XMLObjectLoader(self.engine)
101 # FIXME M. George Hansen 2011-06-06: character stats scripts aren't 101 # FIXME M. George Hansen 2011-06-06: character stats scripts aren't
102 # finished, unfortunately. 102 # finished, unfortunately.
701 obj.fifeagent.gfx = ref.gfx 701 obj.fifeagent.gfx = ref.gfx
702 702
703 if obj.fifeagent.behaviour: 703 if obj.fifeagent.behaviour:
704 obj.fifeagent.behaviour.parent = obj 704 obj.fifeagent.behaviour.parent = obj
705 fifeagent.setup_behaviour(obj.fifeagent) 705 fifeagent.setup_behaviour(obj.fifeagent)
706 obj.fifeagent.behaviour.speed = self.settings.parpg.PCSpeed 706 obj.fifeagent.behaviour.speed = self.settings.get("parpg", "PCSpeed")
707 #Start the behaviour 707 #Start the behaviour
708 obj.fifeagent.behaviour.idle() 708 obj.fifeagent.behaviour.idle()
709 # create the agent 709 # create the agent
710 #obj.setup() 710 #obj.setup()
711 #obj.behaviour.speed = self.settings.parpg.PCSpeed 711 #obj.behaviour.speed = self.settings.parpg.PCSpeed