1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-26 03:52:01 +02:00

Paint timer color into player color

This commit is contained in:
nordsoft 2023-08-19 19:45:25 +04:00
parent d4ab3087cb
commit 314a17cdd9
2 changed files with 10 additions and 1 deletions

View File

@ -15,6 +15,7 @@
#include "../CPlayerInterface.h"
#include "../render/EFont.h"
#include "../render/Graphics.h"
#include "../gui/CGuiHandler.h"
#include "../gui/TextAlignment.h"
#include "../widgets/Images.h"
@ -77,6 +78,13 @@ void TurnTimerWidget::setTime(int time)
std::ostringstream oss;
oss << turnTime / 60 << ":" << std::setw(2) << std::setfill('0') << turnTime % 60;
w->setText(oss.str());
if(graphics && LOCPLINT && LOCPLINT->cb
&& variables["textColorFromPlayerColor"].Bool()
&& LOCPLINT->cb->getCurrentPlayer().isValidPlayer())
{
w->setColor(graphics->playerColors[LOCPLINT->cb->getCurrentPlayer()]);
}
}
}

View File

@ -28,6 +28,7 @@
"variables":
{
"notificationTime": [0, 1, 2, 3, 4, 5, 20],
"notificationSound": "WE5"
"notificationSound": "WE5",
"textColorFromPlayerColor": true
}
}