Deleting a TMX Map also removes it from created/altered worldmaps, and

marks these as modified.
This commit is contained in:
Zukero
2017-07-25 19:16:35 +02:00
parent 7eb5c7c208
commit f93d03dbd3
5 changed files with 45 additions and 3 deletions

View File

@@ -496,6 +496,9 @@ public class WorldMapView extends JComponent implements Scrollable {
public void pushToModel() {
worldmap.segmentX = offsetX / TILE_SIZE;
worldmap.segmentY = offsetY / TILE_SIZE;
for (String id : worldmap.mapLocations.keySet()) {
worldmap.getProject().getMap(id).removeBacklink(worldmap);
}
worldmap.mapLocations.clear();
for (String s : mapLocations.keySet()) {
int x = mapLocations.get(s).x / TILE_SIZE;
@@ -504,6 +507,10 @@ public class WorldMapView extends JComponent implements Scrollable {
worldmap.mapLocations.put(s, new Point(x, y));
}
for (String id : worldmap.mapLocations.keySet()) {
worldmap.getProject().getMap(id).addBacklink(worldmap);
}
List<String> toRemove = new ArrayList<String>();
for (String s : worldmap.labels.keySet()) {
if (!mapLocations.containsKey(s)) {