diff options
Diffstat (limited to 'src/dedicated')
-rw-r--r-- | src/dedicated/console.cc | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/dedicated/console.cc b/src/dedicated/console.cc index c2b71c0..b1629fd 100644 --- a/src/dedicated/console.cc +++ b/src/dedicated/console.cc @@ -206,10 +206,26 @@ void Console::draw_status() if (core::game()) { attroff(A_BOLD); color_set(2, NULL); - int minutes = (int) floorf(core::game()->time() / 60.0f); - int seconds = (int) floorf(core::game()->time() - (float) minutes * 60.0f); + std::stringstream status; - status << "time " << std::setfill(' ') << std::setw(3) << minutes << ":" << std::setfill('0') << std::setw(2) << seconds; + + // system time + int year = 0, month = 0, day = 0, hour = 0, min = 0, sec = 0; + sys::get_datetime(year, month, day, hour, min, sec); + + status << std::setw(4) << std::setfill('0') << year << "-" + << std::setw(2) << std::setfill('0') << month << "-" + << std::setw(2) << std::setfill('0') << day << " " + << std::setw(2) << hour << ":" + << std::setw(2) << min << ":" + << std::setw(2) << sec << " " + << std::setw(2) << " "; + + // uptime + int uptime_minutes = (int) floorf(core::game()->time() / 60.0f); + int uptime_seconds = (int) floorf(core::game()->time() - (float) uptime_minutes * 60.0f); + status << "uptime " << std::setfill(' ') << std::setw(3) << uptime_minutes << ":" << std::setfill('0') << std::setw(2) << uptime_seconds; + mvaddnstr(0, 1, status.str().c_str(), status.str().size()); } } |