diff options
author | lonaasan <shadowlona@shadowlona.dev> | 2024-09-06 23:29:02 +0200 |
---|---|---|
committer | lonaasan <shadowlona@shadowlona.dev> | 2024-09-06 23:29:02 +0200 |
commit | 57e9d13e6a2d182a93fb32124e1334a5a6972e94 (patch) | |
tree | 4728cce132a1678d55c909168bca9c4c2208b727 /source/game/StarCommandProcessor.cpp | |
parent | 90db1e0fbadaeb625691d3d0d13f5ae6ef057109 (diff) |
Added custom OpenSB help text categories and descriptions
Diffstat (limited to 'source/game/StarCommandProcessor.cpp')
-rw-r--r-- | source/game/StarCommandProcessor.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source/game/StarCommandProcessor.cpp b/source/game/StarCommandProcessor.cpp index 14413b4..b5beb20 100644 --- a/source/game/StarCommandProcessor.cpp +++ b/source/game/StarCommandProcessor.cpp @@ -53,12 +53,14 @@ String CommandProcessor::help(ConnectionId connectionId, String const& argumentS auto assets = Root::singleton().assets(); auto basicCommands = assets->json("/help.config:basicCommands"); + auto openSbCommands = assets->json("/help.config:openSbCommands"); auto adminCommands = assets->json("/help.config:adminCommands"); auto debugCommands = assets->json("/help.config:debugCommands"); + auto openSbDebugCommands = assets->json("/help.config:openSbDebugCommands"); if (arguments.size()) { if (arguments.size() >= 1) { - if (auto helpText = basicCommands.optString(arguments[0]).orMaybe(adminCommands.optString(arguments[0])).orMaybe(debugCommands.optString(arguments[0]))) + if (auto helpText = basicCommands.optString(arguments[0]).orMaybe(openSbCommands.optString(arguments[0])).orMaybe(adminCommands.optString(arguments[0])).orMaybe(debugCommands.optString(arguments[0])).orMaybe(openSbDebugCommands.optString(arguments[0]))) return *helpText; } } @@ -74,12 +76,18 @@ String CommandProcessor::help(ConnectionId connectionId, String const& argumentS String basicHelpFormat = assets->json("/help.config:basicHelpText").toString(); res = res + strf(basicHelpFormat.utf8Ptr(), commandDescriptions(basicCommands)); + String openSbHelpFormat = assets->json("/help.config:openSbHelpText").toString(); + res = res + "\n" + strf(openSbHelpFormat.utf8Ptr(), commandDescriptions(openSbCommands)); + if (!adminCheck(connectionId, "")) { String adminHelpFormat = assets->json("/help.config:adminHelpText").toString(); res = res + "\n" + strf(adminHelpFormat.utf8Ptr(), commandDescriptions(adminCommands)); String debugHelpFormat = assets->json("/help.config:debugHelpText").toString(); res = res + "\n" + strf(debugHelpFormat.utf8Ptr(), commandDescriptions(debugCommands)); + + String openSbDebugHelpFormat = assets->json("/help.config:openSbDebugHelpText").toString(); + res = res + "\n" + strf(openSbDebugHelpFormat.utf8Ptr(), commandDescriptions(openSbDebugCommands)); } res = res + "\n" + basicCommands.getString("help"); |