Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/frontend/StarClientCommandProcessor.cpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2025-02-03 09:26:37 +1100
committerKae <80987908+Novaenia@users.noreply.github.com>2025-02-03 09:26:37 +1100
commitb53b8ecca0e7690d8ddffbcad21d229851d5205d (patch)
tree5f1a8fd6d65b77870aaea78dd8fb5995611f72b3 /source/frontend/StarClientCommandProcessor.cpp
parent56f384a2acef619f287db700f48e8f1a3ec71e61 (diff)
add /hotreload
Diffstat (limited to 'source/frontend/StarClientCommandProcessor.cpp')
-rw-r--r--source/frontend/StarClientCommandProcessor.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/frontend/StarClientCommandProcessor.cpp b/source/frontend/StarClientCommandProcessor.cpp
index 7671a00..c19c68f 100644
--- a/source/frontend/StarClientCommandProcessor.cpp
+++ b/source/frontend/StarClientCommandProcessor.cpp
@@ -20,6 +20,7 @@ ClientCommandProcessor::ClientCommandProcessor(UniverseClientPtr universeClient,
m_paneManager(paneManager), m_macroCommands(std::move(macroCommands)) {
m_builtinCommands = {
{"reload", bind(&ClientCommandProcessor::reload, this)},
+ {"hotReload", bind(&ClientCommandProcessor::hotReload, this)},
{"whoami", bind(&ClientCommandProcessor::whoami, this)},
{"gravity", bind(&ClientCommandProcessor::gravity, this)},
{"debug", bind(&ClientCommandProcessor::debug, this, _1)},
@@ -128,6 +129,11 @@ String ClientCommandProcessor::reload() {
return "Client Star::Root reloaded";
}
+String ClientCommandProcessor::hotReload() {
+ Root::singleton().hotReload();
+ return "Hot-reloaded assets";
+}
+
String ClientCommandProcessor::whoami() {
return strf("Client: You are {}. You are {}an Admin.",
m_universeClient->mainPlayer()->name(), m_universeClient->mainPlayer()->isAdmin() ? "" : "not ");