Mercurial > fife-parpg
comparison engine/python/fife/extensions/fife_timer.py @ 507:d6de9ab3ce2a
Fixed a small problem with the fife timer library. There was a problem with UH when clicking on certain buttons on the main menu which cased a hang/crash. The timer now stops itself before executing the callback.
author | prock@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Wed, 19 May 2010 15:10:34 +0000 |
parents | ae9f5383f5b1 |
children | c8820cc201db |
comparison
equal
deleted
inserted
replaced
506:226e26d1d11e | 507:d6de9ab3ce2a |
---|---|
101 | 101 |
102 def updateEvent(self,delta): | 102 def updateEvent(self,delta): |
103 """ | 103 """ |
104 Should not be called directly. This is called by FIFE. | 104 Should not be called directly. This is called by FIFE. |
105 """ | 105 """ |
106 if callable(self._callback): | |
107 self._callback() | |
108 | |
109 if self._repeat != 0: | 106 if self._repeat != 0: |
110 self._executed += 1 | 107 self._executed += 1 |
111 if self._executed >= self._repeat: | 108 if self._executed >= self._repeat: |
109 print "in here" | |
112 self.stop() | 110 self.stop() |
111 | |
112 if callable(self._callback): | |
113 print "calling event" | |
114 self._callback() | |
115 | |
113 | 116 |
114 def delayCall(delay,callback): | 117 def delayCall(delay,callback): |
115 """ | 118 """ |
116 Delay a function call by a number of milliseconds. | 119 Delay a function call by a number of milliseconds. |
117 | 120 |