mirror of
https://github.com/AndorsTrailRelease/ATCS.git
synced 2025-10-27 18:44:03 +01:00
Compare commits
22 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
de0274a5be | ||
|
|
3d2dbb9f51 | ||
|
|
f53302cb18 | ||
|
|
8d6a40eb13 | ||
|
|
0199bcfb4c | ||
|
|
3fe895a668 | ||
|
|
025a63af28 | ||
|
|
528ac7a7e3 | ||
|
|
506afb95ed | ||
|
|
5d802ed0e3 | ||
|
|
33cbd059ec | ||
|
|
6cb0941ca6 | ||
|
|
cfb38c33d6 | ||
|
|
ec3afaaf36 | ||
|
|
9f978591ff | ||
|
|
7fff58d8f9 | ||
|
|
6192bd8dce | ||
|
|
be43a2a5d4 | ||
|
|
99524bf043 | ||
|
|
f2144ab446 | ||
|
|
ada045a13b | ||
|
|
4c4f7e5b92 |
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="WINDOWS-1252" standalone="no"?>
|
||||
<jardesc>
|
||||
<jar path="ATCS/ATCS_v0.6.4.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
packaging/ATCS_latest
Normal file
1
packaging/ATCS_latest
Normal file
@@ -0,0 +1 @@
|
||||
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.4"
|
||||
!define VERSION "0.6.7"
|
||||
!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.4";
|
||||
public static final String APP_VERSION = "v0.6.7";
|
||||
|
||||
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_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() {
|
||||
|
||||
@@ -22,6 +22,7 @@ public class ActorCondition extends JSONElement {
|
||||
private static final long serialVersionUID = -3969824899972048507L;
|
||||
|
||||
public static final Integer CLEAR_AC_MAGNITUDE = -99;
|
||||
public static final Integer FOREVER_DURATION = 999;
|
||||
|
||||
// Available from init state
|
||||
//public String id; inherited.
|
||||
@@ -43,9 +44,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 +188,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 +207,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 +234,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 +298,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 +319,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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -19,20 +19,20 @@ public class KeyArea extends MapObject {
|
||||
String requireType = obj.getProperties().getProperty("requireType");
|
||||
String requireId = obj.getProperties().getProperty("requireId");
|
||||
String requireValue = obj.getProperties().getProperty("requireValue");
|
||||
if (requireId == null) {
|
||||
oldSchoolRequirement = false;
|
||||
if (requireType == null) {
|
||||
String[] fields = obj.getName().split(":");
|
||||
if (fields.length == 2) {
|
||||
requireType = Requirement.RequirementType.questProgress.toString();
|
||||
requireValue = fields[1];
|
||||
requireId = fields[0];
|
||||
oldSchoolRequirement = true;
|
||||
} else if (fields.length == 3) {
|
||||
requireValue = fields[2];
|
||||
requireType = fields[0];
|
||||
requireId = fields[1];
|
||||
oldSchoolRequirement = true;
|
||||
}
|
||||
oldSchoolRequirement = true;
|
||||
} else {
|
||||
oldSchoolRequirement = false;
|
||||
}
|
||||
requirement = new Requirement();
|
||||
if (requireType != null) requirement.type = Requirement.RequirementType.valueOf(requireType);
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ public class WriterModeDataSet implements ProjectTreeNode, Serializable {
|
||||
|
||||
@Override
|
||||
public String getDesc() {
|
||||
return (needsSaving() ? "*" : "")+"Dialogue sketchs";
|
||||
return (needsSaving() ? "*" : "")+"Dialogue sketches";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -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,10 @@ 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 ITEM_CATEGORY_RES = "/com/gpl/rpg/atcontentstudio/img/equip_weapon.png";
|
||||
public static Image getItemCategoryImage() { return getImage(ITEM_CATEGORY_RES); }
|
||||
@@ -235,6 +244,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 +288,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);
|
||||
|
||||
@@ -316,11 +316,15 @@ public abstract class Editor extends JPanel implements ProjectElementListener {
|
||||
// }
|
||||
|
||||
public static JSpinner addIntegerField(JPanel pane, String label, Integer initialValue, boolean allowNegatives, boolean editable, final FieldUpdateListener listener) {
|
||||
return addIntegerField(pane, label, initialValue, 0, allowNegatives, editable, listener);
|
||||
}
|
||||
|
||||
public static JSpinner addIntegerField(JPanel pane, String label, Integer initialValue, Integer defaultValue, boolean allowNegatives, boolean editable, final FieldUpdateListener listener) {
|
||||
JPanel tfPane = new JPanel();
|
||||
tfPane.setLayout(new JideBoxLayout(tfPane, JideBoxLayout.LINE_AXIS, 6));
|
||||
JLabel tfLabel = new JLabel(label);
|
||||
tfPane.add(tfLabel, JideBoxLayout.FIX);
|
||||
final JSpinner spinner = new JSpinner(new SpinnerNumberModel(initialValue != null ? initialValue.intValue() : 0, allowNegatives ? Integer.MIN_VALUE : 0, Integer.MAX_VALUE, 1));
|
||||
final JSpinner spinner = new JSpinner(new SpinnerNumberModel(initialValue != null ? initialValue.intValue() : defaultValue.intValue(), allowNegatives ? Integer.MIN_VALUE : 0, Integer.MAX_VALUE, 1));
|
||||
((JSpinner.DefaultEditor)spinner.getEditor()).getTextField().setHorizontalAlignment(JTextField.LEFT);
|
||||
spinner.setEnabled(editable);
|
||||
((DefaultFormatter)((NumberEditor)spinner.getEditor()).getTextField().getFormatter()).setCommitsOnValidEdit(true);
|
||||
|
||||
@@ -338,6 +338,7 @@ public class JSONImportWizard extends JDialog {
|
||||
} else if (existingNode.getDataType() == GameSource.Type.altered) {
|
||||
errors.add("An item with id "+node.id+" is already altered in this project.");
|
||||
} else {
|
||||
node.jsonFile = existingNode.jsonFile;
|
||||
warnings.add("An item with id "+node.id+" exists in the used game source. This one will be inserted as \"altered\"");
|
||||
}
|
||||
existingNode = null;
|
||||
@@ -412,7 +413,7 @@ public class JSONImportWizard extends JDialog {
|
||||
proj.createElements(created);
|
||||
JSONElement lastNode = created.get(created.size() - 1);
|
||||
if (lastNode != null) {
|
||||
lastNode.save();
|
||||
// lastNode.save();
|
||||
ATContentStudio.frame.selectInTree(lastNode);
|
||||
}
|
||||
JSONImportWizard.this.setVisible(false);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -242,17 +242,17 @@ public class ProjectsTree extends JPanel {
|
||||
addNextSeparator = false;
|
||||
}
|
||||
|
||||
if (actions.testWriter.isEnabled()) {
|
||||
if (actions.createWriter.isEnabled()) {
|
||||
addNextSeparator = true;
|
||||
popupMenu.add(new JMenuItem(actions.testWriter));
|
||||
popupMenu.add(new JMenuItem(actions.createWriter));
|
||||
}
|
||||
// if (actions.testCommitWriter.isEnabled()) {
|
||||
// addNextSeparator = true;
|
||||
// popupMenu.add(new JMenuItem(actions.testCommitWriter));
|
||||
// }
|
||||
if (actions.createWriter.isEnabled()) {
|
||||
if (actions.generateWriter.isEnabled()) {
|
||||
addNextSeparator = true;
|
||||
popupMenu.add(new JMenuItem(actions.createWriter));
|
||||
popupMenu.add(new JMenuItem(actions.generateWriter));
|
||||
}
|
||||
if (addNextSeparator) {
|
||||
popupMenu.add(new JSeparator());
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -399,7 +399,7 @@ public class WorkspaceActions {
|
||||
};
|
||||
};
|
||||
|
||||
public ATCSAction testWriter = new ATCSAction("Create dialogue sketch", "Create a dialogue sketch for fast dialogue edition"){
|
||||
public ATCSAction createWriter = new ATCSAction("Create dialogue sketch", "Create a dialogue sketch for fast dialogue edition"){
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (selectedNode == null || selectedNode.getProject() == null) return;
|
||||
new WriterSketchCreationWizard(selectedNode.getProject()).setVisible(true);
|
||||
@@ -434,7 +434,7 @@ public class WorkspaceActions {
|
||||
}
|
||||
};*/
|
||||
|
||||
public ATCSAction createWriter = new ATCSAction("Generate dialogue sketch", "Generates a dialogue sketch from this dialogue and its tree.") {
|
||||
public ATCSAction generateWriter = new ATCSAction("Generate dialogue sketch", "Generates a dialogue sketch from this dialogue and its tree.") {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (selectedNode == null || selectedNode.getProject() == null || !(selectedNode instanceof Dialogue)) return;
|
||||
new WriterSketchCreationWizard(selectedNode.getProject(), (Dialogue)selectedNode).setVisible(true);
|
||||
@@ -472,9 +472,9 @@ public class WorkspaceActions {
|
||||
actions.add(exportProject);
|
||||
actions.add(showAbout);
|
||||
actions.add(exitATCS);
|
||||
actions.add(testWriter);
|
||||
// actions.add(testCommitWriter);
|
||||
actions.add(createWriter);
|
||||
// actions.add(testCommitWriter);
|
||||
actions.add(generateWriter);
|
||||
actions.add(editWorkspaceSettings);
|
||||
selectionChanged(null, null);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
@@ -96,6 +98,8 @@ public class DialogueEditor extends JSONElementEditor {
|
||||
private JComboBox rewardObjIdCombo;
|
||||
private MyComboBox rewardObj;
|
||||
private JComponent rewardValue;
|
||||
private JRadioButton rewardConditionTimed;
|
||||
private JRadioButton rewardConditionForever;
|
||||
|
||||
private RepliesListModel repliesListModel;
|
||||
@SuppressWarnings("rawtypes")
|
||||
@@ -114,6 +118,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;
|
||||
@@ -384,11 +389,37 @@ public class DialogueEditor extends JSONElementEditor {
|
||||
rewardValue = null;
|
||||
break;
|
||||
case actorCondition:
|
||||
|
||||
rewardMap = null;
|
||||
rewardObjId = null;
|
||||
rewardObjIdCombo = null;
|
||||
rewardObj = addActorConditionBox(pane, ((Dialogue)target).getProject(), "Actor Condition: ", (ActorCondition) reward.reward_obj, writable, listener);
|
||||
rewardConditionTimed = new JRadioButton("For a number of rounds");
|
||||
pane.add(rewardConditionTimed, JideBoxLayout.FIX);
|
||||
rewardValue = addIntegerField(pane, "Duration: ", reward.reward_value, false, writable, listener);
|
||||
rewardConditionForever = new JRadioButton("Forever");
|
||||
pane.add(rewardConditionForever, JideBoxLayout.FIX);
|
||||
|
||||
ButtonGroup radioGroup = new ButtonGroup();
|
||||
radioGroup.add(rewardConditionTimed);
|
||||
radioGroup.add(rewardConditionForever);
|
||||
|
||||
rewardConditionTimed.setSelected(reward.reward_value == null || reward.reward_value != ActorCondition.FOREVER_DURATION);
|
||||
rewardConditionForever.setSelected(!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()));
|
||||
}
|
||||
});
|
||||
|
||||
break;
|
||||
case alignmentChange:
|
||||
rewardMap = null;
|
||||
@@ -426,9 +457,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 +719,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 +733,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 +843,17 @@ 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 rewardForever = reward.reward_value != null && reward.reward_value == ActorCondition.FOREVER_DURATION;
|
||||
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 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 +885,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 +1120,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 +1231,14 @@ public class DialogueEditor extends JSONElementEditor {
|
||||
if (stage != null) stage.addBacklink(dialogue);
|
||||
}
|
||||
rewardsListModel.itemChanged(selectedReward);
|
||||
} else if (source == rewardConditionForever) {
|
||||
selectedReward.reward_value = ActorCondition.FOREVER_DURATION;
|
||||
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 +1273,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;
|
||||
|
||||
@@ -487,7 +487,7 @@ public class ItemEditor extends JSONElementEditor {
|
||||
hitSourceConditionChance = addDoubleField(pane, "Chance: ", condition.chance, writable, listener);
|
||||
hitSourceConditionApply = new JRadioButton("Apply new condition");
|
||||
pane.add(hitSourceConditionApply, JideBoxLayout.FIX);
|
||||
hitSourceConditionMagnitude = addIntegerField(pane, "Magnitude: ", condition.magnitude == null ? null : condition.magnitude >= 0 ? condition.magnitude : 0, false, writable, listener);
|
||||
hitSourceConditionMagnitude = addIntegerField(pane, "Magnitude: ", condition.magnitude == null ? null : condition.magnitude >= 0 ? condition.magnitude : 0, 1, false, writable, listener);
|
||||
hitSourceConditionDuration = addIntegerField(pane, "Duration: ", condition.duration, false, writable, listener);
|
||||
hitSourceConditionClear = new JRadioButton("Clear active condition");
|
||||
pane.add(hitSourceConditionClear, JideBoxLayout.FIX);
|
||||
@@ -543,7 +543,7 @@ public class ItemEditor extends JSONElementEditor {
|
||||
hitTargetConditionChance = addDoubleField(pane, "Chance: ", condition.chance, writable, listener);
|
||||
hitTargetConditionApply = new JRadioButton("Apply new condition");
|
||||
pane.add(hitTargetConditionApply, JideBoxLayout.FIX);
|
||||
hitTargetConditionMagnitude = addIntegerField(pane, "Magnitude: ", condition.magnitude == null ? null : condition.magnitude >= 0 ? condition.magnitude : 0, false, writable, listener);
|
||||
hitTargetConditionMagnitude = addIntegerField(pane, "Magnitude: ", condition.magnitude == null ? null : condition.magnitude >= 0 ? condition.magnitude : 0, 1, false, writable, listener);
|
||||
hitTargetConditionDuration = addIntegerField(pane, "Duration: ", condition.duration, false, writable, listener);
|
||||
hitTargetConditionClear = new JRadioButton("Clear active condition");
|
||||
pane.add(hitTargetConditionClear, JideBoxLayout.FIX);
|
||||
@@ -599,7 +599,7 @@ public class ItemEditor extends JSONElementEditor {
|
||||
killSourceConditionChance = addDoubleField(pane, "Chance: ", condition.chance, writable, listener);
|
||||
killSourceConditionApply = new JRadioButton("Apply new condition");
|
||||
pane.add(killSourceConditionApply, JideBoxLayout.FIX);
|
||||
killSourceConditionMagnitude = addIntegerField(pane, "Magnitude: ", condition.magnitude == null ? null : condition.magnitude >= 0 ? condition.magnitude : 0, false, writable, listener);
|
||||
killSourceConditionMagnitude = addIntegerField(pane, "Magnitude: ", condition.magnitude == null ? null : condition.magnitude >= 0 ? condition.magnitude : 0, 1, false, writable, listener);
|
||||
killSourceConditionDuration = addIntegerField(pane, "Duration: ", condition.duration, false, writable, listener);
|
||||
killSourceConditionClear = new JRadioButton("Clear active condition");
|
||||
pane.add(killSourceConditionClear, JideBoxLayout.FIX);
|
||||
@@ -651,7 +651,7 @@ public class ItemEditor extends JSONElementEditor {
|
||||
Project proj = ((Item)target).getProject();
|
||||
|
||||
equipConditionBox = addActorConditionBox(pane, proj, "Actor Condition: ", condition.condition, writable, listener);
|
||||
equipConditionMagnitude = addIntegerField(pane, "Magnitude: ", condition.magnitude, false, writable, listener);
|
||||
equipConditionMagnitude = addIntegerField(pane, "Magnitude: ", condition.magnitude, 1, false, writable, listener);
|
||||
|
||||
pane.revalidate();
|
||||
pane.repaint();
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -181,12 +181,12 @@ public class NPCEditor extends JSONElementEditor {
|
||||
moveTypeBox = addEnumValueBox(pane, "Movement type: ", NPC.MovementType.values(), npc.movement_type, npc.writable, listener);
|
||||
combatTraitPane = new CollapsiblePanel("Combat traits: ");
|
||||
combatTraitPane.setLayout(new JideBoxLayout(combatTraitPane, JideBoxLayout.PAGE_AXIS, 6));
|
||||
maxHP = addIntegerField(combatTraitPane, "Max HP: ", npc.max_hp, false, npc.writable, listener);
|
||||
maxAP = addIntegerField(combatTraitPane, "Max AP: ", npc.max_ap, false, npc.writable, listener);
|
||||
moveCost = addIntegerField(combatTraitPane, "Move cost: ", npc.move_cost, false, npc.writable, listener);
|
||||
maxHP = addIntegerField(combatTraitPane, "Max HP: ", npc.max_hp, 1, false, npc.writable, listener);
|
||||
maxAP = addIntegerField(combatTraitPane, "Max AP: ", npc.max_ap, 10, false, npc.writable, listener);
|
||||
moveCost = addIntegerField(combatTraitPane, "Move cost: ", npc.move_cost, 10, false, npc.writable, listener);
|
||||
atkDmgMin = addIntegerField(combatTraitPane, "Attack Damage min: ", npc.attack_damage_min, false, npc.writable, listener);
|
||||
atkDmgMax = addIntegerField(combatTraitPane, "Attack Damage max: ", npc.attack_damage_max, false, npc.writable, listener);
|
||||
atkCost = addIntegerField(combatTraitPane, "Attack cost: ", npc.attack_cost, false, npc.writable, listener);
|
||||
atkCost = addIntegerField(combatTraitPane, "Attack cost: ", npc.attack_cost, 10, false, npc.writable, listener);
|
||||
atkChance = addIntegerField(combatTraitPane, "Attack chance: ", npc.attack_chance, false, npc.writable, listener);
|
||||
critSkill = addIntegerField(combatTraitPane, "Critical skill: ", npc.critical_skill, false, npc.writable, listener);
|
||||
critMult = addDoubleField(combatTraitPane, "Critical multiplier: ", npc.critical_multiplier, npc.writable, listener);
|
||||
@@ -323,7 +323,7 @@ public class NPCEditor extends JSONElementEditor {
|
||||
Project proj = ((NPC)target).getProject();
|
||||
|
||||
sourceConditionBox = addActorConditionBox(pane, proj, "Actor Condition: ", condition.condition, writable, listener);
|
||||
sourceConditionMagnitude = addIntegerField(pane, "Magnitude: ", condition.magnitude, false, writable, listener);
|
||||
sourceConditionMagnitude = addIntegerField(pane, "Magnitude: ", condition.magnitude, 1, false, writable, listener);
|
||||
sourceConditionDuration = addIntegerField(pane, "Duration: ", condition.duration, false, writable, listener);
|
||||
sourceConditionChance = addDoubleField(pane, "Chance: ", condition.chance, writable, listener);
|
||||
|
||||
@@ -341,7 +341,7 @@ public class NPCEditor extends JSONElementEditor {
|
||||
Project proj = ((NPC)target).getProject();
|
||||
|
||||
targetConditionBox = addActorConditionBox(pane, proj, "Actor Condition: ", condition.condition, writable, listener);
|
||||
targetConditionMagnitude = addIntegerField(pane, "Magnitude: ", condition.magnitude, false, writable, listener);
|
||||
targetConditionMagnitude = addIntegerField(pane, "Magnitude: ", condition.magnitude, 1, false, writable, listener);
|
||||
targetConditionDuration = addIntegerField(pane, "Duration: ", condition.duration, false, writable, listener);
|
||||
targetConditionChance = addDoubleField(pane, "Chance: ", condition.chance, writable, listener);
|
||||
|
||||
|
||||
@@ -206,11 +206,12 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe
|
||||
|
||||
JScrollPane tmxScroller = new JScrollPane(getTmxEditorPane(), JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
|
||||
JScrollPane xmlScroller = new JScrollPane(getXmlEditorPane(), JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
|
||||
JScrollPane replScroller = new JScrollPane(getReplacementSimulatorPane(), JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
|
||||
//JScrollPane replScroller = new JScrollPane(getReplacementSimulatorPane(), JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
|
||||
xmlScroller.getVerticalScrollBar().setUnitIncrement(16);
|
||||
editorTabsHolder.add("TMX", tmxScroller);
|
||||
editorTabsHolder.add("XML", xmlScroller);
|
||||
editorTabsHolder.add("Replacements", replScroller);
|
||||
//editorTabsHolder.add("Replacements", replScroller);
|
||||
editorTabsHolder.add("Replacements", getReplacementSimulatorPane());
|
||||
|
||||
}
|
||||
|
||||
@@ -523,6 +524,7 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe
|
||||
if (selected instanceof ContainerArea) {
|
||||
droplistBox = addDroplistBox(pane, ((TMXMap)target).getProject(), "Droplist: ", ((ContainerArea)selected).droplist, ((TMXMap)target).writable, listener);
|
||||
} else if (selected instanceof KeyArea) {
|
||||
areaField = addTextField(pane, "Area ID: ", ((KeyArea)selected).name, ((TMXMap)target).writable, listener);
|
||||
dialogueBox = addDialogueBox(pane, ((TMXMap)target).getProject(), "Message when locked: ", ((KeyArea)selected).dialogue, ((TMXMap)target).writable, listener);
|
||||
requirementTypeCombo = addEnumValueBox(pane, "Requirement type: ", Requirement.RequirementType.values(), ((KeyArea)selected).requirement.type, ((TMXMap)target).writable, listener);
|
||||
requirementParamsPane = new JPanel();
|
||||
@@ -561,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);
|
||||
@@ -696,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:
|
||||
@@ -705,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;
|
||||
@@ -755,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;
|
||||
@@ -785,7 +796,7 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe
|
||||
activateAndViewPane.setLayout(new JideBoxLayout(activateAndViewPane, JideBoxLayout.LINE_AXIS));
|
||||
|
||||
activateAndViewPane.add(areasActivationPane, JideBoxLayout.FIX);
|
||||
activateAndViewPane.add(viewer, JideBoxLayout.VARY);
|
||||
activateAndViewPane.add(new JScrollPane(viewer), JideBoxLayout.VARY);
|
||||
|
||||
replacementSimulator.add(walkableVisibleBox, JideBoxLayout.FIX);
|
||||
replacementSimulator.add(activateAndViewPane, JideBoxLayout.VARY);
|
||||
@@ -1812,6 +1823,7 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe
|
||||
}
|
||||
|
||||
|
||||
private int skipAreaFieldEvents = 0;
|
||||
|
||||
public class MapFieldUpdater implements FieldUpdateListener {
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@@ -1847,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;
|
||||
@@ -1972,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) {
|
||||
@@ -2021,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;
|
||||
@@ -2038,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;
|
||||
@@ -2062,9 +2143,9 @@ public class TMXMapEditor extends Editor implements TMXMap.MapChangedOnDiskListe
|
||||
if (modified) {
|
||||
if (map.state != GameDataElement.State.modified) {
|
||||
map.state = GameDataElement.State.modified;
|
||||
map.childrenChanged(new ArrayList<ProjectTreeNode>());
|
||||
ATContentStudio.frame.editorChanged(TMXMapEditor.this);
|
||||
}
|
||||
map.childrenChanged(new ArrayList<ProjectTreeNode>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -10,14 +10,18 @@ import java.awt.event.FocusListener;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.geom.Point2D;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.swing.AbstractAction;
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JEditorPane;
|
||||
import javax.swing.JInternalFrame;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JScrollPane;
|
||||
@@ -57,6 +61,9 @@ import prefuse.visual.EdgeItem;
|
||||
import prefuse.visual.VisualItem;
|
||||
import prefuse.visual.expression.InGroupPredicate;
|
||||
|
||||
import com.gpl.rpg.atcontentstudio.ATContentStudio;
|
||||
import com.gpl.rpg.atcontentstudio.model.GameDataElement;
|
||||
import com.gpl.rpg.atcontentstudio.model.ProjectTreeNode;
|
||||
import com.gpl.rpg.atcontentstudio.model.gamedata.Dialogue;
|
||||
import com.gpl.rpg.atcontentstudio.model.tools.writermode.WriterModeData;
|
||||
import com.gpl.rpg.atcontentstudio.model.tools.writermode.WriterModeData.EmptyReply;
|
||||
@@ -71,8 +78,19 @@ import com.jidesoft.swing.JideBoxLayout;
|
||||
public class WriterModeEditor extends Editor {
|
||||
|
||||
private static final long serialVersionUID = -6591631891278528494L;
|
||||
|
||||
private static final String HELP_TEXT =
|
||||
"<html><body><table>"
|
||||
+ "<tr><td valign=\"middle\">(Esc.)</td><td valign=\"middle\"> Cancel edition</td></tr>"
|
||||
+ "<tr><td valign=\"middle\">(Ctrl+Enter)</td><td valign=\"middle\"> Confirm changes</td></tr>"
|
||||
+ "<tr><td valign=\"middle\">(Shift+Enter)</td><td valign=\"middle\"> Create next of same kind</td></tr>"
|
||||
+ "<tr><td valign=\"middle\">(Alt+Enter)</td><td valign=\"middle\"> Create next of other kind</td></tr>"
|
||||
+ "</table></body></html>";
|
||||
|
||||
|
||||
|
||||
private JComponent overlay = null;
|
||||
private JComponent helpWindow = null;
|
||||
private Display view;
|
||||
|
||||
final private WriterModeData data;
|
||||
@@ -87,12 +105,19 @@ public class WriterModeEditor extends Editor {
|
||||
selected = data.begin;
|
||||
view = new WriterGraphView();
|
||||
view.setLocation(0, 0);
|
||||
|
||||
setLayout(new BorderLayout());
|
||||
add(createButtonPane(), BorderLayout.NORTH);
|
||||
add(view, BorderLayout.CENTER);
|
||||
}
|
||||
|
||||
|
||||
public void dataAltered() {
|
||||
data.state = GameDataElement.State.modified;
|
||||
data.childrenChanged(new ArrayList<ProjectTreeNode>());
|
||||
ATContentStudio.frame.editorChanged(this);
|
||||
}
|
||||
|
||||
public JPanel createButtonPane() {
|
||||
JPanel pane = new JPanel();
|
||||
pane.setLayout(new JideBoxLayout(pane, JideBoxLayout.LINE_AXIS));
|
||||
@@ -102,6 +127,8 @@ public class WriterModeEditor extends Editor {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
data.save();
|
||||
data.childrenChanged(new ArrayList<ProjectTreeNode>());
|
||||
ATContentStudio.frame.editorChanged(WriterModeEditor.this);
|
||||
}
|
||||
});
|
||||
export.addActionListener(new ActionListener() {
|
||||
@@ -111,6 +138,8 @@ public class WriterModeEditor extends Editor {
|
||||
data.getProject().createElements(created);
|
||||
//data.begin.dialogue.save();
|
||||
data.save();
|
||||
data.childrenChanged(new ArrayList<ProjectTreeNode>());
|
||||
ATContentStudio.frame.editorChanged(WriterModeEditor.this);
|
||||
}
|
||||
});
|
||||
pane.add(save, JideBoxLayout.FIX);
|
||||
@@ -135,6 +164,22 @@ public class WriterModeEditor extends Editor {
|
||||
}
|
||||
|
||||
|
||||
private void createHelpWindow() {
|
||||
JInternalFrame window = new JInternalFrame("Help", true, true);
|
||||
window.setLayout(new BorderLayout());
|
||||
JEditorPane area = new JEditorPane();
|
||||
area.setContentType("text/html");
|
||||
area.setText(HELP_TEXT);
|
||||
area.setEditable(false);
|
||||
|
||||
window.add(new JScrollPane(area));
|
||||
window.setSize(350, 250);
|
||||
window.setLocation(0, 0);
|
||||
|
||||
view.add(window);
|
||||
helpWindow = window;
|
||||
}
|
||||
|
||||
public static final String GRAPH = "graph";
|
||||
public static final String NODES = "graph.nodes";
|
||||
public static final String NULL_NODES = "graph.nullNodes";
|
||||
@@ -587,6 +632,7 @@ public class WriterModeEditor extends Editor {
|
||||
addEdge(selected, target);
|
||||
}
|
||||
}
|
||||
dataAltered();
|
||||
}
|
||||
|
||||
static final String disposeEditorString = "disposeEditor";
|
||||
@@ -612,6 +658,7 @@ public class WriterModeEditor extends Editor {
|
||||
revalidate();
|
||||
repaint();
|
||||
disposeOverlay();
|
||||
dataAltered();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -654,6 +701,7 @@ public class WriterModeEditor extends Editor {
|
||||
revalidate();
|
||||
repaint();
|
||||
}
|
||||
dataAltered();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -695,7 +743,7 @@ public class WriterModeEditor extends Editor {
|
||||
revalidate();
|
||||
repaint();
|
||||
}
|
||||
|
||||
dataAltered();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -721,7 +769,20 @@ public class WriterModeEditor extends Editor {
|
||||
revalidate();
|
||||
repaint();
|
||||
}
|
||||
|
||||
dataAltered();
|
||||
}
|
||||
};
|
||||
|
||||
static final String showHelpString = "showHelp";
|
||||
final AbstractAction showHelp = new AbstractAction("Show help window") {
|
||||
private static final long serialVersionUID = 1658086056088672748L;
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (helpWindow == null) {
|
||||
createHelpWindow();
|
||||
}
|
||||
helpWindow.setVisible(true);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -812,6 +873,8 @@ public class WriterModeEditor extends Editor {
|
||||
area.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, KeyEvent.ALT_DOWN_MASK, true), commitAndCreateNextDefaultNodeString);
|
||||
area.getActionMap().put(commitAndCreateNextDefaultNodeString, commitAndCreateNextDefaultNode);
|
||||
|
||||
area.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_F1, 0, true), showHelpString);
|
||||
area.getActionMap().put(showHelpString, showHelp);
|
||||
|
||||
if (selected instanceof WriterDialogue) {
|
||||
area.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, KeyEvent.SHIFT_DOWN_MASK, true), createContinueTalkingNodeString);
|
||||
@@ -1081,8 +1144,8 @@ public class WriterModeEditor extends Editor {
|
||||
|
||||
@Override
|
||||
public void targetUpdated() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
this.icon = new ImageIcon(((GameDataElement)target).getIcon());
|
||||
this.name = ((GameDataElement)target).getDesc();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -128,13 +128,13 @@ public class FileUtils {
|
||||
case Windows:
|
||||
System.err.println("Trying the Windows way with mklink");
|
||||
try {
|
||||
Runtime.getRuntime().exec("cmd.exe /C mklink "+(targetFile.isDirectory() ? "/J " : "")+linkFile.getAbsolutePath()+" "+targetFile.getAbsolutePath());
|
||||
Runtime.getRuntime().exec("cmd.exe /C mklink "+(targetFile.isDirectory() ? "/J " : "")+"\""+linkFile.getAbsolutePath()+"\" \""+targetFile.getAbsolutePath()+"\"");
|
||||
} catch (IOException e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
System.err.println("Attempting UAC elevation through VBS script.");
|
||||
if (!linkFile.exists()) {
|
||||
runWithUac("cmd.exe /C mklink "+(targetFile.isDirectory() ? "/J " : "")+linkFile.getAbsolutePath()+" "+targetFile.getAbsolutePath(), 3, linkFile);
|
||||
System.err.println("Attempting UAC elevation through VBS script.");
|
||||
runWithUac("cmd.exe /C mklink "+(targetFile.isDirectory() ? "/J " : "")+"\""+linkFile.getAbsolutePath()+"\" \""+targetFile.getAbsolutePath()+"\"", 3, linkFile);
|
||||
}
|
||||
break;
|
||||
case MacOS:
|
||||
|
||||
Reference in New Issue
Block a user