mirror of
https://github.com/AndorsTrailRelease/ATCS.git
synced 2025-10-27 18:44:03 +01:00
Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5a1d8637f9 | ||
|
|
97119b7101 | ||
|
|
104029124b | ||
|
|
2aad37549c | ||
|
|
8dc05bd26a | ||
|
|
de0274a5be | ||
|
|
3d2dbb9f51 | ||
|
|
f53302cb18 | ||
|
|
8d6a40eb13 | ||
|
|
0199bcfb4c | ||
|
|
3fe895a668 | ||
|
|
025a63af28 | ||
|
|
528ac7a7e3 | ||
|
|
506afb95ed | ||
|
|
5d802ed0e3 | ||
|
|
33cbd059ec | ||
|
|
6cb0941ca6 | ||
|
|
cfb38c33d6 |
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="WINDOWS-1252" standalone="no"?>
|
||||
<jardesc>
|
||||
<jar path="ATCS/ATCS_v0.6.5.jar"/>
|
||||
<jar path="ATCS/ATCS_v0.6.7.jar"/>
|
||||
<options buildIfNeeded="true" compress="true" descriptionLocation="/ATCS/ATCS_JAR.jardesc" exportErrors="true" exportWarnings="true" includeDirectoryEntries="false" overwrite="false" saveDescription="true" storeRefactorings="false" useSourceFolders="false"/>
|
||||
<storedRefactorings deprecationInfo="true" structuralOnly="false"/>
|
||||
<selectedProjects/>
|
||||
|
||||
@@ -1 +1 @@
|
||||
v0.6.5
|
||||
v0.6.7
|
||||
@@ -4,7 +4,7 @@ set "ATCS_DIR=%~dp0"
|
||||
set "MAX_MEM=512M"
|
||||
set "CP=%ATCS_DIR%lib\*"
|
||||
set "JAVA=javaw.exe"
|
||||
set "JAVA_OPTS="
|
||||
set "JAVA_OPTS=-DFONT_SCALE=1.0 -Dswing.aatext=true"
|
||||
set "ENV_FILE=%ATCS_DIR%ATCS.env.bat"
|
||||
set "MAIN_CLASS=com.gpl.rpg.atcontentstudio.ATContentStudio"
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ ATCS_DIR=$(dirname $(readlink -f "$0" || greadlink -f "$0" || stat -f "$0"))
|
||||
MAX_MEM=512M
|
||||
CP=$(find ${ATCS_DIR}/lib/ -name '*.jar' | paste -sd: -)
|
||||
JAVA=java
|
||||
JAVA_OPTS=
|
||||
JAVA_OPTS='-DFONT_SCALE=1.0 -Dswing.aatext=true'
|
||||
ENV_FILE=${ATCS_DIR}/ATCS.env
|
||||
MAIN_CLASS=com.gpl.rpg.atcontentstudio.ATContentStudio
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ set "ATCS_DIR=%~dp0"
|
||||
set "MAX_MEM=512M"
|
||||
set "CP=%ATCS_DIR%lib\*"
|
||||
set "JAVA=javaw.exe"
|
||||
set "JAVA_OPTS="
|
||||
set "JAVA_OPTS=-DFONT_SCALE=1.0 -Dswing.aatext=true"
|
||||
set "ENV_FILE=%ATCS_DIR%ATCS.env.bat"
|
||||
set "MAIN_CLASS=com.gpl.rpg.atcontentstudio.ATContentStudio"
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
!include MUI2.nsh
|
||||
|
||||
!define VERSION "0.6.5"
|
||||
!define VERSION "0.6.8"
|
||||
!define TRAINER_VERSION "0.1.4"
|
||||
!define JAVA_BIN "javaw"
|
||||
|
||||
|
||||
@@ -14,18 +14,23 @@ import java.io.InputStreamReader;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import javax.swing.JEditorPane;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.UIDefaults;
|
||||
import javax.swing.UIManager;
|
||||
import javax.swing.UnsupportedLookAndFeelException;
|
||||
import javax.swing.event.HyperlinkEvent;
|
||||
import javax.swing.event.HyperlinkListener;
|
||||
import javax.swing.plaf.FontUIResource;
|
||||
|
||||
import com.gpl.rpg.atcontentstudio.model.Workspace;
|
||||
import com.gpl.rpg.atcontentstudio.ui.StudioFrame;
|
||||
@@ -38,12 +43,15 @@ import prefuse.data.expression.parser.ExpressionParser;
|
||||
public class ATContentStudio {
|
||||
|
||||
public static final String APP_NAME = "Andor's Trail Content Studio";
|
||||
public static final String APP_VERSION = "v0.6.5";
|
||||
public static final String APP_VERSION = "v0.6.8";
|
||||
|
||||
public static final String CHECK_UPDATE_URL = "https://andorstrail.com/static/ATCS_latest";
|
||||
public static final String DOWNLOAD_URL = "https://andorstrail.com/viewtopic.php?f=6&t=4806";
|
||||
|
||||
public static final String FONT_SCALE_ENV_VAR_NAME = "FONT_SCALE";
|
||||
|
||||
public static boolean STARTED = false;
|
||||
public static float SCALING=1.0f;
|
||||
public static StudioFrame frame = null;
|
||||
|
||||
//Need to keep a strong reference to it, to avoid garbage collection that'll reset these loggers.
|
||||
@@ -53,6 +61,17 @@ public class ATContentStudio {
|
||||
* @param args
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
String fontScaling = System.getProperty(FONT_SCALE_ENV_VAR_NAME);
|
||||
Float fontScale = null;
|
||||
if (fontScaling != null) {
|
||||
try {
|
||||
fontScale = Float.parseFloat(fontScaling);
|
||||
SCALING=fontScale;
|
||||
} catch (NumberFormatException e) {
|
||||
System.err.println("Failed to parse font scaling parameter. Using default.");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
ConfigCache.init();
|
||||
|
||||
@@ -69,6 +88,9 @@ public class ATContentStudio {
|
||||
} catch (UnsupportedLookAndFeelException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
scaleUIFont();
|
||||
|
||||
//Need to keep a strong reference to it, to avoid garbage collection that'll reset this setting.
|
||||
Logger l = Logger.getLogger(ExpressionParser.class.getName());
|
||||
@@ -178,4 +200,28 @@ public class ATContentStudio {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void scaleUIFont() {
|
||||
if (SCALING != 1.0f) {
|
||||
System.out.println("Scaling fonts to "+SCALING);
|
||||
UIDefaults defaults = UIManager.getLookAndFeelDefaults();
|
||||
Map<Object, Object> newDefaults = new HashMap<Object, Object>();
|
||||
for (Enumeration<Object> e = defaults.keys(); e.hasMoreElements();) {
|
||||
Object key = e.nextElement();
|
||||
Object value = defaults.get(key);
|
||||
if (value instanceof Font) {
|
||||
Font font = (Font) value;
|
||||
int newSize = (int)(font.getSize() * SCALING);
|
||||
if (value instanceof FontUIResource) {
|
||||
newDefaults.put(key, new FontUIResource(font.getName(), font.getStyle(), newSize));
|
||||
} else {
|
||||
newDefaults.put(key, new Font(font.getName(), font.getStyle(), newSize));
|
||||
}
|
||||
}
|
||||
}
|
||||
for (Object key : newDefaults.keySet()) {
|
||||
defaults.put(key, newDefaults.get(key));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BIN
src/com/gpl/rpg/atcontentstudio/img/alignment.png
Normal file
BIN
src/com/gpl/rpg/atcontentstudio/img/alignment.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
BIN
src/com/gpl/rpg/atcontentstudio/img/bonemeal.png
Normal file
BIN
src/com/gpl/rpg/atcontentstudio/img/bonemeal.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 607 B |
BIN
src/com/gpl/rpg/atcontentstudio/img/timer.png
Normal file
BIN
src/com/gpl/rpg/atcontentstudio/img/timer.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 881 B |
BIN
src/com/gpl/rpg/atcontentstudio/img/ui_icon_immunity.png
Normal file
BIN
src/com/gpl/rpg/atcontentstudio/img/ui_icon_immunity.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
BIN
src/com/gpl/rpg/atcontentstudio/img/ui_icon_skill.png
Normal file
BIN
src/com/gpl/rpg/atcontentstudio/img/ui_icon_skill.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.0 KiB |
@@ -222,6 +222,8 @@ public class Project implements ProjectTreeNode, Serializable {
|
||||
public void refreshTransients(Workspace w) {
|
||||
this.parent = w;
|
||||
|
||||
projectElementListeners = new HashMap<Class<? extends GameDataElement>, List<ProjectElementListener>>();
|
||||
|
||||
try {
|
||||
knownSpritesheetsProperties = new Properties();
|
||||
knownSpritesheetsProperties.load(Project.class.getResourceAsStream("/spritesheets.properties"));
|
||||
@@ -254,7 +256,6 @@ public class Project implements ProjectTreeNode, Serializable {
|
||||
|
||||
linkAll();
|
||||
|
||||
projectElementListeners = new HashMap<Class<? extends GameDataElement>, List<ProjectElementListener>>();
|
||||
}
|
||||
|
||||
public void linkAll() {
|
||||
|
||||
@@ -21,7 +21,9 @@ public class ActorCondition extends JSONElement {
|
||||
|
||||
private static final long serialVersionUID = -3969824899972048507L;
|
||||
|
||||
public static final Integer CLEAR_AC_MAGNITUDE = -99;
|
||||
public static final Integer MAGNITUDE_CLEAR = -99;
|
||||
public static final Integer DURATION_FOREVER = 999;;
|
||||
public static final Integer DURATION_NONE = 0;
|
||||
|
||||
// Available from init state
|
||||
//public String id; inherited.
|
||||
@@ -43,9 +45,16 @@ public class ActorCondition extends JSONElement {
|
||||
blood
|
||||
}
|
||||
|
||||
public static enum VisualEffectID {
|
||||
redSplash
|
||||
,blueSwirl
|
||||
,greenSplash
|
||||
,miss
|
||||
}
|
||||
|
||||
public static class RoundEffect implements Cloneable {
|
||||
// Available from parsed state
|
||||
public String visual_effect = null;
|
||||
public VisualEffectID visual_effect = null;
|
||||
public Integer hp_boost_min = null;
|
||||
public Integer hp_boost_max = null;
|
||||
public Integer ap_boost_min = null;
|
||||
@@ -180,7 +189,13 @@ public class ActorCondition extends JSONElement {
|
||||
this.round_effect.ap_boost_max = JSONElement.getInteger((Number) (((Map)roundEffect.get("increaseCurrentAP")).get("max")));
|
||||
this.round_effect.ap_boost_min = JSONElement.getInteger((Number) (((Map)roundEffect.get("increaseCurrentAP")).get("min")));
|
||||
}
|
||||
this.round_effect.visual_effect = (String) roundEffect.get("visualEffectID");
|
||||
String vfx = (String) roundEffect.get("visualEffectID");
|
||||
this.round_effect.visual_effect = null;
|
||||
if (vfx != null) {
|
||||
try {
|
||||
this.round_effect.visual_effect = VisualEffectID.valueOf(vfx);
|
||||
} catch(IllegalArgumentException e) {}
|
||||
}
|
||||
}
|
||||
Map fullRoundEffect = (Map) aCondJson.get("fullRoundEffect");
|
||||
if (fullRoundEffect != null) {
|
||||
@@ -193,7 +208,13 @@ public class ActorCondition extends JSONElement {
|
||||
this.full_round_effect.ap_boost_max = JSONElement.getInteger((Number) (((Map)fullRoundEffect.get("increaseCurrentAP")).get("max")));
|
||||
this.full_round_effect.ap_boost_min = JSONElement.getInteger((Number) (((Map)fullRoundEffect.get("increaseCurrentAP")).get("min")));
|
||||
}
|
||||
this.full_round_effect.visual_effect = (String) fullRoundEffect.get("visualEffectID");
|
||||
String vfx = (String) roundEffect.get("visualEffectID");
|
||||
this.full_round_effect.visual_effect = null;
|
||||
if (vfx != null) {
|
||||
try {
|
||||
this.full_round_effect.visual_effect = VisualEffectID.valueOf(vfx);
|
||||
} catch(IllegalArgumentException e) {}
|
||||
}
|
||||
}
|
||||
this.state = State.parsed;
|
||||
|
||||
@@ -214,6 +235,9 @@ public class ActorCondition extends JSONElement {
|
||||
}
|
||||
if (this.icon_id != null) {
|
||||
String spritesheetId = this.icon_id.split(":")[0];
|
||||
if (getProject().getSpritesheet(spritesheetId) == null) {
|
||||
System.out.println(this.id);
|
||||
}
|
||||
getProject().getSpritesheet(spritesheetId).addBacklink(this);
|
||||
}
|
||||
|
||||
@@ -275,7 +299,7 @@ public class ActorCondition extends JSONElement {
|
||||
if (this.stacking != null && this.stacking == 1) jsonAC.put("isStacking", this.stacking);
|
||||
if (this.round_effect != null) {
|
||||
Map jsonRound = new LinkedHashMap();
|
||||
if (this.round_effect.visual_effect != null) jsonRound.put("visualEffectID", this.round_effect.visual_effect);
|
||||
if (this.round_effect.visual_effect != null) jsonRound.put("visualEffectID", this.round_effect.visual_effect.toString());
|
||||
if (this.round_effect.hp_boost_min != null || this.round_effect.hp_boost_max != null) {
|
||||
Map jsonHP = new LinkedHashMap();
|
||||
if (this.round_effect.hp_boost_min != null) jsonHP.put("min", this.round_effect.hp_boost_min);
|
||||
@@ -296,7 +320,7 @@ public class ActorCondition extends JSONElement {
|
||||
}
|
||||
if (this.full_round_effect != null) {
|
||||
Map jsonFullRound = new LinkedHashMap();
|
||||
if (this.full_round_effect.visual_effect != null) jsonFullRound.put("visualEffectID", this.full_round_effect.visual_effect);
|
||||
if (this.full_round_effect.visual_effect != null) jsonFullRound.put("visualEffectID", this.full_round_effect.visual_effect.toString());
|
||||
if (this.full_round_effect.hp_boost_min != null || this.full_round_effect.hp_boost_max != null) {
|
||||
Map jsonHP = new LinkedHashMap();
|
||||
if (this.full_round_effect.hp_boost_min != null) jsonHP.put("min", this.full_round_effect.hp_boost_min);
|
||||
|
||||
@@ -58,6 +58,7 @@ public class Dialogue extends JSONElement {
|
||||
dropList,
|
||||
skillIncrease,
|
||||
actorCondition,
|
||||
actorConditionImmunity,
|
||||
alignmentChange,
|
||||
giveItem,
|
||||
createTimer,
|
||||
@@ -250,6 +251,7 @@ public class Dialogue extends JSONElement {
|
||||
reward.map = reward.map_name != null ? proj.getMap(reward.map_name) : null;
|
||||
break;
|
||||
case actorCondition:
|
||||
case actorConditionImmunity:
|
||||
reward.reward_obj = proj.getActorCondition(reward.reward_obj_id);
|
||||
break;
|
||||
case alignmentChange:
|
||||
|
||||
@@ -34,6 +34,7 @@ public class Item extends JSONElement {
|
||||
public String category_id = null;
|
||||
public String description = null;
|
||||
public HitEffect hit_effect = null;
|
||||
public HitReceivedEffect hit_received_effect = null;
|
||||
public KillEffect kill_effect = null;
|
||||
public EquipEffect equip_effect = null;
|
||||
|
||||
@@ -58,6 +59,14 @@ public class Item extends JSONElement {
|
||||
public List<TimedConditionEffect> conditions_target = null;
|
||||
}
|
||||
|
||||
public static class HitReceivedEffect extends HitEffect {
|
||||
//Available from parsed state
|
||||
public Integer hp_boost_min_target = null;
|
||||
public Integer hp_boost_max_target = null;
|
||||
public Integer ap_boost_min_target = null;
|
||||
public Integer ap_boost_max_target = null;
|
||||
}
|
||||
|
||||
public static class EquipEffect {
|
||||
//Available from parsed state
|
||||
public Integer damage_boost_min = null;
|
||||
@@ -246,6 +255,53 @@ public class Item extends JSONElement {
|
||||
}
|
||||
}
|
||||
|
||||
Map hitReceivedEffect = (Map) itemJson.get("hitReceivedEffect");
|
||||
if (hitReceivedEffect != null) {
|
||||
this.hit_received_effect = new HitReceivedEffect();
|
||||
if (hitReceivedEffect.get("increaseCurrentHP") != null) {
|
||||
this.hit_received_effect.hp_boost_min = JSONElement.getInteger((Number) (((Map)hitReceivedEffect.get("increaseCurrentHP")).get("min")));
|
||||
this.hit_received_effect.hp_boost_max = JSONElement.getInteger((Number) (((Map)hitReceivedEffect.get("increaseCurrentHP")).get("max")));
|
||||
}
|
||||
if (hitReceivedEffect.get("increaseCurrentAP") != null) {
|
||||
this.hit_received_effect.ap_boost_min = JSONElement.getInteger((Number) (((Map)hitReceivedEffect.get("increaseCurrentAP")).get("min")));
|
||||
this.hit_received_effect.ap_boost_max = JSONElement.getInteger((Number) (((Map)hitReceivedEffect.get("increaseCurrentAP")).get("max")));
|
||||
}
|
||||
if (hitReceivedEffect.get("increaseAttackerCurrentHP") != null) {
|
||||
this.hit_received_effect.hp_boost_min_target = JSONElement.getInteger((Number) (((Map)hitReceivedEffect.get("increaseAttackerCurrentHP")).get("min")));
|
||||
this.hit_received_effect.hp_boost_max_target = JSONElement.getInteger((Number) (((Map)hitReceivedEffect.get("increaseAttackerCurrentHP")).get("max")));
|
||||
}
|
||||
if (hitReceivedEffect.get("increaseAttackerCurrentAP") != null) {
|
||||
this.hit_received_effect.ap_boost_min_target = JSONElement.getInteger((Number) (((Map)hitReceivedEffect.get("increaseAttackerCurrentAP")).get("min")));
|
||||
this.hit_received_effect.ap_boost_max_target = JSONElement.getInteger((Number) (((Map)hitReceivedEffect.get("increaseAttackerCurrentAP")).get("max")));
|
||||
}
|
||||
List conditionsSourceJson = (List) hitReceivedEffect.get("conditionsSource");
|
||||
if (conditionsSourceJson != null && !conditionsSourceJson.isEmpty()) {
|
||||
this.hit_received_effect.conditions_source = new ArrayList<Item.TimedConditionEffect>();
|
||||
for (Object conditionJsonObj : conditionsSourceJson) {
|
||||
Map conditionJson = (Map)conditionJsonObj;
|
||||
TimedConditionEffect condition = new TimedConditionEffect();
|
||||
condition.condition_id = (String) conditionJson.get("condition");
|
||||
condition.magnitude = JSONElement.getInteger((Number) conditionJson.get("magnitude"));
|
||||
condition.duration = JSONElement.getInteger((Number) conditionJson.get("duration"));
|
||||
if (conditionJson.get("chance") != null) condition.chance = JSONElement.parseChance(conditionJson.get("chance").toString());
|
||||
this.hit_received_effect.conditions_source.add(condition);
|
||||
}
|
||||
}
|
||||
List conditionsTargetJson = (List) hitReceivedEffect.get("conditionsTarget");
|
||||
if (conditionsTargetJson != null && !conditionsTargetJson.isEmpty()) {
|
||||
this.hit_received_effect.conditions_target = new ArrayList<Item.TimedConditionEffect>();
|
||||
for (Object conditionJsonObj : conditionsTargetJson) {
|
||||
Map conditionJson = (Map)conditionJsonObj;
|
||||
TimedConditionEffect condition = new TimedConditionEffect();
|
||||
condition.condition_id = (String) conditionJson.get("condition");
|
||||
condition.magnitude = JSONElement.getInteger((Number) conditionJson.get("magnitude"));
|
||||
condition.duration = JSONElement.getInteger((Number) conditionJson.get("duration"));
|
||||
if (conditionJson.get("chance") != null) condition.chance = JSONElement.parseChance(conditionJson.get("chance").toString());
|
||||
this.hit_received_effect.conditions_target.add(condition);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Map killEffect = (Map) itemJson.get("killEffect");
|
||||
if (killEffect == null) {
|
||||
killEffect = (Map) itemJson.get("useEffect");
|
||||
@@ -321,6 +377,18 @@ public class Item extends JSONElement {
|
||||
if (ce.condition != null) ce.condition.addBacklink(this);
|
||||
}
|
||||
}
|
||||
if (this.hit_received_effect != null && this.hit_received_effect.conditions_source != null) {
|
||||
for (TimedConditionEffect ce : this.hit_received_effect.conditions_source) {
|
||||
if (ce.condition_id != null) ce.condition = proj.getActorCondition(ce.condition_id);
|
||||
if (ce.condition != null) ce.condition.addBacklink(this);
|
||||
}
|
||||
}
|
||||
if (this.hit_received_effect != null && this.hit_received_effect.conditions_target != null) {
|
||||
for (TimedConditionEffect ce : this.hit_received_effect.conditions_target) {
|
||||
if (ce.condition_id != null) ce.condition = proj.getActorCondition(ce.condition_id);
|
||||
if (ce.condition != null) ce.condition.addBacklink(this);
|
||||
}
|
||||
}
|
||||
if (this.kill_effect != null && this.kill_effect.conditions_source != null) {
|
||||
for (TimedConditionEffect ce : this.kill_effect.conditions_source) {
|
||||
if (ce.condition_id != null) ce.condition = proj.getActorCondition(ce.condition_id);
|
||||
@@ -422,6 +490,47 @@ public class Item extends JSONElement {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.hit_received_effect != null) {
|
||||
clone.hit_received_effect = new HitReceivedEffect();
|
||||
clone.hit_received_effect.ap_boost_max = this.hit_received_effect.ap_boost_max;
|
||||
clone.hit_received_effect.ap_boost_min = this.hit_received_effect.ap_boost_min;
|
||||
clone.hit_received_effect.hp_boost_max = this.hit_received_effect.hp_boost_max;
|
||||
clone.hit_received_effect.hp_boost_min = this.hit_received_effect.hp_boost_min;
|
||||
clone.hit_received_effect.ap_boost_max_target = this.hit_received_effect.ap_boost_max_target;
|
||||
clone.hit_received_effect.ap_boost_min_target = this.hit_received_effect.ap_boost_min_target;
|
||||
clone.hit_received_effect.hp_boost_max_target = this.hit_received_effect.hp_boost_max_target;
|
||||
clone.hit_received_effect.hp_boost_min_target = this.hit_received_effect.hp_boost_min_target;
|
||||
if (this.hit_received_effect.conditions_source != null) {
|
||||
clone.hit_received_effect.conditions_source = new ArrayList<Item.TimedConditionEffect>();
|
||||
for (TimedConditionEffect c : this.hit_received_effect.conditions_source) {
|
||||
TimedConditionEffect cclone = new TimedConditionEffect();
|
||||
cclone.magnitude = c.magnitude;
|
||||
cclone.condition_id = c.condition_id;
|
||||
cclone.condition = c.condition;
|
||||
cclone.chance = c.chance;
|
||||
cclone.duration = c.duration;
|
||||
if (cclone.condition != null) {
|
||||
cclone.condition.addBacklink(clone);
|
||||
}
|
||||
clone.hit_received_effect.conditions_source.add(cclone);
|
||||
}
|
||||
}
|
||||
if (this.hit_received_effect.conditions_target != null) {
|
||||
clone.hit_received_effect.conditions_target = new ArrayList<Item.TimedConditionEffect>();
|
||||
for (TimedConditionEffect c : this.hit_received_effect.conditions_target) {
|
||||
TimedConditionEffect cclone = new TimedConditionEffect();
|
||||
cclone.magnitude = c.magnitude;
|
||||
cclone.condition_id = c.condition_id;
|
||||
cclone.condition = c.condition;
|
||||
cclone.chance = c.chance;
|
||||
cclone.duration = c.duration;
|
||||
if (cclone.condition != null) {
|
||||
cclone.condition.addBacklink(clone);
|
||||
}
|
||||
clone.hit_received_effect.conditions_target.add(cclone);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.kill_effect != null) {
|
||||
clone.kill_effect = new KillEffect();
|
||||
clone.kill_effect.ap_boost_max = this.kill_effect.ap_boost_max;
|
||||
@@ -600,6 +709,74 @@ public class Item extends JSONElement {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.hit_received_effect != null) {
|
||||
Map hitReceivedEffectJson = new LinkedHashMap();
|
||||
itemJson.put("hitReceivedEffect", hitReceivedEffectJson);
|
||||
if (this.hit_received_effect.hp_boost_min != null || this.hit_received_effect.hp_boost_max != null) {
|
||||
Map hpJson = new LinkedHashMap();
|
||||
hitReceivedEffectJson.put("increaseCurrentHP", hpJson);
|
||||
if (this.hit_received_effect.hp_boost_min != null) hpJson.put("min", this.hit_received_effect.hp_boost_min);
|
||||
else hpJson.put("min", 0);
|
||||
if (this.hit_received_effect.hp_boost_max != null) hpJson.put("max", this.hit_received_effect.hp_boost_max);
|
||||
else hpJson.put("max", 0);
|
||||
}
|
||||
if (this.hit_received_effect.ap_boost_min != null || this.hit_received_effect.ap_boost_max != null) {
|
||||
Map apJson = new LinkedHashMap();
|
||||
hitReceivedEffectJson.put("increaseCurrentAP", apJson);
|
||||
if (this.hit_received_effect.ap_boost_min != null) apJson.put("min", this.hit_received_effect.ap_boost_min);
|
||||
else apJson.put("min", 0);
|
||||
if (this.hit_received_effect.ap_boost_max != null) apJson.put("max", this.hit_received_effect.ap_boost_max);
|
||||
else apJson.put("max", 0);
|
||||
}
|
||||
if (this.hit_received_effect.hp_boost_min_target != null || this.hit_received_effect.hp_boost_max_target != null) {
|
||||
Map hpJson = new LinkedHashMap();
|
||||
hitReceivedEffectJson.put("increaseAttackerCurrentHP", hpJson);
|
||||
if (this.hit_received_effect.hp_boost_min_target != null) hpJson.put("min", this.hit_received_effect.hp_boost_min_target);
|
||||
else hpJson.put("min", 0);
|
||||
if (this.hit_received_effect.hp_boost_max_target != null) hpJson.put("max", this.hit_received_effect.hp_boost_max_target);
|
||||
else hpJson.put("max", 0);
|
||||
}
|
||||
if (this.hit_received_effect.ap_boost_min_target != null || this.hit_received_effect.ap_boost_max_target != null) {
|
||||
Map apJson = new LinkedHashMap();
|
||||
hitReceivedEffectJson.put("increaseAttackerCurrentAP", apJson);
|
||||
if (this.hit_received_effect.ap_boost_min_target != null) apJson.put("min", this.hit_received_effect.ap_boost_min_target);
|
||||
else apJson.put("min", 0);
|
||||
if (this.hit_received_effect.ap_boost_max_target != null) apJson.put("max", this.hit_received_effect.ap_boost_max_target);
|
||||
else apJson.put("max", 0);
|
||||
}
|
||||
if (this.hit_received_effect.conditions_source != null) {
|
||||
List conditionsSourceJson = new ArrayList();
|
||||
hitReceivedEffectJson.put("conditionsSource", conditionsSourceJson);
|
||||
for (TimedConditionEffect condition : this.hit_received_effect.conditions_source) {
|
||||
Map conditionJson = new LinkedHashMap();
|
||||
conditionsSourceJson.add(conditionJson);
|
||||
if (condition.condition != null) {
|
||||
conditionJson.put("condition", condition.condition.id);
|
||||
} else if (condition.condition_id != null) {
|
||||
conditionJson.put("condition", condition.condition_id);
|
||||
}
|
||||
if (condition.magnitude != null) conditionJson.put("magnitude", condition.magnitude);
|
||||
if (condition.duration != null) conditionJson.put("duration", condition.duration);
|
||||
if (condition.chance != null) conditionJson.put("chance", JSONElement.printJsonChance(condition.chance));
|
||||
}
|
||||
}
|
||||
if (this.hit_received_effect.conditions_target != null) {
|
||||
List conditionsTargetJson = new ArrayList();
|
||||
hitReceivedEffectJson.put("conditionsTarget", conditionsTargetJson);
|
||||
for (TimedConditionEffect condition : this.hit_received_effect.conditions_target) {
|
||||
Map conditionJson = new LinkedHashMap();
|
||||
conditionsTargetJson.add(conditionJson);
|
||||
if (condition.condition != null) {
|
||||
conditionJson.put("condition", condition.condition.id);
|
||||
} else if (condition.condition_id != null) {
|
||||
conditionJson.put("condition", condition.condition_id);
|
||||
}
|
||||
if (condition.magnitude != null) conditionJson.put("magnitude", condition.magnitude);
|
||||
if (condition.duration != null) conditionJson.put("duration", condition.duration);
|
||||
if (condition.chance != null) conditionJson.put("chance", JSONElement.printJsonChance(condition.chance));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.kill_effect != null) {
|
||||
Map killEffectJson = new LinkedHashMap();
|
||||
if (this.category != null && this.category.action_type != null && this.category.action_type == ItemCategory.ActionType.equip) {
|
||||
|
||||
@@ -47,6 +47,8 @@ public class NPC extends JSONElement {
|
||||
public Integer block_chance = null;
|
||||
public Integer damage_resistance = null;
|
||||
public HitEffect hit_effect = null;
|
||||
public HitReceivedEffect hit_received_effect = null;
|
||||
public DeathEffect death_effect = null;
|
||||
|
||||
//Available from linked state
|
||||
public Dialogue dialogue = null;
|
||||
@@ -70,17 +72,29 @@ public class NPC extends JSONElement {
|
||||
protectSpawn,
|
||||
wholeMap
|
||||
}
|
||||
|
||||
public static class HitEffect {
|
||||
|
||||
public static class DeathEffect {
|
||||
//Available from parsed state
|
||||
public Integer hp_boost_min = null;
|
||||
public Integer hp_boost_max = null;
|
||||
public Integer ap_boost_min = null;
|
||||
public Integer ap_boost_max = null;
|
||||
public List<TimedConditionEffect> conditions_source = null;
|
||||
}
|
||||
|
||||
public static class HitEffect extends DeathEffect {
|
||||
//Available from parsed state
|
||||
public List<TimedConditionEffect> conditions_target = null;
|
||||
}
|
||||
|
||||
public static class HitReceivedEffect extends HitEffect {
|
||||
//Available from parsed state
|
||||
public Integer hp_boost_min_target = null;
|
||||
public Integer hp_boost_max_target = null;
|
||||
public Integer ap_boost_min_target = null;
|
||||
public Integer ap_boost_max_target = null;
|
||||
}
|
||||
|
||||
public static class TimedConditionEffect {
|
||||
//Available from parsed state
|
||||
public Integer magnitude = null;
|
||||
@@ -224,6 +238,79 @@ public class NPC extends JSONElement {
|
||||
}
|
||||
}
|
||||
|
||||
Map hitReceivedEffect = (Map) npcJson.get("hitReceivedEffect");
|
||||
if (hitReceivedEffect != null) {
|
||||
this.hit_received_effect = new HitReceivedEffect();
|
||||
if (hitReceivedEffect.get("increaseCurrentHP") != null) {
|
||||
this.hit_received_effect.hp_boost_max = JSONElement.getInteger((Number) (((Map)hitReceivedEffect.get("increaseCurrentHP")).get("max")));
|
||||
this.hit_received_effect.hp_boost_min = JSONElement.getInteger((Number) (((Map)hitReceivedEffect.get("increaseCurrentHP")).get("min")));
|
||||
}
|
||||
if (hitReceivedEffect.get("increaseCurrentAP") != null) {
|
||||
this.hit_received_effect.ap_boost_max = JSONElement.getInteger((Number) (((Map)hitReceivedEffect.get("increaseCurrentAP")).get("max")));
|
||||
this.hit_received_effect.ap_boost_min = JSONElement.getInteger((Number) (((Map)hitReceivedEffect.get("increaseCurrentAP")).get("min")));
|
||||
}
|
||||
if (hitReceivedEffect.get("increaseAttackerCurrentHP") != null) {
|
||||
this.hit_received_effect.hp_boost_max_target = JSONElement.getInteger((Number) (((Map)hitReceivedEffect.get("increaseAttackerCurrentHP")).get("max")));
|
||||
this.hit_received_effect.hp_boost_min_target = JSONElement.getInteger((Number) (((Map)hitReceivedEffect.get("increaseAttackerCurrentHP")).get("min")));
|
||||
}
|
||||
if (hitReceivedEffect.get("increaseAttackerCurrentAP") != null) {
|
||||
this.hit_received_effect.ap_boost_max_target = JSONElement.getInteger((Number) (((Map)hitReceivedEffect.get("increaseAttackerCurrentAP")).get("max")));
|
||||
this.hit_received_effect.ap_boost_min_target = JSONElement.getInteger((Number) (((Map)hitReceivedEffect.get("increaseAttackerCurrentAP")).get("min")));
|
||||
}
|
||||
List conditionsSourceJson = (List) hitReceivedEffect.get("conditionsSource");
|
||||
if (conditionsSourceJson != null && !conditionsSourceJson.isEmpty()) {
|
||||
this.hit_received_effect.conditions_source = new ArrayList<NPC.TimedConditionEffect>();
|
||||
for (Object conditionJsonObj : conditionsSourceJson) {
|
||||
Map conditionJson = (Map)conditionJsonObj;
|
||||
TimedConditionEffect condition = new TimedConditionEffect();
|
||||
condition.condition_id = (String) conditionJson.get("condition");
|
||||
condition.magnitude = JSONElement.getInteger((Number) conditionJson.get("magnitude"));
|
||||
condition.duration = JSONElement.getInteger((Number) conditionJson.get("duration"));
|
||||
if (conditionJson.get("chance") != null) condition.chance = JSONElement.parseChance(conditionJson.get("chance").toString());
|
||||
this.hit_received_effect.conditions_source.add(condition);
|
||||
}
|
||||
}
|
||||
List conditionsTargetJson = (List) hitReceivedEffect.get("conditionsTarget");
|
||||
if (conditionsTargetJson != null && !conditionsTargetJson.isEmpty()) {
|
||||
this.hit_received_effect.conditions_target = new ArrayList<NPC.TimedConditionEffect>();
|
||||
for (Object conditionJsonObj : conditionsTargetJson) {
|
||||
Map conditionJson = (Map)conditionJsonObj;
|
||||
TimedConditionEffect condition = new TimedConditionEffect();
|
||||
condition.condition_id = (String) conditionJson.get("condition");
|
||||
condition.magnitude = JSONElement.getInteger((Number) conditionJson.get("magnitude"));
|
||||
condition.duration = JSONElement.getInteger((Number) conditionJson.get("duration"));
|
||||
if (conditionJson.get("chance") != null) condition.chance = JSONElement.parseChance(conditionJson.get("chance").toString());
|
||||
this.hit_received_effect.conditions_target.add(condition);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Map deathEffect = (Map) npcJson.get("deathEffect");
|
||||
if (deathEffect != null) {
|
||||
this.death_effect = new HitEffect();
|
||||
if (deathEffect.get("increaseCurrentHP") != null) {
|
||||
this.death_effect.hp_boost_max = JSONElement.getInteger((Number) (((Map)deathEffect.get("increaseCurrentHP")).get("max")));
|
||||
this.death_effect.hp_boost_min = JSONElement.getInteger((Number) (((Map)deathEffect.get("increaseCurrentHP")).get("min")));
|
||||
}
|
||||
if (deathEffect.get("increaseCurrentAP") != null) {
|
||||
this.death_effect.ap_boost_max = JSONElement.getInteger((Number) (((Map)deathEffect.get("increaseCurrentAP")).get("max")));
|
||||
this.death_effect.ap_boost_min = JSONElement.getInteger((Number) (((Map)deathEffect.get("increaseCurrentAP")).get("min")));
|
||||
}
|
||||
List conditionsSourceJson = (List) deathEffect.get("conditionsSource");
|
||||
if (conditionsSourceJson != null && !conditionsSourceJson.isEmpty()) {
|
||||
this.death_effect.conditions_source = new ArrayList<NPC.TimedConditionEffect>();
|
||||
for (Object conditionJsonObj : conditionsSourceJson) {
|
||||
Map conditionJson = (Map)conditionJsonObj;
|
||||
TimedConditionEffect condition = new TimedConditionEffect();
|
||||
condition.condition_id = (String) conditionJson.get("condition");
|
||||
condition.magnitude = JSONElement.getInteger((Number) conditionJson.get("magnitude"));
|
||||
condition.duration = JSONElement.getInteger((Number) conditionJson.get("duration"));
|
||||
if (conditionJson.get("chance") != null) condition.chance = JSONElement.parseChance(conditionJson.get("chance").toString());
|
||||
this.death_effect.conditions_source.add(condition);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -267,6 +354,24 @@ public class NPC extends JSONElement {
|
||||
if (ce.condition != null) ce.condition.addBacklink(this);
|
||||
}
|
||||
}
|
||||
if (this.hit_received_effect != null && this.hit_received_effect.conditions_source != null) {
|
||||
for (TimedConditionEffect ce : this.hit_received_effect.conditions_source) {
|
||||
if (ce.condition_id != null) ce.condition = proj.getActorCondition(ce.condition_id);
|
||||
if (ce.condition != null) ce.condition.addBacklink(this);
|
||||
}
|
||||
}
|
||||
if (this.hit_received_effect != null && this.hit_received_effect.conditions_target != null) {
|
||||
for (TimedConditionEffect ce : this.hit_received_effect.conditions_target) {
|
||||
if (ce.condition_id != null) ce.condition = proj.getActorCondition(ce.condition_id);
|
||||
if (ce.condition != null) ce.condition.addBacklink(this);
|
||||
}
|
||||
}
|
||||
if (this.death_effect != null && this.death_effect.conditions_source != null) {
|
||||
for (TimedConditionEffect ce : this.death_effect.conditions_source) {
|
||||
if (ce.condition_id != null) ce.condition = proj.getActorCondition(ce.condition_id);
|
||||
if (ce.condition != null) ce.condition.addBacklink(this);
|
||||
}
|
||||
}
|
||||
this.state = State.linked;
|
||||
}
|
||||
|
||||
@@ -343,6 +448,69 @@ public class NPC extends JSONElement {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.hit_received_effect != null) {
|
||||
clone.hit_received_effect = new HitReceivedEffect();
|
||||
clone.hit_received_effect.ap_boost_max = this.hit_received_effect.ap_boost_max;
|
||||
clone.hit_received_effect.ap_boost_min = this.hit_received_effect.ap_boost_min;
|
||||
clone.hit_received_effect.hp_boost_max = this.hit_received_effect.hp_boost_max;
|
||||
clone.hit_received_effect.hp_boost_min = this.hit_received_effect.hp_boost_min;
|
||||
clone.hit_received_effect.ap_boost_max_target = this.hit_received_effect.ap_boost_max_target;
|
||||
clone.hit_received_effect.ap_boost_min_target = this.hit_received_effect.ap_boost_min_target;
|
||||
clone.hit_received_effect.hp_boost_max_target = this.hit_received_effect.hp_boost_max_target;
|
||||
clone.hit_received_effect.hp_boost_min_target = this.hit_received_effect.hp_boost_min_target;
|
||||
if (this.hit_received_effect.conditions_source != null) {
|
||||
clone.hit_received_effect.conditions_source = new ArrayList<TimedConditionEffect>();
|
||||
for (TimedConditionEffect c : this.hit_received_effect.conditions_source) {
|
||||
TimedConditionEffect cclone = new TimedConditionEffect();
|
||||
cclone.magnitude = c.magnitude;
|
||||
cclone.condition_id = c.condition_id;
|
||||
cclone.condition = c.condition;
|
||||
cclone.chance = c.chance;
|
||||
cclone.duration = c.duration;
|
||||
if (cclone.condition != null) {
|
||||
cclone.condition.addBacklink(clone);
|
||||
}
|
||||
clone.hit_received_effect.conditions_source.add(cclone);
|
||||
}
|
||||
}
|
||||
if (this.hit_received_effect.conditions_target != null) {
|
||||
clone.hit_received_effect.conditions_target = new ArrayList<TimedConditionEffect>();
|
||||
for (TimedConditionEffect c : this.hit_received_effect.conditions_target) {
|
||||
TimedConditionEffect cclone = new TimedConditionEffect();
|
||||
cclone.magnitude = c.magnitude;
|
||||
cclone.condition_id = c.condition_id;
|
||||
cclone.condition = c.condition;
|
||||
cclone.chance = c.chance;
|
||||
cclone.duration = c.duration;
|
||||
if (cclone.condition != null) {
|
||||
cclone.condition.addBacklink(clone);
|
||||
}
|
||||
clone.hit_received_effect.conditions_target.add(cclone);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.death_effect != null) {
|
||||
clone.death_effect = new DeathEffect();
|
||||
clone.death_effect.ap_boost_max = this.death_effect.ap_boost_max;
|
||||
clone.death_effect.ap_boost_min = this.death_effect.ap_boost_min;
|
||||
clone.death_effect.hp_boost_max = this.death_effect.hp_boost_max;
|
||||
clone.death_effect.hp_boost_min = this.death_effect.hp_boost_min;
|
||||
if (this.death_effect.conditions_source != null) {
|
||||
clone.death_effect.conditions_source = new ArrayList<TimedConditionEffect>();
|
||||
for (TimedConditionEffect c : this.death_effect.conditions_source) {
|
||||
TimedConditionEffect cclone = new TimedConditionEffect();
|
||||
cclone.magnitude = c.magnitude;
|
||||
cclone.condition_id = c.condition_id;
|
||||
cclone.condition = c.condition;
|
||||
cclone.chance = c.chance;
|
||||
cclone.duration = c.duration;
|
||||
if (cclone.condition != null) {
|
||||
cclone.condition.addBacklink(clone);
|
||||
}
|
||||
clone.death_effect.conditions_source.add(cclone);
|
||||
}
|
||||
}
|
||||
}
|
||||
clone.max_ap = this.max_ap;
|
||||
clone.max_hp = this.max_hp;
|
||||
clone.monster_class = this.monster_class;
|
||||
@@ -478,6 +646,110 @@ public class NPC extends JSONElement {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.hit_received_effect != null) {
|
||||
Map hitReceivedEffectJson = new LinkedHashMap();
|
||||
npcJson.put("hitReceivedEffect", hitReceivedEffectJson);
|
||||
if (this.hit_received_effect.hp_boost_min != null || this.hit_received_effect.hp_boost_max != null) {
|
||||
Map hpJson = new LinkedHashMap();
|
||||
hitReceivedEffectJson.put("increaseCurrentHP", hpJson);
|
||||
if (this.hit_received_effect.hp_boost_min != null) hpJson.put("min", this.hit_received_effect.hp_boost_min);
|
||||
else hpJson.put("min", 0);
|
||||
if (this.hit_received_effect.hp_boost_max != null) hpJson.put("max", this.hit_received_effect.hp_boost_max);
|
||||
else hpJson.put("max", 0);
|
||||
}
|
||||
if (this.hit_received_effect.ap_boost_min != null || this.hit_received_effect.ap_boost_max != null) {
|
||||
Map apJson = new LinkedHashMap();
|
||||
hitReceivedEffectJson.put("increaseCurrentAP", apJson);
|
||||
if (this.hit_received_effect.ap_boost_min != null) apJson.put("min", this.hit_received_effect.ap_boost_min);
|
||||
else apJson.put("min", 0);
|
||||
if (this.hit_received_effect.ap_boost_max != null) apJson.put("max", this.hit_received_effect.ap_boost_max);
|
||||
else apJson.put("max", 0);
|
||||
}
|
||||
if (this.hit_received_effect.hp_boost_min_target != null || this.hit_received_effect.hp_boost_max_target != null) {
|
||||
Map hpJson = new LinkedHashMap();
|
||||
hitReceivedEffectJson.put("increaseAttackerCurrentHP", hpJson);
|
||||
if (this.hit_received_effect.hp_boost_min_target != null) hpJson.put("min", this.hit_received_effect.hp_boost_min_target);
|
||||
else hpJson.put("min", 0);
|
||||
if (this.hit_received_effect.hp_boost_max_target != null) hpJson.put("max", this.hit_received_effect.hp_boost_max_target);
|
||||
else hpJson.put("max", 0);
|
||||
}
|
||||
if (this.hit_received_effect.ap_boost_min_target != null || this.hit_received_effect.ap_boost_max_target != null) {
|
||||
Map apJson = new LinkedHashMap();
|
||||
hitReceivedEffectJson.put("increaseAttackerCurrentAP", apJson);
|
||||
if (this.hit_received_effect.ap_boost_min_target != null) apJson.put("min", this.hit_received_effect.ap_boost_min_target);
|
||||
else apJson.put("min", 0);
|
||||
if (this.hit_received_effect.ap_boost_max_target != null) apJson.put("max", this.hit_received_effect.ap_boost_max_target);
|
||||
else apJson.put("max", 0);
|
||||
}
|
||||
if (this.hit_received_effect.conditions_source != null) {
|
||||
List conditionsSourceJson = new ArrayList();
|
||||
hitReceivedEffectJson.put("conditionsSource", conditionsSourceJson);
|
||||
for (TimedConditionEffect condition : this.hit_received_effect.conditions_source) {
|
||||
Map conditionJson = new LinkedHashMap();
|
||||
conditionsSourceJson.add(conditionJson);
|
||||
if (condition.condition != null) {
|
||||
conditionJson.put("condition", condition.condition.id);
|
||||
} else if (condition.condition_id != null) {
|
||||
conditionJson.put("condition", condition.condition_id);
|
||||
}
|
||||
if (condition.magnitude != null) conditionJson.put("magnitude", condition.magnitude);
|
||||
if (condition.duration != null) conditionJson.put("duration", condition.duration);
|
||||
if (condition.chance != null) conditionJson.put("chance", JSONElement.printJsonChance(condition.chance));
|
||||
}
|
||||
}
|
||||
if (this.hit_received_effect.conditions_target != null) {
|
||||
List conditionsTargetJson = new ArrayList();
|
||||
hitReceivedEffectJson.put("conditionsTarget", conditionsTargetJson);
|
||||
for (TimedConditionEffect condition : this.hit_received_effect.conditions_target) {
|
||||
Map conditionJson = new LinkedHashMap();
|
||||
conditionsTargetJson.add(conditionJson);
|
||||
if (condition.condition != null) {
|
||||
conditionJson.put("condition", condition.condition.id);
|
||||
} else if (condition.condition_id != null) {
|
||||
conditionJson.put("condition", condition.condition_id);
|
||||
}
|
||||
if (condition.magnitude != null) conditionJson.put("magnitude", condition.magnitude);
|
||||
if (condition.duration != null) conditionJson.put("duration", condition.duration);
|
||||
if (condition.chance != null) conditionJson.put("chance", JSONElement.printJsonChance(condition.chance));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.death_effect != null) {
|
||||
Map deathEffectJson = new LinkedHashMap();
|
||||
npcJson.put("deathEffect", deathEffectJson);
|
||||
if (this.death_effect.hp_boost_min != null || this.death_effect.hp_boost_max != null) {
|
||||
Map hpJson = new LinkedHashMap();
|
||||
deathEffectJson.put("increaseCurrentHP", hpJson);
|
||||
if (this.death_effect.hp_boost_min != null) hpJson.put("min", this.death_effect.hp_boost_min);
|
||||
else hpJson.put("min", 0);
|
||||
if (this.death_effect.hp_boost_max != null) hpJson.put("max", this.death_effect.hp_boost_max);
|
||||
else hpJson.put("max", 0);
|
||||
}
|
||||
if (this.death_effect.ap_boost_min != null || this.death_effect.ap_boost_max != null) {
|
||||
Map apJson = new LinkedHashMap();
|
||||
deathEffectJson.put("increaseCurrentAP", apJson);
|
||||
if (this.death_effect.ap_boost_min != null) apJson.put("min", this.death_effect.ap_boost_min);
|
||||
else apJson.put("min", 0);
|
||||
if (this.death_effect.ap_boost_max != null) apJson.put("max", this.death_effect.ap_boost_max);
|
||||
else apJson.put("max", 0);
|
||||
}
|
||||
if (this.death_effect.conditions_source != null) {
|
||||
List conditionsSourceJson = new ArrayList();
|
||||
deathEffectJson.put("conditionsSource", conditionsSourceJson);
|
||||
for (TimedConditionEffect condition : this.death_effect.conditions_source) {
|
||||
Map conditionJson = new LinkedHashMap();
|
||||
conditionsSourceJson.add(conditionJson);
|
||||
if (condition.condition != null) {
|
||||
conditionJson.put("condition", condition.condition.id);
|
||||
} else if (condition.condition_id != null) {
|
||||
conditionJson.put("condition", condition.condition_id);
|
||||
}
|
||||
if (condition.magnitude != null) conditionJson.put("magnitude", condition.magnitude);
|
||||
if (condition.duration != null) conditionJson.put("duration", condition.duration);
|
||||
if (condition.chance != null) conditionJson.put("chance", JSONElement.printJsonChance(condition.chance));
|
||||
}
|
||||
}
|
||||
}
|
||||
return npcJson;
|
||||
}
|
||||
|
||||
|
||||
@@ -99,8 +99,8 @@ public class Quest extends JSONElement {
|
||||
public void parse(Map questJson) {
|
||||
this.visible_in_log = JSONElement.getInteger((Number) questJson.get("showInLog"));
|
||||
List questStagesJson = (List) questJson.get("stages");
|
||||
this.stages = new ArrayList<QuestStage>();
|
||||
if (questStagesJson != null && !questStagesJson.isEmpty()) {
|
||||
this.stages = new ArrayList<QuestStage>();
|
||||
for (Object questStageJsonObj : questStagesJson) {
|
||||
Map questStageJson = (Map)questStageJsonObj;
|
||||
QuestStage questStage = new QuestStage(this);
|
||||
|
||||
@@ -53,12 +53,61 @@ public class Requirement extends JSONElement {
|
||||
usedItem,
|
||||
spentGold,
|
||||
consumedBonemeals,
|
||||
hasActorCondition
|
||||
hasActorCondition,
|
||||
factionScore
|
||||
}
|
||||
|
||||
public enum SkillID {
|
||||
weaponChance
|
||||
,weaponDmg
|
||||
,barter
|
||||
,dodge
|
||||
,barkSkin
|
||||
,moreCriticals
|
||||
,betterCriticals
|
||||
,speed // Raises max ap
|
||||
,coinfinder
|
||||
,moreExp
|
||||
,cleave // +10ap on kill
|
||||
,eater // +1hp per kill
|
||||
,fortitude // +N hp per levelup
|
||||
,evasion // increase successful flee chance & reduce chance of monster attack
|
||||
,regeneration // +N hp per round
|
||||
,lowerExploss
|
||||
,magicfinder
|
||||
,resistanceMental // lowers chance to get negative active conditions by monsters (Mental like Dazed)
|
||||
,resistancePhysical // lowers chance to get negative active conditions by monsters (Physical Capacity like Minor fatigue)
|
||||
,resistanceBlood // lowers chance to get negative active conditions by monsters (Blood Disorder like Weak Poison)
|
||||
,shadowBless
|
||||
,crit1 // lowers atk ability
|
||||
,crit2 // lowers def ability ,rejuvenation // Reduces magnitudes of conditions
|
||||
,rejuvenation // Reduces magnitudes of conditions
|
||||
,taunt // Causes AP loss of attackers that miss
|
||||
,concussion // AC loss for monsters with (AC-BC)>N
|
||||
,weaponProficiencyDagger
|
||||
,weaponProficiency1hsword
|
||||
,weaponProficiency2hsword
|
||||
,weaponProficiencyAxe
|
||||
,weaponProficiencyBlunt
|
||||
,weaponProficiencyUnarmed
|
||||
,armorProficiencyShield
|
||||
,armorProficiencyUnarmored
|
||||
,armorProficiencyLight
|
||||
,armorProficiencyHeavy
|
||||
,fightstyleDualWield
|
||||
,fightstyle2hand
|
||||
,fightstyleWeaponShield
|
||||
,specializationDualWield
|
||||
,specialization2hand
|
||||
,specializationWeaponShield
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDesc() {
|
||||
return ((negated != null && negated) ? "NOT " : "")+required_obj_id+(required_value == null ? "" : ":"+required_value.toString());
|
||||
return ((negated != null && negated) ? "NOT " : "")
|
||||
+(type == null ? "" : type.toString()+":")
|
||||
+(required_obj_id == null ? "" : required_obj_id+":")
|
||||
+(required_value == null ? "" : required_value.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -20,7 +20,7 @@ public class KeyArea extends MapObject {
|
||||
String requireId = obj.getProperties().getProperty("requireId");
|
||||
String requireValue = obj.getProperties().getProperty("requireValue");
|
||||
oldSchoolRequirement = false;
|
||||
if (requireId == null) {
|
||||
if (requireType == null) {
|
||||
String[] fields = obj.getName().split(":");
|
||||
if (fields.length == 2) {
|
||||
requireType = Requirement.RequirementType.questProgress.toString();
|
||||
@@ -76,7 +76,7 @@ public class KeyArea extends MapObject {
|
||||
}
|
||||
if (requirement != null) {
|
||||
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+":"+((requirement.required_value == null) ? "" : Integer.toString(requirement.required_value)));
|
||||
} else {
|
||||
if (requirement.type != null) {
|
||||
tmxObject.getProperties().setProperty("requireType", requirement.type.toString());
|
||||
@@ -89,13 +89,16 @@ public class KeyArea extends MapObject {
|
||||
if (requirement.required_value != null) {
|
||||
tmxObject.getProperties().setProperty("requireValue", requirement.required_value.toString());
|
||||
}
|
||||
if (requirement.negated != null) {
|
||||
tmxObject.getProperties().setProperty("requireNegation", Boolean.toString(requirement.negated));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void updateNameFromRequirementChange() {
|
||||
if (oldSchoolRequirement && Requirement.RequirementType.questProgress.equals(requirement.type) && (requirement.negated == null || !requirement.negated)) {
|
||||
name = requirement.required_obj_id+":"+Integer.toString(requirement.required_value);
|
||||
name = requirement.required_obj_id+":"+((requirement.required_value == null) ? "" : Integer.toString(requirement.required_value));
|
||||
} else if (oldSchoolRequirement) {
|
||||
int i = 0;
|
||||
String futureName = requirement.type.toString() + "#" + Integer.toString(i);
|
||||
|
||||
@@ -17,13 +17,13 @@ public class ReplaceArea extends MapObject {
|
||||
public List<ReplaceArea.Replacement> replacements = null;
|
||||
|
||||
public ReplaceArea(tiled.core.MapObject obj) {
|
||||
// String requireType = obj.getProperties().getProperty("requireType");
|
||||
String requireType = obj.getProperties().getProperty("requireType");
|
||||
String requireId = obj.getProperties().getProperty("requireId");
|
||||
String requireValue = obj.getProperties().getProperty("requireValue");
|
||||
if (requireId == null) {
|
||||
if (requireType == null) {
|
||||
String[] fields = obj.getName().split(":");
|
||||
if (fields.length == 2) {
|
||||
// requireType = Requirement.RequirementType.questProgress.toString();
|
||||
requireType = Requirement.RequirementType.questProgress.toString();
|
||||
requireValue = fields[1];
|
||||
requireId = fields[0];
|
||||
oldSchoolRequirement = true;
|
||||
@@ -34,9 +34,7 @@ public class ReplaceArea extends MapObject {
|
||||
}*/
|
||||
}
|
||||
requirement = new Requirement();
|
||||
//Replace areas only support questProgress requirements ATM
|
||||
//requirement.type = Requirement.RequirementType.valueOf(requireType);
|
||||
requirement.type = Requirement.RequirementType.questProgress;
|
||||
if (requireType != null) requirement.type = Requirement.RequirementType.valueOf(requireType);
|
||||
requirement.required_obj_id = requireId;
|
||||
if (requireValue != null) requirement.required_value = Integer.parseInt(requireValue);
|
||||
requirement.state = GameDataElement.State.parsed;
|
||||
@@ -93,7 +91,7 @@ public class ReplaceArea extends MapObject {
|
||||
}
|
||||
if (requirement != null) {
|
||||
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+":"+((requirement.required_value == null) ? "" : Integer.toString(requirement.required_value)));
|
||||
} else {
|
||||
tmxObject.getProperties().setProperty("requireType", requirement.type.toString());
|
||||
if (requirement.required_obj != null) {
|
||||
@@ -104,6 +102,9 @@ public class ReplaceArea extends MapObject {
|
||||
if (requirement.required_value != null) {
|
||||
tmxObject.getProperties().setProperty("requireValue", requirement.required_value.toString());
|
||||
}
|
||||
if (requirement.negated != null) {
|
||||
tmxObject.getProperties().setProperty("requireNegation", Boolean.toString(requirement.negated));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -111,7 +112,7 @@ public class ReplaceArea extends MapObject {
|
||||
//Don't use yet !
|
||||
public void updateNameFromRequirementChange() {
|
||||
if (oldSchoolRequirement && Requirement.RequirementType.questProgress.equals(requirement.type) && (requirement.negated == null || !requirement.negated)) {
|
||||
name = requirement.required_obj_id+":"+Integer.toString(requirement.required_value);
|
||||
name = requirement.required_obj_id+":"+((requirement.required_value == null) ? "" : Integer.toString(requirement.required_value));
|
||||
} else if (oldSchoolRequirement) {
|
||||
int i = 0;
|
||||
String futureName = requirement.type.toString() + "#" + Integer.toString(i);
|
||||
|
||||
@@ -14,6 +14,7 @@ import java.util.Map;
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.swing.tree.TreeNode;
|
||||
|
||||
import com.gpl.rpg.atcontentstudio.ATContentStudio;
|
||||
import com.gpl.rpg.atcontentstudio.Notification;
|
||||
import com.gpl.rpg.atcontentstudio.model.GameDataElement;
|
||||
import com.gpl.rpg.atcontentstudio.model.GameSource.Type;
|
||||
@@ -174,7 +175,7 @@ public class Spritesheet extends GameDataElement {
|
||||
}
|
||||
Image result = getImage(index);
|
||||
if (result == null) return null;
|
||||
result = result.getScaledInstance(16, 16, BufferedImage.SCALE_SMOOTH);
|
||||
result = result.getScaledInstance((int)(16*ATContentStudio.SCALING), (int)(16*ATContentStudio.SCALING), Image.SCALE_SMOOTH);
|
||||
cache_icon.put(index, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import java.util.Map;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
import com.gpl.rpg.atcontentstudio.ATContentStudio;
|
||||
import com.gpl.rpg.atcontentstudio.Notification;
|
||||
|
||||
public class DefaultIcons {
|
||||
@@ -107,6 +108,10 @@ public class DefaultIcons {
|
||||
public static Image getNPCImage() { return getImage(NPC_RES); }
|
||||
public static Image getNPCIcon() { return getIcon(NPC_RES); }
|
||||
|
||||
private static String BONEMEAL_RES = "/com/gpl/rpg/atcontentstudio/img/bonemeal.png";
|
||||
public static Image getBonemealImage() { return getImage(BONEMEAL_RES); }
|
||||
public static Image getBonemealIcon() { return getIcon(BONEMEAL_RES); }
|
||||
|
||||
private static String NPC_CLOSE_RES = "/com/gpl/rpg/atcontentstudio/img/npc_close.png";
|
||||
public static Image getNPCCloseImage() { return getImage(NPC_CLOSE_RES); }
|
||||
public static Image getNPCCloseIcon() { return getIcon(NPC_CLOSE_RES); }
|
||||
@@ -130,6 +135,14 @@ public class DefaultIcons {
|
||||
private static String GOLD_RES = "/com/gpl/rpg/atcontentstudio/img/ui_icon_coins.png";
|
||||
public static Image getGoldImage() { return getImage(GOLD_RES); }
|
||||
public static Image getGoldIcon() { return getIcon(GOLD_RES); }
|
||||
|
||||
private static String SKILL_RES = "/com/gpl/rpg/atcontentstudio/img/ui_icon_skill.png";
|
||||
public static Image getSkillImage() { return getImage(SKILL_RES); }
|
||||
public static Image getSkillIcon() { return getIcon(SKILL_RES); }
|
||||
|
||||
private static String IMMUNITY_RES = "/com/gpl/rpg/atcontentstudio/img/ui_icon_immunity.png";
|
||||
public static Image getImmunityImage() { return getImage(IMMUNITY_RES); }
|
||||
public static Image getImmunityIcon() { return getIcon(IMMUNITY_RES); }
|
||||
|
||||
private static String ITEM_CATEGORY_RES = "/com/gpl/rpg/atcontentstudio/img/equip_weapon.png";
|
||||
public static Image getItemCategoryImage() { return getImage(ITEM_CATEGORY_RES); }
|
||||
@@ -235,6 +248,14 @@ public class DefaultIcons {
|
||||
public static Image getZoomImage() { return getImage(ZOOM_RES); }
|
||||
public static Image getZoomIcon() { return getIcon(ZOOM_RES); }
|
||||
|
||||
private static String TIMER_RES = "/com/gpl/rpg/atcontentstudio/img/timer.png";
|
||||
public static Image getTimerImage() { return getImage(TIMER_RES); }
|
||||
public static Image getTimerIcon() { return getIcon(TIMER_RES); }
|
||||
|
||||
private static String ALIGNMENT_RES = "/com/gpl/rpg/atcontentstudio/img/alignment.png";
|
||||
public static Image getAlignmentImage() { return getImage(ALIGNMENT_RES); }
|
||||
public static Image getAlignmentIcon() { return getIcon(ALIGNMENT_RES); }
|
||||
|
||||
private static String STATUS_RED_RES = "/com/gpl/rpg/atcontentstudio/img/status_red.png";
|
||||
public static Image getStatusRedImage() { return getImage(STATUS_RED_RES); }
|
||||
public static Image getStatusRedIcon() { return getIcon(STATUS_RED_RES); }
|
||||
@@ -271,7 +292,7 @@ public class DefaultIcons {
|
||||
|
||||
private static Image getIcon(String res) {
|
||||
if (iconCache.get(res) == null) {
|
||||
Image icon = getImage(res).getScaledInstance(16, 16, Image.SCALE_SMOOTH);
|
||||
Image icon = getImage(res).getScaledInstance((int)(16*ATContentStudio.SCALING), (int)(16*ATContentStudio.SCALING), Image.SCALE_SMOOTH);
|
||||
iconCache.put(res, icon);
|
||||
}
|
||||
return iconCache.get(res);
|
||||
|
||||
@@ -18,6 +18,7 @@ import javax.swing.ListModel;
|
||||
import javax.swing.event.ListDataEvent;
|
||||
import javax.swing.event.ListDataListener;
|
||||
|
||||
import com.gpl.rpg.atcontentstudio.ATContentStudio;
|
||||
import com.gpl.rpg.atcontentstudio.Notification;
|
||||
import com.gpl.rpg.atcontentstudio.NotificationListener;
|
||||
|
||||
@@ -54,7 +55,7 @@ public class NotificationsPane extends JList {
|
||||
label.setBorder(BorderFactory.createLineBorder(Color.BLUE));
|
||||
// label.setForeground(Color.WHITE);
|
||||
}
|
||||
f = f.deriveFont(10f);
|
||||
f = f.deriveFont(10f*ATContentStudio.SCALING);
|
||||
label.setFont(f);
|
||||
return label;
|
||||
}
|
||||
|
||||
35
src/com/gpl/rpg/atcontentstudio/ui/OverlayIcon.java
Normal file
35
src/com/gpl/rpg/atcontentstudio/ui/OverlayIcon.java
Normal file
@@ -0,0 +1,35 @@
|
||||
package com.gpl.rpg.atcontentstudio.ui;
|
||||
|
||||
import java.awt.Component;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Image;
|
||||
|
||||
import javax.swing.Icon;
|
||||
|
||||
public class OverlayIcon implements Icon {
|
||||
|
||||
private Image background;
|
||||
private Image overlay;
|
||||
|
||||
public OverlayIcon(Image background, Image overlay) {
|
||||
this.background = background;
|
||||
this.overlay = overlay;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintIcon(Component c, Graphics g, int x, int y) {
|
||||
g.drawImage(background, x, y, null);
|
||||
g.drawImage(overlay, x, y, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIconWidth() {
|
||||
return Math.max(background.getWidth(null), overlay.getWidth(null));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIconHeight() {
|
||||
return Math.max(background.getHeight(null), overlay.getHeight(null));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -40,7 +40,7 @@ public class StudioFrame extends JFrame {
|
||||
|
||||
private static final long serialVersionUID = -3391514100319186661L;
|
||||
|
||||
|
||||
|
||||
final ProjectsTree projectTree;
|
||||
final EditorsArea editors;
|
||||
|
||||
@@ -165,6 +165,7 @@ public class StudioFrame extends JFrame {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
try {
|
||||
UIManager.setLookAndFeel(i.getClassName());
|
||||
ATContentStudio.scaleUIFont();
|
||||
SwingUtilities.updateComponentTreeUI(ATContentStudio.frame);
|
||||
ConfigCache.setFavoriteLaFClassName(i.getClassName());
|
||||
} catch (ClassNotFoundException e1) {
|
||||
|
||||
@@ -9,6 +9,7 @@ import javax.swing.JDialog;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JOptionPane;
|
||||
|
||||
import com.gpl.rpg.atcontentstudio.ATContentStudio;
|
||||
import com.jidesoft.swing.JideBoxLayout;
|
||||
|
||||
|
||||
@@ -19,7 +20,7 @@ private static final long serialVersionUID = 8239669104275145995L;
|
||||
super(parent, "Loading...");
|
||||
this.setIconImage(DefaultIcons.getMainIconImage());
|
||||
this.getContentPane().setLayout(new JideBoxLayout(this.getContentPane(), JideBoxLayout.PAGE_AXIS, 6));
|
||||
this.getContentPane().add(new JLabel("<html><font size=5>Please wait.<br/>"+message+"</font></html>"), JideBoxLayout.VARY);
|
||||
this.getContentPane().add(new JLabel("<html><font size="+(int)(5 * ATContentStudio.SCALING)+">Please wait.<br/>"+message+"</font></html>"), JideBoxLayout.VARY);
|
||||
JMovingIdler idler = new JMovingIdler();
|
||||
idler.setBackground(Color.WHITE);
|
||||
idler.setForeground(Color.GREEN);
|
||||
@@ -46,7 +47,7 @@ private static final long serialVersionUID = 8239669104275145995L;
|
||||
info.setVisible(true);
|
||||
workload.run();
|
||||
info.dispose();
|
||||
if (showConfirm) JOptionPane.showMessageDialog(parent, "<html><font size=5>Done !</font></html>");
|
||||
if (showConfirm) JOptionPane.showMessageDialog(parent, "<html><font size="+(int)(5 * ATContentStudio.SCALING)+">Done !</font></html>");
|
||||
};
|
||||
}.start();
|
||||
}
|
||||
|
||||
@@ -35,13 +35,15 @@ public class ActorConditionEditor extends JSONElementEditor {
|
||||
private IntegerBasedCheckBox positiveBox;
|
||||
private IntegerBasedCheckBox stackingBox;
|
||||
|
||||
private JTextField roundVisualField;
|
||||
//private JTextField roundVisualField;
|
||||
private JComboBox roundVisualField;
|
||||
private JSpinner roundHpMinField;
|
||||
private JSpinner roundHpMaxField;
|
||||
private JSpinner roundApMinField;
|
||||
private JSpinner roundApMaxField;
|
||||
|
||||
private JTextField fullRoundVisualField;
|
||||
//private JTextField fullRoundVisualField;
|
||||
private JComboBox fullRoundVisualField;
|
||||
private JSpinner fullRoundHpMinField;
|
||||
private JSpinner fullRoundHpMaxField;
|
||||
private JSpinner fullRoundApMinField;
|
||||
@@ -82,7 +84,7 @@ public class ActorConditionEditor extends JSONElementEditor {
|
||||
stackingBox = addIntegerBasedCheckBox(pane, "Stacking", ac.stacking, ac.writable, listener);
|
||||
|
||||
|
||||
CollapsiblePanel roundEffectPane = new CollapsiblePanel("Effect every round (4s): ");
|
||||
CollapsiblePanel roundEffectPane = new CollapsiblePanel("Effect every round (6s): ");
|
||||
roundEffectPane.setLayout(new JideBoxLayout(roundEffectPane, JideBoxLayout.PAGE_AXIS));
|
||||
final ActorCondition.RoundEffect roundEffect;
|
||||
if (ac.round_effect != null) {
|
||||
@@ -90,7 +92,7 @@ public class ActorConditionEditor extends JSONElementEditor {
|
||||
} else {
|
||||
roundEffect = new ActorCondition.RoundEffect();
|
||||
}
|
||||
roundVisualField = addTextField(roundEffectPane, "Visual effect ID: ", roundEffect.visual_effect, ac.writable, listener);
|
||||
roundVisualField = addEnumValueBox(roundEffectPane, "Visual effect ID:", ActorCondition.VisualEffectID.values(), roundEffect.visual_effect, ac.writable, listener);//addTextField(roundEffectPane, "Visual effect ID: ", roundEffect.visual_effect, ac.writable, listener);
|
||||
roundHpMinField = addIntegerField(roundEffectPane, "HP Bonus Min: ", roundEffect.hp_boost_min, true, ac.writable, listener);
|
||||
roundHpMaxField = addIntegerField(roundEffectPane, "HP Bonus Max: ", roundEffect.hp_boost_max, true, ac.writable, listener);
|
||||
roundApMinField = addIntegerField(roundEffectPane, "AP Bonus Min: ", roundEffect.ap_boost_min, true, ac.writable, listener);
|
||||
@@ -99,7 +101,7 @@ public class ActorConditionEditor extends JSONElementEditor {
|
||||
pane.add(roundEffectPane, JideBoxLayout.FIX);
|
||||
|
||||
|
||||
CollapsiblePanel fullRoundEffectPane = new CollapsiblePanel("Effect every full round (20s): ");
|
||||
CollapsiblePanel fullRoundEffectPane = new CollapsiblePanel("Effect every full round (25s): ");
|
||||
fullRoundEffectPane.setLayout(new JideBoxLayout(fullRoundEffectPane, JideBoxLayout.PAGE_AXIS));
|
||||
final ActorCondition.RoundEffect fullRoundEffect;
|
||||
if (ac.full_round_effect != null) {
|
||||
@@ -107,7 +109,7 @@ public class ActorConditionEditor extends JSONElementEditor {
|
||||
} else {
|
||||
fullRoundEffect = new ActorCondition.RoundEffect();
|
||||
}
|
||||
fullRoundVisualField = addTextField(fullRoundEffectPane, "Visual effect ID: ", fullRoundEffect.visual_effect, ac.writable, listener);
|
||||
fullRoundVisualField = addEnumValueBox(fullRoundEffectPane, "Visual effect ID:", ActorCondition.VisualEffectID.values(), fullRoundEffect.visual_effect, ac.writable, listener);//addTextField(fullRoundEffectPane, "Visual effect ID: ", fullRoundEffect.visual_effect, ac.writable, listener);
|
||||
fullRoundHpMinField = addIntegerField(fullRoundEffectPane, "HP Bonus min: ", fullRoundEffect.hp_boost_min, true, ac.writable, listener);
|
||||
fullRoundHpMaxField = addIntegerField(fullRoundEffectPane, "HP Bonus max: ", fullRoundEffect.hp_boost_max, true, ac.writable, listener);
|
||||
fullRoundApMinField = addIntegerField(fullRoundEffectPane, "AP Bonus min: ", fullRoundEffect.ap_boost_min, true, ac.writable, listener);
|
||||
@@ -194,7 +196,7 @@ public class ActorConditionEditor extends JSONElementEditor {
|
||||
if (aCond.round_effect == null) {
|
||||
aCond.round_effect = new ActorCondition.RoundEffect();
|
||||
}
|
||||
aCond.round_effect.visual_effect = (String) value;
|
||||
aCond.round_effect.visual_effect = (ActorCondition.VisualEffectID) value;
|
||||
}
|
||||
} else if (source == roundHpMinField) {
|
||||
if (value == null) {
|
||||
@@ -264,7 +266,7 @@ public class ActorConditionEditor extends JSONElementEditor {
|
||||
if (aCond.full_round_effect == null) {
|
||||
aCond.full_round_effect = new ActorCondition.RoundEffect();
|
||||
}
|
||||
aCond.full_round_effect.visual_effect = (String) value;
|
||||
aCond.full_round_effect.visual_effect = (ActorCondition.VisualEffectID) value;
|
||||
}
|
||||
} else if (source == fullRoundHpMinField) {
|
||||
if (value == null) {
|
||||
|
||||
@@ -14,6 +14,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import javax.swing.ButtonGroup;
|
||||
import javax.swing.DefaultListCellRenderer;
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.JButton;
|
||||
@@ -22,6 +23,7 @@ import javax.swing.JComponent;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JList;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JRadioButton;
|
||||
import javax.swing.JScrollPane;
|
||||
import javax.swing.JSpinner;
|
||||
import javax.swing.JTextArea;
|
||||
@@ -50,6 +52,7 @@ import com.gpl.rpg.atcontentstudio.ui.BooleanBasedCheckBox;
|
||||
import com.gpl.rpg.atcontentstudio.ui.CollapsiblePanel;
|
||||
import com.gpl.rpg.atcontentstudio.ui.DefaultIcons;
|
||||
import com.gpl.rpg.atcontentstudio.ui.FieldUpdateListener;
|
||||
import com.gpl.rpg.atcontentstudio.ui.OverlayIcon;
|
||||
import com.gpl.rpg.atcontentstudio.ui.gamedataeditors.dialoguetree.DialogueGraphView;
|
||||
import com.jidesoft.swing.JideBoxLayout;
|
||||
|
||||
@@ -96,6 +99,9 @@ public class DialogueEditor extends JSONElementEditor {
|
||||
private JComboBox rewardObjIdCombo;
|
||||
private MyComboBox rewardObj;
|
||||
private JComponent rewardValue;
|
||||
private JRadioButton rewardConditionTimed;
|
||||
private JRadioButton rewardConditionForever;
|
||||
private JRadioButton rewardConditionClear;
|
||||
|
||||
private RepliesListModel repliesListModel;
|
||||
@SuppressWarnings("rawtypes")
|
||||
@@ -114,6 +120,7 @@ public class DialogueEditor extends JSONElementEditor {
|
||||
private JComboBox requirementTypeCombo;
|
||||
private JPanel requirementParamsPane;
|
||||
private MyComboBox requirementObj;
|
||||
private JComboBox requirementSkill;
|
||||
private JTextField requirementObjId;
|
||||
private JComponent requirementValue;
|
||||
private BooleanBasedCheckBox requirementNegated;
|
||||
@@ -357,6 +364,7 @@ public class DialogueEditor extends JSONElementEditor {
|
||||
if (rewardObj != null) {
|
||||
removeElementListener(rewardObj);
|
||||
}
|
||||
boolean immunity = false;
|
||||
if (reward.type != null) {
|
||||
switch (reward.type) {
|
||||
case activateMapObjectGroup:
|
||||
@@ -383,12 +391,59 @@ public class DialogueEditor extends JSONElementEditor {
|
||||
rewardObj = null;
|
||||
rewardValue = null;
|
||||
break;
|
||||
case actorConditionImmunity:
|
||||
immunity = true;
|
||||
case actorCondition:
|
||||
|
||||
rewardMap = null;
|
||||
rewardObjId = null;
|
||||
rewardObjIdCombo = null;
|
||||
rewardObj = addActorConditionBox(pane, ((Dialogue)target).getProject(), "Actor Condition: ", (ActorCondition) reward.reward_obj, writable, listener);
|
||||
rewardValue = addIntegerField(pane, "Duration: ", reward.reward_value, false, writable, listener);
|
||||
rewardConditionTimed = new JRadioButton("For a number of rounds");
|
||||
pane.add(rewardConditionTimed, JideBoxLayout.FIX);
|
||||
rewardValue = addIntegerField(pane, "Duration: ", reward.reward_value, 1, false, writable, listener);
|
||||
rewardConditionForever = new JRadioButton("Forever");
|
||||
pane.add(rewardConditionForever, JideBoxLayout.FIX);
|
||||
if (!immunity) {
|
||||
rewardConditionClear = new JRadioButton("Clear actor condition");
|
||||
pane.add(rewardConditionClear, JideBoxLayout.FIX);
|
||||
}
|
||||
|
||||
ButtonGroup radioGroup = new ButtonGroup();
|
||||
radioGroup.add(rewardConditionTimed);
|
||||
radioGroup.add(rewardConditionForever);
|
||||
if (!immunity) radioGroup.add(rewardConditionClear);
|
||||
|
||||
if (immunity) {
|
||||
rewardConditionTimed.setSelected(reward.reward_value == null || (reward.reward_value != ActorCondition.DURATION_FOREVER && reward.reward_value != ActorCondition.MAGNITUDE_CLEAR));
|
||||
rewardConditionForever.setSelected(reward.reward_value != null && reward.reward_value != ActorCondition.DURATION_FOREVER);
|
||||
rewardConditionClear.setSelected(reward.reward_value != null && reward.reward_value != ActorCondition.MAGNITUDE_CLEAR);
|
||||
} else {
|
||||
rewardConditionTimed.setSelected(reward.reward_value != null && reward.reward_value != ActorCondition.DURATION_FOREVER);
|
||||
rewardConditionForever.setSelected(reward.reward_value == null || reward.reward_value == ActorCondition.DURATION_FOREVER);
|
||||
}
|
||||
rewardValue.setEnabled(rewardConditionTimed.isSelected());
|
||||
|
||||
rewardConditionTimed.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
listener.valueChanged(rewardConditionTimed, new Boolean(rewardConditionTimed.isSelected()));
|
||||
}
|
||||
});
|
||||
rewardConditionForever.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
listener.valueChanged(rewardConditionForever, new Boolean(rewardConditionForever.isSelected()));
|
||||
}
|
||||
});
|
||||
if (!immunity) {
|
||||
rewardConditionClear.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
listener.valueChanged(rewardConditionClear, new Boolean(rewardConditionClear.isSelected()));
|
||||
}
|
||||
});
|
||||
}
|
||||
break;
|
||||
case alignmentChange:
|
||||
rewardMap = null;
|
||||
@@ -426,9 +481,13 @@ public class DialogueEditor extends JSONElementEditor {
|
||||
rewardValue = addQuestStageBox(pane, ((Dialogue)target).getProject(), "Quest stage: ", reward.reward_value, writable, listener, (Quest) reward.reward_obj, rewardObj);
|
||||
break;
|
||||
case skillIncrease:
|
||||
Requirement.SkillID skillId = null;
|
||||
try {
|
||||
skillId = reward.reward_obj_id == null ? null : Requirement.SkillID.valueOf(reward.reward_obj_id);
|
||||
} catch(IllegalArgumentException e) {}
|
||||
rewardMap = null;
|
||||
rewardObjId = addTextField(pane, "Skill ID: ", reward.reward_obj_id, writable, listener);
|
||||
rewardObjIdCombo = null;
|
||||
rewardObjId = null;// addTextField(pane, "Skill ID: ", reward.reward_obj_id, writable, listener);
|
||||
rewardObjIdCombo = addEnumValueBox(pane, "Skill ID: ", Requirement.SkillID.values(), skillId, writable, listener);
|
||||
rewardObj = null;
|
||||
rewardValue = null;
|
||||
break;
|
||||
@@ -684,8 +743,13 @@ public class DialogueEditor extends JSONElementEditor {
|
||||
requirementValue = addQuestStageBox(pane, project, "Quest stage: ", requirement.required_value, writable, listener, (Quest) requirement.required_obj, requirementObj);
|
||||
break;
|
||||
case skillLevel:
|
||||
Requirement.SkillID skillId = null;
|
||||
try {
|
||||
skillId = requirement.required_obj_id == null ? null : Requirement.SkillID.valueOf(requirement.required_obj_id);
|
||||
} catch(IllegalArgumentException e) {}
|
||||
requirementObj = null;
|
||||
requirementObjId = addTextField(pane, "Skill ID:", requirement.required_obj_id, writable, listener);
|
||||
requirementSkill = addEnumValueBox(pane, "Skill ID:", Requirement.SkillID.values(), skillId, writable, listener);
|
||||
requirementObjId = null;//addTextField(pane, "Skill ID:", requirement.required_obj_id, writable, listener);
|
||||
requirementValue = addIntegerField(pane, "Level: ", requirement.required_value, false, writable, listener);
|
||||
break;
|
||||
case timerElapsed:
|
||||
@@ -693,6 +757,11 @@ public class DialogueEditor extends JSONElementEditor {
|
||||
requirementObjId = addTextField(pane, "Timer ID:", requirement.required_obj_id, writable, listener);
|
||||
requirementValue = addIntegerField(pane, "Timer value: ", requirement.required_value, false, writable, listener);
|
||||
break;
|
||||
case factionScore:
|
||||
requirementObj = null;
|
||||
requirementObjId = addTextField(pane, "Faction ID:", requirement.required_obj_id, writable, listener);
|
||||
requirementValue = addIntegerField(pane, "Minimum score: ", requirement.required_value, true, writable, listener);
|
||||
break;
|
||||
case wear:
|
||||
requirementObj = addItemBox(pane, project, "Item: ", (Item) requirement.required_obj, writable, listener);
|
||||
requirementObjId = null;
|
||||
@@ -798,14 +867,27 @@ public class DialogueEditor extends JSONElementEditor {
|
||||
label.setIcon(new ImageIcon(DefaultIcons.getObjectLayerIcon()));
|
||||
break;
|
||||
case actorCondition:
|
||||
label.setText("Give actor condition "+rewardObjDesc+" for "+reward.reward_value+" turns");
|
||||
boolean rewardClear = reward.reward_value != null && reward.reward_value.intValue() == ActorCondition.MAGNITUDE_CLEAR;
|
||||
if (rewardClear) {
|
||||
label.setText("Clear actor condition "+rewardObjDesc);
|
||||
} else {
|
||||
boolean rewardForever = reward.reward_value != null && reward.reward_value.intValue() == ActorCondition.DURATION_FOREVER;
|
||||
label.setText("Give actor condition "+rewardObjDesc+(rewardForever ? " forever" : " for "+reward.reward_value+" turns"));
|
||||
}
|
||||
if (reward.reward_obj != null) label.setIcon(new ImageIcon(reward.reward_obj.getIcon()));
|
||||
break;
|
||||
case actorConditionImmunity:
|
||||
boolean rewardForever = reward.reward_value == null || reward.reward_value.intValue() == ActorCondition.DURATION_FOREVER;
|
||||
label.setText("Give immunity to actor condition "+rewardObjDesc+(rewardForever ? " forever" : " for "+reward.reward_value+" turns"));
|
||||
if (reward.reward_obj != null) label.setIcon(new OverlayIcon(reward.reward_obj.getIcon(), DefaultIcons.getImmunityIcon()));
|
||||
break;
|
||||
case alignmentChange:
|
||||
label.setText("Change alignment for faction "+rewardObjDesc+" : "+reward.reward_value);
|
||||
label.setIcon(new ImageIcon(DefaultIcons.getAlignmentIcon()));
|
||||
break;
|
||||
case createTimer:
|
||||
label.setText("Create timer "+rewardObjDesc);
|
||||
label.setIcon(new ImageIcon(DefaultIcons.getTimerIcon()));
|
||||
break;
|
||||
case deactivateMapObjectGroup:
|
||||
label.setText("Deactivate map object group "+rewardObjDesc+" on map "+reward.map_name);
|
||||
@@ -837,6 +919,7 @@ public class DialogueEditor extends JSONElementEditor {
|
||||
break;
|
||||
case skillIncrease:
|
||||
label.setText("Increase skill "+rewardObjDesc+" level");
|
||||
label.setIcon(new ImageIcon(DefaultIcons.getSkillIcon()));
|
||||
break;
|
||||
case spawnAll:
|
||||
label.setText("Respawn all monsters in spawnarea area "+rewardObjDesc+" on map "+reward.map_name);
|
||||
@@ -1071,7 +1154,18 @@ public class DialogueEditor extends JSONElementEditor {
|
||||
if (req.required_obj.getIcon() != null) {
|
||||
label.setIcon(new ImageIcon(req.required_obj.getIcon()));
|
||||
}
|
||||
} if (req.type == null) {
|
||||
} else if (req.type == Requirement.RequirementType.skillLevel) {
|
||||
label.setIcon(new ImageIcon(DefaultIcons.getSkillIcon()));
|
||||
} else if (req.type == Requirement.RequirementType.spentGold) {
|
||||
label.setIcon(new ImageIcon(DefaultIcons.getGoldIcon()));
|
||||
} else if (req.type == Requirement.RequirementType.consumedBonemeals) {
|
||||
label.setIcon(new ImageIcon(DefaultIcons.getBonemealIcon()));
|
||||
} else if (req.type == Requirement.RequirementType.timerElapsed) {
|
||||
label.setIcon(new ImageIcon(DefaultIcons.getTimerIcon()));
|
||||
} else if (req.type == Requirement.RequirementType.factionScore) {
|
||||
label.setIcon(new ImageIcon(DefaultIcons.getAlignmentIcon()));
|
||||
}
|
||||
if (req.type == null) {
|
||||
label.setText("New, undefined requirement.");
|
||||
}
|
||||
}
|
||||
@@ -1171,6 +1265,18 @@ public class DialogueEditor extends JSONElementEditor {
|
||||
if (stage != null) stage.addBacklink(dialogue);
|
||||
}
|
||||
rewardsListModel.itemChanged(selectedReward);
|
||||
} else if (source == rewardConditionClear) {
|
||||
selectedReward.reward_value = ActorCondition.MAGNITUDE_CLEAR;
|
||||
rewardValue.setEnabled(false);
|
||||
rewardsListModel.itemChanged(selectedReward);
|
||||
} else if (source == rewardConditionForever) {
|
||||
selectedReward.reward_value = ActorCondition.DURATION_FOREVER;
|
||||
rewardValue.setEnabled(false);
|
||||
rewardsListModel.itemChanged(selectedReward);
|
||||
} else if (source == rewardConditionTimed) {
|
||||
selectedReward.reward_value = (Integer) ((JSpinner)rewardValue).getValue();
|
||||
rewardValue.setEnabled(true);
|
||||
rewardsListModel.itemChanged(selectedReward);
|
||||
} else if (source == replyTypeCombo) {
|
||||
updateRepliesParamsEditorPane(repliesParamsPane, selectedReply, this);
|
||||
repliesListModel.itemChanged(selectedReply);
|
||||
@@ -1205,6 +1311,15 @@ public class DialogueEditor extends JSONElementEditor {
|
||||
selectedRequirement.required_obj_id = null;
|
||||
}
|
||||
requirementsListModel.itemChanged(selectedRequirement);
|
||||
} else if (source == requirementSkill) {
|
||||
if (selectedRequirement.required_obj != null) {
|
||||
selectedRequirement.required_obj.removeBacklink(dialogue);
|
||||
selectedRequirement.required_obj = null;
|
||||
}
|
||||
if (selectedRequirement.type == Requirement.RequirementType.skillLevel) {
|
||||
selectedRequirement.required_obj_id = value == null ? null : value.toString();
|
||||
}
|
||||
requirementsListModel.itemChanged(selectedRequirement);
|
||||
} else if (source == requirementObjId) {
|
||||
selectedRequirement.required_obj_id = (String) value;
|
||||
selectedRequirement.required_obj = null;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -95,6 +95,7 @@ public abstract class JSONElementEditor extends Editor {
|
||||
jsonEditorPane.setText(((JSONElement)target).toJsonString());
|
||||
jsonEditorPane.setEditable(((JSONElement)target).writable);
|
||||
jsonEditorPane.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JSON);
|
||||
jsonEditorPane.setFont(jsonEditorPane.getFont().deriveFont(ATContentStudio.SCALING * jsonEditorPane.getFont().getSize()));
|
||||
JPanel result = new JPanel();
|
||||
result.setLayout(new BorderLayout());
|
||||
result.add(jsonEditorPane, BorderLayout.CENTER);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -563,9 +563,8 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe
|
||||
});
|
||||
pane.add(tACPane, JideBoxLayout.FIX);
|
||||
} else if (selected instanceof ReplaceArea) {
|
||||
//Replace areas only use questProgress requirements ATM
|
||||
//requirementTypeCombo = addEnumValueBox(pane, "Requirement type: ", Requirement.RequirementType.values(), ((ReplaceArea)selected).requirement.type, ((TMXMap)target).writable, listener);
|
||||
areaField = addTextField(pane, "Area ID: ", ((ReplaceArea)selected).name, ((TMXMap)target).writable, listener);
|
||||
requirementTypeCombo = addEnumValueBox(pane, "Requirement type: ", Requirement.RequirementType.values(), ((ReplaceArea)selected).requirement.type, ((TMXMap)target).writable, listener);
|
||||
requirementParamsPane = new JPanel();
|
||||
requirementParamsPane.setLayout(new JideBoxLayout(requirementParamsPane, JideBoxLayout.PAGE_AXIS, 6));
|
||||
pane.add(requirementParamsPane, JideBoxLayout.FIX);
|
||||
@@ -698,8 +697,12 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe
|
||||
requirementValue = addQuestStageBox(pane, project, "Quest stage: ", requirement.required_value, writable, listener, (Quest) requirement.required_obj, requirementObj);
|
||||
break;
|
||||
case skillLevel:
|
||||
requirementObj = null;
|
||||
requirementObjId = addTextField(pane, "Skill ID:", requirement.required_obj_id, writable, listener);
|
||||
Requirement.SkillID skillId = null;
|
||||
try {
|
||||
skillId = requirement.required_obj_id == null ? null : Requirement.SkillID.valueOf(requirement.required_obj_id);
|
||||
} catch(IllegalArgumentException e) {}
|
||||
requirementObj = addEnumValueBox(pane, "Skill ID:", Requirement.SkillID.values(), skillId, writable, listener);
|
||||
requirementObjId = null;//addTextField(pane, "Skill ID:", requirement.required_obj_id, writable, listener);
|
||||
requirementValue = addIntegerField(pane, "Level: ", requirement.required_value, false, writable, listener);
|
||||
break;
|
||||
case timerElapsed:
|
||||
@@ -707,6 +710,11 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe
|
||||
requirementObjId = addTextField(pane, "Timer ID:", requirement.required_obj_id, writable, listener);
|
||||
requirementValue = addIntegerField(pane, "Timer value: ", requirement.required_value, false, writable, listener);
|
||||
break;
|
||||
case factionScore:
|
||||
requirementObj = null;
|
||||
requirementObjId = addTextField(pane, "Faction ID:", requirement.required_obj_id, writable, listener);
|
||||
requirementValue = addIntegerField(pane, "Minimum score: ", requirement.required_value, true, writable, listener);
|
||||
break;
|
||||
case wear:
|
||||
requirementObj = addItemBox(pane, project, "Item: ", (Item) requirement.required_obj, writable, listener);
|
||||
requirementObjId = null;
|
||||
@@ -757,6 +765,7 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe
|
||||
editorPane.setText(((TMXMap)target).toXml());
|
||||
editorPane.setEditable(false);
|
||||
editorPane.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_XML);
|
||||
editorPane.setFont(editorPane.getFont().deriveFont(ATContentStudio.SCALING * editorPane.getFont().getSize()));
|
||||
pane.add(editorPane, JideBoxLayout.VARY);
|
||||
|
||||
return pane;
|
||||
@@ -1814,6 +1823,7 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe
|
||||
}
|
||||
|
||||
|
||||
private int skipAreaFieldEvents = 0;
|
||||
|
||||
public class MapFieldUpdater implements FieldUpdateListener {
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@@ -1849,8 +1859,22 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe
|
||||
tmxViewer.revalidate();
|
||||
tmxViewer.repaint();
|
||||
} else if (source == areaField) {
|
||||
selectedMapObject.name = (String) value;
|
||||
groupObjectsListModel.objectChanged(selectedMapObject);
|
||||
if (skipAreaFieldEvents > 0) skipAreaFieldEvents--;
|
||||
else {
|
||||
selectedMapObject.name = (String) value;
|
||||
if (selectedMapObject instanceof KeyArea) {
|
||||
KeyArea area = (KeyArea) selectedMapObject;
|
||||
if (area.oldSchoolRequirement) {
|
||||
area.oldSchoolRequirement = false;
|
||||
}
|
||||
} else if (selectedMapObject instanceof ReplaceArea) {
|
||||
ReplaceArea area = (ReplaceArea) selectedMapObject;
|
||||
if (area.oldSchoolRequirement) {
|
||||
area.oldSchoolRequirement = false;
|
||||
}
|
||||
}
|
||||
groupObjectsListModel.objectChanged(selectedMapObject);
|
||||
}
|
||||
} else if (source == spawngroupField) {
|
||||
if (selectedMapObject instanceof SpawnArea) {
|
||||
SpawnArea area = (SpawnArea)selectedMapObject;
|
||||
@@ -1974,37 +1998,76 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe
|
||||
KeyArea area = (KeyArea) selectedMapObject;
|
||||
area.requirement.changeType((Requirement.RequirementType)requirementTypeCombo.getSelectedItem());
|
||||
updateRequirementParamsPane(requirementParamsPane, area.requirement, this);
|
||||
if (area.oldSchoolRequirement) area.updateNameFromRequirementChange();
|
||||
if (area.oldSchoolRequirement) {
|
||||
area.updateNameFromRequirementChange();
|
||||
skipAreaFieldEvents+=2;
|
||||
areaField.setText(area.name);
|
||||
}
|
||||
} else if (selectedMapObject instanceof ReplaceArea) {
|
||||
ReplaceArea area = (ReplaceArea) selectedMapObject;
|
||||
area.requirement.changeType((Requirement.RequirementType)requirementTypeCombo.getSelectedItem());
|
||||
updateRequirementParamsPane(requirementParamsPane, area.requirement, this);
|
||||
if (area.oldSchoolRequirement) {
|
||||
area.updateNameFromRequirementChange();
|
||||
skipAreaFieldEvents+=2;
|
||||
areaField.setText(area.name);
|
||||
}
|
||||
}
|
||||
} else if (source == requirementObj) {
|
||||
if (selectedMapObject instanceof KeyArea) {
|
||||
KeyArea area = (KeyArea) selectedMapObject;
|
||||
area.requirement.required_obj = (GameDataElement) value;
|
||||
if (area.requirement.required_obj != null) {
|
||||
area.requirement.required_obj_id = area.requirement.required_obj.id;
|
||||
if (area.requirement.type == Requirement.RequirementType.skillLevel) {
|
||||
area.requirement.required_obj_id = value == null ? null : value.toString();
|
||||
} else {
|
||||
area.requirement.required_obj_id = null;
|
||||
area.requirement.required_obj = (GameDataElement) value;
|
||||
if (area.requirement.required_obj != null) {
|
||||
area.requirement.required_obj_id = area.requirement.required_obj.id;
|
||||
} else {
|
||||
area.requirement.required_obj_id = null;
|
||||
}
|
||||
}
|
||||
if (area.oldSchoolRequirement) {
|
||||
area.updateNameFromRequirementChange();
|
||||
skipAreaFieldEvents+=2;
|
||||
areaField.setText(area.name);
|
||||
}
|
||||
if (area.oldSchoolRequirement) area.updateNameFromRequirementChange();
|
||||
} else if (selectedMapObject instanceof ReplaceArea) {
|
||||
ReplaceArea area = (ReplaceArea) selectedMapObject;
|
||||
area.requirement.required_obj = (GameDataElement) value;
|
||||
if (area.requirement.required_obj != null) {
|
||||
area.requirement.required_obj_id = area.requirement.required_obj.id;
|
||||
if (area.requirement.type == Requirement.RequirementType.skillLevel) {
|
||||
area.requirement.required_obj_id = value == null ? null : value.toString();
|
||||
} else {
|
||||
area.requirement.required_obj_id = null;
|
||||
area.requirement.required_obj = (GameDataElement) value;
|
||||
if (area.requirement.required_obj != null) {
|
||||
area.requirement.required_obj_id = area.requirement.required_obj.id;
|
||||
} else {
|
||||
area.requirement.required_obj_id = null;
|
||||
}
|
||||
}
|
||||
if (area.oldSchoolRequirement) {
|
||||
area.updateNameFromRequirementChange();
|
||||
skipAreaFieldEvents+=2;
|
||||
areaField.setText(area.name);
|
||||
}
|
||||
if (area.oldSchoolRequirement) area.updateNameFromRequirementChange();
|
||||
}
|
||||
} else if (source == requirementObjId) {
|
||||
if (selectedMapObject instanceof KeyArea) {
|
||||
KeyArea area = (KeyArea) selectedMapObject;
|
||||
area.requirement.required_obj_id = (String) value;
|
||||
area.requirement.required_obj = null;
|
||||
if (area.oldSchoolRequirement) {
|
||||
area.updateNameFromRequirementChange();
|
||||
skipAreaFieldEvents+=2;
|
||||
areaField.setText(area.name);
|
||||
}
|
||||
} else if (selectedMapObject instanceof ReplaceArea) {
|
||||
ReplaceArea area = (ReplaceArea) selectedMapObject;
|
||||
area.requirement.required_obj_id = (String) value;
|
||||
area.requirement.required_obj = null;
|
||||
if (area.oldSchoolRequirement) {
|
||||
area.updateNameFromRequirementChange();
|
||||
skipAreaFieldEvents+=2;
|
||||
areaField.setText(area.name);
|
||||
}
|
||||
}
|
||||
} else if (source == requirementValue) {
|
||||
if (selectedMapObject instanceof KeyArea) {
|
||||
@@ -2023,7 +2086,11 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe
|
||||
stage = quest.getStage(area.requirement.required_value);
|
||||
if (stage != null) stage.addBacklink(map);
|
||||
}
|
||||
if (area.oldSchoolRequirement) area.updateNameFromRequirementChange();
|
||||
if (area.oldSchoolRequirement) {
|
||||
area.updateNameFromRequirementChange();
|
||||
skipAreaFieldEvents+=2;
|
||||
areaField.setText(area.name);
|
||||
}
|
||||
} else if (selectedMapObject instanceof ReplaceArea) {
|
||||
ReplaceArea area = (ReplaceArea) selectedMapObject;
|
||||
Quest quest = null;
|
||||
@@ -2040,17 +2107,29 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe
|
||||
stage = quest.getStage(area.requirement.required_value);
|
||||
if (stage != null) stage.addBacklink(map);
|
||||
}
|
||||
if (area.oldSchoolRequirement) area.updateNameFromRequirementChange();
|
||||
if (area.oldSchoolRequirement) {
|
||||
area.updateNameFromRequirementChange();
|
||||
skipAreaFieldEvents+=2;
|
||||
areaField.setText(area.name);
|
||||
}
|
||||
}
|
||||
} else if (source == requirementNegated) {
|
||||
if (selectedMapObject instanceof KeyArea) {
|
||||
KeyArea area = (KeyArea) selectedMapObject;
|
||||
area.requirement.negated = (Boolean) value;
|
||||
if (area.oldSchoolRequirement) area.updateNameFromRequirementChange();
|
||||
if (area.oldSchoolRequirement) {
|
||||
area.updateNameFromRequirementChange();
|
||||
skipAreaFieldEvents+=2;
|
||||
areaField.setText(area.name);
|
||||
}
|
||||
} else if (selectedMapObject instanceof ReplaceArea) {
|
||||
ReplaceArea area = (ReplaceArea) selectedMapObject;
|
||||
area.requirement.negated = (Boolean) value;
|
||||
if (area.oldSchoolRequirement) area.updateNameFromRequirementChange();
|
||||
if (area.oldSchoolRequirement) {
|
||||
area.updateNameFromRequirementChange();
|
||||
skipAreaFieldEvents+=2;
|
||||
areaField.setText(area.name);
|
||||
}
|
||||
}
|
||||
} else if (source == sourceLayer) {
|
||||
selectedReplacement.sourceLayer = (String)value;
|
||||
|
||||
@@ -130,6 +130,7 @@ public class WorldMapEditor extends Editor implements FieldUpdateListener {
|
||||
editorPane.setText(((WorldmapSegment)target).toXml());
|
||||
editorPane.setEditable(false);
|
||||
editorPane.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_XML);
|
||||
editorPane.setFont(editorPane.getFont().deriveFont(ATContentStudio.SCALING * editorPane.getFont().getSize()));
|
||||
pane.add(editorPane, JideBoxLayout.VARY);
|
||||
|
||||
return pane;
|
||||
|
||||
@@ -18,7 +18,7 @@ public class DesktopIntegration {
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
Runtime.getRuntime().exec(Workspace.activeWorkspace.settings.mapEditorCommand.getCurrentValue()+" "+f.getAbsolutePath());
|
||||
Runtime.getRuntime().exec(Workspace.activeWorkspace.settings.mapEditorCommand.getCurrentValue()+" \""+f.getAbsolutePath()+"\"");
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -40,7 +40,7 @@ public class DesktopIntegration {
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
Runtime.getRuntime().exec(Workspace.activeWorkspace.settings.imageEditorCommand.getCurrentValue()+" "+f.getAbsolutePath());
|
||||
Runtime.getRuntime().exec(Workspace.activeWorkspace.settings.imageEditorCommand.getCurrentValue()+" \""+f.getAbsolutePath()+"\"");
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user