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

summaryrefslogtreecommitdiff
path: root/source/frontend/StarClientCommandProcessor.cpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2024-12-27 20:14:36 +1100
committerKae <80987908+Novaenia@users.noreply.github.com>2024-12-27 20:14:36 +1100
commit5cf11ead986b950a9932fae667805fd71d79fa72 (patch)
treef0e3ad6d0aa2675d7189afae14c9ccfc31a00491 /source/frontend/StarClientCommandProcessor.cpp
parent3205f3b2831eba410b96727d2bae33205689ea96 (diff)
temporary /render cmd for debugging
Diffstat (limited to 'source/frontend/StarClientCommandProcessor.cpp')
-rw-r--r--source/frontend/StarClientCommandProcessor.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/source/frontend/StarClientCommandProcessor.cpp b/source/frontend/StarClientCommandProcessor.cpp
index e0fe827..5b2ca0f 100644
--- a/source/frontend/StarClientCommandProcessor.cpp
+++ b/source/frontend/StarClientCommandProcessor.cpp
@@ -52,7 +52,8 @@ ClientCommandProcessor::ClientCommandProcessor(UniverseClientPtr universeClient,
{"enabletech", bind(&ClientCommandProcessor::enableTech, this, _1)},
{"upgradeship", bind(&ClientCommandProcessor::upgradeShip, this, _1)},
{"swap", bind(&ClientCommandProcessor::swap, this, _1)},
- {"respawnInWorld", bind(&ClientCommandProcessor::respawnInWorld, this, _1)}
+ {"respawnInWorld", bind(&ClientCommandProcessor::respawnInWorld, this, _1)},
+ {"render", bind(&ClientCommandProcessor::render, this, _1)}
};
}
@@ -440,4 +441,12 @@ String ClientCommandProcessor::respawnInWorld(String const& argumentsString) {
return strf("Respawn in this world set to {} (This is client-side!)", respawnInWorld ? "true" : "false");
}
+// Temporary hardcoded render command for debugging purposes, future version will write to the clipboard
+String ClientCommandProcessor::render(String const& imagePath) {
+ auto image = Root::singleton().assets()->image(imagePath);
+ image->writePng(File::open("render.png", IOMode::Write));
+ return strf("Saved {}x{} image to render.png", image->width(), image->height());
+}
+
+
} \ No newline at end of file