diff options
author | echinelli <emilianochinelli@gmail.com> | 2010-12-08 23:40:18 (GMT) |
---|---|---|
committer | echinelli <emilianochinelli@gmail.com> | 2010-12-08 23:40:18 (GMT) |
commit | a625d188ee58920a02d03d7fca74a5674fd8d961 (patch) | |
tree | c8663a85c220715997300c88c970acf4fd3811e3 | |
parent | 7666ebe72c0da60eb4258cb0cc93e0def72d0881 (diff) |
Improvements in menu.py
-rwxr-xr-x | Saludame.activity/game_manager.py | 7 | ||||
-rwxr-xr-x | Saludame.activity/menu.py | 10 |
2 files changed, 16 insertions, 1 deletions
diff --git a/Saludame.activity/game_manager.py b/Saludame.activity/game_manager.py index fa97a7a..2eae77d 100755 --- a/Saludame.activity/game_manager.py +++ b/Saludame.activity/game_manager.py @@ -499,6 +499,13 @@ class GameManager: print "no se pudo cargar la partida." ## + def get_active_events(self): + """ + returns current events + """ + events = self.active_events + self.active_social_events + return events + def get_current_place(self): """ returns character's current location. diff --git a/Saludame.activity/menu.py b/Saludame.activity/menu.py index 090bec1..b2704e1 100755 --- a/Saludame.activity/menu.py +++ b/Saludame.activity/menu.py @@ -126,7 +126,15 @@ class Menu(Window): return False #verify event if action.allowed_events: - None + allowed = False + active_events = game_manager.get_active_events() + for evt_name in action.allowed_events: + for active_evt in active_events: + if evt_name == active_evt.name: + allowed = True + break + if not allowed: + return False return True def close(self): |