瀏覽代碼

Add newly created map into global mapAttributes map

Marcus Huderle 6 年之前
父節點
當前提交
bcc74b4461
共有 1 個檔案被更改,包括 13 行新增0 行删除
  1. 13
    0
      project.cpp

+ 13
- 0
project.cpp 查看文件

@@ -451,6 +451,19 @@ void Project::setNewMapAttributes(Map* map) {
451 451
     map->blockdata_label = QString("%1_MapBlockdata").arg(map->name);
452 452
     map->tileset_primary_label = "gTileset_General";
453 453
     map->tileset_secondary_label = "gTileset_Petalburg";
454
+
455
+    // Insert new entry into the global map attributes.
456
+    QMap<QString, QString>* attrs = new QMap<QString, QString>;
457
+    attrs->insert("border_label", QString("%1_MapBorder").arg(map->name));
458
+    attrs->insert("border_filepath", QString("data/maps/%1/border.bin").arg(map->name));
459
+    attrs->insert("blockdata_label", QString("%1_MapBlockdata").arg(map->name));
460
+    attrs->insert("blockdata_filepath", QString("data/maps/%1/map.bin").arg(map->name));
461
+    attrs->insert("attributes_label", QString("%1_MapAttributes").arg(map->name));
462
+    attrs->insert("width", map->width);
463
+    attrs->insert("height", map->height);
464
+    attrs->insert("tileset_primary", map->tileset_primary_label);
465
+    attrs->insert("tileset_secondary", map->tileset_secondary_label);
466
+    mapAttributes->insert(map->name, attrs);
454 467
 }
455 468
 
456 469
 void Project::getTilesets(Map* map) {