From 5bbd63b79ab80bcef562080d52b15dc024c55c46 Mon Sep 17 00:00:00 2001 From: Alexandr Akulich Date: Wed, 11 Jan 2017 17:11:28 +0300 Subject: [PATCH] Implemented "set time [hh mm]" console command --- src/target/REGoth.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/target/REGoth.cpp b/src/target/REGoth.cpp index d7569fa7..b26519f8 100755 --- a/src/target/REGoth.cpp +++ b/src/target/REGoth.cpp @@ -375,6 +375,17 @@ class ExampleCubes : public /*entry::AppI*/ PLATFORM_CLASS return "Set time to " + std::to_string(t); }); + console.registerCommand("set time", [this](const std::vector& args) -> std::string { + if(args.size() != 4) + return "Invalid arguments. Usage: set time [hh mm]"; + + int hh = std::stoi(args[2]); + int mm = std::stoi(args[3]); + m_pEngine->getMainWorld().get().getSky().getTimeOfDay(hh, mm); + + return "Set time to " + args[2] + ":" + args[3]; + }); + console.registerCommand("heroexport", [this](const std::vector& args) -> std::string { auto& s = m_pEngine->getMainWorld().get().getScriptEngine();