Skip to content

Commit

Permalink
Implemented "set time [hh mm]" console command
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandr Akulich committed Jan 11, 2017
1 parent 77203dc commit 5bbd63b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/target/REGoth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string>& 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<std::string>& args) -> std::string {
auto& s = m_pEngine->getMainWorld().get().getScriptEngine();

Expand Down

0 comments on commit 5bbd63b

Please sign in to comment.