diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-07-04 04:42:16 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-07-04 04:42:16 +1000 |
commit | c343a7dfafb0b2e5e063ec83fd87cd05d5387b13 (patch) | |
tree | d525d784492eadc66963fb4af20b8d2b9f6ec48b /source/frontend/StarClientCommandProcessor.cpp | |
parent | 081dd693ca57ef624342e729c5b27b2e5da98410 (diff) |
Add toggle for debug HUD
Diffstat (limited to 'source/frontend/StarClientCommandProcessor.cpp')
-rw-r--r-- | source/frontend/StarClientCommandProcessor.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/source/frontend/StarClientCommandProcessor.cpp b/source/frontend/StarClientCommandProcessor.cpp index b6ab53c..0f78ea0 100644 --- a/source/frontend/StarClientCommandProcessor.cpp +++ b/source/frontend/StarClientCommandProcessor.cpp @@ -21,7 +21,7 @@ ClientCommandProcessor::ClientCommandProcessor(UniverseClientPtr universeClient, {"reload", bind(&ClientCommandProcessor::reload, this)}, {"whoami", bind(&ClientCommandProcessor::whoami, this)}, {"gravity", bind(&ClientCommandProcessor::gravity, this)}, - {"debug", bind(&ClientCommandProcessor::debug, this)}, + {"debug", bind(&ClientCommandProcessor::debug, this, _1)}, {"boxes", bind(&ClientCommandProcessor::boxes, this)}, {"fullbright", bind(&ClientCommandProcessor::fullbright, this)}, {"asyncLighting", bind(&ClientCommandProcessor::asyncLighting, this)}, @@ -105,6 +105,10 @@ bool ClientCommandProcessor::debugDisplayEnabled() const { return m_debugDisplayEnabled; } +bool ClientCommandProcessor::debugHudEnabled() const { + return m_debugHudEnabled; +} + bool ClientCommandProcessor::fixedCameraEnabled() const { return m_fixedCameraEnabled; } @@ -126,12 +130,18 @@ String ClientCommandProcessor::gravity() { return strf("{}", m_universeClient->worldClient()->gravity(m_universeClient->mainPlayer()->position())); } -String ClientCommandProcessor::debug() { +String ClientCommandProcessor::debug(StringList const& arguments) { if (!adminCommandAllowed()) return "You must be an admin to use this command."; - m_debugDisplayEnabled = !m_debugDisplayEnabled; - return strf("Debug display {}", m_debugDisplayEnabled ? "enabled" : "disabled"); + if (!arguments.empty() && arguments.at(0).equalsIgnoreCase("hud")) { + m_debugHudEnabled = !m_debugHudEnabled; + return strf("Debug HUD {}", m_debugHudEnabled ? "enabled" : "disabled"); + } + else { + m_debugDisplayEnabled = !m_debugDisplayEnabled; + return strf("Debug display {}", m_debugDisplayEnabled ? "enabled" : "disabled"); + } } String ClientCommandProcessor::boxes() { |