diff --git a/evennia/prototypes/menus.py b/evennia/prototypes/menus.py index 1d291e8732..edef289962 100644 --- a/evennia/prototypes/menus.py +++ b/evennia/prototypes/menus.py @@ -2027,14 +2027,14 @@ def node_apply_diff(caller, **kwargs): sep=" |r->|n ", new='', change=inst)) options.append(_keep_option(key, prototype, base_obj, obj_prototype, diff, update_objects, back_node)) - options.extend( - [{"key": ("|wu|Wpdate {} objects".format(len(update_objects)), "update", "u"), - "desc": "Update {} objects".format(len(update_objects)), - "goto": (_apply_diff, {"prototype": prototype, "objects": update_objects, - "back_node": back_node, "diff": diff, "base_obj": base_obj})}, - {"key": ("|wr|Weset changes", "reset", "r"), - "goto": ("node_apply_diff", {"prototype": prototype, "back_node": back_node, - "objects": update_objects})}]) + options.extend( + [{"key": ("|wu|Wpdate {} objects".format(len(update_objects)), "update", "u"), + "desc": "Update {} objects".format(len(update_objects)), + "goto": (_apply_diff, {"prototype": prototype, "objects": update_objects, + "back_node": back_node, "diff": diff, "base_obj": base_obj})}, + {"key": ("|wr|Weset changes", "reset", "r"), + "goto": ("node_apply_diff", {"prototype": prototype, "back_node": back_node, + "objects": update_objects})}]) if ichanges < 1: text = ["Analyzed a random sample object (out of {}) - " diff --git a/evennia/utils/evmenu.py b/evennia/utils/evmenu.py index 127e2d3f13..f82dc5cb1f 100644 --- a/evennia/utils/evmenu.py +++ b/evennia/utils/evmenu.py @@ -866,19 +866,34 @@ class EvMenu(object): props = {prop: value for prop, value in all_props if prop not in all_methods and prop not in all_builtins and not prop.endswith("__")} + local = {key: var for key, var in locals().items() + if key not in all_props and not key.endswith("__")} + if arg: if arg in props: debugtxt = " |y* {}:|n\n{}".format(arg, props[arg]) + elif arg in local: + debugtxt = " |y* {}:|n\n{}".format(arg, local[arg]) elif arg == 'full': - debugtxt = ("|yMENU DEBUG full ... |n\n" + "\n".join(props) + + debugtxt = ("|yMENU DEBUG full ... |n\n" + "\n".join( + "|y *|n {}: {}".format(key, val) + for key, val in sorted(props.items())) + + "\n |yLOCAL VARS:|n\n" + "\n".join( + "|y *|n {}: {}".format(key, val) + for key, val in sorted(local.items())) + "\n |y... END MENU DEBUG|n") else: debugtxt = "|yUsage: menudebug full||n" else: - debugtxt = "|yMENU DEBUG properties:|n\n" + "\n".join("|y *|n {}: {}".format( - prop, crop(to_str(value, force_string=True), width=50)) - for prop, value in sorted(props.items())) - debugtxt += "\n|y... END MENU DEBUG (use menudebug for full value)|n" + debugtxt = ("|yMENU DEBUG properties ... |n\n" + "\n".join( + "|y *|n {}: {}".format( + key, crop(to_str(val, force_string=True), width=50)) + for key, val in sorted(props.items())) + + "\n |yLOCAL VARS:|n\n" + "\n".join( + "|y *|n {}: {}".format( + key, crop(to_str(val, force_string=True), width=50)) + for key, val in sorted(local.items())) + + "\n |y... END MENU DEBUG|n") self.caller.msg(debugtxt) def parse_input(self, raw_string):