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->actionScenarioProperties->setIcon(QIcon{":/icons/menu-settings.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());
|
||||
ui->campaignView->setScene(campaignScene.get());
|
||||
@@ -65,6 +69,8 @@ void CampaignEditor::redraw()
|
||||
campaignScene->clear();
|
||||
|
||||
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)));
|
||||
for (auto & s : campaignState->scenarios)
|
||||
{
|
||||
@@ -105,6 +111,7 @@ void CampaignEditor::redraw()
|
||||
campaignScene->addItem(pixmap);
|
||||
}
|
||||
|
||||
campaignScene->setSceneRect(background.rect());
|
||||
ui->campaignView->show();
|
||||
}
|
||||
|
||||
|
@@ -47,8 +47,15 @@
|
||||
<addaction name="actionCampaignProperties"/>
|
||||
<addaction name="actionScenarioProperties"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuView">
|
||||
<property name="title">
|
||||
<string>View</string>
|
||||
</property>
|
||||
<addaction name="actionShowFullBackground"/>
|
||||
</widget>
|
||||
<addaction name="menuFile"/>
|
||||
<addaction name="menuEdit"/>
|
||||
<addaction name="menuView"/>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@@ -68,6 +75,8 @@
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionCampaignProperties"/>
|
||||
<addaction name="actionScenarioProperties"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionShowFullBackground"/>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@@ -144,6 +153,17 @@
|
||||
<string notr="true">Enter</string>
|
||||
</property>
|
||||
</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>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
|
Reference in New Issue
Block a user