fix region map editor ui

This commit is contained in:
garak 2019-04-07 19:25:29 -04:00 committed by huderlem
parent 06a3e0049b
commit d094dced1f
2 changed files with 88 additions and 83 deletions

View file

@ -456,84 +456,88 @@
<property name="lineWidth"> <property name="lineWidth">
<number>1</number> <number>1</number>
</property> </property>
<widget class="QWidget" name="layoutWidget_4"> <layout class="QVBoxLayout" name="verticalLayout">
<property name="geometry"> <item>
<rect> <layout class="QGridLayout" name="gridLayout_22">
<x>13</x> <property name="sizeConstraint">
<y>11</y> <enum>QLayout::SetNoConstraint</enum>
<width>281</width> </property>
<height>91</height> <item row="0" column="0">
</rect> <widget class="QLabel" name="label_RM_MapSection">
</property> <property name="text">
<layout class="QGridLayout" name="gridLayout_22"> <string>Map Section</string>
<item row="0" column="0"> </property>
<widget class="QLabel" name="label_RM_MapSection"> </widget>
<property name="text"> </item>
<string>Map Section</string> <item row="0" column="1">
</property> <widget class="QComboBox" name="comboBox_RM_ConnectedMap">
</widget> <property name="sizePolicy">
</item> <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<item row="0" column="1"> <horstretch>0</horstretch>
<widget class="QComboBox" name="comboBox_RM_ConnectedMap"> <verstretch>0</verstretch>
<property name="sizePolicy"> </sizepolicy>
<sizepolicy hsizetype="Expanding" vsizetype="Fixed"> </property>
<horstretch>0</horstretch> <property name="toolTip">
<verstretch>0</verstretch> <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The section of the region map which the map is grouped under. This also determines the name of the map that is display when the player enters it.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</sizepolicy> </property>
</property> <property name="editable">
<property name="toolTip"> <bool>true</bool>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The section of the region map which the map is grouped under. This also determines the name of the map that is display when the player enters it.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> </property>
</property> <property name="insertPolicy">
<property name="editable"> <enum>QComboBox::NoInsert</enum>
<bool>true</bool> </property>
</property> </widget>
<property name="insertPolicy"> </item>
<enum>QComboBox::NoInsert</enum> <item row="1" column="0">
</property> <widget class="QLabel" name="label_RM_MapName">
</widget> <property name="text">
</item> <string>Map Name</string>
<item row="1" column="0"> </property>
<widget class="QLabel" name="label_RM_MapName"> </widget>
<property name="text"> </item>
<string>Map Name</string> <item row="1" column="1">
</property> <widget class="QLineEdit" name="lineEdit_RM_MapName"/>
</widget> </item>
</item> <item row="2" column="0">
<item row="1" column="1"> <widget class="QLabel" name="label_RM_CityMap">
<widget class="QLineEdit" name="lineEdit_RM_MapName"/> <property name="text">
</item> <string>City Map</string>
<item row="2" column="0"> </property>
<widget class="QLabel" name="label_RM_CityMap"> </widget>
<property name="text"> </item>
<string>City Map</string> <item row="2" column="1">
</property> <widget class="QComboBox" name="comboBox_RM_CityMap">
</widget> <property name="toolTip">
</item> <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The map type is a general attribute, which is used for many different things. For example. it determines whether biking or running is allowed.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<item row="2" column="1"> </property>
<widget class="QComboBox" name="comboBox_RM_CityMap"> <property name="editable">
<property name="toolTip"> <bool>true</bool>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The map type is a general attribute, which is used for many different things. For example. it determines whether biking or running is allowed.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> </property>
</property> </widget>
<property name="editable"> </item>
<bool>true</bool> </layout>
</property> </item>
</widget> <item>
</item> <widget class="QPushButton" name="pushButton_RM_Options_delete">
</layout> <property name="text">
</widget> <string>Delete Square</string>
<widget class="QPushButton" name="pushButton_RM_Options_delete"> </property>
<property name="geometry"> </widget>
<rect> </item>
<x>10</x> <item>
<y>100</y> <spacer name="verticalSpacer">
<width>113</width> <property name="orientation">
<height>32</height> <enum>Qt::Vertical</enum>
</rect> </property>
</property> <property name="sizeHint" stdset="0">
<property name="text"> <size>
<string>Delete Square</string> <width>20</width>
</property> <height>40</height>
</widget> </size>
</property>
</spacer>
</item>
</layout>
</widget> </widget>
</item> </item>
</layout> </layout>

View file

@ -114,7 +114,7 @@ void RegionMapEditor::displayRegionMapImage() {
this->ui->graphicsView_Region_Map_BkgImg->setScene(this->scene_region_map_image); this->ui->graphicsView_Region_Map_BkgImg->setScene(this->scene_region_map_image);
if (regionMapFirstDraw) { if (regionMapFirstDraw) {
on_verticalSlider_Zoom_Map_Image_valueChanged(initialScale); on_verticalSlider_Zoom_Map_Image_valueChanged(this->ui->verticalSlider_Zoom_Map_Image->value());
RegionMapHistoryItem *commit = new RegionMapHistoryItem( RegionMapHistoryItem *commit = new RegionMapHistoryItem(
RegionMapEditorBox::BackgroundImage, this->region_map->getTiles(), this->region_map->width(), this->region_map->height() RegionMapEditorBox::BackgroundImage, this->region_map->getTiles(), this->region_map->width(), this->region_map->height()
); );
@ -141,6 +141,7 @@ void RegionMapEditor::displayRegionMapLayout() {
connect(this->region_map_layout_item, &RegionMapLayoutPixmapItem::hoveredTileCleared, connect(this->region_map_layout_item, &RegionMapLayoutPixmapItem::hoveredTileCleared,
this, &RegionMapEditor::onRegionMapLayoutHoveredTileCleared); this, &RegionMapEditor::onRegionMapLayoutHoveredTileCleared);
updateRegionMapLayoutOptions(this->currIndex);
this->region_map_layout_item->draw(); this->region_map_layout_item->draw();
this->region_map_layout_item->select(this->currIndex); this->region_map_layout_item->select(this->currIndex);
@ -192,7 +193,7 @@ void RegionMapEditor::displayRegionMapTileSelector() {
this, &RegionMapEditor::onRegionMapTileSelectorHoveredTileCleared); this, &RegionMapEditor::onRegionMapTileSelectorHoveredTileCleared);
this->ui->graphicsView_RegionMap_Tiles->setScene(this->scene_region_map_tiles); this->ui->graphicsView_RegionMap_Tiles->setScene(this->scene_region_map_tiles);
on_verticalSlider_Zoom_Image_Tiles_valueChanged(initialScale); on_verticalSlider_Zoom_Image_Tiles_valueChanged(this->ui->verticalSlider_Zoom_Image_Tiles->value());
this->mapsquare_selector_item->select(this->selectedImageTile); this->mapsquare_selector_item->select(this->selectedImageTile);
} }
@ -215,7 +216,7 @@ void RegionMapEditor::displayCityMapTileSelector() {
this, &RegionMapEditor::onCityMapTileSelectorSelectedTileChanged); this, &RegionMapEditor::onCityMapTileSelectorSelectedTileChanged);
this->ui->graphicsView_City_Map_Tiles->setScene(this->scene_city_map_tiles); this->ui->graphicsView_City_Map_Tiles->setScene(this->scene_city_map_tiles);
on_verticalSlider_Zoom_City_Tiles_valueChanged(initialScale); on_verticalSlider_Zoom_City_Tiles_valueChanged(this->ui->verticalSlider_Zoom_City_Tiles->value());
this->city_map_selector_item->select(this->selectedCityTile); this->city_map_selector_item->select(this->selectedCityTile);
} }
@ -241,7 +242,7 @@ void RegionMapEditor::displayCityMap(QString f) {
scene_city_map_image->setSceneRect(this->scene_city_map_image->sceneRect()); scene_city_map_image->setSceneRect(this->scene_city_map_image->sceneRect());
this->ui->graphicsView_City_Map->setScene(scene_city_map_image); this->ui->graphicsView_City_Map->setScene(scene_city_map_image);
on_verticalSlider_Zoom_City_Map_valueChanged(initialScale); on_verticalSlider_Zoom_City_Map_valueChanged(this->ui->verticalSlider_Zoom_City_Map->value());
} }
bool RegionMapEditor::createCityMap(QString name) { bool RegionMapEditor::createCityMap(QString name) {
@ -581,7 +582,7 @@ void RegionMapEditor::on_action_Swap_triggered() {
if (popup.exec() == QDialog::Accepted) { if (popup.exec() == QDialog::Accepted) {
this->region_map->replaceSectionId(oldId, newId); this->region_map->replaceSectionId(oldId, newId);
this->region_map_layout_item->draw(); displayRegionMapLayout();
this->region_map_layout_item->select(this->region_map_layout_item->selectedTile); this->region_map_layout_item->select(this->region_map_layout_item->selectedTile);
this->hasUnsavedChanges = true; this->hasUnsavedChanges = true;
} }