From a27e893359a4810c4932dbd9372fdd1f8db5e432 Mon Sep 17 00:00:00 2001 From: Anton Tarasenko Date: Sun, 20 Aug 2023 18:19:15 +0700 Subject: [PATCH] Change `InfoQueryHandler` to respect "help" command's name change --- sources/InfoQueryHandler/InfoQueryHandler.uc | 35 +++++++++++++------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/sources/InfoQueryHandler/InfoQueryHandler.uc b/sources/InfoQueryHandler/InfoQueryHandler.uc index 6f22cdd..28b2824 100644 --- a/sources/InfoQueryHandler/InfoQueryHandler.uc +++ b/sources/InfoQueryHandler/InfoQueryHandler.uc @@ -34,7 +34,7 @@ var private const int TACEDIA_HELP_COMMANDS_CHAT, TACEDIA_HELP_COMMANDS_CONSOLE; var private const int TACEDIA_HELP_COMMANDS_CHAT_AND_CONSOLE; var private const int TACEDIA_HELP_COMMANDS_NO, TACEDIA_HELP_COMMANDS_USELESS; var private const int TACEDIA_RUNNING, TACEDIA_VERSION, TACEDIA_CREDITS; -var private const int TACEDIA_ACKNOWLEDGMENT, TPREFIX, TSEPARATOR; +var private const int TACEDIA_ACKNOWLEDGMENT, TPREFIX, THELP, TSEPARATOR; public static function StaticConstructor() { @@ -228,7 +228,7 @@ private final static function StopOutput() private final static function OutAcediaHelp() { - local MutableText prefix, builder; + local MutableText prefix, helpName, builder; default.currentOutput .Flush() @@ -242,12 +242,17 @@ private final static function OutAcediaHelp() .GetChatPrefix() .IntoMutableText() .ChangeDefaultColor(__().color.TextEmphasis); + helpName = class'Commands_Feature'.static + .GetHelpCommandName() + .IntoMutableText() + .ChangeDefaultColor(__().color.TextEmphasis); if ( class'Commands_Feature'.static.IsUsingChatInput() && class'Commands_Feature'.static.IsUsingMutateInput()) { builder = T(default.TACEDIA_HELP_COMMANDS_CHAT_AND_CONSOLE).MutableCopy(); builder.Replace(T(default.TPREFIX), prefix); + builder.Replace(T(default.THELP), helpName); default.currentOutput.WriteLine(builder); __().memory.Free(builder); } @@ -256,20 +261,24 @@ private final static function OutAcediaHelp() builder = T(default.TACEDIA_HELP_COMMANDS_CHAT).MutableCopy(); builder.Replace(T(default.TPREFIX), prefix); - default.currentOutput.WriteLine(builder); + builder.Replace(T(default.THELP), helpName); + default.currentOutput.WriteLine(builder); __().memory.Free(builder); } else if (class'Commands_Feature'.static.IsUsingMutateInput()) { - default.currentOutput - .WriteLine(T(default.TACEDIA_HELP_COMMANDS_CONSOLE)); + builder = + T(default.TACEDIA_HELP_COMMANDS_CONSOLE).MutableCopy(); + builder.Replace(T(default.THELP), helpName); + default.currentOutput.WriteLine(builder); + __().memory.Free(builder); } else { default.currentOutput .WriteLine(T(default.TACEDIA_HELP_COMMANDS_USELESS)); } - __().memory.Free(prefix); + __().memory.Free2(prefix, helpName); } private final static function OutAcediaStatus() @@ -297,11 +306,11 @@ defaultproperties TACEDIA_HELP = 2 stringConstants(2) = "Acedia always supports four commands: {$TextEmphasis help}, {$TextEmphasis status}, {$TextEmphasis version} and {$TextEmphasis credits}" TACEDIA_HELP_COMMANDS_CHAT = 3 - stringConstants(3) = "To get detailed information about available to you commands, please type {$TextEmphasis %PREFIX%help} in chat" + stringConstants(3) = "To get detailed information about available to you commands, please type {$TextEmphasis %PREFIX%%HELP%} in chat" TACEDIA_HELP_COMMANDS_CONSOLE = 4 - stringConstants(4) = "To get detailed information about available to you commands, please type {$TextEmphasis mutate help -l} in console" + stringConstants(4) = "To get detailed information about available to you commands, please type {$TextEmphasis mutate %HELP% -l} in console" TACEDIA_HELP_COMMANDS_CHAT_AND_CONSOLE = 5 - stringConstants(5) = "To get detailed information about available to you commands, please type {$TextEmphasis %PREFIX%help} in chat or {$TextEmphasis mutate help -l} in console" + stringConstants(5) = "To get detailed information about available to you commands, please type {$TextEmphasis %PREFIX%%HELP%} in chat or {$TextEmphasis mutate %HELP% -l} in console" TACEDIA_HELP_COMMANDS_NO = 6 stringConstants(6) = "Unfortunately other commands aren't available right now. To enable them please type {$TextEmphasis mutate acediacommands} in console if you have enough rights to reenable them." TACEDIA_HELP_COMMANDS_USELESS = 7 @@ -311,11 +320,13 @@ defaultproperties TACEDIA_VERSION = 9 stringConstants(9) = "AcediaCore version 0.1.dev8 - this is a development version, bugs and issues are expected" TACEDIA_CREDITS = 10 - stringConstants(10) = "AcediaCore was developed by dkanus, 2019 - 2022" + stringConstants(10) = "AcediaCore was developed by dkanus, 2019 - 2023" TACEDIA_ACKNOWLEDGMENT = 11 stringConstants(11) = "Special thanks for NikC- and Chaos for suggestions, testing and discussion" TPREFIX = 12 stringConstants(12) = "%PREFIX%" - TSEPARATOR = 13 - stringConstants(13) = "=============================" + THELP = 13 + stringConstants(13) = "%HELP%" + TSEPARATOR = 14 + stringConstants(14) = "=============================" } \ No newline at end of file