Mercurial > fife-parpg
changeset 533:082e919cc348
Setting Extension:
Added possibility to set a custom style for the options gui
author | nihathrael@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Sat, 29 May 2010 17:52:07 +0000 |
parents | 4da56756a617 |
children | 65a92a2449d5 |
files | engine/python/fife/extensions/fife_settings.py |
diffstat | 1 files changed, 11 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/engine/python/fife/extensions/fife_settings.py Sat May 29 17:27:49 2010 +0000 +++ b/engine/python/fife/extensions/fife_settings.py Sat May 29 17:52:07 2010 +0000 @@ -148,6 +148,9 @@ #default settings self._resolutions = ['640x480', '800x600', '1024x768', '1280x800', '1440x900'] + #Used to stylize the options gui + self._gui_style = "default" + self.loadSettings() def loadSettings(self): @@ -155,6 +158,13 @@ self._root_element = self._tree.getroot() self.validateTree() + def setGuiStyle(self, style): + """ Set a custom gui style used for the option dialog. + @param style: Pychan style to be used + @type style: C{string} + """ + self._gui_style = style + def validateTree(self): """ Iterates the settings tree and prints warning when an invalid tag is found """ for c in self._root_element.getchildren(): @@ -365,6 +375,7 @@ self.OptionsDlg = pychan.loadXML(self._settings_gui_xml) else: self.OptionsDlg = pychan.loadXML(StringIO(self._settings_gui_xml)) + self.OptionsDlg.stylize(self._gui_style) self.OptionsDlg.distributeInitialData({ 'screen_resolution' : self._resolutions, 'render_backend' : ['OpenGL', 'SDL']