comparison objects/action.py @ 54:de09adb7a736

Fixed bug in the text splitting code of ExamineAction.
author KarstenBock@gmx.net
date Thu, 08 Sep 2011 18:56:10 +0200
parents d3a9caba067b
children 04af237dde10
comparison
equal deleted inserted replaced
53:7b9f6e3513d4 54:de09adb7a736
206 action_text = self.examine_desc 206 action_text = self.examine_desc
207 self.view.hud.addAction(unicode(action_text)) 207 self.view.hud.addAction(unicode(action_text))
208 logger.debug(action_text) 208 logger.debug(action_text)
209 #this code will cut the line up into smaller lines that will be displayed 209 #this code will cut the line up into smaller lines that will be displayed
210 place = 25 210 place = 25
211 while place <= len(action_text): 211 while place < len(action_text):
212 if action_text[place] == ' ': 212 if action_text[place] == ' ':
213 action_text = action_text[:place] +'\n'+action_text[place:] 213 action_text = action_text[:place] +'\n'+action_text[place:]
214 place += 26 #plus 1 character to offset the new line 214 place += 26 #plus 1 character to offset the new line
215 else: place += 1 215 else: place += 1
216 self.view.displayObjectText(self.examine_id, unicode(action_text), time=3000) 216 self.view.displayObjectText(self.examine_id, unicode(action_text), time=3000)