Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pressing Esc in resource overview bar crashes #2051

Closed
ChrisOelmueller opened this issue Mar 18, 2013 · 1 comment · Fixed by #2063
Closed

Pressing Esc in resource overview bar crashes #2051

ChrisOelmueller opened this issue Mar 18, 2013 · 1 comment · Fixed by #2063

Comments

@ChrisOelmueller
Copy link
Member

  • Load game
  • Hover resource overview bar
  • Hit Esc
Traceback (most recent call last):
  File "/home/eoc/UH/unknown-horizons/horizons/gui/keylisteners/ingamekeylistener.py", line 68, in keyPressed
    if self.session.ingame_gui.on_key_press(action, evt):
  File "/home/eoc/UH/unknown-horizons/horizons/gui/ingamegui.py", line 389, in on_key_press
    return self.on_escape()
  File "/home/eoc/UH/unknown-horizons/horizons/gui/ingamegui.py", line 344, in on_escape
    self.cursor.on_escape()
  File "/home/eoc/UH/fife/engine/python/fife/fife.py", line 2851, in <lambda>
    __getattr__ = lambda self, name: _swig_getattr(self, IMouseListener, name)
  File "/home/eoc/UH/fife/engine/python/fife/fife.py", line 55, in _swig_getattr
    raise AttributeError(name)
AttributeError: on_escape
@totycro
Copy link
Contributor

totycro commented Mar 25, 2013

This is related to 3fb4239

The problem is that there are cursor tools, which are not SelectionTool, but still don't have an on_escape, in this case ResBarMouseTool.

How about using hasattr? Then all cursor tools, that have a meaningful action on escape could get it, all other, such as SelectionTool, would not.

ChrisOelmueller added a commit that referenced this issue Apr 13, 2013
Perhaps the lesser of two evils here, as suggested by @totycro
Fixes #2051  Pressing Esc in resource overview bar crashes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants