X-Git-Url: https://plomlompom.com/repos/foo.html?a=blobdiff_plain;f=rogue_chat_curses.py;h=18977d2cd4b13e3867f1d52d55fff745143398d1;hb=81d7eeb3c08c19e2d0a1e34852ec85aaeee0b87a;hp=2dfbdd1b6b76772877ac47b9db7c04b4e199e919;hpb=ee3263e4b0bbc9146040c58bb3ed9bb1653102c1;p=plomrogue2
diff --git a/rogue_chat_curses.py b/rogue_chat_curses.py
index 2dfbdd1..18977d2 100755
--- a/rogue_chat_curses.py
+++ b/rogue_chat_curses.py
@@ -139,7 +139,7 @@ cmd_PORTAL.argtypes = 'yx_tuple:nonneg string'
def cmd_PLAY_ERROR(game, msg):
game.tui.log_msg('? ' + msg)
- game.tui.flash()
+ game.tui.flash = True
game.tui.do_refresh = True
cmd_PLAY_ERROR.argtypes = 'string'
@@ -291,11 +291,9 @@ class TUI:
self.force_instant_connect = True
self.input_lines = []
self.fov = ''
+ self.flash = False
curses.wrapper(self.loop)
- def flash(self):
- curses.flash()
-
def connect(self):
def handle_recv(msg):
@@ -431,7 +429,7 @@ class TUI:
self.explorer = target
self.query_info()
else:
- self.flash()
+ self.flash = True
def draw_history():
lines = []
@@ -636,6 +634,9 @@ class TUI:
else:
self.send('PING')
last_ping = now
+ if self.flash:
+ curses.flash()
+ self.flash = False
if self.do_refresh:
draw_screen()
self.do_refresh = False
@@ -748,7 +749,7 @@ class TUI:
self.host = self.game.portals[player.position]
self.reconnect()
else:
- self.flash()
+ self.flash = True
self.log_msg('? not standing on portal')
elif key in self.movement_keys and 'MOVE' in self.game.tasks:
self.send('TASK:MOVE ' + self.movement_keys[key])