comparison src/parpg/gui/dialoguegui.py @ 169:87073af1d2d2

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 5feab6555bf9
children
comparison
equal deleted inserted replaced
168:704145b96171 169:87073af1d2d2
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()