From 92a3e0475684691ee8c9de4afba654fb9e0f3dc3 Mon Sep 17 00:00:00 2001 From: InspectorCaracal <51038201+InspectorCaracal@users.noreply.github.com> Date: Tue, 12 Dec 2023 14:45:52 -0700 Subject: [PATCH 1/3] make prefix a setting --- evennia/contrib/rpg/rpsystem/rpsystem.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evennia/contrib/rpg/rpsystem/rpsystem.py b/evennia/contrib/rpg/rpsystem/rpsystem.py index 384259ee61..3e06bd0504 100644 --- a/evennia/contrib/rpg/rpsystem/rpsystem.py +++ b/evennia/contrib/rpg/rpsystem/rpsystem.py @@ -179,7 +179,7 @@ _AT_SEARCH_RESULT = variable_from_module(*settings.SEARCH_AT_RESULT.rsplit(".", # The prefix is the (single-character) symbol used to find the start # of a object reference, such as /tall (note that # the system will understand multi-word references like '/a tall man' too). -_PREFIX = "/" +_PREFIX = getattr(settings, 'RPSYSTEM_EMOTE_PREFIX', "/") # The num_sep is the (single-character) symbol used to separate the # sdesc from the number when trying to separate identical sdescs from From db3dd5b8314ac72abb096561d68aa2a2748e8ae7 Mon Sep 17 00:00:00 2001 From: InspectorCaracal <51038201+InspectorCaracal@users.noreply.github.com> Date: Tue, 12 Dec 2023 15:13:05 -0700 Subject: [PATCH 2/3] embed actual prefix into CmdEmote --- evennia/contrib/rpg/rpsystem/rpsystem.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/evennia/contrib/rpg/rpsystem/rpsystem.py b/evennia/contrib/rpg/rpsystem/rpsystem.py index 3e06bd0504..900aa27d00 100644 --- a/evennia/contrib/rpg/rpsystem/rpsystem.py +++ b/evennia/contrib/rpg/rpsystem/rpsystem.py @@ -897,7 +897,7 @@ class RPCommand(Command): class CmdEmote(RPCommand): # replaces the main emote - """ + f""" Emote an action, allowing dynamic replacement of text in the emote. @@ -905,11 +905,11 @@ class CmdEmote(RPCommand): # replaces the main emote emote text Example: - emote /me looks around. - emote With a flurry /me attacks /tall man with his sword. - emote "Hello", /me says. + emote {_PREFIX}me looks around. + emote With a flurry {_PREFIX}me attacks {_PREFIX}tall man with his sword. + emote "Hello", {_PREFIX}me says. - Describes an event in the world. This allows the use of /ref + Describes an event in the world. This allows the use of {_PREFIX}ref markers to replace with the short descriptions or recognized strings of objects in the same room. These will be translated to emotes to match each person seeing it. Use "..." for saying From ce04e79d585f125a2f7ff9192d417a2cf8c56974 Mon Sep 17 00:00:00 2001 From: Cal Date: Wed, 20 Dec 2023 10:44:37 -0700 Subject: [PATCH 3/3] fix docstring/help --- evennia/contrib/rpg/rpsystem/rpsystem.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/evennia/contrib/rpg/rpsystem/rpsystem.py b/evennia/contrib/rpg/rpsystem/rpsystem.py index 900aa27d00..f1c7bb6728 100644 --- a/evennia/contrib/rpg/rpsystem/rpsystem.py +++ b/evennia/contrib/rpg/rpsystem/rpsystem.py @@ -897,7 +897,7 @@ class RPCommand(Command): class CmdEmote(RPCommand): # replaces the main emote - f""" + """ Emote an action, allowing dynamic replacement of text in the emote. @@ -905,11 +905,11 @@ class CmdEmote(RPCommand): # replaces the main emote emote text Example: - emote {_PREFIX}me looks around. - emote With a flurry {_PREFIX}me attacks {_PREFIX}tall man with his sword. - emote "Hello", {_PREFIX}me says. + emote {prefix}me looks around. + emote With a flurry {prefix}me attacks {prefix}tall man with his sword. + emote "Hello", {prefix}me says. - Describes an event in the world. This allows the use of {_PREFIX}ref + Describes an event in the world. This allows the use of {prefix}ref markers to replace with the short descriptions or recognized strings of objects in the same room. These will be translated to emotes to match each person seeing it. Use "..." for saying @@ -923,6 +923,9 @@ class CmdEmote(RPCommand): # replaces the main emote locks = "cmd:all()" arg_regex = "" + def get_help(self, caller, cmdset): + return self.__doc__.format(prefix=_PREFIX) + def func(self): "Perform the emote." if not self.args: