mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-10 22:31:40 +02:00
option to show full background
This commit is contained in:
@@ -34,6 +34,10 @@ CampaignEditor::CampaignEditor():
|
|||||||
ui->actionNew->setIcon(QIcon{":/icons/document-new.png"});
|
ui->actionNew->setIcon(QIcon{":/icons/document-new.png"});
|
||||||
ui->actionScenarioProperties->setIcon(QIcon{":/icons/menu-settings.png"});
|
ui->actionScenarioProperties->setIcon(QIcon{":/icons/menu-settings.png"});
|
||||||
ui->actionCampaignProperties->setIcon(QIcon{":/icons/menu-mods.png"});
|
ui->actionCampaignProperties->setIcon(QIcon{":/icons/menu-mods.png"});
|
||||||
|
ui->actionShowFullBackground->setIcon(QIcon{":/icons/tool-area.png"});
|
||||||
|
|
||||||
|
ui->actionShowFullBackground->setCheckable(true);
|
||||||
|
connect(ui->actionShowFullBackground, &QAction::triggered, [this](){ redraw(); });
|
||||||
|
|
||||||
campaignScene.reset(new CampaignScene());
|
campaignScene.reset(new CampaignScene());
|
||||||
ui->campaignView->setScene(campaignScene.get());
|
ui->campaignView->setScene(campaignScene.get());
|
||||||
@@ -65,6 +69,8 @@ void CampaignEditor::redraw()
|
|||||||
campaignScene->clear();
|
campaignScene->clear();
|
||||||
|
|
||||||
auto background = BitmapHandler::loadBitmap(campaignState->getRegions().getBackgroundName().getName());
|
auto background = BitmapHandler::loadBitmap(campaignState->getRegions().getBackgroundName().getName());
|
||||||
|
if(!ui->actionShowFullBackground->isChecked())
|
||||||
|
background = background.copy(0, 0, 456, 600);
|
||||||
campaignScene->addItem(new QGraphicsPixmapItem(QPixmap::fromImage(background)));
|
campaignScene->addItem(new QGraphicsPixmapItem(QPixmap::fromImage(background)));
|
||||||
for (auto & s : campaignState->scenarios)
|
for (auto & s : campaignState->scenarios)
|
||||||
{
|
{
|
||||||
@@ -105,6 +111,7 @@ void CampaignEditor::redraw()
|
|||||||
campaignScene->addItem(pixmap);
|
campaignScene->addItem(pixmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
campaignScene->setSceneRect(background.rect());
|
||||||
ui->campaignView->show();
|
ui->campaignView->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -47,8 +47,15 @@
|
|||||||
<addaction name="actionCampaignProperties"/>
|
<addaction name="actionCampaignProperties"/>
|
||||||
<addaction name="actionScenarioProperties"/>
|
<addaction name="actionScenarioProperties"/>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QMenu" name="menuView">
|
||||||
|
<property name="title">
|
||||||
|
<string>View</string>
|
||||||
|
</property>
|
||||||
|
<addaction name="actionShowFullBackground"/>
|
||||||
|
</widget>
|
||||||
<addaction name="menuFile"/>
|
<addaction name="menuFile"/>
|
||||||
<addaction name="menuEdit"/>
|
<addaction name="menuEdit"/>
|
||||||
|
<addaction name="menuView"/>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
@@ -68,6 +75,8 @@
|
|||||||
<addaction name="separator"/>
|
<addaction name="separator"/>
|
||||||
<addaction name="actionCampaignProperties"/>
|
<addaction name="actionCampaignProperties"/>
|
||||||
<addaction name="actionScenarioProperties"/>
|
<addaction name="actionScenarioProperties"/>
|
||||||
|
<addaction name="separator"/>
|
||||||
|
<addaction name="actionShowFullBackground"/>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
@@ -144,6 +153,17 @@
|
|||||||
<string notr="true">Enter</string>
|
<string notr="true">Enter</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="actionShowFullBackground">
|
||||||
|
<property name="text">
|
||||||
|
<string>Show full background</string>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Show full background</string>
|
||||||
|
</property>
|
||||||
|
<property name="shortcut">
|
||||||
|
<string notr="true">F</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
|
Reference in New Issue
Block a user