mirror of
https://github.com/AndorsTrailRelease/ATCS.git
synced 2025-10-27 18:44:03 +01:00
Added support for new spawn area property: ignoreAreas.
This commit is contained in:
@@ -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<NPC> spawnGroup = new ArrayList<NPC>();
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user