1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-12-07 23:33:15 +02:00

Proper support for player-colored buttons in UI

This commit is contained in:
Ivan Savenko
2023-05-03 19:05:07 +03:00
parent 7aacba6e55
commit d4098059b8
7 changed files with 46 additions and 25 deletions

View File

@@ -17,6 +17,7 @@
#include "CResDataBar.h"
#include "../gui/CGuiHandler.h"
#include "../gui/Shortcut.h"
#include "../mapView/MapView.h"
#include "../render/CAnimation.h"
#include "../render/IImage.h"
@@ -158,8 +159,9 @@ std::shared_ptr<CIntObject> CAdventureMapWidget::buildMapButton(const JsonNode &
auto position = readTargetArea(input["area"]);
auto image = input["image"].String();
auto help = readHintText(input["help"]);
bool playerColored = input["playerColored"].Bool();
auto button = std::make_shared<CButton>(position.topLeft(), image, help);
auto button = std::make_shared<CButton>(position.topLeft(), image, help, 0, EShortcut::NONE, playerColored);
loadButtonHotkey(button, input["hotkey"]);