mirror of
https://github.com/OMGeeky/ATCS.git
synced 2026-01-07 03:56:55 +01:00
v0.4.5 to cope with changes to spawnareas definition in game code.
replaced gcode references by github repo.
This commit is contained in:
@@ -18,7 +18,7 @@ import com.gpl.rpg.atcontentstudio.ui.WorkspaceSelector;
|
|||||||
public class ATContentStudio {
|
public class ATContentStudio {
|
||||||
|
|
||||||
public static final String APP_NAME = "Andor's Trail Content Studio";
|
public static final String APP_NAME = "Andor's Trail Content Studio";
|
||||||
public static final String APP_VERSION = "v0.4.4";
|
public static final String APP_VERSION = "v0.4.5";
|
||||||
|
|
||||||
public static boolean STARTED = false;
|
public static boolean STARTED = false;
|
||||||
public static StudioFrame frame = null;
|
public static StudioFrame frame = null;
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ public class KeyArea extends MapObject {
|
|||||||
oldSchoolRequirement = false;
|
oldSchoolRequirement = false;
|
||||||
}
|
}
|
||||||
requirement = new Requirement();
|
requirement = new Requirement();
|
||||||
requirement.type = Requirement.RequirementType.valueOf(requireType);
|
if (requireType != null) requirement.type = Requirement.RequirementType.valueOf(requireType);
|
||||||
requirement.required_obj_id = requireId;
|
requirement.required_obj_id = requireId;
|
||||||
if (requireValue != null) requirement.required_value = Integer.parseInt(requireValue);
|
if (requireValue != null) requirement.required_value = Integer.parseInt(requireValue);
|
||||||
requirement.state = GameDataElement.State.parsed;
|
requirement.state = GameDataElement.State.parsed;
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ public class SpawnArea extends MapObject {
|
|||||||
public int quantity = 1;
|
public int quantity = 1;
|
||||||
public int spawnchance = 10;
|
public int spawnchance = 10;
|
||||||
public boolean active = true;
|
public boolean active = true;
|
||||||
|
public String spawngroup_id;
|
||||||
public List<NPC> spawnGroup = new ArrayList<NPC>();
|
public List<NPC> spawnGroup = new ArrayList<NPC>();
|
||||||
|
|
||||||
public SpawnArea(tiled.core.MapObject obj) {
|
public SpawnArea(tiled.core.MapObject obj) {
|
||||||
@@ -25,12 +26,17 @@ public class SpawnArea extends MapObject {
|
|||||||
if (obj.getProperties().getProperty("active") != null) {
|
if (obj.getProperties().getProperty("active") != null) {
|
||||||
this.active = Boolean.parseBoolean(obj.getProperties().getProperty("active"));
|
this.active = Boolean.parseBoolean(obj.getProperties().getProperty("active"));
|
||||||
}
|
}
|
||||||
|
if (obj.getProperties().getProperty("spawngroup") != null) {
|
||||||
|
this.spawngroup_id = obj.getProperties().getProperty("spawngroup");
|
||||||
|
} else if (obj.getName() != null ){
|
||||||
|
this.spawngroup_id = obj.getName();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void link() {
|
public void link() {
|
||||||
if (name != null) {
|
if (spawngroup_id != null) {
|
||||||
spawnGroup = parentMap.getProject().getSpawnGroup(name);
|
spawnGroup = parentMap.getProject().getSpawnGroup(spawngroup_id);
|
||||||
} else {
|
} else {
|
||||||
spawnGroup = new ArrayList<NPC>();
|
spawnGroup = new ArrayList<NPC>();
|
||||||
}
|
}
|
||||||
@@ -65,6 +71,9 @@ public class SpawnArea extends MapObject {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void savePropertiesInTmxObject(tiled.core.MapObject tmxObject) {
|
public void savePropertiesInTmxObject(tiled.core.MapObject tmxObject) {
|
||||||
|
if (spawngroup_id != null) {
|
||||||
|
tmxObject.getProperties().setProperty("spawngroup", spawngroup_id);
|
||||||
|
}
|
||||||
if (quantity != 1) {
|
if (quantity != 1) {
|
||||||
tmxObject.getProperties().setProperty("quantity", Integer.toString(quantity));
|
tmxObject.getProperties().setProperty("quantity", Integer.toString(quantity));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ public class AboutEditor extends Editor {
|
|||||||
"<br/>" +
|
"<br/>" +
|
||||||
"Play <a href=\"https://play.google.com/store/apps/details?id=com.gpl.rpg.AndorsTrail\">Andor's Trail</a> for free on your Android device.<br/>" +
|
"Play <a href=\"https://play.google.com/store/apps/details?id=com.gpl.rpg.AndorsTrail\">Andor's Trail</a> for free on your Android device.<br/>" +
|
||||||
"Visit <a href=\"http://andorstrail.com/\">the official forum</a> to give or receive help.<br/>" +
|
"Visit <a href=\"http://andorstrail.com/\">the official forum</a> to give or receive help.<br/>" +
|
||||||
"Open the project's <a href=\"https://code.google.com/p/andors-trail/\">Google Code page</a> to check out the game's source code.<br/>" +
|
"Open the project's <a href=\"https://github.com/Zukero/andors-trail/\">GitHub project page</a> to check out the game's source code.<br/>" +
|
||||||
"<br/>" +
|
"<br/>" +
|
||||||
"For content creation help, make sure to use the following resources:<br/>" +
|
"For content creation help, make sure to use the following resources:<br/>" +
|
||||||
"<a href=\"http://andorstrail.com/viewtopic.php?f=6&t=4560\">The contribution guide on the forums</a><br/>" +
|
"<a href=\"http://andorstrail.com/viewtopic.php?f=6&t=4560\">The contribution guide on the forums</a><br/>" +
|
||||||
|
|||||||
@@ -370,7 +370,7 @@ public class WorkspaceActions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void putValue(String key, Object value) {
|
public synchronized void putValue(String key, Object value) {
|
||||||
PropertyChangeEvent event = new PropertyChangeEvent(this, key, values.get(key), value);
|
PropertyChangeEvent event = new PropertyChangeEvent(this, key, values.get(key), value);
|
||||||
values.put(key, value);
|
values.put(key, value);
|
||||||
for (PropertyChangeListener l : listeners) {
|
for (PropertyChangeListener l : listeners) {
|
||||||
@@ -379,7 +379,7 @@ public class WorkspaceActions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setEnabled(boolean b) {
|
public synchronized void setEnabled(boolean b) {
|
||||||
PropertyChangeEvent event = new PropertyChangeEvent(this, "enabled", isEnabled(), b);
|
PropertyChangeEvent event = new PropertyChangeEvent(this, "enabled", isEnabled(), b);
|
||||||
enabled = b;
|
enabled = b;
|
||||||
for (PropertyChangeListener l : listeners) {
|
for (PropertyChangeListener l : listeners) {
|
||||||
@@ -395,12 +395,12 @@ public class WorkspaceActions {
|
|||||||
private Set<PropertyChangeListener> listeners = new HashSet<PropertyChangeListener>();
|
private Set<PropertyChangeListener> listeners = new HashSet<PropertyChangeListener>();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addPropertyChangeListener(PropertyChangeListener listener) {
|
public synchronized void addPropertyChangeListener(PropertyChangeListener listener) {
|
||||||
listeners.add(listener);
|
listeners.add(listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removePropertyChangeListener(PropertyChangeListener listener) {
|
public synchronized void removePropertyChangeListener(PropertyChangeListener listener) {
|
||||||
listeners.remove(listener);
|
listeners.remove(listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -147,6 +147,7 @@ public class TMXMapEditor extends Editor {
|
|||||||
private JComboBox evaluateTriggerBox;
|
private JComboBox evaluateTriggerBox;
|
||||||
private JSpinner quantityField;
|
private JSpinner quantityField;
|
||||||
private JCheckBox activeForNewGame;
|
private JCheckBox activeForNewGame;
|
||||||
|
private JTextField spawngroupField;
|
||||||
private JList npcList;
|
private JList npcList;
|
||||||
private SpawnGroupNpcListModel npcListModel;
|
private SpawnGroupNpcListModel npcListModel;
|
||||||
|
|
||||||
@@ -546,7 +547,8 @@ public class TMXMapEditor extends Editor {
|
|||||||
} else if (selected instanceof SignArea) {
|
} else if (selected instanceof SignArea) {
|
||||||
dialogueBox = addDialogueBox(pane, ((TMXMap)target).getProject(), "Message: ", ((SignArea)selected).dialogue, ((TMXMap)target).writable, listener);
|
dialogueBox = addDialogueBox(pane, ((TMXMap)target).getProject(), "Message: ", ((SignArea)selected).dialogue, ((TMXMap)target).writable, listener);
|
||||||
} else if (selected instanceof SpawnArea) {
|
} else if (selected instanceof SpawnArea) {
|
||||||
areaField = addTextField(pane, "Spawn group ID: ", ((SpawnArea)selected).name, ((TMXMap)target).writable, listener);
|
areaField = addTextField(pane, "Spawn area ID: ", ((SpawnArea)selected).name, ((TMXMap)target).writable, listener);
|
||||||
|
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);
|
quantityField = addIntegerField(pane, "Number of spawned NPCs: ", ((SpawnArea)selected).quantity, false, ((TMXMap)target).writable, listener);
|
||||||
activeForNewGame = addBooleanBasedCheckBox(pane, "Active in a new game: ", ((SpawnArea)selected).active, ((TMXMap)target).writable, listener);
|
activeForNewGame = addBooleanBasedCheckBox(pane, "Active in a new game: ", ((SpawnArea)selected).active, ((TMXMap)target).writable, listener);
|
||||||
npcListModel = new SpawnGroupNpcListModel((SpawnArea) selected);
|
npcListModel = new SpawnGroupNpcListModel((SpawnArea) selected);
|
||||||
@@ -1690,6 +1692,16 @@ public class TMXMapEditor extends Editor {
|
|||||||
tmxViewer.revalidate();
|
tmxViewer.revalidate();
|
||||||
tmxViewer.repaint();
|
tmxViewer.repaint();
|
||||||
} else if (source == areaField) {
|
} else if (source == areaField) {
|
||||||
|
if (selectedMapObject instanceof SpawnArea) {
|
||||||
|
SpawnArea area = (SpawnArea)selectedMapObject;
|
||||||
|
area.name = (String) value;
|
||||||
|
groupObjectsListModel.objectChanged(area);
|
||||||
|
} else if (selectedMapObject instanceof MapChange) {
|
||||||
|
MapChange area = (MapChange) selectedMapObject;
|
||||||
|
area.name = (String) value;
|
||||||
|
groupObjectsListModel.objectChanged(area);
|
||||||
|
}
|
||||||
|
} else if (source == spawngroupField) {
|
||||||
if (selectedMapObject instanceof SpawnArea) {
|
if (selectedMapObject instanceof SpawnArea) {
|
||||||
SpawnArea area = (SpawnArea)selectedMapObject;
|
SpawnArea area = (SpawnArea)selectedMapObject;
|
||||||
if (area.spawnGroup != null && !area.spawnGroup.isEmpty()) {
|
if (area.spawnGroup != null && !area.spawnGroup.isEmpty()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user