X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;f=client%2Fcommands.py;h=d86346f29b38caa30621e807b2e52d1ac39a346b;hb=a4e6c51b2e9aa85dc5f5e3067b602c01953a6d43;hp=159af5dcd6ec58ce901491aabbfabbf392b64361;hpb=3d4ef72a869787ade399af85a42ab0aef9d73766;p=plomrogue diff --git a/client/commands.py b/client/commands.py index 159af5d..d86346f 100644 --- a/client/commands.py +++ b/client/commands.py @@ -1,3 +1,8 @@ +# This file is part of PlomRogue. PlomRogue is licensed under the GPL version 3 +# or any later version. For details on its copyright, license, and warranties, +# see the file NOTICE in the root directory of the PlomRogue source package. + + from client.config.world_data import world_data from client.io import send from client.query_mapcell import query_mapcell @@ -22,7 +27,7 @@ def command_sender(string, int_field=None): int_string = "" if int_field: int_string = " " + str(world_data[int_field]) - send(string + int_string) + send(string + int_string) return command_send @@ -61,8 +66,15 @@ def command_looker(string): def command_look_scroller(string): def command_look_scroll(): - win_size = next(win["size"] for win in windows - if win["func"] == win_look) + from client.window_management import windows + from client.config.windows import windows_config + from client.windows import win_look + try: + i = next(i for i in range(len(windows_config)) + if windows_config[i]["func"] == win_look) + except StopIteration: + return + win_size = windows[i].size if string == "up" and world_data["look_scroll"] > 0: world_data["look_scroll"] -= 1 elif string == "down" and world_data["look_scroll"] \