Browse Source

Provide populated comboboxes and tooltips for (mostly) everything

Marcus Huderle 6 years ago
parent
commit
fba2ade2bb
8 changed files with 328 additions and 263 deletions
  1. 3
    3
      event.cpp
  2. 65
    14
      mainwindow.cpp
  3. 2
    0
      mainwindow.h
  4. 202
    198
      mainwindow.ui
  5. 1
    1
      map.h
  6. 12
    0
      objectpropertiesframe.ui
  7. 35
    43
      project.cpp
  8. 8
    4
      project.h

+ 3
- 3
event.cpp View File

42
     Event *event = new Event;
42
     Event *event = new Event;
43
     event->put("event_group_type", "object_event_group");
43
     event->put("event_group_type", "object_event_group");
44
     event->put("event_type", EventType::Object);
44
     event->put("event_type", EventType::Object);
45
-    event->put("sprite", "EVENT_OBJ_GFX_BOY_1");
45
+    event->put("sprite", "MOVEMENT_TYPE_LOOK_AROUND");
46
     event->put("movement_type", "1");
46
     event->put("movement_type", "1");
47
     event->put("radius_x", 0);
47
     event->put("radius_x", 0);
48
     event->put("radius_y", 0);
48
     event->put("radius_y", 0);
49
     event->put("script_label", "NULL");
49
     event->put("script_label", "NULL");
50
     event->put("event_flag", "0");
50
     event->put("event_flag", "0");
51
     event->put("replacement", "0");
51
     event->put("replacement", "0");
52
-    event->put("trainer_see_type", "0");
52
+    event->put("is_trainer", "FALSE");
53
     event->put("sight_radius_tree_id", 0);
53
     event->put("sight_radius_tree_id", 0);
54
     return event;
54
     return event;
55
 }
55
 }
130
     text += QString(", %1").arg(this->get("movement_type"));
130
     text += QString(", %1").arg(this->get("movement_type"));
131
     text += QString(", %1").arg(radius_x);
131
     text += QString(", %1").arg(radius_x);
132
     text += QString(", %1").arg(radius_y);
132
     text += QString(", %1").arg(radius_y);
133
-    text += QString(", %1").arg(this->get("trainer_see_type"));
133
+    text += QString(", %1").arg(this->get("is_trainer"));
134
     text += QString(", %1").arg(this->get("sight_radius_tree_id"));
134
     text += QString(", %1").arg(this->get("sight_radius_tree_id"));
135
     text += QString(", %1").arg(this->get("script_label"));
135
     text += QString(", %1").arg(this->get("script_label"));
136
     text += QString(", %1").arg(this->get("event_flag"));
136
     text += QString(", %1").arg(this->get("event_flag"));

+ 65
- 14
mainwindow.cpp View File

244
 void MainWindow::displayMapProperties() {
244
 void MainWindow::displayMapProperties() {
245
     ui->comboBox_Song->clear();
245
     ui->comboBox_Song->clear();
246
     ui->comboBox_Location->clear();
246
     ui->comboBox_Location->clear();
247
-    ui->comboBox_Visibility->clear();
247
+    ui->checkBox_Visibility->setChecked(false);
248
     ui->comboBox_Weather->clear();
248
     ui->comboBox_Weather->clear();
249
     ui->comboBox_Type->clear();
249
     ui->comboBox_Type->clear();
250
     ui->comboBox_BattleScene->clear();
250
     ui->comboBox_BattleScene->clear();
263
     ui->comboBox_Song->addItems(songs);
263
     ui->comboBox_Song->addItems(songs);
264
     ui->comboBox_Song->setCurrentText(map->song);
264
     ui->comboBox_Song->setCurrentText(map->song);
265
 
265
 
266
-    ui->comboBox_Location->addItems(project->getLocations());
266
+    ui->comboBox_Location->addItems(*project->regionMapSections);
267
     ui->comboBox_Location->setCurrentText(map->location);
267
     ui->comboBox_Location->setCurrentText(map->location);
268
 
268
 
269
     QMap<QString, QStringList> tilesets = project->getTilesets();
269
     QMap<QString, QStringList> tilesets = project->getTilesets();
272
     ui->comboBox_SecondaryTileset->addItems(tilesets.value("secondary"));
272
     ui->comboBox_SecondaryTileset->addItems(tilesets.value("secondary"));
273
     ui->comboBox_SecondaryTileset->setCurrentText(map->layout->tileset_secondary_label);
273
     ui->comboBox_SecondaryTileset->setCurrentText(map->layout->tileset_secondary_label);
274
 
274
 
275
-    ui->comboBox_Visibility->addItems(project->getVisibilities());
276
-    ui->comboBox_Visibility->setCurrentText(map->visibility);
275
+    ui->checkBox_Visibility->setChecked(map->requiresFlash.toInt() > 0 || map->requiresFlash == "TRUE");
277
 
276
 
278
-    ui->comboBox_Weather->addItems(project->getWeathers());
277
+    ui->comboBox_Weather->addItems(*project->weatherNames);
279
     ui->comboBox_Weather->setCurrentText(map->weather);
278
     ui->comboBox_Weather->setCurrentText(map->weather);
280
 
279
 
281
-    ui->comboBox_Type->addItems(project->getMapTypes());
280
+    ui->comboBox_Type->addItems(*project->mapTypes);
282
     ui->comboBox_Type->setCurrentText(map->type);
281
     ui->comboBox_Type->setCurrentText(map->type);
283
 
282
 
284
-    ui->comboBox_BattleScene->addItems(project->getBattleScenes());
283
+    ui->comboBox_BattleScene->addItems(*project->mapBattleScenes);
285
     ui->comboBox_BattleScene->setCurrentText(map->battle_scene);
284
     ui->comboBox_BattleScene->setCurrentText(map->battle_scene);
286
 
285
 
287
     ui->checkBox_ShowLocation->setChecked(map->show_location.toInt() > 0 || map->show_location == "TRUE");
286
     ui->checkBox_ShowLocation->setChecked(map->show_location.toInt() > 0 || map->show_location == "TRUE");
301
     }
300
     }
302
 }
301
 }
303
 
302
 
304
-void MainWindow::on_comboBox_Visibility_activated(const QString &visibility)
303
+void MainWindow::on_comboBox_Visibility_activated(const QString &requiresFlash)
305
 {
304
 {
306
     if (editor && editor->map) {
305
     if (editor && editor->map) {
307
-        editor->map->visibility = visibility;
306
+        editor->map->requiresFlash = requiresFlash;
308
     }
307
     }
309
 }
308
 }
310
 
309
 
329
     }
328
     }
330
 }
329
 }
331
 
330
 
331
+void MainWindow::on_checkBox_Visibility_clicked(bool checked)
332
+{
333
+    if (editor && editor->map) {
334
+        if (checked) {
335
+            editor->map->requiresFlash = "TRUE";
336
+        } else {
337
+            editor->map->requiresFlash = "FALSE";
338
+        }
339
+    }
340
+}
341
+
332
 void MainWindow::on_checkBox_ShowLocation_clicked(bool checked)
342
 void MainWindow::on_checkBox_ShowLocation_clicked(bool checked)
333
 {
343
 {
334
     if (editor && editor->map) {
344
     if (editor && editor->map) {
344
     Project *project = editor->project;
354
     Project *project = editor->project;
345
     project->readMapLayoutsTable();
355
     project->readMapLayoutsTable();
346
     project->readAllMapLayouts();
356
     project->readAllMapLayouts();
357
+    project->readRegionMapSections();
347
     project->readItemNames();
358
     project->readItemNames();
348
     project->readFlagNames();
359
     project->readFlagNames();
349
     project->readVarNames();
360
     project->readVarNames();
350
     project->readMovementTypes();
361
     project->readMovementTypes();
362
+    project->readMapTypes();
363
+    project->readMapBattleScenes();
364
+    project->readWeatherNames();
351
     project->readCoordEventWeatherNames();
365
     project->readCoordEventWeatherNames();
352
     project->readSecretBaseIds();
366
     project->readSecretBaseIds();
353
     project->readBgEventFacingDirections();
367
     project->readBgEventFacingDirections();
642
         QMap<QString, QString> field_labels;
656
         QMap<QString, QString> field_labels;
643
         field_labels["script_label"] = "Script";
657
         field_labels["script_label"] = "Script";
644
         field_labels["event_flag"] = "Event Flag";
658
         field_labels["event_flag"] = "Event Flag";
645
-        field_labels["replacement"] = "Replacement";
646
         field_labels["movement_type"] = "Movement";
659
         field_labels["movement_type"] = "Movement";
647
         field_labels["radius_x"] = "Movement Radius X";
660
         field_labels["radius_x"] = "Movement Radius X";
648
         field_labels["radius_y"] = "Movement Radius Y";
661
         field_labels["radius_y"] = "Movement Radius Y";
649
-        field_labels["trainer_see_type"] = "Trainer See Type";
662
+        field_labels["is_trainer"] = "Trainer";
650
         field_labels["sight_radius_tree_id"] = "Sight Radius / Berry Tree ID";
663
         field_labels["sight_radius_tree_id"] = "Sight Radius / Berry Tree ID";
651
         field_labels["destination_warp"] = "Destination Warp";
664
         field_labels["destination_warp"] = "Destination Warp";
652
         field_labels["destination_map_name"] = "Destination Map";
665
         field_labels["destination_map_name"] = "Destination Map";
684
             fields << "radius_y";
697
             fields << "radius_y";
685
             fields << "script_label";
698
             fields << "script_label";
686
             fields << "event_flag";
699
             fields << "event_flag";
687
-            fields << "replacement";
688
-            fields << "trainer_see_type";
700
+            fields << "is_trainer";
689
             fields << "sight_radius_tree_id";
701
             fields << "sight_radius_tree_id";
690
         }
702
         }
691
         else if (event_type == EventType::Warp) {
703
         else if (event_type == EventType::Warp) {
713
         }
725
         }
714
 
726
 
715
         for (QString key : fields) {
727
         for (QString key : fields) {
728
+            QString value = item->event->get(key);
716
             QWidget *widget = new QWidget(frame);
729
             QWidget *widget = new QWidget(frame);
717
             QFormLayout *fl = new QFormLayout(widget);
730
             QFormLayout *fl = new QFormLayout(widget);
718
             fl->setContentsMargins(9, 0, 9, 0);
731
             fl->setContentsMargins(9, 0, 9, 0);
732
+
733
+            // is_trainer is the only non-combobox item.
734
+            if (key == "is_trainer") {
735
+                QCheckBox *checkbox = new QCheckBox(widget);
736
+                checkbox->setEnabled(true);
737
+                checkbox->setChecked(value.toInt() != 0 && value != "FALSE");
738
+                checkbox->setToolTip("Whether or not this object is trainer.");
739
+                fl->addRow(new QLabel(field_labels[key], widget), checkbox);
740
+                widget->setLayout(fl);
741
+                frame->layout()->addWidget(widget);
742
+                connect(checkbox, &QCheckBox::stateChanged, [=](int state) {
743
+                    QString isTrainer = state == Qt::Checked ? "TRUE" : "FALSE";
744
+                    item->event->put("is_trainer", isTrainer);
745
+                });
746
+                continue;
747
+            }
748
+
719
             NoScrollComboBox *combo = new NoScrollComboBox(widget);
749
             NoScrollComboBox *combo = new NoScrollComboBox(widget);
720
             combo->setEditable(true);
750
             combo->setEditable(true);
721
 
751
 
722
-            QString value = item->event->get(key);
723
             if (key == "destination_map_name") {
752
             if (key == "destination_map_name") {
724
                 if (!editor->project->mapNames->contains(value)) {
753
                 if (!editor->project->mapNames->contains(value)) {
725
                     combo->addItem(value);
754
                     combo->addItem(value);
726
                 }
755
                 }
727
                 combo->addItems(*editor->project->mapNames);
756
                 combo->addItems(*editor->project->mapNames);
757
+                combo->setToolTip("The destination map name of the warp.");
758
+            } else if (key == "destination_warp") {
759
+                combo->setToolTip("The warp id on the destination map.");
728
             } else if (key == "item") {
760
             } else if (key == "item") {
729
                 if (!editor->project->itemNames->contains(value)) {
761
                 if (!editor->project->itemNames->contains(value)) {
730
                     combo->addItem(value);
762
                     combo->addItem(value);
735
                     combo->addItem(value);
767
                     combo->addItem(value);
736
                 }
768
                 }
737
                 combo->addItems(*editor->project->flagNames);
769
                 combo->addItems(*editor->project->flagNames);
770
+                if (key == "flag")
771
+                    combo->setToolTip("The flag which is set when the hidden item is picked up.");
772
+                else if (key == "event_flag")
773
+                    combo->setToolTip("The flag which hides the object when set.");
738
             } else if (key == "script_var") {
774
             } else if (key == "script_var") {
739
                 if (!editor->project->varNames->contains(value)) {
775
                 if (!editor->project->varNames->contains(value)) {
740
                     combo->addItem(value);
776
                     combo->addItem(value);
741
                 }
777
                 }
742
                 combo->addItems(*editor->project->varNames);
778
                 combo->addItems(*editor->project->varNames);
779
+                combo->setToolTip("The variable by which the script is triggered. The script is triggered when this variable's value matches 'Var Value'.");
780
+            } else if (key == "script_var_value")  {
781
+                combo->setToolTip("The variable's value which triggers the script.");
743
             } else if (key == "movement_type") {
782
             } else if (key == "movement_type") {
744
                 if (!editor->project->movementTypes->contains(value)) {
783
                 if (!editor->project->movementTypes->contains(value)) {
745
                     combo->addItem(value);
784
                     combo->addItem(value);
746
                 }
785
                 }
747
                 combo->addItems(*editor->project->movementTypes);
786
                 combo->addItems(*editor->project->movementTypes);
787
+                combo->setToolTip("The object's natural movement behavior when the player is not interacting with it.");
748
             } else if (key == "weather") {
788
             } else if (key == "weather") {
749
                 if (!editor->project->coordEventWeatherNames->contains(value)) {
789
                 if (!editor->project->coordEventWeatherNames->contains(value)) {
750
                     combo->addItem(value);
790
                     combo->addItem(value);
751
                 }
791
                 }
752
                 combo->addItems(*editor->project->coordEventWeatherNames);
792
                 combo->addItems(*editor->project->coordEventWeatherNames);
793
+                combo->setToolTip("The weather that starts when the player steps on this spot.");
753
             } else if (key == "secret_base_id") {
794
             } else if (key == "secret_base_id") {
754
                 if (!editor->project->secretBaseIds->contains(value)) {
795
                 if (!editor->project->secretBaseIds->contains(value)) {
755
                     combo->addItem(value);
796
                     combo->addItem(value);
756
                 }
797
                 }
757
                 combo->addItems(*editor->project->secretBaseIds);
798
                 combo->addItems(*editor->project->secretBaseIds);
799
+                combo->setToolTip("The secret base id which is inside this secret base entrance. Secret base ids are meant to be unique to each and every secret base entrance.");
758
             } else if (key == "player_facing_direction") {
800
             } else if (key == "player_facing_direction") {
759
                 if (!editor->project->bgEventFacingDirections->contains(value)) {
801
                 if (!editor->project->bgEventFacingDirections->contains(value)) {
760
                     combo->addItem(value);
802
                     combo->addItem(value);
761
                 }
803
                 }
762
                 combo->addItems(*editor->project->bgEventFacingDirections);
804
                 combo->addItems(*editor->project->bgEventFacingDirections);
805
+                combo->setToolTip("The direction which the player must be facing to be able to interact with this event.");
806
+            } else if (key == "radius_x") {
807
+                combo->setToolTip("The maximum number of metatiles this object is allowed to move left or right during its normal movement behavior actions.");
808
+            } else if (key == "radius_y") {
809
+                combo->setToolTip("The maximum number of metatiles this object is allowed to move up or down during its normal movement behavior actions.");
810
+            } else if (key == "script_label") {
811
+                combo->setToolTip("The script which is executed with this event.");
812
+            } else if (key == "sight_radius_tree_id") {
813
+                combo->setToolTip("The maximum sight range of a trainer, OR the unique id of the berry tree.");
763
             } else {
814
             } else {
764
                 combo->addItem(value);
815
                 combo->addItem(value);
765
             }
816
             }

+ 2
- 0
mainwindow.h View File

99
 
99
 
100
     void on_checkBox_smartPaths_stateChanged(int selected);
100
     void on_checkBox_smartPaths_stateChanged(int selected);
101
 
101
 
102
+    void on_checkBox_Visibility_clicked(bool checked);
103
+
102
 private:
104
 private:
103
     Ui::MainWindow *ui;
105
     Ui::MainWindow *ui;
104
     QStandardItemModel *mapListModel;
106
     QStandardItemModel *mapListModel;

+ 202
- 198
mainwindow.ui View File

69
         <bool>false</bool>
69
         <bool>false</bool>
70
        </property>
70
        </property>
71
        <widget class="QWidget" name="tab_Map">
71
        <widget class="QWidget" name="tab_Map">
72
+        <property name="toolTip">
73
+         <string/>
74
+        </property>
72
         <attribute name="icon">
75
         <attribute name="icon">
73
          <iconset resource="resources/images.qrc">
76
          <iconset resource="resources/images.qrc">
74
           <normaloff>:/icons/map.ico</normaloff>:/icons/map.ico</iconset>
77
           <normaloff>:/icons/map.ico</normaloff>:/icons/map.ico</iconset>
76
         <attribute name="title">
79
         <attribute name="title">
77
          <string>Map</string>
80
          <string>Map</string>
78
         </attribute>
81
         </attribute>
82
+        <attribute name="toolTip">
83
+         <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Edit the map layout.&lt;/p&gt;&lt;p&gt;Select metatiles or collision attributes from the right panel, and paint them onto the map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
84
+        </attribute>
79
         <layout class="QGridLayout" name="gridLayout_9">
85
         <layout class="QGridLayout" name="gridLayout_9">
80
          <property name="leftMargin">
86
          <property name="leftMargin">
81
           <number>0</number>
87
           <number>0</number>
164
                   <property name="enabled">
170
                   <property name="enabled">
165
                    <bool>true</bool>
171
                    <bool>true</bool>
166
                   </property>
172
                   </property>
173
+                  <property name="toolTip">
174
+                   <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Pencil&lt;/p&gt;&lt;p&gt;Click and drag to draw on the map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
175
+                  </property>
167
                   <property name="text">
176
                   <property name="text">
168
                    <string>Paint</string>
177
                    <string>Paint</string>
169
                   </property>
178
                   </property>
187
                   <property name="enabled">
196
                   <property name="enabled">
188
                    <bool>true</bool>
197
                    <bool>true</bool>
189
                   </property>
198
                   </property>
199
+                  <property name="toolTip">
200
+                   <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Pointer&lt;/p&gt;&lt;p&gt;Does nothing&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
201
+                  </property>
190
                   <property name="text">
202
                   <property name="text">
191
                    <string>Select</string>
203
                    <string>Select</string>
192
                   </property>
204
                   </property>
201
                 </item>
213
                 </item>
202
                 <item>
214
                 <item>
203
                  <widget class="QToolButton" name="toolButton_Fill">
215
                  <widget class="QToolButton" name="toolButton_Fill">
216
+                  <property name="toolTip">
217
+                   <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Flood Fill&lt;/p&gt;&lt;p&gt;Fills all similar tiles in a region with the selected metatiles or collision attributes&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
218
+                  </property>
204
                   <property name="text">
219
                   <property name="text">
205
                    <string>Fill</string>
220
                    <string>Fill</string>
206
                   </property>
221
                   </property>
215
                 </item>
230
                 </item>
216
                 <item>
231
                 <item>
217
                  <widget class="QToolButton" name="toolButton_Dropper">
232
                  <widget class="QToolButton" name="toolButton_Dropper">
233
+                  <property name="toolTip">
234
+                   <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Eye Dropper&lt;/p&gt;&lt;p&gt;Click to select a metatile or collision attribute.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
235
+                  </property>
218
                   <property name="text">
236
                   <property name="text">
219
                    <string>Dropper</string>
237
                    <string>Dropper</string>
220
                   </property>
238
                   </property>
229
                 </item>
247
                 </item>
230
                 <item>
248
                 <item>
231
                  <widget class="QCheckBox" name="checkBox_smartPaths">
249
                  <widget class="QCheckBox" name="checkBox_smartPaths">
250
+                  <property name="toolTip">
251
+                   <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Smart-path mode allows easier drawing of paths. If a 3x3 metatile block is selcted in the right panel, then smart path mode will automatically form a pathway using those selected blocks.&lt;/p&gt;&lt;p&gt;When smart-path mode is &lt;span style=&quot; font-weight:600;&quot;&gt;not&lt;/span&gt; enabled, clicking and dragging a selection will tile it in a grid.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
252
+                  </property>
232
                   <property name="styleSheet">
253
                   <property name="styleSheet">
233
                    <string notr="true">margin-left: 10px</string>
254
                    <string notr="true">margin-left: 10px</string>
234
                   </property>
255
                   </property>
239
                 </item>
260
                 </item>
240
                 <item>
261
                 <item>
241
                  <widget class="QCheckBox" name="checkBox_ToggleGrid">
262
                  <widget class="QCheckBox" name="checkBox_ToggleGrid">
263
+                  <property name="toolTip">
264
+                   <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Toggles a grid over the map's metatile boundaries.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
265
+                  </property>
242
                   <property name="styleSheet">
266
                   <property name="styleSheet">
243
                    <string notr="true"/>
267
                    <string notr="true"/>
244
                   </property>
268
                   </property>
262
                 </item>
286
                 </item>
263
                 <item>
287
                 <item>
264
                  <widget class="QPushButton" name="pushButton">
288
                  <widget class="QPushButton" name="pushButton">
289
+                  <property name="toolTip">
290
+                   <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Change a map layout's width and height.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
291
+                  </property>
265
                   <property name="text">
292
                   <property name="text">
266
                    <string>Change Dimensions</string>
293
                    <string>Change Dimensions</string>
267
                   </property>
294
                   </property>
494
                       <property name="focusPolicy">
521
                       <property name="focusPolicy">
495
                        <enum>Qt::StrongFocus</enum>
522
                        <enum>Qt::StrongFocus</enum>
496
                       </property>
523
                       </property>
524
+                      <property name="toolTip">
525
+                       <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Primary Tileset&lt;/p&gt;&lt;p&gt;Defines the first 0x200 metatiles available for the map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
526
+                      </property>
497
                       <property name="editable">
527
                       <property name="editable">
498
                        <bool>true</bool>
528
                        <bool>true</bool>
499
                       </property>
529
                       </property>
511
                       <property name="focusPolicy">
541
                       <property name="focusPolicy">
512
                        <enum>Qt::StrongFocus</enum>
542
                        <enum>Qt::StrongFocus</enum>
513
                       </property>
543
                       </property>
544
+                      <property name="toolTip">
545
+                       <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Secondary Tileset&lt;/p&gt;&lt;p&gt;Defines the second 0x200 metatiles available for the map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
546
+                      </property>
514
                       <property name="editable">
547
                       <property name="editable">
515
                        <bool>true</bool>
548
                        <bool>true</bool>
516
                       </property>
549
                       </property>
580
                         <height>48</height>
613
                         <height>48</height>
581
                        </size>
614
                        </size>
582
                       </property>
615
                       </property>
616
+                      <property name="toolTip">
617
+                       <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The border is a 2x2 metatile which is repeated outside of the map layout's boundary. Draw on this border area to modify it.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
618
+                      </property>
583
                       <property name="frameShape">
619
                       <property name="frameShape">
584
                        <enum>QFrame::StyledPanel</enum>
620
                        <enum>QFrame::StyledPanel</enum>
585
                       </property>
621
                       </property>
852
          <bool>true</bool>
888
          <bool>true</bool>
853
         </property>
889
         </property>
854
         <attribute name="title">
890
         <attribute name="title">
855
-         <string>Objects</string>
891
+         <string>Events</string>
892
+        </attribute>
893
+        <attribute name="toolTip">
894
+         <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Edit the map's events.&lt;/p&gt;&lt;p&gt;View and modify objects, warps, signs, etc.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
856
         </attribute>
895
         </attribute>
857
         <layout class="QGridLayout" name="gridLayout_10">
896
         <layout class="QGridLayout" name="gridLayout_10">
858
          <property name="leftMargin">
897
          <property name="leftMargin">
1113
                     <height>32</height>
1152
                     <height>32</height>
1114
                    </size>
1153
                    </size>
1115
                   </property>
1154
                   </property>
1155
+                  <property name="toolTip">
1156
+                   <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Add a new event to the map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
1157
+                  </property>
1116
                   <property name="text">
1158
                   <property name="text">
1117
                    <string>New Object</string>
1159
                    <string>New Object</string>
1118
                   </property>
1160
                   </property>
1139
                     <height>32</height>
1181
                     <height>32</height>
1140
                    </size>
1182
                    </size>
1141
                   </property>
1183
                   </property>
1184
+                  <property name="toolTip">
1185
+                   <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Delete the selected event from the map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
1186
+                  </property>
1142
                   <property name="text">
1187
                   <property name="text">
1143
                    <string>Delete</string>
1188
                    <string>Delete</string>
1144
                   </property>
1189
                   </property>
1178
        </widget>
1223
        </widget>
1179
        <widget class="QWidget" name="tab_Attributes">
1224
        <widget class="QWidget" name="tab_Attributes">
1180
         <attribute name="title">
1225
         <attribute name="title">
1181
-         <string>Attributes</string>
1226
+         <string>Header</string>
1182
         </attribute>
1227
         </attribute>
1183
         <widget class="QFrame" name="frame_3">
1228
         <widget class="QFrame" name="frame_3">
1184
          <property name="enabled">
1229
          <property name="enabled">
1188
           <rect>
1233
           <rect>
1189
            <x>10</x>
1234
            <x>10</x>
1190
            <y>10</y>
1235
            <y>10</y>
1191
-           <width>301</width>
1192
-           <height>251</height>
1236
+           <width>381</width>
1237
+           <height>311</height>
1193
           </rect>
1238
           </rect>
1194
          </property>
1239
          </property>
1240
+         <property name="sizePolicy">
1241
+          <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
1242
+           <horstretch>0</horstretch>
1243
+           <verstretch>0</verstretch>
1244
+          </sizepolicy>
1245
+         </property>
1195
          <property name="frameShape">
1246
          <property name="frameShape">
1196
           <enum>QFrame::StyledPanel</enum>
1247
           <enum>QFrame::StyledPanel</enum>
1197
          </property>
1248
          </property>
1198
          <property name="frameShadow">
1249
          <property name="frameShadow">
1199
           <enum>QFrame::Raised</enum>
1250
           <enum>QFrame::Raised</enum>
1200
          </property>
1251
          </property>
1201
-         <widget class="QLabel" name="label_3">
1202
-          <property name="geometry">
1203
-           <rect>
1204
-            <x>20</x>
1205
-            <y>30</y>
1206
-            <width>47</width>
1207
-            <height>21</height>
1208
-           </rect>
1209
-          </property>
1210
-          <property name="text">
1211
-           <string>Song</string>
1212
-          </property>
1213
-         </widget>
1214
-         <widget class="QLabel" name="label_4">
1215
-          <property name="geometry">
1216
-           <rect>
1217
-            <x>20</x>
1218
-            <y>60</y>
1219
-            <width>47</width>
1220
-            <height>21</height>
1221
-           </rect>
1222
-          </property>
1223
-          <property name="text">
1224
-           <string>Location</string>
1225
-          </property>
1226
-         </widget>
1227
-         <widget class="QLabel" name="label_5">
1228
-          <property name="geometry">
1229
-           <rect>
1230
-            <x>20</x>
1231
-            <y>90</y>
1232
-            <width>47</width>
1233
-            <height>21</height>
1234
-           </rect>
1235
-          </property>
1236
-          <property name="text">
1237
-           <string>Visibility</string>
1238
-          </property>
1239
-         </widget>
1240
-         <widget class="QLabel" name="label_6">
1241
-          <property name="geometry">
1242
-           <rect>
1243
-            <x>20</x>
1244
-            <y>120</y>
1245
-            <width>47</width>
1246
-            <height>21</height>
1247
-           </rect>
1248
-          </property>
1249
-          <property name="text">
1250
-           <string>Weather</string>
1251
-          </property>
1252
-         </widget>
1253
-         <widget class="QLabel" name="label_7">
1254
-          <property name="geometry">
1255
-           <rect>
1256
-            <x>20</x>
1257
-            <y>150</y>
1258
-            <width>47</width>
1259
-            <height>21</height>
1260
-           </rect>
1252
+         <layout class="QFormLayout" name="formLayout_2">
1253
+          <property name="verticalSpacing">
1254
+           <number>12</number>
1261
           </property>
1255
           </property>
1262
-          <property name="text">
1263
-           <string>Type</string>
1264
-          </property>
1265
-         </widget>
1266
-         <widget class="QLabel" name="label_8">
1267
-          <property name="geometry">
1268
-           <rect>
1269
-            <x>20</x>
1270
-            <y>180</y>
1271
-            <width>101</width>
1272
-            <height>21</height>
1273
-           </rect>
1274
-          </property>
1275
-          <property name="text">
1276
-           <string>Show location name</string>
1277
-          </property>
1278
-         </widget>
1279
-         <widget class="QLabel" name="label_9">
1280
-          <property name="geometry">
1281
-           <rect>
1282
-            <x>20</x>
1283
-            <y>210</y>
1284
-            <width>81</width>
1285
-            <height>21</height>
1286
-           </rect>
1287
-          </property>
1288
-          <property name="text">
1289
-           <string>Battle scene</string>
1290
-          </property>
1291
-         </widget>
1292
-         <widget class="QComboBox" name="comboBox_Location">
1293
-          <property name="geometry">
1294
-           <rect>
1295
-            <x>80</x>
1296
-            <y>60</y>
1297
-            <width>211</width>
1298
-            <height>22</height>
1299
-           </rect>
1300
-          </property>
1301
-          <property name="editable">
1302
-           <bool>true</bool>
1303
-          </property>
1304
-         </widget>
1305
-         <widget class="QComboBox" name="comboBox_Visibility">
1306
-          <property name="geometry">
1307
-           <rect>
1308
-            <x>80</x>
1309
-            <y>90</y>
1310
-            <width>211</width>
1311
-            <height>22</height>
1312
-           </rect>
1313
-          </property>
1314
-          <property name="editable">
1315
-           <bool>true</bool>
1316
-          </property>
1317
-         </widget>
1318
-         <widget class="QComboBox" name="comboBox_Song">
1319
-          <property name="geometry">
1320
-           <rect>
1321
-            <x>80</x>
1322
-            <y>30</y>
1323
-            <width>211</width>
1324
-            <height>22</height>
1325
-           </rect>
1326
-          </property>
1327
-          <property name="editable">
1328
-           <bool>true</bool>
1329
-          </property>
1330
-         </widget>
1331
-         <widget class="QComboBox" name="comboBox_Weather">
1332
-          <property name="geometry">
1333
-           <rect>
1334
-            <x>80</x>
1335
-            <y>120</y>
1336
-            <width>211</width>
1337
-            <height>22</height>
1338
-           </rect>
1339
-          </property>
1340
-          <property name="editable">
1341
-           <bool>true</bool>
1342
-          </property>
1343
-         </widget>
1344
-         <widget class="QComboBox" name="comboBox_Type">
1345
-          <property name="geometry">
1346
-           <rect>
1347
-            <x>80</x>
1348
-            <y>150</y>
1349
-            <width>211</width>
1350
-            <height>22</height>
1351
-           </rect>
1352
-          </property>
1353
-          <property name="editable">
1354
-           <bool>true</bool>
1355
-          </property>
1356
-         </widget>
1357
-         <widget class="QComboBox" name="comboBox_BattleScene">
1358
-          <property name="geometry">
1359
-           <rect>
1360
-            <x>90</x>
1361
-            <y>210</y>
1362
-            <width>201</width>
1363
-            <height>22</height>
1364
-           </rect>
1365
-          </property>
1366
-          <property name="editable">
1367
-           <bool>true</bool>
1368
-          </property>
1369
-         </widget>
1370
-         <widget class="QCheckBox" name="checkBox_ShowLocation">
1371
-          <property name="geometry">
1372
-           <rect>
1373
-            <x>130</x>
1374
-            <y>180</y>
1375
-            <width>161</width>
1376
-            <height>21</height>
1377
-           </rect>
1378
-          </property>
1379
-          <property name="text">
1380
-           <string/>
1381
-          </property>
1382
-         </widget>
1383
-         <widget class="QLabel" name="label_10">
1384
-          <property name="geometry">
1385
-           <rect>
1386
-            <x>0</x>
1387
-            <y>0</y>
1388
-            <width>47</width>
1389
-            <height>13</height>
1390
-           </rect>
1391
-          </property>
1392
-          <property name="text">
1393
-           <string>Header</string>
1394
-          </property>
1395
-         </widget>
1256
+          <item row="0" column="0">
1257
+           <widget class="QLabel" name="label_3">
1258
+            <property name="text">
1259
+             <string>Song</string>
1260
+            </property>
1261
+           </widget>
1262
+          </item>
1263
+          <item row="0" column="1">
1264
+           <widget class="QComboBox" name="comboBox_Song">
1265
+            <property name="toolTip">
1266
+             <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>
1267
+            </property>
1268
+            <property name="editable">
1269
+             <bool>true</bool>
1270
+            </property>
1271
+           </widget>
1272
+          </item>
1273
+          <item row="1" column="0">
1274
+           <widget class="QLabel" name="label_4">
1275
+            <property name="text">
1276
+             <string>Location</string>
1277
+            </property>
1278
+           </widget>
1279
+          </item>
1280
+          <item row="1" column="1">
1281
+           <widget class="QComboBox" name="comboBox_Location">
1282
+            <property name="toolTip">
1283
+             <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>
1284
+            </property>
1285
+            <property name="editable">
1286
+             <bool>true</bool>
1287
+            </property>
1288
+           </widget>
1289
+          </item>
1290
+          <item row="2" column="0">
1291
+           <widget class="QLabel" name="label_5">
1292
+            <property name="text">
1293
+             <string>Requires Flash</string>
1294
+            </property>
1295
+           </widget>
1296
+          </item>
1297
+          <item row="3" column="0">
1298
+           <widget class="QLabel" name="label_6">
1299
+            <property name="text">
1300
+             <string>Weather</string>
1301
+            </property>
1302
+           </widget>
1303
+          </item>
1304
+          <item row="3" column="1">
1305
+           <widget class="QComboBox" name="comboBox_Weather">
1306
+            <property name="toolTip">
1307
+             <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>
1308
+            </property>
1309
+            <property name="editable">
1310
+             <bool>true</bool>
1311
+            </property>
1312
+           </widget>
1313
+          </item>
1314
+          <item row="4" column="0">
1315
+           <widget class="QLabel" name="label_7">
1316
+            <property name="text">
1317
+             <string>Type</string>
1318
+            </property>
1319
+           </widget>
1320
+          </item>
1321
+          <item row="4" column="1">
1322
+           <widget class="QComboBox" name="comboBox_Type">
1323
+            <property name="toolTip">
1324
+             <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>
1325
+            </property>
1326
+            <property name="editable">
1327
+             <bool>true</bool>
1328
+            </property>
1329
+           </widget>
1330
+          </item>
1331
+          <item row="5" column="0">
1332
+           <widget class="QLabel" name="label_8">
1333
+            <property name="text">
1334
+             <string>Show Location Name</string>
1335
+            </property>
1336
+           </widget>
1337
+          </item>
1338
+          <item row="5" column="1">
1339
+           <widget class="QCheckBox" name="checkBox_ShowLocation">
1340
+            <property name="toolTip">
1341
+             <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>
1342
+            </property>
1343
+            <property name="text">
1344
+             <string/>
1345
+            </property>
1346
+           </widget>
1347
+          </item>
1348
+          <item row="6" column="0">
1349
+           <widget class="QLabel" name="label_9">
1350
+            <property name="text">
1351
+             <string>Battle scene</string>
1352
+            </property>
1353
+           </widget>
1354
+          </item>
1355
+          <item row="6" column="1">
1356
+           <widget class="QComboBox" name="comboBox_BattleScene">
1357
+            <property name="toolTip">
1358
+             <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>
1359
+            </property>
1360
+            <property name="editable">
1361
+             <bool>true</bool>
1362
+            </property>
1363
+           </widget>
1364
+          </item>
1365
+          <item row="2" column="1">
1366
+           <widget class="QCheckBox" name="checkBox_Visibility">
1367
+            <property name="toolTip">
1368
+             <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>
1369
+            </property>
1370
+            <property name="text">
1371
+             <string/>
1372
+            </property>
1373
+           </widget>
1374
+          </item>
1375
+         </layout>
1396
         </widget>
1376
         </widget>
1397
        </widget>
1377
        </widget>
1398
        <widget class="QWidget" name="tab_Connections">
1378
        <widget class="QWidget" name="tab_Connections">
1486
                    <verstretch>0</verstretch>
1466
                    <verstretch>0</verstretch>
1487
                   </sizepolicy>
1467
                   </sizepolicy>
1488
                  </property>
1468
                  </property>
1469
+                 <property name="toolTip">
1470
+                  <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Add a new connection.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
1471
+                 </property>
1489
                  <property name="text">
1472
                  <property name="text">
1490
                   <string/>
1473
                   <string/>
1491
                  </property>
1474
                  </property>
1498
                </item>
1481
                </item>
1499
                <item>
1482
                <item>
1500
                 <widget class="QPushButton" name="pushButton_RemoveConnection">
1483
                 <widget class="QPushButton" name="pushButton_RemoveConnection">
1484
+                 <property name="toolTip">
1485
+                  <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Remove the currently-selected connection.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
1486
+                 </property>
1501
                  <property name="text">
1487
                  <property name="text">
1502
                   <string/>
1488
                   <string/>
1503
                  </property>
1489
                  </property>
1546
                    <verstretch>0</verstretch>
1532
                    <verstretch>0</verstretch>
1547
                   </sizepolicy>
1533
                   </sizepolicy>
1548
                  </property>
1534
                  </property>
1535
+                 <property name="toolTip">
1536
+                  <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If enabled, connections will automatically be updated on the connected map.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
1537
+                 </property>
1549
                  <property name="text">
1538
                  <property name="text">
1550
                   <string>Mirror</string>
1539
                   <string>Mirror</string>
1551
                  </property>
1540
                  </property>
1608
                </property>
1597
                </property>
1609
                <item>
1598
                <item>
1610
                 <widget class="QComboBox" name="comboBox_ConnectionDirection">
1599
                 <widget class="QComboBox" name="comboBox_ConnectionDirection">
1600
+                 <property name="toolTip">
1601
+                  <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The direction of the connection.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
1602
+                 </property>
1611
                  <item>
1603
                  <item>
1612
                   <property name="text">
1604
                   <property name="text">
1613
                    <string>up</string>
1605
                    <string>up</string>
1655
                </item>
1647
                </item>
1656
                <item>
1648
                <item>
1657
                 <widget class="QComboBox" name="comboBox_ConnectedMap">
1649
                 <widget class="QComboBox" name="comboBox_ConnectedMap">
1650
+                 <property name="toolTip">
1651
+                  <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The destination map name of the connection.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
1652
+                 </property>
1658
                  <property name="editable">
1653
                  <property name="editable">
1659
                   <bool>true</bool>
1654
                   <bool>true</bool>
1660
                  </property>
1655
                  </property>
1669
                </item>
1664
                </item>
1670
                <item>
1665
                <item>
1671
                 <widget class="QSpinBox" name="spinBox_ConnectionOffset">
1666
                 <widget class="QSpinBox" name="spinBox_ConnectionOffset">
1667
+                 <property name="toolTip">
1668
+                  <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The number of metatiles to offset the connection.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
1669
+                 </property>
1672
                  <property name="minimum">
1670
                  <property name="minimum">
1673
                   <number>-999</number>
1671
                   <number>-999</number>
1674
                  </property>
1672
                  </property>
1846
                   </item>
1844
                   </item>
1847
                   <item>
1845
                   <item>
1848
                    <widget class="QComboBox" name="comboBox_DiveMap">
1846
                    <widget class="QComboBox" name="comboBox_DiveMap">
1847
+                    <property name="toolTip">
1848
+                     <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Destination map name when using &lt;span style=&quot; font-weight:600;&quot;&gt;Dive&lt;/span&gt;. If empty, no such connection will exist.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
1849
+                    </property>
1849
                     <property name="editable">
1850
                     <property name="editable">
1850
                      <bool>true</bool>
1851
                      <bool>true</bool>
1851
                     </property>
1852
                     </property>
1860
                   </item>
1861
                   </item>
1861
                   <item>
1862
                   <item>
1862
                    <widget class="QComboBox" name="comboBox_EmergeMap">
1863
                    <widget class="QComboBox" name="comboBox_EmergeMap">
1864
+                    <property name="toolTip">
1865
+                     <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Destination map name when emerging using &lt;span style=&quot; font-weight:600;&quot;&gt;Dive&lt;/span&gt;. If empty, no such connection will exist.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
1866
+                    </property>
1863
                     <property name="editable">
1867
                     <property name="editable">
1864
                      <bool>true</bool>
1868
                      <bool>true</bool>
1865
                     </property>
1869
                     </property>

+ 1
- 1
map.h View File

127
     QString song;
127
     QString song;
128
     QString layout_id;
128
     QString layout_id;
129
     QString location;
129
     QString location;
130
-    QString visibility;
130
+    QString requiresFlash;
131
     QString weather;
131
     QString weather;
132
     QString type;
132
     QString type;
133
     QString unknown;
133
     QString unknown;

+ 12
- 0
objectpropertiesframe.ui View File

109
               <property name="focusPolicy">
109
               <property name="focusPolicy">
110
                <enum>Qt::StrongFocus</enum>
110
                <enum>Qt::StrongFocus</enum>
111
               </property>
111
               </property>
112
+              <property name="toolTip">
113
+               <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The X coordinate of this object.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
114
+              </property>
112
               <property name="minimum">
115
               <property name="minimum">
113
                <number>-32768</number>
116
                <number>-32768</number>
114
               </property>
117
               </property>
136
               <property name="focusPolicy">
139
               <property name="focusPolicy">
137
                <enum>Qt::StrongFocus</enum>
140
                <enum>Qt::StrongFocus</enum>
138
               </property>
141
               </property>
142
+              <property name="toolTip">
143
+               <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The Y coordinate of this object.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
144
+              </property>
139
               <property name="minimum">
145
               <property name="minimum">
140
                <number>-32768</number>
146
                <number>-32768</number>
141
               </property>
147
               </property>
163
               <property name="focusPolicy">
169
               <property name="focusPolicy">
164
                <enum>Qt::StrongFocus</enum>
170
                <enum>Qt::StrongFocus</enum>
165
               </property>
171
               </property>
172
+              <property name="toolTip">
173
+               <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The elevation of this object.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
174
+              </property>
166
               <property name="maximum">
175
               <property name="maximum">
167
                <number>15</number>
176
                <number>15</number>
168
               </property>
177
               </property>
232
         <property name="focusPolicy">
241
         <property name="focusPolicy">
233
          <enum>Qt::StrongFocus</enum>
242
          <enum>Qt::StrongFocus</enum>
234
         </property>
243
         </property>
244
+        <property name="toolTip">
245
+         <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The sprite graphics to use for this object.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
246
+        </property>
235
         <property name="editable">
247
         <property name="editable">
236
          <bool>true</bool>
248
          <bool>true</bool>
237
         </property>
249
         </property>

+ 35
- 43
project.cpp View File

17
     groupNames = new QStringList;
17
     groupNames = new QStringList;
18
     map_groups = new QMap<QString, int>;
18
     map_groups = new QMap<QString, int>;
19
     mapNames = new QStringList;
19
     mapNames = new QStringList;
20
+    regionMapSections = new QStringList;
20
     itemNames = new QStringList;
21
     itemNames = new QStringList;
21
     flagNames = new QStringList;
22
     flagNames = new QStringList;
22
     varNames = new QStringList;
23
     varNames = new QStringList;
23
     movementTypes = new QStringList;
24
     movementTypes = new QStringList;
25
+    mapTypes = new QStringList;
26
+    mapBattleScenes = new QStringList;
27
+    weatherNames = new QStringList;
24
     coordEventWeatherNames = new QStringList;
28
     coordEventWeatherNames = new QStringList;
25
     secretBaseIds = new QStringList;
29
     secretBaseIds = new QStringList;
26
     bgEventFacingDirections = new QStringList;
30
     bgEventFacingDirections = new QStringList;
168
     map->song = header->value(4);
172
     map->song = header->value(4);
169
     map->layout_id = header->value(5);
173
     map->layout_id = header->value(5);
170
     map->location = header->value(6);
174
     map->location = header->value(6);
171
-    map->visibility = header->value(7);
175
+    map->requiresFlash = header->value(7);
172
     map->weather = header->value(8);
176
     map->weather = header->value(8);
173
     map->type = header->value(9);
177
     map->type = header->value(9);
174
     map->unknown = header->value(10);
178
     map->unknown = header->value(10);
183
     map->connections_label = "0x0";
187
     map->connections_label = "0x0";
184
     map->song = "MUS_DAN02";
188
     map->song = "MUS_DAN02";
185
     map->layout_id = QString("%1").arg(mapIndex);
189
     map->layout_id = QString("%1").arg(mapIndex);
186
-    map->location = "0";
187
-    map->visibility = "0";
188
-    map->weather = "2";
189
-    map->type = "1";
190
+    map->location = "MAPSEC_LITTLEROOT_TOWN";
191
+    map->requiresFlash = "FALSE";
192
+    map->weather = "WEATHER_SUNNY";
193
+    map->type = "MAP_TYPE_TOWN";
190
     map->unknown = "0";
194
     map->unknown = "0";
191
-    map->show_location = "1";
192
-    map->battle_scene = "0";
195
+    map->show_location = "TRUE";
196
+    map->battle_scene = "MAP_BATTLE_SCENE_NORMAL";
193
 }
197
 }
194
 
198
 
195
 void Project::saveMapHeader(Map *map) {
199
 void Project::saveMapHeader(Map *map) {
211
     text += QString("\t.2byte %1\n").arg(map->song);
215
     text += QString("\t.2byte %1\n").arg(map->song);
212
     text += QString("\t.2byte %1\n").arg(map->layout_id);
216
     text += QString("\t.2byte %1\n").arg(map->layout_id);
213
     text += QString("\t.byte %1\n").arg(map->location);
217
     text += QString("\t.byte %1\n").arg(map->location);
214
-    text += QString("\t.byte %1\n").arg(map->visibility);
218
+    text += QString("\t.byte %1\n").arg(map->requiresFlash);
215
     text += QString("\t.byte %1\n").arg(map->weather);
219
     text += QString("\t.byte %1\n").arg(map->weather);
216
     text += QString("\t.byte %1\n").arg(map->type);
220
     text += QString("\t.byte %1\n").arg(map->type);
217
     text += QString("\t.2byte %1\n").arg(map->unknown);
221
     text += QString("\t.2byte %1\n").arg(map->unknown);
986
     return parser->parseAsm(text);
990
     return parser->parseAsm(text);
987
 }
991
 }
988
 
992
 
989
-QStringList Project::getLocations() {
990
-    // TODO
991
-    QStringList names;
992
-    for (int i = 0; i < 88; i++) {
993
-        names.append(QString("%1").arg(i));
994
-    }
995
-    return names;
996
-}
997
-
998
 QStringList Project::getVisibilities() {
993
 QStringList Project::getVisibilities() {
999
     // TODO
994
     // TODO
1000
     QStringList names;
995
     QStringList names;
1045
     return allTilesets;
1040
     return allTilesets;
1046
 }
1041
 }
1047
 
1042
 
1048
-QStringList Project::getWeathers() {
1049
-    // TODO
1050
-    QStringList names;
1051
-    for (int i = 0; i < 16; i++) {
1052
-        names.append(QString("%1").arg(i));
1053
-    }
1054
-    return names;
1055
-}
1056
-
1057
-QStringList Project::getMapTypes() {
1058
-    // TODO
1059
-    QStringList names;
1060
-    for (int i = 0; i < 16; i++) {
1061
-        names.append(QString("%1").arg(i));
1062
-    }
1063
-    return names;
1064
-}
1065
-
1066
-QStringList Project::getBattleScenes() {
1067
-    // TODO
1068
-    QStringList names;
1069
-    for (int i = 0; i < 16; i++) {
1070
-        names.append(QString("%1").arg(i));
1071
-    }
1072
-    return names;
1043
+void Project::readRegionMapSections() {
1044
+    QString filepath = root + "/include/constants/region_map_sections.h";
1045
+    QStringList prefixes = (QStringList() << "MAPSEC_");
1046
+    readCDefinesSorted(filepath, prefixes, regionMapSections);
1073
 }
1047
 }
1074
 
1048
 
1075
 void Project::readItemNames() {
1049
 void Project::readItemNames() {
1096
     readCDefinesSorted(filepath, prefixes, movementTypes);
1070
     readCDefinesSorted(filepath, prefixes, movementTypes);
1097
 }
1071
 }
1098
 
1072
 
1073
+void Project::readMapTypes() {
1074
+    QString filepath = root + "/include/constants/map_types.h";
1075
+    QStringList prefixes = (QStringList() << "MAP_TYPE_");
1076
+    readCDefinesSorted(filepath, prefixes, mapTypes);
1077
+}
1078
+
1079
+void Project::readMapBattleScenes() {
1080
+    QString filepath = root + "/include/constants/map_types.h";
1081
+    QStringList prefixes = (QStringList() << "MAP_BATTLE_SCENE_");
1082
+    readCDefinesSorted(filepath, prefixes, mapBattleScenes);
1083
+}
1084
+
1085
+void Project::readWeatherNames() {
1086
+    QString filepath = root + "/include/constants/weather.h";
1087
+    QStringList prefixes = (QStringList() << "WEATHER_");
1088
+    readCDefinesSorted(filepath, prefixes, weatherNames);
1089
+}
1090
+
1099
 void Project::readCoordEventWeatherNames() {
1091
 void Project::readCoordEventWeatherNames() {
1100
     QString filepath = root + "/include/constants/weather.h";
1092
     QString filepath = root + "/include/constants/weather.h";
1101
     QStringList prefixes = (QStringList() << "COORD_EVENT_WEATHER_");
1093
     QStringList prefixes = (QStringList() << "COORD_EVENT_WEATHER_");
1352
             object->put("movement_type", command.value(i++));
1344
             object->put("movement_type", command.value(i++));
1353
             object->put("radius_x", command.value(i++).toInt(nullptr, 0));
1345
             object->put("radius_x", command.value(i++).toInt(nullptr, 0));
1354
             object->put("radius_y", command.value(i++).toInt(nullptr, 0));
1346
             object->put("radius_y", command.value(i++).toInt(nullptr, 0));
1355
-            object->put("trainer_see_type", command.value(i++));
1347
+            object->put("is_trainer", command.value(i++));
1356
             object->put("sight_radius_tree_id", command.value(i++));
1348
             object->put("sight_radius_tree_id", command.value(i++));
1357
             object->put("script_label", command.value(i++));
1349
             object->put("script_label", command.value(i++));
1358
             object->put("event_flag", command.value(i++));
1350
             object->put("event_flag", command.value(i++));

+ 8
- 4
project.h View File

23
     QList<QString> mapLayoutsTableMaster;
23
     QList<QString> mapLayoutsTableMaster;
24
     QMap<QString, MapLayout*> mapLayouts;
24
     QMap<QString, MapLayout*> mapLayouts;
25
     QMap<QString, MapLayout*> mapLayoutsMaster;
25
     QMap<QString, MapLayout*> mapLayoutsMaster;
26
+    QStringList *regionMapSections = NULL;
26
     QStringList *itemNames = NULL;
27
     QStringList *itemNames = NULL;
27
     QStringList *flagNames = NULL;
28
     QStringList *flagNames = NULL;
28
     QStringList *varNames = NULL;
29
     QStringList *varNames = NULL;
29
     QStringList *movementTypes = NULL;
30
     QStringList *movementTypes = NULL;
31
+    QStringList *mapTypes = NULL;
32
+    QStringList *mapBattleScenes = NULL;
33
+    QStringList *weatherNames = NULL;
30
     QStringList *coordEventWeatherNames = NULL;
34
     QStringList *coordEventWeatherNames = NULL;
31
     QStringList *secretBaseIds = NULL;
35
     QStringList *secretBaseIds = NULL;
32
     QStringList *bgEventFacingDirections = NULL;
36
     QStringList *bgEventFacingDirections = NULL;
76
 
80
 
77
     QList<QStringList>* parseAsm(QString text);
81
     QList<QStringList>* parseAsm(QString text);
78
     QStringList getSongNames();
82
     QStringList getSongNames();
79
-    QStringList getLocations();
80
     QStringList getVisibilities();
83
     QStringList getVisibilities();
81
     QMap<QString, QStringList> getTilesets();
84
     QMap<QString, QStringList> getTilesets();
82
-    QStringList getWeathers();
83
-    QStringList getMapTypes();
84
-    QStringList getBattleScenes();
85
+    void readRegionMapSections();
85
     void readItemNames();
86
     void readItemNames();
86
     void readFlagNames();
87
     void readFlagNames();
87
     void readVarNames();
88
     void readVarNames();
88
     void readMovementTypes();
89
     void readMovementTypes();
90
+    void readMapTypes();
91
+    void readMapBattleScenes();
92
+    void readWeatherNames();
89
     void readCoordEventWeatherNames();
93
     void readCoordEventWeatherNames();
90
     void readSecretBaseIds();
94
     void readSecretBaseIds();
91
     void readBgEventFacingDirections();
95
     void readBgEventFacingDirections();