comparison gui/dialogs.py @ 2:06145a6ee387

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 7a89ea5404b1
children
comparison
equal deleted inserted replaced
1:4912a6f97c52 2:06145a6ee387
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details. 11 # GNU General Public License for more details.
12 12
13 # You should have received a copy of the GNU General Public License 13 # You should have received a copy of the GNU General Public License
14 # along with PARPG. If not, see <http://www.gnu.org/licenses/>. 14 # along with PARPG. If not, see <http://www.gnu.org/licenses/>.
15 from fife.extensions import pychan
15 16
16 import os 17 from parpg import vfs
17
18 from fife.extensions import pychan
19 18
20 class RestartDialog(object): 19 class RestartDialog(object):
21 def __init__(self, settings): 20 def __init__(self, settings):
22 self.settings = settings 21 self.settings = settings
23 self.window = pychan.loadXML(os.path.join(self.settings.system_path, 22 xml_file = vfs.VFS.open('gui/restart_dialog.xml')
24 self.settings.parpg.GuiPath, 23 self.window = pychan.loadXML(xml_file)
25 'restart_dialog.xml'))
26 self.window.mapEvents({'closeButton': self.hide}) 24 self.window.mapEvents({'closeButton': self.hide})
27 25
28 def hide(self): 26 def hide(self):
29 self.window.hide() 27 self.window.hide()
30 28