1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-19 21:10:12 +02:00

pos from texture

This commit is contained in:
Laserlicht 2023-10-01 19:44:04 +02:00 committed by GitHub
parent cbd014ac88
commit 12ca3ea0ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -49,9 +49,6 @@ CMapOverview::CMapOverview(std::string mapName, std::string fileName, std::strin
OBJ_CONSTRUCTION_CAPTURING_ALL_NO_DISPOSE;
const JsonNode config(JsonPath::builtin("config/widgets/mapOverview.json"));
pos = Rect(0, 0, config["items"][0]["rect"]["w"].Integer(), config["items"][0]["rect"]["h"].Integer());
widget = std::make_shared<CMapOverviewWidget>(*this);
updateShadow();
@ -179,6 +176,10 @@ CMapOverviewWidget::CMapOverviewWidget(CMapOverview& parent):
build(config);
if(auto w = widget<CFilledTexture>("background"))
{
p.pos = w->pos;
}
if(auto w = widget<CTextBox>("fileName"))
{
w->setText(p.fileName);