Browse Source

Change `InfoQueryHandler` to respect "help" command's name change

develop
Anton Tarasenko 1 year ago
parent
commit
a27e893359
  1. 35
      sources/InfoQueryHandler/InfoQueryHandler.uc

35
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_CHAT_AND_CONSOLE;
var private const int TACEDIA_HELP_COMMANDS_NO, TACEDIA_HELP_COMMANDS_USELESS; 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_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() public static function StaticConstructor()
{ {
@ -228,7 +228,7 @@ private final static function StopOutput()
private final static function OutAcediaHelp() private final static function OutAcediaHelp()
{ {
local MutableText prefix, builder; local MutableText prefix, helpName, builder;
default.currentOutput default.currentOutput
.Flush() .Flush()
@ -242,12 +242,17 @@ private final static function OutAcediaHelp()
.GetChatPrefix() .GetChatPrefix()
.IntoMutableText() .IntoMutableText()
.ChangeDefaultColor(__().color.TextEmphasis); .ChangeDefaultColor(__().color.TextEmphasis);
helpName = class'Commands_Feature'.static
.GetHelpCommandName()
.IntoMutableText()
.ChangeDefaultColor(__().color.TextEmphasis);
if ( class'Commands_Feature'.static.IsUsingChatInput() if ( class'Commands_Feature'.static.IsUsingChatInput()
&& class'Commands_Feature'.static.IsUsingMutateInput()) && class'Commands_Feature'.static.IsUsingMutateInput())
{ {
builder = builder =
T(default.TACEDIA_HELP_COMMANDS_CHAT_AND_CONSOLE).MutableCopy(); T(default.TACEDIA_HELP_COMMANDS_CHAT_AND_CONSOLE).MutableCopy();
builder.Replace(T(default.TPREFIX), prefix); builder.Replace(T(default.TPREFIX), prefix);
builder.Replace(T(default.THELP), helpName);
default.currentOutput.WriteLine(builder); default.currentOutput.WriteLine(builder);
__().memory.Free(builder); __().memory.Free(builder);
} }
@ -256,20 +261,24 @@ private final static function OutAcediaHelp()
builder = builder =
T(default.TACEDIA_HELP_COMMANDS_CHAT).MutableCopy(); T(default.TACEDIA_HELP_COMMANDS_CHAT).MutableCopy();
builder.Replace(T(default.TPREFIX), prefix); builder.Replace(T(default.TPREFIX), prefix);
default.currentOutput.WriteLine(builder); builder.Replace(T(default.THELP), helpName);
default.currentOutput.WriteLine(builder);
__().memory.Free(builder); __().memory.Free(builder);
} }
else if (class'Commands_Feature'.static.IsUsingMutateInput()) else if (class'Commands_Feature'.static.IsUsingMutateInput())
{ {
default.currentOutput builder =
.WriteLine(T(default.TACEDIA_HELP_COMMANDS_CONSOLE)); T(default.TACEDIA_HELP_COMMANDS_CONSOLE).MutableCopy();
builder.Replace(T(default.THELP), helpName);
default.currentOutput.WriteLine(builder);
__().memory.Free(builder);
} }
else else
{ {
default.currentOutput default.currentOutput
.WriteLine(T(default.TACEDIA_HELP_COMMANDS_USELESS)); .WriteLine(T(default.TACEDIA_HELP_COMMANDS_USELESS));
} }
__().memory.Free(prefix); __().memory.Free2(prefix, helpName);
} }
private final static function OutAcediaStatus() private final static function OutAcediaStatus()
@ -297,11 +306,11 @@ defaultproperties
TACEDIA_HELP = 2 TACEDIA_HELP = 2
stringConstants(2) = "Acedia always supports four commands: {$TextEmphasis help}, {$TextEmphasis status}, {$TextEmphasis version} and {$TextEmphasis credits}" stringConstants(2) = "Acedia always supports four commands: {$TextEmphasis help}, {$TextEmphasis status}, {$TextEmphasis version} and {$TextEmphasis credits}"
TACEDIA_HELP_COMMANDS_CHAT = 3 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 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 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 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." 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 TACEDIA_HELP_COMMANDS_USELESS = 7
@ -311,11 +320,13 @@ defaultproperties
TACEDIA_VERSION = 9 TACEDIA_VERSION = 9
stringConstants(9) = "AcediaCore version 0.1.dev8 - this is a development version, bugs and issues are expected" stringConstants(9) = "AcediaCore version 0.1.dev8 - this is a development version, bugs and issues are expected"
TACEDIA_CREDITS = 10 TACEDIA_CREDITS = 10
stringConstants(10) = "AcediaCore was developed by dkanus, 2019 - 2022" stringConstants(10) = "AcediaCore was developed by dkanus, 2019 - 2023"
TACEDIA_ACKNOWLEDGMENT = 11 TACEDIA_ACKNOWLEDGMENT = 11
stringConstants(11) = "Special thanks for NikC- and Chaos for suggestions, testing and discussion" stringConstants(11) = "Special thanks for NikC- and Chaos for suggestions, testing and discussion"
TPREFIX = 12 TPREFIX = 12
stringConstants(12) = "%PREFIX%" stringConstants(12) = "%PREFIX%"
TSEPARATOR = 13 THELP = 13
stringConstants(13) = "=============================" stringConstants(13) = "%HELP%"
TSEPARATOR = 14
stringConstants(14) = "============================="
} }
Loading…
Cancel
Save