Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Allow running UH with current FIFE git master #2058

Merged
merged 1 commit into from

2 participants

@ChrisOelmueller
Collaborator

This manually merges the fifechan-sync branch and the compat layer
should be removed once we decide to stop supporting FIFE 0.3.4.

@ChrisOelmueller
Collaborator

Removed another import block in 11ad92e

@ChrisOelmueller ChrisOelmueller Allow running UH with current FIFE git master
This manually merges the `fifechan-sync` branch and the compat layer
should be removed once we decide to stop supporting FIFE 0.3.4.
d50ef29
@nihathrael nihathrael merged commit 310697e into master
@nihathrael nihathrael deleted the 035 branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 7, 2013
  1. @ChrisOelmueller

    Allow running UH with current FIFE git master

    ChrisOelmueller authored
    This manually merges the `fifechan-sync` branch and the compat layer
    should be removed once we decide to stop supporting FIFE 0.3.4.
This page is out of date. Refresh to see the latest.
View
7 horizons/engine/engine.py
@@ -192,7 +192,12 @@ def show_settings(self):
if not hasattr(self, "_settings_extra_inited"):
self._setting_handler.setup_setting_extras()
self._settings_extra_inited = True
- self._setting.onOptionsPress()
+ if hasattr(self._setting, 'showSettingsDialog'):
+ #TODO fifechan / FIFE 0.3.5+ compat
+ self._setting.showSettingsDialog()
+ else:
+ # this is the old (0.3.4 and earlier) API
+ self._setting.onOptionsPress()
def set_cursor_image(self, which="default"):
"""Sets a certain cursor image.
View
9 horizons/engine/settingsdialog.py
@@ -21,7 +21,12 @@
# ###################################################
-from fife.extensions.fife_settings import Setting
+try:
+ #TODO fifechan / FIFE 0.3.5+ compat
+ from fife.extensions.pychan.fife_pychansettings import FifePychanSettings
+except ImportError:
+ # this is the old (0.3.4 and earlier) API
+ from fife.extensions.fife_settings import Setting as FifePychanSettings
import horizons.main
@@ -30,7 +35,7 @@
from horizons.gui.widgets.pickbeltwidget import OptionsPickbeltWidget
from horizons.messaging import SettingChanged
-class SettingsDialog(Setting):
+class SettingsDialog(FifePychanSettings):
"""
Localized settings dialog by using load_uh_widget() instead of
plain load_xml().
View
6 horizons/engine/settingshandler.py
@@ -107,7 +107,11 @@ def setup_setting_extras(self):
#which will update slider as value
#read fife-extension-pychan-Widget-widget.py if u want know how it works
slider_event_map = {}
- self.settings_dialog = self._setting.loadSettingsDialog()
+ if not hasattr(self.engine._setting, '_loadSettingsDialog'):
+ #TODO fifechan / FIFE 0.3.5+ compat
+ # manually copy the old (0.3.4 and earlier) API to the new one
+ self._setting._loadSettingsDialog = self._setting.loadSettingsDialog
+ self.settings_dialog = self._setting._loadSettingsDialog()
slider_dict = {'AutosaveInterval': 'autosaveinterval',
'AutosaveMaxCount': 'autosavemaxcount',
'QuicksaveMaxCount': 'quicksavemaxcount',
View
8 horizons/gui/modules/settings.py
@@ -29,8 +29,14 @@ class SettingsDialog(Window):
def show(self):
horizons.globals.fife.show_settings()
+ fife_setting = horizons.globals.fife._setting
+ if not hasattr(fife_setting, '_optionsDialog'):
+ #TODO fifechan / FIFE 0.3.5+ compat
+ # this is the old API
+ widget = fife_setting.OptionsDlg
+ else:
+ widget = fife_setting._optionsDialog
# Patch original dialog
- widget = horizons.globals.fife._setting.OptionsDlg
if not hasattr(widget, '__patched__'):
# replace hide method so we take control over how the dialog
# is hidden
View
7 horizons/gui/style.py
@@ -19,7 +19,12 @@
# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# ###################################################
-from fife.fife import Color
+try:
+ #TODO fifechan / FIFE 0.3.5+ compat
+ from fife.fifechan import Color
+except ImportError:
+ # this is the old (0.3.4 and earlier) API
+ from fife.fife import Color
BROWN = { 64: Color(80, 80, 40, 64),
96: Color(80, 80, 40, 96),
Something went wrong with that request. Please try again.