1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-12-13 23:57:41 +02:00

Fixed visibility of corner gems

This commit is contained in:
Ivan Savenko
2023-04-26 18:12:18 +03:00
parent a015bf6507
commit 4958190e82
6 changed files with 143 additions and 69 deletions

View File

@@ -32,8 +32,10 @@
CAdventureMapWidget::CAdventureMapWidget()
: state(EGameState::NOT_INITIALIZED)
{
pos.w = 800;
pos.h = 600;
pos.x = pos.y = 0;
pos.w = GH.screenDimensions().x;
pos.h = GH.screenDimensions().y;
REGISTER_BUILDER("adventureInfobar", &CAdventureMapWidget::buildInfobox );
REGISTER_BUILDER("adventureMapImage", &CAdventureMapWidget::buildMapImage );
REGISTER_BUILDER("adventureMapButton", &CAdventureMapWidget::buildMapButton );
@@ -154,7 +156,12 @@ std::shared_ptr<CIntObject> CAdventureMapWidget::buildMapButton(const JsonNode &
std::shared_ptr<CIntObject> CAdventureMapWidget::buildMapContainer(const JsonNode & input)
{
auto position = readTargetArea(input["area"]);
auto result = std::make_shared<CAdventureMapContainerWidget>();
std::shared_ptr<CAdventureMapContainerWidget> result;
if (input["overlay"].Bool())
result = std::make_shared<CAdventureMapOverlayWidget>();
else
result = std::make_shared<CAdventureMapContainerWidget>();
result->moveBy(position.topLeft());
subwidgetSizes.push_back(position);
@@ -388,3 +395,8 @@ void CAdventureMapIcon::setPlayer(const PlayerColor & player)
{
image->setFrame(index + player.getNum() * iconsPerPlayer);
}
void CAdventureMapOverlayWidget::show(SDL_Surface * to)
{
CIntObject::showAll(to);
}