- added patch from Taoki for showing time of game day under minimap (thanks)

This commit is contained in:
Mark Vejvoda 2012-08-15 14:37:27 +00:00
parent 3c1651d084
commit 648c3e190a
3 changed files with 36 additions and 0 deletions

View File

@ -3768,6 +3768,11 @@ void Game::render2d() {
}
}
// clock
if(photoModeEnabled == false) {
renderer.renderClock();
}
//resource info
if(photoModeEnabled == false) {
if(this->masterserverMode == false) {

View File

@ -2241,6 +2241,36 @@ void Renderer::renderChatManager(const ChatManager *chatManager) {
}
}
void Renderer::renderClock() {
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == true) {
return;
}
const Metrics &metrics = Metrics::getInstance();
const World *world = game->getWorld();
const Vec4f fontColor = game->getGui()->getDisplay()->getColor();
int hours = world->getTimeFlow()->getTime();
int minutes = (world->getTimeFlow()->getTime() - hours) * 100 * 0.6; // scale 100 to 60
char szBuf[100]="";
sprintf(szBuf,"%.2d:%.2d",hours,minutes);
string str = szBuf;
if(renderText3DEnabled == true) {
renderTextShadow3D(
str, CoreData::getInstance().getDisplayFontSmall3D(),
fontColor,
10, metrics.getVirtualH()-160, false);
}
else {
renderTextShadow(
str, CoreData::getInstance().getDisplayFontSmall(),
fontColor,
10, metrics.getVirtualH()-160, false);
}
}
void Renderer::renderResourceStatus() {
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == true) {
return;

View File

@ -478,6 +478,7 @@ public:
void renderConsoleLine(int lineIndex, int xPosition, int yPosition, int lineHeight, Font2D* font, string stringToHightlight, const ConsoleLineInfo *lineInfo);
void renderChatManager(const ChatManager *chatManager);
void renderClock();
void renderResourceStatus();
void renderSelectionQuad();
void renderText(const string &text, Font2D *font, float alpha, int x, int y, bool centered= false);