From 31fd2795f23e82b89f551341905e401b65185d63 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 9 Sep 2017 18:53:02 +0200 Subject: [PATCH] Set default choice for destroy verification question --- evennia/commands/default/building.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/evennia/commands/default/building.py b/evennia/commands/default/building.py index a48f4f14e8..8f591b990d 100644 --- a/evennia/commands/default/building.py +++ b/evennia/commands/default/building.py @@ -630,7 +630,9 @@ class CmdDestroy(COMMAND_DEFAULT_CLASS): aliases = ["@delete", "@del"] locks = "cmd:perm(destroy) or perm(Builder)" help_category = "Building" - confirm = True # set to False to always bypass confirmation + + confirm = True # set to False to always bypass confirmation + default_confirm = 'yes' # what to assume if just pressing enter (yes/no) def func(self): "Implements the command." @@ -703,8 +705,9 @@ class CmdDestroy(COMMAND_DEFAULT_CLASS): confirm += ", ".join([obj.get_display_name(caller) for obj in objs]) else: confirm += ", ".join(["#{}".format(obj.id) for obj in objs]) - confirm += " (yes/no)?" + confirm += " [yes]/no?" if self.default_confirm == 'yes' else " yes/[no]" answer = yield(confirm) + answer = self.default_confirm if answer == '' else answer while answer.strip().lower() not in ("y", "yes", "n", "no"): answer = yield(confirm)