X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/decks/%7B%7Bdeck_id%7D%7D/cards/%7B%7Bcard_id%7D%7D/static/git-logo.png?a=blobdiff_plain;f=client_prototype.py;h=2b8719922fd5ba4bdccf3a3921d8e8b125cba17b;hb=a845dce5a0f8a11ce9f8483c071a98f8d2fe9d55;hp=01bb74b4d78b712d8ae994eb77c2513ec7303ced;hpb=6777a44f123233f2e0ee45940265bdc4936d87bf;p=plomrogue diff --git a/client_prototype.py b/client_prototype.py index 01bb74b..2b87199 100644 --- a/client_prototype.py +++ b/client_prototype.py @@ -101,7 +101,6 @@ def draw_screen(): j = win["start"][int(k == 0)] - sep_size if (j >= 0 and j < screen_size[int(k == 0)]): start = win["start"][k] - # start = start if start >= 0 else 0 end = win["start"][k] + win["size"][k] end = end if end < screen_size[k] else screen_size[k] if k: @@ -294,7 +293,6 @@ def cursed_main(stdscr): curses.noecho() curses.curs_set(False) - # stdscr.keypad(True) signal.signal(signal.SIGWINCH, lambda ignore_1, ignore_2: set_window_geometries()) set_window_geometries() @@ -447,9 +445,12 @@ def command_toggle_look_mode(): query_mapcell() -def command_sender(string): +def command_sender(string, int_field=None): def command_send(): - io["file_out"].write(string + "\n") + int_string = "" + if int_field: + int_string = " " + str(world_data[int_field]) + io["file_out"].write(string + int_string + "\n") io["file_out"].flush() return command_send @@ -513,8 +514,11 @@ io = { "path_worldstate": "server/worldstate" } commands = { + "A": (command_sender("ai"),), + "D": (command_sender("drop", "inventory_selection"),), "P": (command_sender("pick_up"),), "Q": (command_quit,), + "U": (command_sender("use", "inventory_selection"),), "W": (command_sender("wait"),), "c": (command_sender("move south-east"), command_looker("south-east")), "d": (command_sender("move east"), command_looker("east")),