diff --git a/src/com/gpl/rpg/atcontentstudio/model/maps/SpawnArea.java b/src/com/gpl/rpg/atcontentstudio/model/maps/SpawnArea.java index f04b3ac..1052c40 100644 --- a/src/com/gpl/rpg/atcontentstudio/model/maps/SpawnArea.java +++ b/src/com/gpl/rpg/atcontentstudio/model/maps/SpawnArea.java @@ -13,6 +13,7 @@ public class SpawnArea extends MapObject { public int quantity = 1; public int spawnchance = 10; public boolean active = true; + public boolean ignoreAreas = false; public String spawngroup_id; public List spawnGroup = new ArrayList(); @@ -26,6 +27,9 @@ public class SpawnArea extends MapObject { if (obj.getProperties().getProperty("active") != null) { this.active = Boolean.parseBoolean(obj.getProperties().getProperty("active")); } + if (obj.getProperties().getProperty("ignoreAreas") != null) { + this.ignoreAreas = Boolean.parseBoolean(obj.getProperties().getProperty("ignoreAreas")); + } if (obj.getProperties().getProperty("spawngroup") != null) { this.spawngroup_id = obj.getProperties().getProperty("spawngroup"); } else if (obj.getName() != null ){ @@ -84,6 +88,9 @@ public class SpawnArea extends MapObject { if (!this.active) { tmxObject.getProperties().setProperty("active", Boolean.toString(active)); } + if (this.ignoreAreas) { + tmxObject.getProperties().setProperty("ignoreAreas", Boolean.toString(ignoreAreas)); + } } } diff --git a/src/com/gpl/rpg/atcontentstudio/ui/map/TMXMapEditor.java b/src/com/gpl/rpg/atcontentstudio/ui/map/TMXMapEditor.java index 0ebf936..c1bf206 100644 --- a/src/com/gpl/rpg/atcontentstudio/ui/map/TMXMapEditor.java +++ b/src/com/gpl/rpg/atcontentstudio/ui/map/TMXMapEditor.java @@ -162,6 +162,7 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe private JComboBox evaluateTriggerBox; private JSpinner quantityField; private JCheckBox spawnActiveForNewGame; + private JCheckBox spawnIgnoreAreas; private JTextField spawngroupField; @SuppressWarnings("rawtypes") private JList npcList; @@ -629,6 +630,7 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe spawngroupField = addTextField(pane, "Spawn group ID: ", ((SpawnArea)selected).spawngroup_id, ((TMXMap)target).writable, listener); quantityField = addIntegerField(pane, "Number of spawned NPCs: ", ((SpawnArea)selected).quantity, false, ((TMXMap)target).writable, listener); spawnActiveForNewGame = addBooleanBasedCheckBox(pane, "Active in a new game: ", ((SpawnArea)selected).active, ((TMXMap)target).writable, listener); + spawnIgnoreAreas = addBooleanBasedCheckBox(pane, "Monsters can walk on other game objects: ", ((SpawnArea)selected).ignoreAreas, ((TMXMap)target).writable, listener); npcListModel = new SpawnGroupNpcListModel((SpawnArea) selected); npcList = new JList(npcListModel); npcList.setCellRenderer(new GDERenderer(true, ((TMXMap)target).writable)); @@ -1993,6 +1995,11 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe SpawnArea area = (SpawnArea) selectedMapObject; area.active = (Boolean) value; } + } else if (source == spawnIgnoreAreas) { + if (selectedMapObject instanceof SpawnArea) { + SpawnArea area = (SpawnArea) selectedMapObject; + area.ignoreAreas = (Boolean) value; + } } else if (source == requirementTypeCombo) { if (selectedMapObject instanceof KeyArea) { KeyArea area = (KeyArea) selectedMapObject;