1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

ui support

This commit is contained in:
Laserlicht
2025-08-02 02:33:47 +02:00
parent 4552c1f562
commit d2d0b2292e
3 changed files with 21 additions and 30 deletions

View File

@@ -153,10 +153,6 @@ void AdventureMapShortcuts::worldViewScale4x()
void AdventureMapShortcuts::switchMapLevel() void AdventureMapShortcuts::switchMapLevel()
{ {
int maxLevels = GAME->interface()->cb->getMapSize().z;
if (maxLevels < 2) // TODO: multilevel support
return;
owner.hotkeySwitchMapLevel(); owner.hotkeySwitchMapLevel();
} }

View File

@@ -116,8 +116,9 @@ void MapView::onMapLevelSwitched()
{ {
if(GAME->interface()->cb->getMapSize().z > 1) if(GAME->interface()->cb->getMapSize().z > 1)
{ {
if(model->getLevel() == 0) int newLevel = model->getLevel() + 1;
controller->setViewCenter(model->getMapViewCenter(), 1); if(newLevel < GAME->interface()->cb->getMapSize().z)
controller->setViewCenter(model->getMapViewCenter(), newLevel);
else else
controller->setViewCenter(model->getMapViewCenter(), 0); controller->setViewCenter(model->getMapViewCenter(), 0);
} }

View File

@@ -93,8 +93,6 @@ void PassabilityLayer::update()
pixmap.reset(new QPixmap(map->width * 32, map->height * 32)); pixmap.reset(new QPixmap(map->width * 32, map->height * 32));
pixmap->fill(Qt::transparent); pixmap->fill(Qt::transparent);
if(scene->level == 0 || map->mapLevels == 2) // TODO: multilevel support
{
QPainter painter(pixmap.get()); QPainter painter(pixmap.get());
for(int j = 0; j < map->height; ++j) for(int j = 0; j < map->height; ++j)
{ {
@@ -107,7 +105,6 @@ void PassabilityLayer::update()
} }
} }
} }
}
redraw(); redraw();
} }
@@ -121,8 +118,6 @@ void ObjectPickerLayer::highlight(std::function<bool(const CGObjectInstance *)>
if(!map) if(!map)
return; return;
if(scene->level == 0 || map->mapLevels == 2) // TODO: multilevel support
{
for(int j = 0; j < map->height; ++j) for(int j = 0; j < map->height; ++j)
{ {
for(int i = 0; i < map->width; ++i) for(int i = 0; i < map->width; ++i)
@@ -141,7 +136,6 @@ void ObjectPickerLayer::highlight(std::function<bool(const CGObjectInstance *)>
} }
} }
} }
}
isActive = true; isActive = true;
} }