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 diff --git a/source/frontend/StarClientCommandProcessor.hpp b/source/frontend/StarClientCommandProcessor.hpp index 94dad5d..c3978a4 100644 --- a/source/frontend/StarClientCommandProcessor.hpp +++ b/source/frontend/StarClientCommandProcessor.hpp @@ -59,6 +59,7 @@ private: String upgradeShip(String const& argumentsString); String swap(String const& argumentsString); String respawnInWorld(String const& argumentsString); + String render(String const& imagePath); UniverseClientPtr m_universeClient; CinematicPtr m_cinematicOverlay;