home
·
contact
·
privacy
projects
/
plomrogue2
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add alternate map control preset.
[plomrogue2]
/
rogue_chat_curses.py
diff --git
a/rogue_chat_curses.py
b/rogue_chat_curses.py
index c4d0ddf5b6ae023dd1b09c1cd9401645aef8211c..1d327727c3fee4ede955321459c9e1d85b11656b 100755
(executable)
--- a/
rogue_chat_curses.py
+++ b/
rogue_chat_curses.py
@@
-187,8
+187,6
@@
def cmd_LOGIN_OK(game):
game.tui.switch_mode('post_login_wait')
game.tui.send('GET_GAMESTATE')
game.tui.log_msg('@ welcome!')
game.tui.switch_mode('post_login_wait')
game.tui.send('GET_GAMESTATE')
game.tui.log_msg('@ welcome!')
- game.tui.log_msg('@ hint: see top of terminal for how to get help.')
- game.tui.log_msg('@ hint: enter study mode to understand your environment.')
cmd_LOGIN_OK.argtypes = ''
def cmd_ADMIN_OK(game):
cmd_LOGIN_OK.argtypes = ''
def cmd_ADMIN_OK(game):
@@
-623,6
+621,7
@@
class TUI:
self.disconnected = False
self.game.thing_types = {}
self.game.terrains = {}
self.disconnected = False
self.game.thing_types = {}
self.game.terrains = {}
+ self.is_admin = False
time.sleep(0.1) # give potential SSL negotation some time …
self.socket.send('TASKS')
self.socket.send('TERRAINS')
time.sleep(0.1) # give potential SSL negotation some time …
self.socket.send('TASKS')
self.socket.send('TERRAINS')
@@
-808,8
+807,9
@@
class TUI:
self.restore_input_values()
def set_default_colors(self):
self.restore_input_values()
def set_default_colors(self):
- curses.init_color(1, 1000, 1000, 1000)
- curses.init_color(2, 0, 0, 0)
+ if curses.can_change_color():
+ curses.init_color(7, 1000, 1000, 1000)
+ curses.init_color(0, 0, 0, 0)
self.do_refresh = True
def set_random_colors(self):
self.do_refresh = True
def set_random_colors(self):
@@
-818,8
+818,9
@@
class TUI:
import random
return int(offset + random.random()*375)
import random
return int(offset + random.random()*375)
- curses.init_color(1, rand(625), rand(625), rand(625))
- curses.init_color(2, rand(0), rand(0), rand(0))
+ if curses.can_change_color():
+ curses.init_color(7, rand(625), rand(625), rand(625))
+ curses.init_color(0, rand(0), rand(0), rand(0))
self.do_refresh = True
def get_info(self):
self.do_refresh = True
def get_info(self):
@@
-1239,10
+1240,14
@@
class TUI:
'dance': 'DANCE',
}
'dance': 'DANCE',
}
- curses.curs_set(
False
) # hide cursor
+ curses.curs_set(
0
) # hide cursor
curses.start_color()
self.set_default_colors()
curses.start_color()
self.set_default_colors()
- curses.init_pair(1, 1, 2)
+ curses.init_pair(1, 7, 0)
+ if not curses.can_change_color():
+ self.log_msg('@ unfortunately, your terminal does not seem to '
+ 'support re-definition of colors; you might miss out '
+ 'on some color effects')
stdscr.timeout(10)
reset_screen_size()
self.explorer = YX(0, 0)
stdscr.timeout(10)
reset_screen_size()
self.explorer = YX(0, 0)