home · contact · privacy
Improve chat message meta data display.
authorChristian Heller <c.heller@plomlompom.de>
Fri, 11 Dec 2020 07:07:10 +0000 (08:07 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Fri, 11 Dec 2020 07:07:10 +0000 (08:07 +0100)
plomrogue/things.py

index 7168f7816fd97faa4b9426ab185a7bb4472aac4a..a13f771dd2f7821d9d895f837c8348375b30bf0b 100644 (file)
@@ -89,13 +89,16 @@ class Thing(ThingBase):
                                               url_limits)
             lowered_nick = lower_msg_by_volume(name, volume,
                                                largest_audible_distance)
-            self.game.io.send('CHAT ' +
-                              quote('(volume: %.2f) %s: %s' % (volume,
-                                                               lowered_nick,
-                                                               lowered_msg)),
-                              c_id)
+            symbol = ''
             if listener.fov_test(self.position[0], self.position[1]):
                 self.game.io.send('CHATFACE %s' % self.id_, c_id)
+                if self.type_ == 'Player' and hasattr(self, 'thing_char'):
+                    symbol = '/@' + self.thing_char
+            self.game.io.send('CHAT ' +
+                              quote('vol:%.f%s %s%s: %s' % (volume * 100, '%',
+                                                            lowered_nick, symbol,
+                                                            lowered_msg)),
+                              c_id)