Mercurial > touhou
comparison pytouhou/game/text.py @ 730:f2c3848dabff
PyTouhou: Fix text comparison to be done after encoding to bytes
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Sun, 08 Dec 2019 20:14:28 +0100 |
parents | e15672733c93 |
children |
comparison
equal
deleted
inserted
replaced
729:f953ae5b3732 | 730:f2c3848dabff |
---|---|
114 | 114 |
115 self.set_text(text) | 115 self.set_text(text) |
116 | 116 |
117 | 117 |
118 def set_text(self, text): | 118 def set_text(self, text): |
119 if isinstance(text, str): | |
120 text = text.encode() | |
121 | |
119 if text == self.text: | 122 if text == self.text: |
120 return | 123 return |
121 | |
122 if isinstance(text, str): | |
123 text = text.encode() | |
124 | 124 |
125 self.set_sprites([c - self.shift for c in text]) | 125 self.set_sprites([c - self.shift for c in text]) |
126 self.text = text | 126 self.text = text |
127 self.changed = True | 127 self.changed = True |
128 | 128 |