+def command_look_scroller(string):
+ def command_look_scroll():
+ win_size = next(win["size"] for win in windows
+ if win["func"] == win_look)
+ if string == "up" and world_data["look_scroll"] > 0:
+ world_data["look_scroll"] -= 1
+ elif string == "down" and world_data["look_scroll"] \
+ < len(world_data["look"]) - win_size[0]:
+ world_data["look_scroll"] += 1
+ return command_look_scroll
+
+
+def command_inventory_selector(string):
+ def command_inventory_select():
+ if string == "up" and world_data["inventory_selection"] > 0:
+ world_data["inventory_selection"] -= 1
+ elif string == "down" and world_data["inventory_selection"] \
+ < len(world_data["inventory"]) - 1:
+ world_data["inventory_selection"] += 1
+ return command_inventory_select
+
+