Header tab and new map dialog share UI setup

This commit is contained in:
GriffinR 2024-11-12 14:27:35 -05:00
parent 9e1ef2c741
commit 205bb48c65
14 changed files with 789 additions and 835 deletions

View File

@ -1155,7 +1155,7 @@
<number>2</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_16">
<widget class="QLabel" name="label_Layout">
<property name="text">
<string>Layout</string>
</property>
@ -2220,7 +2220,7 @@
<number>0</number>
</property>
<item>
<widget class="QFrame" name="frame_3">
<widget class="QFrame" name="frame_HeaderData">
<property name="enabled">
<bool>false</bool>
</property>
@ -2236,206 +2236,10 @@
<property name="frameShadow">
<enum>QFrame::Shadow::Raised</enum>
</property>
<layout class="QFormLayout" name="formLayout_2">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::FieldGrowthPolicy::FieldsStayAtSizeHint</enum>
</property>
<property name="verticalSpacing">
<number>12</number>
</property>
<layout class="QVBoxLayout" name="layout_HeaderData">
<property name="bottomMargin">
<number>9</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Song</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="NoScrollComboBox" name="comboBox_Song">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The default background music for this map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="editable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Location</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="NoScrollComboBox" name="comboBox_Location">
<property name="toolTip">
<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 name="editable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Requires Flash</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="checkBox_Visibility">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Whether or not the map is dark and requires Flash to illuminate.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Weather</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="NoScrollComboBox" name="comboBox_Weather">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The default weather for this map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="editable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Type</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="NoScrollComboBox" name="comboBox_Type">
<property name="toolTip">
<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 name="editable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>Battle scene</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="NoScrollComboBox" name="comboBox_BattleScene">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Determines the type of battle scene graphics to use.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="editable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Show Location Name</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QCheckBox" name="checkBox_ShowLocation">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Whether or not to display the location name when the player enters the map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_AllowRunning">
<property name="text">
<string>Allow Running</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QCheckBox" name="checkBox_AllowRunning">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Allows the player to use Running Shoes&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="label_AllowBiking">
<property name="text">
<string>Allow Biking</string>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="QCheckBox" name="checkBox_AllowBiking">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Allows the player to use a Bike&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="label_AllowEscaping">
<property name="text">
<string>Allow Dig &amp; Escape Rope</string>
</property>
</widget>
</item>
<item row="10" column="1">
<widget class="QCheckBox" name="checkBox_AllowEscaping">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Allows the player to use Dig or Escape Rope&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="11" column="0">
<widget class="QLabel" name="label_FloorNumber">
<property name="text">
<string>Floor Number</string>
</property>
</widget>
</item>
<item row="11" column="1">
<widget class="QSpinBox" name="spinBox_FloorNumber">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Floor number to be used for maps with elevators.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="minimum">
<number>-128</number>
</property>
<property name="maximum">
<number>127</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>

235
forms/mapheaderform.ui Normal file
View File

@ -0,0 +1,235 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MapHeaderForm</class>
<widget class="QWidget" name="MapHeaderForm">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>407</width>
<height>349</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::FieldGrowthPolicy::FieldsStayAtSizeHint</enum>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_Song">
<property name="text">
<string>Song</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="NoScrollComboBox" name="comboBox_Song">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The default background music for this map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="editable">
<bool>true</bool>
</property>
<property name="insertPolicy">
<enum>QComboBox::InsertPolicy::NoInsert</enum>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_Location">
<property name="text">
<string>Location</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="NoScrollComboBox" name="comboBox_Location">
<property name="toolTip">
<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 displayed when the player enters it.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="editable">
<bool>true</bool>
</property>
<property name="insertPolicy">
<enum>QComboBox::InsertPolicy::NoInsert</enum>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_RequiresFlash">
<property name="text">
<string>Requires Flash</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="checkBox_RequiresFlash">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If checked, the player will need to use Flash to see fully on this map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_Weather">
<property name="text">
<string>Weather</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="NoScrollComboBox" name="comboBox_Weather">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The default weather on this map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="editable">
<bool>true</bool>
</property>
<property name="insertPolicy">
<enum>QComboBox::InsertPolicy::NoInsert</enum>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_Type">
<property name="text">
<string>Type</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="NoScrollComboBox" name="comboBox_Type">
<property name="toolTip">
<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, underground type maps will have a special transition effect when the player enters/exits the map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="editable">
<bool>true</bool>
</property>
<property name="insertPolicy">
<enum>QComboBox::InsertPolicy::NoInsert</enum>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_BattleScene">
<property name="text">
<string>Battle Scene</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="NoScrollComboBox" name="comboBox_BattleScene">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;This field is used to help determine what graphics to use in the background of battles on this map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="editable">
<bool>true</bool>
</property>
<property name="insertPolicy">
<enum>QComboBox::InsertPolicy::NoInsert</enum>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_ShowLocationName">
<property name="text">
<string>Show Location Name</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QCheckBox" name="checkBox_ShowLocationName">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If checked, a map name popup will appear when the player enters this map. The name that appears on this popup depends on the Location field.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_AllowRunning">
<property name="text">
<string>Allow Running</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QCheckBox" name="checkBox_AllowRunning">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If checked, the player will be allowed to run on this map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_AllowBiking">
<property name="text">
<string>Allow Biking</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QCheckBox" name="checkBox_AllowBiking">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If checked, the player will be allowed to get on their bike on this map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="label_AllowEscaping">
<property name="text">
<string>Allow Dig &amp; Escape Rope</string>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="QCheckBox" name="checkBox_AllowEscaping">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If checked, the player will be allowed to use Dig or Escape Rope on this map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="label_FloorNumber">
<property name="text">
<string>Floor Number</string>
</property>
</widget>
</item>
<item row="10" column="1">
<widget class="NoScrollSpinBox" name="spinBox_FloorNumber">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Floor number to be used for maps with elevators.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>NoScrollComboBox</class>
<extends>QComboBox</extends>
<header>noscrollcombobox.h</header>
</customwidget>
<customwidget>
<class>NoScrollSpinBox</class>
<extends>QSpinBox</extends>
<header>noscrollspinbox.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>453</width>
<height>563</height>
<height>588</height>
</rect>
</property>
<property name="windowTitle">
@ -25,7 +25,7 @@
<x>0</x>
<y>0</y>
<width>427</width>
<height>841</height>
<height>526</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_3">
@ -39,7 +39,14 @@
</property>
</widget>
</item>
<item row="0" column="1">
<item row="2" column="0">
<widget class="QLabel" name="label_ID">
<property name="text">
<string>ID</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLineEdit" name="lineEdit_Name">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The name of the new map. The name cannot be the same as any other existing map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
@ -49,7 +56,23 @@
</property>
</widget>
</item>
<item row="7" column="0" colspan="2">
<item row="5" column="2">
<widget class="QLabel" name="label_GroupError">
<property name="visible">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 0, 0)</string>
</property>
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="7" column="0" colspan="3" alignment="Qt::AlignmentFlag::AlignTop">
<widget class="QGroupBox" name="groupBox_BorderDimensions">
<property name="title">
<string>Border Dimensions</string>
@ -104,357 +127,6 @@
</layout>
</widget>
</item>
<item row="6" column="0" colspan="2">
<widget class="QGroupBox" name="groupBox_MapDimensions">
<property name="title">
<string>Map Dimensions</string>
</property>
<layout class="QFormLayout" name="formLayout_4">
<item row="0" column="0">
<widget class="QLabel" name="label_MapWidth">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Width</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="NoScrollSpinBox" name="spinBox_MapWidth">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Width (in metatiles) of the new map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="minimum">
<number>1</number>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="NoScrollSpinBox" name="spinBox_MapHeight">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Height (in metatiles) of the new map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="minimum">
<number>1</number>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QLabel" name="label_MapDimensionsError">
<property name="visible">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 0, 0)</string>
</property>
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_MapHeight">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Height</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="4" column="1">
<widget class="NoScrollComboBox" name="comboBox_Group">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The name of the group this map will be added to.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="editable">
<bool>true</bool>
</property>
<property name="insertPolicy">
<enum>QComboBox::InsertPolicy::NoInsert</enum>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLabel" name="label_GroupError">
<property name="visible">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 0, 0)</string>
</property>
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="lineEdit_ID">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The constant that will be used to refer to this map. It cannot be the same as any other existing map, and it must start with the specified prefix.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="label_IDError">
<property name="visible">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 0, 0)</string>
</property>
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="9" column="0" colspan="2">
<widget class="QGroupBox" name="groupBox_HeaderData">
<property name="title">
<string>Header Data</string>
</property>
<layout class="QFormLayout" name="formLayout_3">
<item row="0" column="0">
<widget class="QLabel" name="label_Song">
<property name="text">
<string>Song</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="NoScrollComboBox" name="comboBox_Song">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The default background music for this map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="editable">
<bool>true</bool>
</property>
<property name="insertPolicy">
<enum>QComboBox::InsertPolicy::NoInsert</enum>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_Location">
<property name="text">
<string>Location</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_RequiresFlash">
<property name="text">
<string>Requires Flash</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_Weather">
<property name="text">
<string>Weather</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_Type">
<property name="text">
<string>Type</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="NoScrollComboBox" name="comboBox_Type">
<property name="toolTip">
<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, underground type maps will have a special transition effect when the player enters/exits the map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="editable">
<bool>true</bool>
</property>
<property name="insertPolicy">
<enum>QComboBox::InsertPolicy::NoInsert</enum>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_BattleScene">
<property name="text">
<string>Battle Scene</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_ShowLocation">
<property name="text">
<string>Show Location</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_AllowRunning">
<property name="text">
<string>Allow Running</string>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_AllowBiking">
<property name="text">
<string>Allow Biking</string>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="label_AllowEscaping">
<property name="text">
<string>Allow Escaping</string>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="label_FloorNumber">
<property name="text">
<string>Floor Number</string>
</property>
</widget>
</item>
<item row="11" column="0">
<widget class="QLabel" name="label_CanFlyTo">
<property name="text">
<string>Can Fly To</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="NoScrollComboBox" name="comboBox_Location">
<property name="toolTip">
<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 displayed when the player enters it.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="editable">
<bool>true</bool>
</property>
<property name="insertPolicy">
<enum>QComboBox::InsertPolicy::NoInsert</enum>
</property>
</widget>
</item>
<item row="10" column="1">
<widget class="NoScrollSpinBox" name="spinBox_FloorNumber">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Floor number to be used for maps with elevators.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="maximum">
<number>127</number>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="NoScrollComboBox" name="comboBox_BattleScene">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;This field is used to help determine what graphics to use in the background of battles on this map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="editable">
<bool>true</bool>
</property>
<property name="insertPolicy">
<enum>QComboBox::InsertPolicy::NoInsert</enum>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="NoScrollComboBox" name="comboBox_Weather">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The default weather on this map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="editable">
<bool>true</bool>
</property>
<property name="insertPolicy">
<enum>QComboBox::InsertPolicy::NoInsert</enum>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="checkBox_RequiresFlash">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If checked, the player will need to use Flash to see fully on this map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QCheckBox" name="checkBox_ShowLocation">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If checked, a map name popup will appear when the player enters this map. The name that appears on this popup depends on the Location field.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QCheckBox" name="checkBox_AllowRunning">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If checked, the player will be allowed to run on this map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QCheckBox" name="checkBox_AllowBiking">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If checked, the player will be allowed to get on their bike on this map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="QCheckBox" name="checkBox_AllowEscaping">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If checked, the player will be allowed to use Dig or Escape Rope on this map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="11" column="1">
<widget class="QCheckBox" name="checkBox_CanFlyTo">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If checked, a Heal Location will be added to this map automatically.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_Group">
<property name="text">
@ -462,14 +134,20 @@
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_ID">
<property name="text">
<string>ID</string>
<item row="11" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
</property>
</widget>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="1">
<item row="1" column="2">
<widget class="QLabel" name="label_NameError">
<property name="visible">
<bool>false</bool>
@ -485,7 +163,14 @@
</property>
</widget>
</item>
<item row="8" column="0" colspan="2">
<item row="10" column="0">
<widget class="QLabel" name="label_CanFlyTo">
<property name="text">
<string>Can Fly To</string>
</property>
</widget>
</item>
<item row="8" column="0" colspan="3" alignment="Qt::AlignmentFlag::AlignTop">
<widget class="QGroupBox" name="groupBox_Tilesets">
<property name="title">
<string>Tilesets</string>
@ -550,6 +235,131 @@
</layout>
</widget>
</item>
<item row="6" column="0" colspan="3" alignment="Qt::AlignmentFlag::AlignTop">
<widget class="QGroupBox" name="groupBox_MapDimensions">
<property name="title">
<string>Map Dimensions</string>
</property>
<layout class="QFormLayout" name="formLayout_4">
<item row="0" column="0">
<widget class="QLabel" name="label_MapWidth">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Width</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="NoScrollSpinBox" name="spinBox_MapWidth">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Width (in metatiles) of the new map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="minimum">
<number>1</number>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_MapHeight">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Height</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="NoScrollSpinBox" name="spinBox_MapHeight">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Height (in metatiles) of the new map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="minimum">
<number>1</number>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QLabel" name="label_MapDimensionsError">
<property name="visible">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 0, 0)</string>
</property>
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="2" column="2">
<widget class="QLineEdit" name="lineEdit_ID">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The constant that will be used to refer to this map. It cannot be the same as any other existing map, and it must start with the specified prefix.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QLabel" name="label_IDError">
<property name="visible">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 0, 0)</string>
</property>
<property name="text">
<string/>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="9" column="0" colspan="3">
<widget class="QGroupBox" name="groupBox_HeaderData">
<property name="title">
<string>Header Data</string>
</property>
<layout class="QVBoxLayout" name="layout_HeaderData"/>
</widget>
</item>
<item row="4" column="2">
<widget class="NoScrollComboBox" name="comboBox_Group">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The name of the group this map will be added to.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="editable">
<bool>true</bool>
</property>
<property name="insertPolicy">
<enum>QComboBox::InsertPolicy::NoInsert</enum>
</property>
</widget>
</item>
<item row="10" column="1">
<widget class="QCheckBox" name="checkBox_CanFlyTo">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If checked, a Heal Location will be added to this map automatically.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</widget>

View File

@ -62,7 +62,7 @@ public:
void setRequiresFlash(bool requiresFlash);
void setWeather(const QString &weather);
void setType(const QString &type);
void setShowsLocation(bool showsLocation);
void setShowsLocationName(bool showsLocationName);
void setAllowsRunning(bool allowsRunning);
void setAllowsBiking(bool allowsBiking);
void setAllowsEscaping(bool allowsEscaping);
@ -74,7 +74,7 @@ public:
bool requiresFlash() const { return m_requiresFlash; }
QString weather() const { return m_weather; }
QString type() const { return m_type; }
bool showsLocation() const { return m_showsLocation; }
bool showsLocationName() const { return m_showsLocationName; }
bool allowsRunning() const { return m_allowsRunning; }
bool allowsBiking() const { return m_allowsBiking; }
bool allowsEscaping() const { return m_allowsEscaping; }
@ -136,7 +136,7 @@ private:
bool m_requiresFlash;
QString m_weather;
QString m_type;
bool m_showsLocation;
bool m_showsLocationName;
bool m_allowsRunning;
bool m_allowsBiking;
bool m_allowsEscaping;

View File

@ -32,6 +32,7 @@
#include "wildmonchart.h"
#include "updatepromoter.h"
#include "aboutporymap.h"
#include "mapheaderform.h"
@ -199,17 +200,7 @@ private slots:
void on_actionNew_Tileset_triggered();
void on_action_Save_triggered();
void on_action_Exit_triggered();
void on_comboBox_Song_currentTextChanged(const QString &arg1);
void on_comboBox_Location_currentTextChanged(const QString &arg1);
void on_comboBox_Weather_currentTextChanged(const QString &arg1);
void on_comboBox_Type_currentTextChanged(const QString &arg1);
void on_comboBox_BattleScene_currentTextChanged(const QString &arg1);
void on_comboBox_LayoutSelector_currentTextChanged(const QString &arg1);
void on_checkBox_ShowLocation_stateChanged(int selected);
void on_checkBox_AllowRunning_stateChanged(int selected);
void on_checkBox_AllowBiking_stateChanged(int selected);
void on_checkBox_AllowEscaping_stateChanged(int selected);
void on_spinBox_FloorNumber_valueChanged(int offset);
void on_comboBox_LayoutSelector_currentTextChanged(const QString &text);
void on_actionShortcuts_triggered();
void on_actionZoom_In_triggered();
@ -254,7 +245,6 @@ private slots:
void on_comboBox_SecondaryTileset_currentTextChanged(const QString &arg1);
void on_pushButton_ChangeDimensions_clicked();
void on_checkBox_smartPaths_stateChanged(int selected);
void on_checkBox_Visibility_stateChanged(int selected);
void on_checkBox_ToggleBorder_stateChanged(int selected);
void resetMapViewScale();
@ -337,6 +327,8 @@ private:
QAction *copyAction = nullptr;
QAction *pasteAction = nullptr;
MapHeaderForm *mapHeader = nullptr;
QMap<Event::Group, DraggablePixmapItem*> lastSelectedEvent;
bool isProgrammaticEventTabChange;

View File

@ -0,0 +1,56 @@
#ifndef MAPHEADERFORM_H
#define MAPHEADERFORM_H
#include "project.h"
#include "map.h"
#include "ui_mapheaderform.h"
#include <QWidget>
/*
This is the UI class used to edit the fields in a map's header.
It's intended to be used anywhere the UI needs to present an editor for a map's header,
e.g. for the current map in the main editor or in the new map dialog.
*/
namespace Ui {
class MapHeaderForm;
}
class MapHeaderForm : public QWidget
{
Q_OBJECT
public:
explicit MapHeaderForm(QWidget *parent = nullptr);
~MapHeaderForm();
void setProject(Project * project);
void setMap(Map * map);
void clearDisplay();
void clear();
void refreshLocationsComboBox();
Ui::MapHeaderForm *ui;
private:
QPointer<Map> map = nullptr;
QPointer<Project> project = nullptr;
private slots:
void on_comboBox_Song_currentTextChanged(const QString &);
void on_comboBox_Location_currentTextChanged(const QString &);
void on_comboBox_Weather_currentTextChanged(const QString &);
void on_comboBox_Type_currentTextChanged(const QString &);
void on_comboBox_BattleScene_currentTextChanged(const QString &);
void on_checkBox_RequiresFlash_stateChanged(int);
void on_checkBox_ShowLocationName_stateChanged(int);
void on_checkBox_AllowRunning_stateChanged(int);
void on_checkBox_AllowBiking_stateChanged(int);
void on_checkBox_AllowEscaping_stateChanged(int);
void on_spinBox_FloorNumber_valueChanged(int);
};
#endif // MAPHEADERFORM_H

View File

@ -6,6 +6,7 @@
#include "editor.h"
#include "project.h"
#include "map.h"
#include "mapheaderform.h"
namespace Ui {
class NewMapDialog;
@ -34,6 +35,7 @@ signals:
private:
Ui::NewMapDialog *ui;
Project *project;
MapHeaderForm *headerData;
bool validateMapDimensions();
bool validateMapGroup();

View File

@ -83,6 +83,7 @@ SOURCES += src/core/block.cpp \
src/ui/prefabcreationdialog.cpp \
src/ui/regionmappixmapitem.cpp \
src/ui/citymappixmapitem.cpp \
src/ui/mapheaderform.cpp \
src/ui/metatilelayersitem.cpp \
src/ui/metatileselector.cpp \
src/ui/movablerect.cpp \
@ -166,6 +167,7 @@ HEADERS += include/core/block.h \
include/ui/connectionpixmapitem.h \
include/ui/currentselectedmetatilespixmapitem.h \
include/ui/gridsettings.h \
include/ui/mapheaderform.h \
include/ui/newmapconnectiondialog.h \
include/ui/prefabframe.h \
include/ui/projectsettingseditor.h \
@ -233,6 +235,7 @@ FORMS += forms/mainwindow.ui \
forms/colorinputwidget.ui \
forms/connectionslistitem.ui \
forms/gridsettingsdialog.ui \
forms/mapheaderform.ui \
forms/maplisttoolbar.ui \
forms/newmapconnectiondialog.ui \
forms/prefabcreationdialog.ui \

View File

@ -330,8 +330,8 @@ void Map::setType(const QString &type) {
m_type = type;
}
void Map::setShowsLocation(bool showsLocation) {
m_showsLocation = showsLocation;
void Map::setShowsLocationName(bool showsLocationName) {
m_showsLocationName = showsLocationName;
}
void Map::setAllowsRunning(bool allowsRunning) {

View File

@ -235,6 +235,10 @@ void MainWindow::initCustomUI() {
ui->mainTabBar->addTab(mainTabNames.value(i));
ui->mainTabBar->setTabIcon(i, mainTabIcons.value(i));
}
// Create map header data widget
this->mapHeader = new MapHeaderForm();
ui->layout_HeaderData->addWidget(this->mapHeader);
}
void MainWindow::initExtraSignals() {
@ -597,7 +601,7 @@ bool MainWindow::openProject(QString dir, bool initial) {
project->set_root(dir);
connect(project, &Project::fileChanged, this, &MainWindow::showFileWatcherWarning);
connect(project, &Project::mapLoaded, this, &MainWindow::onMapLoaded);
connect(project, &Project::mapSectionIdNamesChanged, this, &MainWindow::refreshLocationsComboBox);
connect(project, &Project::mapSectionIdNamesChanged, this->mapHeader, &MapHeaderForm::refreshLocationsComboBox);
this->editor->setProject(project);
// Make sure project looks reasonable before attempting to load it
@ -1005,47 +1009,22 @@ void MainWindow::openWarpMap(QString map_name, int event_id, Event::Group event_
void MainWindow::displayMapProperties() {
// Block signals to the comboboxes while they are being modified
const QSignalBlocker blocker1(ui->comboBox_Song);
const QSignalBlocker blocker2(ui->comboBox_Location);
const QSignalBlocker blocker3(ui->comboBox_PrimaryTileset);
const QSignalBlocker blocker4(ui->comboBox_SecondaryTileset);
const QSignalBlocker blocker5(ui->comboBox_Weather);
const QSignalBlocker blocker6(ui->comboBox_BattleScene);
const QSignalBlocker blocker7(ui->comboBox_Type);
const QSignalBlocker blocker8(ui->checkBox_Visibility);
const QSignalBlocker blocker9(ui->checkBox_ShowLocation);
const QSignalBlocker blockerA(ui->checkBox_AllowRunning);
const QSignalBlocker blockerB(ui->checkBox_AllowBiking);
const QSignalBlocker blockerC(ui->spinBox_FloorNumber);
const QSignalBlocker blockerD(ui->checkBox_AllowEscaping);
const QSignalBlocker b_PrimaryTileset(ui->comboBox_PrimaryTileset);
const QSignalBlocker b_SecondaryTileset(ui->comboBox_SecondaryTileset);
ui->checkBox_Visibility->setChecked(false);
ui->checkBox_ShowLocation->setChecked(false);
ui->checkBox_AllowRunning->setChecked(false);
ui->checkBox_AllowBiking->setChecked(false);
ui->checkBox_AllowEscaping->setChecked(false);
this->mapHeader->clearDisplay();
if (!editor || !editor->map || !editor->project) {
ui->frame_3->setEnabled(false);
ui->frame_HeaderData->setEnabled(false);
return;
}
ui->frame_3->setEnabled(true);
ui->frame_HeaderData->setEnabled(true);
Map *map = editor->map;
ui->comboBox_PrimaryTileset->setCurrentText(map->layout()->tileset_primary_label);
ui->comboBox_SecondaryTileset->setCurrentText(map->layout()->tileset_secondary_label);
ui->comboBox_Song->setCurrentText(map->song());
ui->comboBox_Location->setCurrentText(map->location());
ui->checkBox_Visibility->setChecked(map->requiresFlash());
ui->comboBox_Weather->setCurrentText(map->weather());
ui->comboBox_Type->setCurrentText(map->type());
ui->comboBox_BattleScene->setCurrentText(map->battleScene());
ui->checkBox_ShowLocation->setChecked(map->showsLocation());
ui->checkBox_AllowRunning->setChecked(map->allowsRunning());
ui->checkBox_AllowBiking->setChecked(map->allowsBiking());
ui->checkBox_AllowEscaping->setChecked(map->allowsEscaping());
ui->spinBox_FloorNumber->setValue(map->floorNumber());
this->mapHeader->setMap(map);
// Custom fields table.
/* // TODO: Re-enable
@ -1068,122 +1047,24 @@ void MainWindow::on_comboBox_LayoutSelector_currentTextChanged(const QString &te
}
}
void MainWindow::on_comboBox_Song_currentTextChanged(const QString &song)
{
if (editor && editor->map) {
editor->map->setSong(song);
markMapEdited();
}
}
void MainWindow::on_comboBox_Location_currentTextChanged(const QString &location)
{
if (editor && editor->map) {
editor->map->setLocation(location);
markMapEdited();
}
}
void MainWindow::on_comboBox_Weather_currentTextChanged(const QString &weather)
{
if (editor && editor->map) {
editor->map->setWeather(weather);
markMapEdited();
}
}
void MainWindow::on_comboBox_Type_currentTextChanged(const QString &type)
{
if (editor && editor->map) {
editor->map->setType(type);
markMapEdited();
}
}
void MainWindow::on_comboBox_BattleScene_currentTextChanged(const QString &battle_scene)
{
if (editor && editor->map) {
editor->map->setBattleScene(battle_scene);
markMapEdited();
}
}
void MainWindow::on_checkBox_Visibility_stateChanged(int selected)
{
if (editor && editor->map) {
editor->map->setRequiresFlash(selected == Qt::Checked);
markMapEdited();
}
}
void MainWindow::on_checkBox_ShowLocation_stateChanged(int selected)
{
if (editor && editor->map) {
editor->map->setShowsLocation(selected == Qt::Checked);
markMapEdited();
}
}
void MainWindow::on_checkBox_AllowRunning_stateChanged(int selected)
{
if (editor && editor->map) {
editor->map->setAllowsRunning(selected == Qt::Checked);
markMapEdited();
}
}
void MainWindow::on_checkBox_AllowBiking_stateChanged(int selected)
{
if (editor && editor->map) {
editor->map->setAllowsBiking(selected == Qt::Checked);
markMapEdited();
}
}
void MainWindow::on_checkBox_AllowEscaping_stateChanged(int selected)
{
if (editor && editor->map) {
editor->map->setAllowsEscaping(selected == Qt::Checked);
markMapEdited();
}
}
void MainWindow::on_spinBox_FloorNumber_valueChanged(int offset)
{
if (editor && editor->map) {
editor->map->setFloorNumber(offset);
markMapEdited();
}
}
// Update the UI using information we've read from the user's project files.
bool MainWindow::setProjectUI() {
Project *project = editor->project;
this->mapHeader->setProject(project);
// Block signals to the comboboxes while they are being modified
const QSignalBlocker blocker1(ui->comboBox_Song);
const QSignalBlocker blocker3(ui->comboBox_PrimaryTileset);
const QSignalBlocker blocker4(ui->comboBox_SecondaryTileset);
const QSignalBlocker blocker5(ui->comboBox_Weather);
const QSignalBlocker blocker6(ui->comboBox_BattleScene);
const QSignalBlocker blocker7(ui->comboBox_Type);
const QSignalBlocker blocker8(ui->comboBox_DiveMap);
const QSignalBlocker blocker9(ui->comboBox_EmergeMap);
const QSignalBlocker blocker10(ui->comboBox_LayoutSelector);
const QSignalBlocker b_PrimaryTileset(ui->comboBox_PrimaryTileset);
const QSignalBlocker b_SecondaryTileset(ui->comboBox_SecondaryTileset);
const QSignalBlocker b_DiveMap(ui->comboBox_DiveMap);
const QSignalBlocker b_EmergeMap(ui->comboBox_EmergeMap);
const QSignalBlocker b_LayoutSelector(ui->comboBox_LayoutSelector);
// Set up project comboboxes
ui->comboBox_Song->clear();
ui->comboBox_Song->addItems(project->songNames);
ui->comboBox_PrimaryTileset->clear();
ui->comboBox_PrimaryTileset->addItems(project->primaryTilesetLabels);
ui->comboBox_SecondaryTileset->clear();
ui->comboBox_SecondaryTileset->addItems(project->secondaryTilesetLabels);
ui->comboBox_Weather->clear();
ui->comboBox_Weather->addItems(project->weatherNames);
ui->comboBox_BattleScene->clear();
ui->comboBox_BattleScene->addItems(project->mapBattleScenes);
ui->comboBox_Type->clear();
ui->comboBox_Type->addItems(project->mapTypes);
ui->comboBox_LayoutSelector->clear();
ui->comboBox_LayoutSelector->addItems(project->mapLayoutsTable);
ui->comboBox_DiveMap->clear();
@ -1194,29 +1075,16 @@ bool MainWindow::setProjectUI() {
ui->comboBox_EmergeMap->addItems(project->mapNames);
ui->comboBox_EmergeMap->setClearButtonEnabled(true);
ui->comboBox_EmergeMap->setFocusedScrollingEnabled(false);
refreshLocationsComboBox();
// Show/hide parts of the UI that are dependent on the user's project settings
// Wild Encounters tab
ui->mainTabBar->setTabEnabled(MainTab::WildPokemon, editor->project->wildEncountersLoaded);
bool hasFlags = projectConfig.mapAllowFlagsEnabled;
ui->checkBox_AllowRunning->setVisible(hasFlags);
ui->checkBox_AllowBiking->setVisible(hasFlags);
ui->checkBox_AllowEscaping->setVisible(hasFlags);
ui->label_AllowRunning->setVisible(hasFlags);
ui->label_AllowBiking->setVisible(hasFlags);
ui->label_AllowEscaping->setVisible(hasFlags);
ui->newEventToolButton->newWeatherTriggerAction->setVisible(projectConfig.eventWeatherTriggerEnabled);
ui->newEventToolButton->newSecretBaseAction->setVisible(projectConfig.eventSecretBaseEnabled);
ui->newEventToolButton->newCloneObjectAction->setVisible(projectConfig.eventCloneObjectEnabled);
bool floorNumEnabled = projectConfig.floorNumberEnabled;
ui->spinBox_FloorNumber->setVisible(floorNumEnabled);
ui->label_FloorNumber->setVisible(floorNumEnabled);
Event::setIcons();
editor->setCollisionGraphics();
ui->spinBox_SelectedElevation->setMaximum(Block::getMaxElevation());
@ -1244,41 +1112,22 @@ bool MainWindow::setProjectUI() {
return true;
}
void MainWindow::refreshLocationsComboBox() {
QStringList locations = this->editor->project->mapSectionIdNames;
locations.sort();
const QSignalBlocker b(ui->comboBox_Location);
ui->comboBox_Location->clear();
ui->comboBox_Location->addItems(locations);
if (this->editor->map)
ui->comboBox_Location->setCurrentText(this->editor->map->location());
}
void MainWindow::clearProjectUI() {
// Block signals to the comboboxes while they are being modified
const QSignalBlocker blocker1(ui->comboBox_Song);
const QSignalBlocker blocker2(ui->comboBox_Location);
const QSignalBlocker blocker3(ui->comboBox_PrimaryTileset);
const QSignalBlocker blocker4(ui->comboBox_SecondaryTileset);
const QSignalBlocker blocker5(ui->comboBox_Weather);
const QSignalBlocker blocker6(ui->comboBox_BattleScene);
const QSignalBlocker blocker7(ui->comboBox_Type);
const QSignalBlocker blocker8(ui->comboBox_DiveMap);
const QSignalBlocker blocker9(ui->comboBox_EmergeMap);
const QSignalBlocker blockerA(ui->comboBox_LayoutSelector);
const QSignalBlocker b_PrimaryTileset(ui->comboBox_PrimaryTileset);
const QSignalBlocker b_SecondaryTileset(ui->comboBox_SecondaryTileset);
const QSignalBlocker b_DiveMap(ui->comboBox_DiveMap);
const QSignalBlocker b_EmergeMap(ui->comboBox_EmergeMap);
const QSignalBlocker b_LayoutSelector(ui->comboBox_LayoutSelector);
ui->comboBox_Song->clear();
ui->comboBox_Location->clear();
ui->comboBox_PrimaryTileset->clear();
ui->comboBox_SecondaryTileset->clear();
ui->comboBox_Weather->clear();
ui->comboBox_BattleScene->clear();
ui->comboBox_Type->clear();
ui->comboBox_DiveMap->clear();
ui->comboBox_EmergeMap->clear();
ui->comboBox_LayoutSelector->clear();
this->mapHeader->clear();
// Clear map models
delete this->mapGroupModel;
delete this->groupListProxyModel;

View File

@ -221,7 +221,7 @@ bool Project::loadMapData(Map* map) {
map->setRequiresFlash(ParseUtil::jsonToBool(mapObj["requires_flash"]));
map->setWeather(ParseUtil::jsonToQString(mapObj["weather"]));
map->setType(ParseUtil::jsonToQString(mapObj["map_type"]));
map->setShowsLocation(ParseUtil::jsonToBool(mapObj["show_map_name"]));
map->setShowsLocationName(ParseUtil::jsonToBool(mapObj["show_map_name"]));
map->setBattleScene(ParseUtil::jsonToQString(mapObj["battle_scene"]));
if (projectConfig.mapAllowFlagsEnabled) {
@ -1293,7 +1293,7 @@ void Project::saveMap(Map *map) {
mapObj["allow_escaping"] = map->allowsEscaping();
mapObj["allow_running"] = map->allowsRunning();
}
mapObj["show_map_name"] = map->showsLocation();
mapObj["show_map_name"] = map->showsLocationName();
if (projectConfig.floorNumberEnabled) {
mapObj["floor_number"] = map->floorNumber();
}

View File

@ -811,7 +811,8 @@ QJSValue MainWindow::getTilePixels(int tileId) {
// Editing map header
//=====================
// TODO: Replace UI setting here with calls to appropriate set functions. Update UI with signals from Map
// TODO: Connect signals from new function calls to update UI
// TODO: Is the error-checking for known constant names still reasonable / needed? (you can type anything after all)
QString MainWindow::getSong() {
if (!this->editor || !this->editor->map)
@ -820,13 +821,13 @@ QString MainWindow::getSong() {
}
void MainWindow::setSong(QString song) {
if (!this->ui || !this->editor || !this->editor->project)
if (!this->editor || !this->editor->map || !this->editor->project)
return;
if (!this->editor->project->songNames.contains(song)) {
logError(QString("Unknown song '%1'").arg(song));
return;
}
this->ui->comboBox_Song->setCurrentText(song);
this->editor->map->setSong(song);
}
QString MainWindow::getLocation() {
@ -836,13 +837,13 @@ QString MainWindow::getLocation() {
}
void MainWindow::setLocation(QString location) {
if (!this->ui || !this->editor || !this->editor->project)
if (!this->editor || !this->editor->map || !this->editor->project)
return;
if (!this->editor->project->mapSectionIdNames.contains(location)) {
logError(QString("Unknown location '%1'").arg(location));
return;
}
this->ui->comboBox_Location->setCurrentText(location);
this->editor->map->setLocation(location);
}
bool MainWindow::getRequiresFlash() {
@ -852,9 +853,9 @@ bool MainWindow::getRequiresFlash() {
}
void MainWindow::setRequiresFlash(bool require) {
if (!this->ui)
if (!this->editor || !this->editor->map)
return;
this->ui->checkBox_Visibility->setChecked(require);
this->editor->map->setRequiresFlash(require);
}
QString MainWindow::getWeather() {
@ -864,13 +865,13 @@ QString MainWindow::getWeather() {
}
void MainWindow::setWeather(QString weather) {
if (!this->ui || !this->editor || !this->editor->project)
if (!this->editor || !this->editor->map || !this->editor->project)
return;
if (!this->editor->project->weatherNames.contains(weather)) {
logError(QString("Unknown weather '%1'").arg(weather));
return;
}
this->ui->comboBox_Weather->setCurrentText(weather);
this->editor->map->setWeather(weather);
}
QString MainWindow::getType() {
@ -880,13 +881,13 @@ QString MainWindow::getType() {
}
void MainWindow::setType(QString type) {
if (!this->ui || !this->editor || !this->editor->project)
if (!this->editor || !this->editor->map || !this->editor->project)
return;
if (!this->editor->project->mapTypes.contains(type)) {
logError(QString("Unknown map type '%1'").arg(type));
return;
}
this->ui->comboBox_Type->setCurrentText(type);
this->editor->map->setType(type);
}
QString MainWindow::getBattleScene() {
@ -896,25 +897,25 @@ QString MainWindow::getBattleScene() {
}
void MainWindow::setBattleScene(QString battleScene) {
if (!this->ui || !this->editor || !this->editor->project)
if (!this->editor || !this->editor->map || !this->editor->project)
return;
if (!this->editor->project->mapBattleScenes.contains(battleScene)) {
logError(QString("Unknown battle scene '%1'").arg(battleScene));
return;
}
this->ui->comboBox_BattleScene->setCurrentText(battleScene);
this->editor->map->setBattleScene(battleScene);
}
bool MainWindow::getShowLocationName() {
if (!this->editor || !this->editor->map)
return false;
return this->editor->map->showsLocation();
return this->editor->map->showsLocationName();
}
void MainWindow::setShowLocationName(bool show) {
if (!this->ui)
if (!this->editor || !this->editor->map)
return;
this->ui->checkBox_ShowLocation->setChecked(show);
this->editor->map->setShowsLocationName(show);
}
bool MainWindow::getAllowRunning() {
@ -924,9 +925,9 @@ bool MainWindow::getAllowRunning() {
}
void MainWindow::setAllowRunning(bool allow) {
if (!this->ui)
if (!this->editor || !this->editor->map)
return;
this->ui->checkBox_AllowRunning->setChecked(allow);
this->editor->map->setAllowsRunning(allow);
}
bool MainWindow::getAllowBiking() {
@ -936,9 +937,9 @@ bool MainWindow::getAllowBiking() {
}
void MainWindow::setAllowBiking(bool allow) {
if (!this->ui)
if (!this->editor || !this->editor->map)
return;
this->ui->checkBox_AllowBiking->setChecked(allow);
this->editor->map->setAllowsBiking(allow);
}
bool MainWindow::getAllowEscaping() {
@ -948,9 +949,9 @@ bool MainWindow::getAllowEscaping() {
}
void MainWindow::setAllowEscaping(bool allow) {
if (!this->ui)
if (!this->editor || !this->editor->map)
return;
this->ui->checkBox_AllowEscaping->setChecked(allow);
this->editor->map->setAllowsEscaping(allow);
}
int MainWindow::getFloorNumber() {
@ -960,12 +961,8 @@ int MainWindow::getFloorNumber() {
}
void MainWindow::setFloorNumber(int floorNumber) {
if (!this->ui)
if (!this->editor || !this->editor->map)
return;
if (floorNumber < -128 || floorNumber > 127) {
logError(QString("Invalid floor number '%1'").arg(floorNumber));
return;
}
this->ui->spinBox_FloorNumber->setValue(floorNumber);
this->editor->map->setFloorNumber(floorNumber);
}

220
src/ui/mapheaderform.cpp Normal file
View File

@ -0,0 +1,220 @@
#include "mapheaderform.h"
#define BLOCK_SIGNALS \
const QSignalBlocker b_Song(ui->comboBox_Song); \
const QSignalBlocker b_Location(ui->comboBox_Location); \
const QSignalBlocker b_RequiresFlash(ui->checkBox_RequiresFlash); \
const QSignalBlocker b_Weather(ui->comboBox_Weather); \
const QSignalBlocker b_Type(ui->comboBox_Type); \
const QSignalBlocker b_BattleScene(ui->comboBox_BattleScene); \
const QSignalBlocker b_ShowLocationName(ui->checkBox_ShowLocationName); \
const QSignalBlocker b_AllowRunning(ui->checkBox_AllowRunning); \
const QSignalBlocker b_AllowBiking(ui->checkBox_AllowBiking); \
const QSignalBlocker b_AllowEscaping(ui->checkBox_AllowEscaping); \
const QSignalBlocker b_FloorNumber(ui->spinBox_FloorNumber);
MapHeaderForm::MapHeaderForm(QWidget *parent)
: QWidget(parent)
, ui(new Ui::MapHeaderForm)
{
ui->setupUi(this);
// This value is an s8 by default, but we don't need to unnecessarily limit users.
ui->spinBox_FloorNumber->setMinimum(INT_MIN);
ui->spinBox_FloorNumber->setMaximum(INT_MAX);
}
MapHeaderForm::~MapHeaderForm()
{
delete ui;
}
void MapHeaderForm::setProject(Project * newProject) {
clear();
this->project = newProject;
if (!this->project)
return;
// Populate combo boxes
BLOCK_SIGNALS
ui->comboBox_Song->addItems(this->project->songNames);
ui->comboBox_Weather->addItems(this->project->weatherNames);
ui->comboBox_Type->addItems(this->project->mapTypes);
ui->comboBox_BattleScene->addItems(this->project->mapBattleScenes);
refreshLocationsComboBox();
// Hide config-specific settings
bool hasFlags = projectConfig.mapAllowFlagsEnabled;
ui->checkBox_AllowRunning->setVisible(hasFlags);
ui->checkBox_AllowBiking->setVisible(hasFlags);
ui->checkBox_AllowEscaping->setVisible(hasFlags);
ui->label_AllowRunning->setVisible(hasFlags);
ui->label_AllowBiking->setVisible(hasFlags);
ui->label_AllowEscaping->setVisible(hasFlags);
bool floorNumEnabled = projectConfig.floorNumberEnabled;
ui->spinBox_FloorNumber->setVisible(floorNumEnabled);
ui->label_FloorNumber->setVisible(floorNumEnabled);
}
void MapHeaderForm::setMap(Map * newMap) {
this->map = newMap;
if (!this->map) {
clearDisplay();
return;
}
BLOCK_SIGNALS
ui->comboBox_Song->setCurrentText(this->map->song());
ui->comboBox_Location->setCurrentText(this->map->location());
ui->checkBox_RequiresFlash->setChecked(this->map->requiresFlash());
ui->comboBox_Weather->setCurrentText(this->map->weather());
ui->comboBox_Type->setCurrentText(this->map->type());
ui->comboBox_BattleScene->setCurrentText(this->map->battleScene());
ui->checkBox_ShowLocationName->setChecked(this->map->showsLocationName());
ui->checkBox_AllowRunning->setChecked(this->map->allowsRunning());
ui->checkBox_AllowBiking->setChecked(this->map->allowsBiking());
ui->checkBox_AllowEscaping->setChecked(this->map->allowsEscaping());
ui->spinBox_FloorNumber->setValue(this->map->floorNumber());
}
void MapHeaderForm::clearDisplay() {
BLOCK_SIGNALS
ui->comboBox_Song->clearEditText();
ui->comboBox_Location->clearEditText();
ui->comboBox_Weather->clearEditText();
ui->comboBox_Type->clearEditText();
ui->comboBox_BattleScene->clearEditText();
ui->checkBox_ShowLocationName->setChecked(false);
ui->checkBox_RequiresFlash->setChecked(false);
ui->checkBox_AllowRunning->setChecked(false);
ui->checkBox_AllowBiking->setChecked(false);
ui->checkBox_AllowEscaping->setChecked(false);
ui->spinBox_FloorNumber->setValue(0);
}
// Clear display and depopulate combo boxes
void MapHeaderForm::clear() {
BLOCK_SIGNALS
ui->comboBox_Song->clear();
ui->comboBox_Location->clear();
ui->comboBox_Weather->clear();
ui->comboBox_Type->clear();
ui->comboBox_BattleScene->clear();
ui->checkBox_ShowLocationName->setChecked(false);
ui->checkBox_RequiresFlash->setChecked(false);
ui->checkBox_AllowRunning->setChecked(false);
ui->checkBox_AllowBiking->setChecked(false);
ui->checkBox_AllowEscaping->setChecked(false);
ui->spinBox_FloorNumber->setValue(0);
}
void MapHeaderForm::refreshLocationsComboBox() {
const QSignalBlocker b(ui->comboBox_Location);
ui->comboBox_Location->clear();
if (this->project) {
QStringList locations = this->project->mapSectionIdNames;
locations.sort();
ui->comboBox_Location->addItems(locations);
}
if (this->map) {
ui->comboBox_Location->setCurrentText(this->map->location());
}
}
void MapHeaderForm::on_comboBox_Song_currentTextChanged(const QString &song)
{
if (this->map) {
this->map->setSong(song);
this->map->modify();
}
}
void MapHeaderForm::on_comboBox_Location_currentTextChanged(const QString &location)
{
if (this->map) {
this->map->setLocation(location);
this->map->modify();
// Update cached location name in the project
// TODO: This should be handled elsewhere now, connected to the map change signal
if (this->project)
this->project->mapNameToMapSectionName.insert(this->map->name(), this->map->location());
}
}
void MapHeaderForm::on_comboBox_Weather_currentTextChanged(const QString &weather)
{
if (this->map) {
this->map->setWeather(weather);
this->map->modify();
}
}
void MapHeaderForm::on_comboBox_Type_currentTextChanged(const QString &type)
{
if (this->map) {
this->map->setType(type);
this->map->modify();
}
}
void MapHeaderForm::on_comboBox_BattleScene_currentTextChanged(const QString &battleScene)
{
if (this->map) {
this->map->setBattleScene(battleScene);
this->map->modify();
}
}
void MapHeaderForm::on_checkBox_RequiresFlash_stateChanged(int selected)
{
if (this->map) {
this->map->setRequiresFlash(selected == Qt::Checked);
this->map->modify();
}
}
void MapHeaderForm::on_checkBox_ShowLocationName_stateChanged(int selected)
{
if (this->map) {
this->map->setShowsLocationName(selected == Qt::Checked);
this->map->modify();
}
}
void MapHeaderForm::on_checkBox_AllowRunning_stateChanged(int selected)
{
if (this->map) {
this->map->setAllowsRunning(selected == Qt::Checked);
this->map->modify();
}
}
void MapHeaderForm::on_checkBox_AllowBiking_stateChanged(int selected)
{
if (this->map) {
this->map->setAllowsBiking(selected == Qt::Checked);
this->map->modify();
}
}
void MapHeaderForm::on_checkBox_AllowEscaping_stateChanged(int selected)
{
if (this->map) {
this->map->setAllowsEscaping(selected == Qt::Checked);
this->map->modify();
}
}
void MapHeaderForm::on_spinBox_FloorNumber_valueChanged(int offset)
{
if (this->map) {
this->map->setFloorNumber(offset);
this->map->modify();
}
}

View File

@ -31,6 +31,9 @@ NewMapDialog::NewMapDialog(QWidget *parent, Project *project) :
ui->lineEdit_Name->setValidator(validator);
ui->lineEdit_ID->setValidator(validator);
this->headerData = new MapHeaderForm();
ui->layout_HeaderData->addWidget(this->headerData);
connect(ui->spinBox_MapWidth, QOverload<int>::of(&QSpinBox::valueChanged), [=](int){validateMapDimensions();});
connect(ui->spinBox_MapHeight, QOverload<int>::of(&QSpinBox::valueChanged), [=](int){validateMapDimensions();});
}
@ -46,11 +49,7 @@ void NewMapDialog::init() {
ui->comboBox_PrimaryTileset->addItems(project->primaryTilesetLabels);
ui->comboBox_SecondaryTileset->addItems(project->secondaryTilesetLabels);
ui->comboBox_Group->addItems(project->groupNames);
ui->comboBox_Song->addItems(project->songNames);
ui->comboBox_Location->addItems(project->mapSectionIdNames);
ui->comboBox_Weather->addItems(project->weatherNames);
ui->comboBox_Type->addItems(project->mapTypes);
ui->comboBox_BattleScene->addItems(project->mapBattleScenes);
this->headerData->setProject(project);
// Set spin box limits
ui->spinBox_MapWidth->setMaximum(project->getMaxMapWidth());
@ -58,21 +57,8 @@ void NewMapDialog::init() {
ui->spinBox_BorderWidth->setMaximum(MAX_BORDER_WIDTH);
ui->spinBox_BorderHeight->setMaximum(MAX_BORDER_HEIGHT);
// Hide config specific ui elements
bool hasFlags = projectConfig.mapAllowFlagsEnabled;
ui->checkBox_AllowRunning->setVisible(hasFlags);
ui->checkBox_AllowBiking->setVisible(hasFlags);
ui->checkBox_AllowEscaping->setVisible(hasFlags);
ui->label_AllowRunning->setVisible(hasFlags);
ui->label_AllowBiking->setVisible(hasFlags);
ui->label_AllowEscaping->setVisible(hasFlags);
ui->groupBox_BorderDimensions->setVisible(projectConfig.useCustomBorderSize);
bool hasFloorNumber = projectConfig.floorNumberEnabled;
ui->spinBox_FloorNumber->setVisible(hasFloorNumber);
ui->label_FloorNumber->setVisible(hasFloorNumber);
// Restore previous settings
ui->lineEdit_Name->setText(project->getNewMapName());
ui->comboBox_Group->setTextItem(settings.group);
@ -82,17 +68,17 @@ void NewMapDialog::init() {
ui->spinBox_BorderHeight->setValue(settings.borderHeight);
ui->comboBox_PrimaryTileset->setTextItem(settings.primaryTilesetLabel);
ui->comboBox_SecondaryTileset->setTextItem(settings.secondaryTilesetLabel);
ui->comboBox_Song->setTextItem(settings.song);
ui->comboBox_Location->setTextItem(settings.location);
ui->checkBox_RequiresFlash->setChecked(settings.requiresFlash);
ui->comboBox_Weather->setTextItem(settings.weather);
ui->comboBox_Type->setTextItem(settings.type);
ui->comboBox_BattleScene->setTextItem(settings.battleScene);
ui->checkBox_ShowLocation->setChecked(settings.showLocationName);
ui->checkBox_AllowRunning->setChecked(settings.allowRunning);
ui->checkBox_AllowBiking->setChecked(settings.allowBiking);
ui->checkBox_AllowEscaping->setChecked(settings.allowEscaping);
ui->spinBox_FloorNumber->setValue(settings.floorNumber);
this->headerData->ui->comboBox_Song->setTextItem(settings.song);
this->headerData->ui->comboBox_Location->setTextItem(settings.location);
this->headerData->ui->checkBox_RequiresFlash->setChecked(settings.requiresFlash);
this->headerData->ui->comboBox_Weather->setTextItem(settings.weather);
this->headerData->ui->comboBox_Type->setTextItem(settings.type);
this->headerData->ui->comboBox_BattleScene->setTextItem(settings.battleScene);
this->headerData->ui->checkBox_ShowLocationName->setChecked(settings.showLocationName);
this->headerData->ui->checkBox_AllowRunning->setChecked(settings.allowRunning);
this->headerData->ui->checkBox_AllowBiking->setChecked(settings.allowBiking);
this->headerData->ui->checkBox_AllowEscaping->setChecked(settings.allowEscaping);
this->headerData->ui->spinBox_FloorNumber->setValue(settings.floorNumber);
ui->checkBox_CanFlyTo->setChecked(settings.canFlyTo);
}
@ -164,17 +150,17 @@ void NewMapDialog::saveSettings() {
settings.borderHeight = ui->spinBox_BorderHeight->value();
settings.primaryTilesetLabel = ui->comboBox_PrimaryTileset->currentText();
settings.secondaryTilesetLabel = ui->comboBox_SecondaryTileset->currentText();
settings.song = ui->comboBox_Song->currentText();
settings.location = ui->comboBox_Location->currentText();
settings.requiresFlash = ui->checkBox_RequiresFlash->isChecked();
settings.weather = ui->comboBox_Weather->currentText();
settings.type = ui->comboBox_Type->currentText();
settings.battleScene = ui->comboBox_BattleScene->currentText();
settings.showLocationName = ui->checkBox_ShowLocation->isChecked();
settings.allowRunning = ui->checkBox_AllowRunning->isChecked();
settings.allowBiking = ui->checkBox_AllowBiking->isChecked();
settings.allowEscaping = ui->checkBox_AllowEscaping->isChecked();
settings.floorNumber = ui->spinBox_FloorNumber->value();
settings.song = this->headerData->ui->comboBox_Song->currentText();
settings.location = this->headerData->ui->comboBox_Location->currentText();
settings.requiresFlash = this->headerData->ui->checkBox_RequiresFlash->isChecked();
settings.weather = this->headerData->ui->comboBox_Weather->currentText();
settings.type = this->headerData->ui->comboBox_Type->currentText();
settings.battleScene = this->headerData->ui->comboBox_BattleScene->currentText();
settings.showLocationName = this->headerData->ui->checkBox_ShowLocationName->isChecked();
settings.allowRunning = this->headerData->ui->checkBox_AllowRunning->isChecked();
settings.allowBiking = this->headerData->ui->checkBox_AllowBiking->isChecked();
settings.allowEscaping = this->headerData->ui->checkBox_AllowEscaping->isChecked();
settings.floorNumber = this->headerData->ui->spinBox_FloorNumber->value();
settings.canFlyTo = ui->checkBox_CanFlyTo->isChecked();
}
@ -334,20 +320,20 @@ void NewMapDialog::on_pushButton_Accept_clicked() {
Map *newMap = new Map;
newMap->setName(ui->lineEdit_Name->text());
newMap->setConstantName(ui->lineEdit_ID->text());
newMap->setSong(ui->comboBox_Song->currentText());
newMap->setLocation(ui->comboBox_Location->currentText());
newMap->setRequiresFlash(ui->checkBox_RequiresFlash->isChecked());
newMap->setWeather(ui->comboBox_Weather->currentText());
newMap->setType(ui->comboBox_Type->currentText());
newMap->setBattleScene(ui->comboBox_BattleScene->currentText());
newMap->setShowsLocation(ui->checkBox_ShowLocation->isChecked());
newMap->setSong(this->headerData->ui->comboBox_Song->currentText());
newMap->setLocation(this->headerData->ui->comboBox_Location->currentText());
newMap->setRequiresFlash(this->headerData->ui->checkBox_RequiresFlash->isChecked());
newMap->setWeather(this->headerData->ui->comboBox_Weather->currentText());
newMap->setType(this->headerData->ui->comboBox_Type->currentText());
newMap->setBattleScene(this->headerData->ui->comboBox_BattleScene->currentText());
newMap->setShowsLocationName(this->headerData->ui->checkBox_ShowLocationName->isChecked());
if (projectConfig.mapAllowFlagsEnabled) {
newMap->setAllowsRunning(ui->checkBox_AllowRunning->isChecked());
newMap->setAllowsBiking(ui->checkBox_AllowBiking->isChecked());
newMap->setAllowsEscaping(ui->checkBox_AllowEscaping->isChecked());
newMap->setAllowsRunning(this->headerData->ui->checkBox_AllowRunning->isChecked());
newMap->setAllowsBiking(this->headerData->ui->checkBox_AllowBiking->isChecked());
newMap->setAllowsEscaping(this->headerData->ui->checkBox_AllowEscaping->isChecked());
}
if (projectConfig.floorNumberEnabled) {
newMap->setFloorNumber(ui->spinBox_FloorNumber->value());
newMap->setFloorNumber(this->headerData->ui->spinBox_FloorNumber->value());
}
newMap->setNeedsHealLocation(ui->checkBox_CanFlyTo->isChecked());