mirror of
https://github.com/OMGeeky/ATCS.git
synced 2026-01-01 17:14:36 +01:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
57b8209b26 | ||
|
|
a7224755ff | ||
|
|
e97168c62e | ||
|
|
1e8dd405c3 | ||
|
|
830e9de56b |
@@ -1 +1 @@
|
|||||||
start "" "javaw.exe" -Xmx512M -cp "lib\ATCS_v0.4.4.jar;lib\jide-oss.jar;lib\ui.jar;lib\junit-4.10.jar;lib\json_simple-1.1.jar;lib\rsyntaxtextarea.jar;lib\prefuse.jar;lib\AndorsTrainer_v0.1.2.jar;lib\bsh-2.0b4.jar" com.gpl.rpg.atcontentstudio.ATContentStudio
|
start "" "javaw.exe" -Xmx512M -cp "lib\ATCS_v0.4.6.jar;lib\jide-oss.jar;lib\ui.jar;lib\junit-4.10.jar;lib\json_simple-1.1.jar;lib\rsyntaxtextarea.jar;lib\prefuse.jar;lib\AndorsTrainer_v0.1.2.jar;lib\bsh-2.0b4.jar" com.gpl.rpg.atcontentstudio.ATContentStudio
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
java -Xmx512M -cp lib/AndorsTrainer_v0.1.2.jar:lib/ATCS_v0.4.4.jar:lib/prefuse.jar:lib/json_simple-1.1.jar:lib/jide-oss.jar:lib/ui.jar:lib/junit-4.10.jar:lib/rsyntaxtextarea.jar:lib/bsh-2.0b4.jar com.gpl.rpg.atcontentstudio.ATContentStudio
|
java -Xmx512M -cp lib/AndorsTrainer_v0.1.2.jar:lib/ATCS_v0.4.6.jar:lib/prefuse.jar:lib/json_simple-1.1.jar:lib/jide-oss.jar:lib/ui.jar:lib/junit-4.10.jar:lib/rsyntaxtextarea.jar:lib/bsh-2.0b4.jar com.gpl.rpg.atcontentstudio.ATContentStudio
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
start "" "javaw.exe" -Xmx512M -cp "lib\jide-oss.jar;lib\ui.jar;lib\junit-4.10.jar;lib\json_simple-1.1.jar;lib\rsyntaxtextarea.jar;lib\prefuse.jar;lib\ATCS_v0.4.3.jar;lib\AndorsTrainer_v0.1.2.jar;lib\bsh-2.0b4.jar" com.gpl.rpg.atcontentstudio.ATContentStudio
|
start "" "javaw.exe" -Xmx512M -cp "lib\ATCS_v0.4.6.jar;lib\jide-oss.jar;lib\ui.jar;lib\junit-4.10.jar;lib\json_simple-1.1.jar;lib\rsyntaxtextarea.jar;lib\prefuse.jar;lib\AndorsTrainer_v0.1.2.jar;lib\bsh-2.0b4.jar" com.gpl.rpg.atcontentstudio.ATContentStudio
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
!include MUI2.nsh
|
!include MUI2.nsh
|
||||||
|
|
||||||
!define VERSION "0.4.4"
|
!define VERSION "0.4.6"
|
||||||
!define JAVA_BIN "java"
|
!define JAVA_BIN "java"
|
||||||
|
|
||||||
Name "Andor's Trail Content Studio v${VERSION}"
|
Name "Andor's Trail Content Studio v${VERSION}"
|
||||||
|
|||||||
@@ -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.6";
|
||||||
|
|
||||||
public static boolean STARTED = false;
|
public static boolean STARTED = false;
|
||||||
public static StudioFrame frame = null;
|
public static StudioFrame frame = null;
|
||||||
|
|||||||
@@ -63,8 +63,8 @@ public class Dialogue extends JSONElement {
|
|||||||
spawnAll,
|
spawnAll,
|
||||||
removeSpawnArea,
|
removeSpawnArea,
|
||||||
deactivateSpawnArea,
|
deactivateSpawnArea,
|
||||||
activateMapChangeArea,
|
activateMapObjectGroup,
|
||||||
deactivateMapChangeArea
|
deactivateMapObjectGroup
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -242,8 +242,8 @@ public class Dialogue extends JSONElement {
|
|||||||
for (Reward reward : rewards) {
|
for (Reward reward : rewards) {
|
||||||
if (reward.reward_obj_id != null) {
|
if (reward.reward_obj_id != null) {
|
||||||
switch (reward.type) {
|
switch (reward.type) {
|
||||||
case activateMapChangeArea:
|
case activateMapObjectGroup:
|
||||||
case deactivateMapChangeArea:
|
case deactivateMapObjectGroup:
|
||||||
case spawnAll:
|
case spawnAll:
|
||||||
case removeSpawnArea:
|
case removeSpawnArea:
|
||||||
case deactivateSpawnArea:
|
case deactivateSpawnArea:
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ public class GameDataCategory<E extends JSONElement> extends ArrayList<E> implem
|
|||||||
dataToSave.add(element.toJson());
|
dataToSave.add(element.toJson());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (dataToSave.isEmpty()) {
|
if (dataToSave.isEmpty() && jsonFile.exists()) {
|
||||||
if (jsonFile.delete()) {
|
if (jsonFile.delete()) {
|
||||||
Notification.addSuccess("File "+jsonFile.getAbsolutePath()+" deleted.");
|
Notification.addSuccess("File "+jsonFile.getAbsolutePath()+" deleted.");
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -496,6 +496,8 @@ public class Item extends JSONElement {
|
|||||||
itemJson.put("id", this.id);
|
itemJson.put("id", this.id);
|
||||||
if (this.icon_id != null) itemJson.put("iconID", this.icon_id);
|
if (this.icon_id != null) itemJson.put("iconID", this.icon_id);
|
||||||
if (this.name != null) itemJson.put("name", this.name);
|
if (this.name != null) itemJson.put("name", this.name);
|
||||||
|
if(this.display_type != null) itemJson.put("displaytype", this.display_type.toString());
|
||||||
|
|
||||||
if (this.has_manual_price != null) itemJson.put("hasManualPrice", this.has_manual_price);
|
if (this.has_manual_price != null) itemJson.put("hasManualPrice", this.has_manual_price);
|
||||||
if (this.base_market_cost != null) itemJson.put("baseMarketCost", this.base_market_cost);
|
if (this.base_market_cost != null) itemJson.put("baseMarketCost", this.base_market_cost);
|
||||||
if (this.category != null) {
|
if (this.category != 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;
|
||||||
@@ -77,7 +77,9 @@ public class KeyArea extends MapObject {
|
|||||||
if (oldSchoolRequirement && Requirement.RequirementType.questProgress.equals(requirement.type) && (requirement.negated == null || !requirement.negated)) {
|
if (oldSchoolRequirement && Requirement.RequirementType.questProgress.equals(requirement.type) && (requirement.negated == null || !requirement.negated)) {
|
||||||
tmxObject.setName(requirement.required_obj_id+":"+Integer.toString(requirement.required_value));
|
tmxObject.setName(requirement.required_obj_id+":"+Integer.toString(requirement.required_value));
|
||||||
} else {
|
} else {
|
||||||
tmxObject.getProperties().setProperty("requireType", requirement.type.toString());
|
if (requirement.type != null) {
|
||||||
|
tmxObject.getProperties().setProperty("requireType", requirement.type.toString());
|
||||||
|
}
|
||||||
if (requirement.required_obj != null) {
|
if (requirement.required_obj != null) {
|
||||||
tmxObject.getProperties().setProperty("requireId", requirement.required_obj.id);
|
tmxObject.getProperties().setProperty("requireId", requirement.required_obj.id);
|
||||||
} else if (requirement.required_obj_id != null) {
|
} else if (requirement.required_obj_id != null) {
|
||||||
|
|||||||
@@ -13,12 +13,18 @@ public class MapObjectGroup {
|
|||||||
public String name;
|
public String name;
|
||||||
public boolean visible;
|
public boolean visible;
|
||||||
public List<MapObject> mapObjects = new ArrayList<MapObject>();
|
public List<MapObject> mapObjects = new ArrayList<MapObject>();
|
||||||
|
public Boolean active;
|
||||||
|
|
||||||
public MapObjectGroup(tiled.core.ObjectGroup layer, TMXMap map) {
|
public MapObjectGroup(tiled.core.ObjectGroup layer, TMXMap map) {
|
||||||
this.tmxGroup = layer;
|
this.tmxGroup = layer;
|
||||||
this.name = layer.getName();
|
this.name = layer.getName();
|
||||||
this.visible = layer.isVisible();
|
this.visible = layer.isVisible();
|
||||||
this.parentMap = map;
|
this.parentMap = map;
|
||||||
|
if (layer.getProperties().get("active") != null) {
|
||||||
|
active = new Boolean(((String) layer.getProperties().get("active")));
|
||||||
|
} else {
|
||||||
|
active = true;
|
||||||
|
}
|
||||||
for (tiled.core.MapObject obj : layer.getObjectsList()) {
|
for (tiled.core.MapObject obj : layer.getObjectsList()) {
|
||||||
mapObjects.add(MapObject.buildObject(obj, map));
|
mapObjects.add(MapObject.buildObject(obj, map));
|
||||||
}
|
}
|
||||||
@@ -44,6 +50,9 @@ public class MapObjectGroup {
|
|||||||
}
|
}
|
||||||
tmxGroup.setVisible(visible);
|
tmxGroup.setVisible(visible);
|
||||||
tmxGroup.setName(name);
|
tmxGroup.setName(name);
|
||||||
|
if (!active) {
|
||||||
|
tmxGroup.getProperties().put("active", Boolean.toString(active));
|
||||||
|
}
|
||||||
for (MapObject object : mapObjects) {
|
for (MapObject object : mapObjects) {
|
||||||
tmxGroup.addObject(object.toTmxObject());
|
tmxGroup.addObject(object.toTmxObject());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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/>" +
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import javax.swing.event.ListDataListener;
|
|||||||
|
|
||||||
import com.gpl.rpg.atcontentstudio.ATContentStudio;
|
import com.gpl.rpg.atcontentstudio.ATContentStudio;
|
||||||
import com.gpl.rpg.atcontentstudio.model.GameDataElement;
|
import com.gpl.rpg.atcontentstudio.model.GameDataElement;
|
||||||
|
import com.gpl.rpg.atcontentstudio.model.GameDataElement.State;
|
||||||
import com.gpl.rpg.atcontentstudio.model.GameSource;
|
import com.gpl.rpg.atcontentstudio.model.GameSource;
|
||||||
import com.gpl.rpg.atcontentstudio.model.Project;
|
import com.gpl.rpg.atcontentstudio.model.Project;
|
||||||
import com.gpl.rpg.atcontentstudio.model.gamedata.ActorCondition;
|
import com.gpl.rpg.atcontentstudio.model.gamedata.ActorCondition;
|
||||||
@@ -293,6 +294,7 @@ public class JSONCreationWizard extends JDialog {
|
|||||||
creation.id = idField.getText();
|
creation.id = idField.getText();
|
||||||
JSONCreationWizard.this.setVisible(false);
|
JSONCreationWizard.this.setVisible(false);
|
||||||
JSONCreationWizard.this.dispose();
|
JSONCreationWizard.this.dispose();
|
||||||
|
creation.state = State.created;
|
||||||
proj.createElement(creation);
|
proj.createElement(creation);
|
||||||
notifyCreated();
|
notifyCreated();
|
||||||
ATContentStudio.frame.selectInTree(creation);
|
ATContentStudio.frame.selectInTree(creation);
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -320,8 +320,13 @@ public class DialogueEditor extends JSONElementEditor {
|
|||||||
}
|
}
|
||||||
if (reward.type != null) {
|
if (reward.type != null) {
|
||||||
switch (reward.type) {
|
switch (reward.type) {
|
||||||
case activateMapChangeArea:
|
case activateMapObjectGroup:
|
||||||
case deactivateMapChangeArea:
|
case deactivateMapObjectGroup:
|
||||||
|
rewardMap = addMapBox(pane, ((Dialogue)target).getProject(), "Map Name: ", reward.map, writable, listener);
|
||||||
|
rewardObjId = addTextField(pane, "Group ID: ", reward.reward_obj_id, writable, listener);
|
||||||
|
rewardObj = null;
|
||||||
|
rewardValue = null;
|
||||||
|
break;
|
||||||
case deactivateSpawnArea:
|
case deactivateSpawnArea:
|
||||||
case removeSpawnArea:
|
case removeSpawnArea:
|
||||||
case spawnAll:
|
case spawnAll:
|
||||||
@@ -732,8 +737,9 @@ public class DialogueEditor extends JSONElementEditor {
|
|||||||
rewardObjDesc = reward.reward_obj_id;
|
rewardObjDesc = reward.reward_obj_id;
|
||||||
}
|
}
|
||||||
switch (reward.type) {
|
switch (reward.type) {
|
||||||
case activateMapChangeArea:
|
case activateMapObjectGroup:
|
||||||
label.setText("Activate mapchange area "+rewardObjDesc+" on map "+reward.map_name);
|
label.setText("Activate map object group "+rewardObjDesc+" on map "+reward.map_name);
|
||||||
|
label.setIcon(new ImageIcon(DefaultIcons.getObjectLayerIcon()));
|
||||||
break;
|
break;
|
||||||
case actorCondition:
|
case actorCondition:
|
||||||
label.setText("Give actor condition "+rewardObjDesc+" for "+reward.reward_value+" turns");
|
label.setText("Give actor condition "+rewardObjDesc+" for "+reward.reward_value+" turns");
|
||||||
@@ -745,11 +751,13 @@ public class DialogueEditor extends JSONElementEditor {
|
|||||||
case createTimer:
|
case createTimer:
|
||||||
label.setText("Create timer "+rewardObjDesc);
|
label.setText("Create timer "+rewardObjDesc);
|
||||||
break;
|
break;
|
||||||
case deactivateMapChangeArea:
|
case deactivateMapObjectGroup:
|
||||||
label.setText("Deactivate mapchange area "+rewardObjDesc+" on map "+reward.map_name);
|
label.setText("Deactivate map object group "+rewardObjDesc+" on map "+reward.map_name);
|
||||||
|
label.setIcon(new ImageIcon(DefaultIcons.getObjectLayerIcon()));
|
||||||
break;
|
break;
|
||||||
case deactivateSpawnArea:
|
case deactivateSpawnArea:
|
||||||
label.setText("Deactivate spawnarea area "+rewardObjDesc+" on map "+reward.map_name);
|
label.setText("Deactivate spawnarea area "+rewardObjDesc+" on map "+reward.map_name);
|
||||||
|
label.setIcon(new ImageIcon(DefaultIcons.getNPCIcon()));
|
||||||
break;
|
break;
|
||||||
case dropList:
|
case dropList:
|
||||||
label.setText("Give contents of droplist "+rewardObjDesc);
|
label.setText("Give contents of droplist "+rewardObjDesc);
|
||||||
@@ -765,12 +773,14 @@ public class DialogueEditor extends JSONElementEditor {
|
|||||||
break;
|
break;
|
||||||
case removeSpawnArea:
|
case removeSpawnArea:
|
||||||
label.setText("Remove all monsters in spawnarea area "+rewardObjDesc+" on map "+reward.map_name);
|
label.setText("Remove all monsters in spawnarea area "+rewardObjDesc+" on map "+reward.map_name);
|
||||||
|
label.setIcon(new ImageIcon(DefaultIcons.getNPCIcon()));
|
||||||
break;
|
break;
|
||||||
case skillIncrease:
|
case skillIncrease:
|
||||||
label.setText("Increase skill "+rewardObjDesc+" level");
|
label.setText("Increase skill "+rewardObjDesc+" level");
|
||||||
break;
|
break;
|
||||||
case spawnAll:
|
case spawnAll:
|
||||||
label.setText("Respawn all monsters in spawnarea area "+rewardObjDesc+" on map "+reward.map_name);
|
label.setText("Respawn all monsters in spawnarea area "+rewardObjDesc+" on map "+reward.map_name);
|
||||||
|
label.setIcon(new ImageIcon(DefaultIcons.getNPCIcon()));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -1027,6 +1037,10 @@ public class DialogueEditor extends JSONElementEditor {
|
|||||||
} else if (source == rewardTypeCombo) {
|
} else if (source == rewardTypeCombo) {
|
||||||
if (selectedReward.type != value) {
|
if (selectedReward.type != value) {
|
||||||
selectedReward.type = (Dialogue.Reward.RewardType) value;
|
selectedReward.type = (Dialogue.Reward.RewardType) value;
|
||||||
|
if (selectedReward.map != null) {
|
||||||
|
selectedReward.map.removeBacklink(dialogue);
|
||||||
|
}
|
||||||
|
selectedReward.map = null;
|
||||||
selectedReward.map_name = null;
|
selectedReward.map_name = null;
|
||||||
selectedReward.reward_obj = null;
|
selectedReward.reward_obj = null;
|
||||||
selectedReward.reward_obj_id = null;
|
selectedReward.reward_obj_id = null;
|
||||||
|
|||||||
@@ -124,6 +124,7 @@ public class TMXMapEditor extends Editor {
|
|||||||
|
|
||||||
private JPanel layerDetailsPane;
|
private JPanel layerDetailsPane;
|
||||||
private BooleanBasedCheckBox layerVisibleBox;
|
private BooleanBasedCheckBox layerVisibleBox;
|
||||||
|
private BooleanBasedCheckBox activeLayerBox;
|
||||||
private JTextField layerNameField;
|
private JTextField layerNameField;
|
||||||
private MapObjectsListModel groupObjectsListModel;
|
private MapObjectsListModel groupObjectsListModel;
|
||||||
private JList groupObjectsList;
|
private JList groupObjectsList;
|
||||||
@@ -147,6 +148,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;
|
||||||
|
|
||||||
@@ -307,6 +309,7 @@ public class TMXMapEditor extends Editor {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
activeForNewGame = addBooleanBasedCheckBox(groupDetailPane, "Active for new game", objGroup.active, map.writable, listener);
|
||||||
groupObjectsListModel = new MapObjectsListModel(objGroup);
|
groupObjectsListModel = new MapObjectsListModel(objGroup);
|
||||||
groupObjectsList = new JList(groupObjectsListModel);
|
groupObjectsList = new JList(groupObjectsListModel);
|
||||||
groupObjectsList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
groupObjectsList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
||||||
@@ -539,14 +542,15 @@ public class TMXMapEditor extends Editor {
|
|||||||
|
|
||||||
|
|
||||||
} else if (selected instanceof RestArea) {
|
} else if (selected instanceof RestArea) {
|
||||||
pane.add(new JLabel("Rest areas have no parameters"), JideBoxLayout.FIX);
|
areaField = addTextField(pane, "Area ID: ", ((RestArea)selected).name, ((TMXMap)target).writable, listener);
|
||||||
} else if (selected instanceof ScriptArea) {
|
} else if (selected instanceof ScriptArea) {
|
||||||
evaluateTriggerBox = addEnumValueBox(pane, "Evaluate on every: ", ScriptArea.EvaluationTrigger.values(), ((ScriptArea)selected).trigger_type, ((TMXMap)target).writable, listener);
|
evaluateTriggerBox = addEnumValueBox(pane, "Evaluate on every: ", ScriptArea.EvaluationTrigger.values(), ((ScriptArea)selected).trigger_type, ((TMXMap)target).writable, listener);
|
||||||
dialogueBox = addDialogueBox(pane, ((TMXMap)target).getProject(), "Script: ", ((ScriptArea)selected).dialogue, ((TMXMap)target).writable, listener);
|
dialogueBox = addDialogueBox(pane, ((TMXMap)target).getProject(), "Script: ", ((ScriptArea)selected).dialogue, ((TMXMap)target).writable, listener);
|
||||||
} 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);
|
||||||
@@ -1681,6 +1685,11 @@ public class TMXMapEditor extends Editor {
|
|||||||
modified = false;
|
modified = false;
|
||||||
tmxViewer.revalidate();
|
tmxViewer.revalidate();
|
||||||
tmxViewer.repaint();
|
tmxViewer.repaint();
|
||||||
|
} else if (source == activeForNewGame) {
|
||||||
|
if (selectedLayer instanceof tiled.core.ObjectGroup) {
|
||||||
|
map.getGroup((tiled.core.ObjectGroup) selectedLayer).active = activeForNewGame.isSelected();
|
||||||
|
}
|
||||||
|
modified = true;
|
||||||
} else if (source == layerList) {
|
} else if (source == layerList) {
|
||||||
modified = false;
|
modified = false;
|
||||||
tmxViewer.revalidate();
|
tmxViewer.revalidate();
|
||||||
@@ -1690,6 +1699,9 @@ public class TMXMapEditor extends Editor {
|
|||||||
tmxViewer.revalidate();
|
tmxViewer.revalidate();
|
||||||
tmxViewer.repaint();
|
tmxViewer.repaint();
|
||||||
} else if (source == areaField) {
|
} else if (source == areaField) {
|
||||||
|
selectedMapObject.name = (String) value;
|
||||||
|
groupObjectsListModel.objectChanged(selectedMapObject);
|
||||||
|
} 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()) {
|
||||||
@@ -1697,7 +1709,7 @@ public class TMXMapEditor extends Editor {
|
|||||||
npc.removeBacklink(map);
|
npc.removeBacklink(map);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
area.name = (String) value;
|
area.spawngroup_id = (String) value;
|
||||||
selectedMapObject.link();
|
selectedMapObject.link();
|
||||||
npcList.setModel(new SpawnGroupNpcListModel(area));
|
npcList.setModel(new SpawnGroupNpcListModel(area));
|
||||||
groupObjectsListModel.objectChanged(area);
|
groupObjectsListModel.objectChanged(area);
|
||||||
@@ -1705,10 +1717,6 @@ public class TMXMapEditor extends Editor {
|
|||||||
npcList.repaint();
|
npcList.repaint();
|
||||||
tmxViewer.revalidate();
|
tmxViewer.revalidate();
|
||||||
tmxViewer.repaint();
|
tmxViewer.repaint();
|
||||||
} else if (selectedMapObject instanceof MapChange) {
|
|
||||||
MapChange area = (MapChange) selectedMapObject;
|
|
||||||
area.name = (String) value;
|
|
||||||
groupObjectsListModel.objectChanged(area);
|
|
||||||
}
|
}
|
||||||
} else if (source == targetAreaCombo) {
|
} else if (source == targetAreaCombo) {
|
||||||
if (selectedMapObject instanceof MapChange) {
|
if (selectedMapObject instanceof MapChange) {
|
||||||
|
|||||||
Reference in New Issue
Block a user