mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-21 21:17:49 +02:00
Support for player-colored images in configurable UI
This commit is contained in:
parent
d3ecd43aba
commit
ffb37f067a
@ -13,6 +13,7 @@
|
|||||||
#include "InterfaceObjectConfigurable.h"
|
#include "InterfaceObjectConfigurable.h"
|
||||||
|
|
||||||
#include "../CGameInfo.h"
|
#include "../CGameInfo.h"
|
||||||
|
#include "../CPlayerInterface.h"
|
||||||
#include "../gui/CAnimation.h"
|
#include "../gui/CAnimation.h"
|
||||||
#include "../gui/CGuiHandler.h"
|
#include "../gui/CGuiHandler.h"
|
||||||
#include "../widgets/CComponent.h"
|
#include "../widgets/CComponent.h"
|
||||||
@ -257,6 +258,9 @@ std::shared_ptr<CPicture> InterfaceObjectConfigurable::buildPicture(const JsonNo
|
|||||||
auto pic = std::make_shared<CPicture>(image, position.x, position.y);
|
auto pic = std::make_shared<CPicture>(image, position.x, position.y);
|
||||||
if(!config["visible"].isNull())
|
if(!config["visible"].isNull())
|
||||||
pic->visible = config["visible"].Bool();
|
pic->visible = config["visible"].Bool();
|
||||||
|
|
||||||
|
if ( config["playerColored"].Bool() && LOCPLINT)
|
||||||
|
pic->colorize(LOCPLINT->playerID);
|
||||||
return pic;
|
return pic;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,12 +4,14 @@
|
|||||||
{
|
{
|
||||||
"type": "picture",
|
"type": "picture",
|
||||||
"name": "menuTactics",
|
"name": "menuTactics",
|
||||||
|
"playerColored" : true,
|
||||||
"position": {"x": 0, "y": 556},
|
"position": {"x": 0, "y": 556},
|
||||||
"image": "COPLACBR.bmp"
|
"image": "COPLACBR.bmp"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "picture",
|
"type": "picture",
|
||||||
"name": "menuBattle",
|
"name": "menuBattle",
|
||||||
|
"playerColored" : true,
|
||||||
"position": {"x": 0, "y": 556},
|
"position": {"x": 0, "y": 556},
|
||||||
"image": "CBAR.bmp"
|
"image": "CBAR.bmp"
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user