1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +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()
{
int maxLevels = GAME->interface()->cb->getMapSize().z;
if (maxLevels < 2) // TODO: multilevel support
return;
owner.hotkeySwitchMapLevel();
}

View File

@@ -116,8 +116,9 @@ void MapView::onMapLevelSwitched()
{
if(GAME->interface()->cb->getMapSize().z > 1)
{
if(model->getLevel() == 0)
controller->setViewCenter(model->getMapViewCenter(), 1);
int newLevel = model->getLevel() + 1;
if(newLevel < GAME->interface()->cb->getMapSize().z)
controller->setViewCenter(model->getMapViewCenter(), newLevel);
else
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->fill(Qt::transparent);
if(scene->level == 0 || map->mapLevels == 2) // TODO: multilevel support
{
QPainter painter(pixmap.get());
for(int j = 0; j < map->height; ++j)
{
@@ -107,7 +105,6 @@ void PassabilityLayer::update()
}
}
}
}
redraw();
}
@@ -121,8 +118,6 @@ void ObjectPickerLayer::highlight(std::function<bool(const CGObjectInstance *)>
if(!map)
return;
if(scene->level == 0 || map->mapLevels == 2) // TODO: multilevel support
{
for(int j = 0; j < map->height; ++j)
{
for(int i = 0; i < map->width; ++i)
@@ -141,7 +136,6 @@ void ObjectPickerLayer::highlight(std::function<bool(const CGObjectInstance *)>
}
}
}
}
isActive = true;
}