mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
ui support
This commit is contained in:
@@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user