Browse Source

Add newly created map into global mapAttributes map

Marcus Huderle 6 years ago
parent
commit
bcc74b4461
1 changed files with 13 additions and 0 deletions
  1. 13
    0
      project.cpp

+ 13
- 0
project.cpp View File

451
     map->blockdata_label = QString("%1_MapBlockdata").arg(map->name);
451
     map->blockdata_label = QString("%1_MapBlockdata").arg(map->name);
452
     map->tileset_primary_label = "gTileset_General";
452
     map->tileset_primary_label = "gTileset_General";
453
     map->tileset_secondary_label = "gTileset_Petalburg";
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
 void Project::getTilesets(Map* map) {
469
 void Project::getTilesets(Map* map) {