Mercurial > parpg-core
comparison src/parpg/gui/dialoguegui.py @ 12:d60f1dab8469
Fixed resource path dependencies issue that caused PARPG to crash on start.
* PARPG should now run without issue (system installation not tested).
* Utilized FIFE's VFS module to remove path dependencies from most PARPG modules.
* The new parpg.vfs module is a singleton with a single global variable, VFS, which is a reference to the global VFS instance. Although a singleton is not ideal it should be replaced once PARPG's core code is refactored.
* The parpg.vfs singleton is initialized in the parpg.applicaiton.PARPGApplication class with the absolute path to the data directory via the parpg.settings module and corresponding configuration file.
* A new DataPath entry was added to the default system configuration file template under the [parpg] section to support the new parpg.vfs module.
* Updated the parpg-assets subrepo to revision 3 to fix some dialog file format issues (for details see commit message for parpg-assets).
* Fixed a few bugs in the parpg.dialogueparsers.YAMLDialogueParser class related to exception handling.
author | M. George Hansen <technopolitica@gmail.com> |
---|---|
date | Mon, 06 Jun 2011 15:56:14 -1000 |
parents | 1fd2201f5c36 |
children | c25c734bd2a7 |
comparison
equal
deleted
inserted
replaced
11:4706e0194af3 | 12:d60f1dab8469 |
---|---|
16 | 16 |
17 from fife import fife | 17 from fife import fife |
18 from fife.extensions import pychan | 18 from fife.extensions import pychan |
19 from fife.extensions.pychan import widgets | 19 from fife.extensions.pychan import widgets |
20 | 20 |
21 from parpg import vfs | |
21 from parpg.dialogueprocessor import DialogueProcessor | 22 from parpg.dialogueprocessor import DialogueProcessor |
22 | 23 |
23 logger = logging.getLogger('dialoguegui') | 24 logger = logging.getLogger('dialoguegui') |
24 | 25 |
25 class DialogueGUI(object): | 26 class DialogueGUI(object): |
27 _logger = logging.getLogger('dialoguegui.DialogueGUI') | 28 _logger = logging.getLogger('dialoguegui.DialogueGUI') |
28 | 29 |
29 def __init__(self, controller, npc, quest_engine, player_character): | 30 def __init__(self, controller, npc, quest_engine, player_character): |
30 self.active = False | 31 self.active = False |
31 self.controller = controller | 32 self.controller = controller |
32 self.dialogue_gui = pychan.loadXML("gui/dialogue.xml") | 33 xml_file = vfs.VFS.open('gui/dialogue.xml') |
34 self.dialogue_gui = pychan.loadXML(xml_file) | |
33 self.npc = npc | 35 self.npc = npc |
34 # TODO Technomage 2010-11-10: the QuestEngine should probably be | 36 # TODO Technomage 2010-11-10: the QuestEngine should probably be |
35 # a singleton-like object, which would avoid all of this instance | 37 # a singleton-like object, which would avoid all of this instance |
36 # handling. | 38 # handling. |
37 self.quest_engine = quest_engine | 39 self.quest_engine = quest_engine |