Mercurial > parpg-source
comparison gui/dialoguegui.py @ 139:dd7655eee67d
Added a "model" value to the dialogues game_state, which stores the GameModel.
author | KarstenBock@gmx.net |
---|---|
date | Sun, 09 Oct 2011 14:38:54 +0200 |
parents | d0b600d7136c |
children |
comparison
equal
deleted
inserted
replaced
138:90ad38b00f13 | 139:dd7655eee67d |
---|---|
25 | 25 |
26 class DialogueGUI(object): | 26 class DialogueGUI(object): |
27 """Window that handles the dialogues.""" | 27 """Window that handles the dialogues.""" |
28 _logger = logging.getLogger('dialoguegui.DialogueGUI') | 28 _logger = logging.getLogger('dialoguegui.DialogueGUI') |
29 | 29 |
30 def __init__(self, controller, npc, quest_engine, met_fnc, meet_fnc, has_fnc, player_character): | 30 def __init__(self, controller, npc, quest_engine, met_fnc, meet_fnc, |
31 has_fnc, player_character): | |
31 self.active = False | 32 self.active = False |
32 self.controller = controller | 33 self.controller = controller |
33 xml_file = vfs.VFS.open('gui/dialogue.xml') | 34 xml_file = vfs.VFS.open('gui/dialogue.xml') |
34 self.dialogue_gui = pychan.loadXML(xml_file) | 35 self.dialogue_gui = pychan.loadXML(xml_file) |
35 self.npc = npc | 36 self.npc = npc |
60 | 61 |
61 game_state = {'npc': self.npc, 'pc': self.player_character, | 62 game_state = {'npc': self.npc, 'pc': self.player_character, |
62 'quest': self.quest_engine, | 63 'quest': self.quest_engine, |
63 'met': self.met_fnc, 'meet': self.meet_fnc, | 64 'met': self.met_fnc, 'meet': self.meet_fnc, |
64 'pc_has': self.pc_has_fnc, 'npc_has': self.npc_has_fnc, | 65 'pc_has': self.pc_has_fnc, 'npc_has': self.npc_has_fnc, |
66 'model': self.controller.model, | |
65 } | 67 } |
66 try: | 68 try: |
67 self.dialogue_processor = DialogueProcessor(self.npc.dialogue.dialogue, | 69 self.dialogue_processor = DialogueProcessor(self.npc.dialogue.dialogue, |
68 game_state) | 70 game_state) |
69 self.dialogue_processor.initiateDialogue() | 71 self.dialogue_processor.initiateDialogue() |