diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..3e9de3b
--- /dev/null
+++ b/.idea/codeStyles/Project.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml
new file mode 100644
index 0000000..79ee123
--- /dev/null
+++ b/.idea/codeStyles/codeStyleConfig.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 4944549..1e030a1 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -1,4 +1,4 @@
-
+
\ No newline at end of file
diff --git a/hacked-libtiled/tiled/core/MapObject.java b/hacked-libtiled/tiled/core/MapObject.java
index 111b825..8e75282 100644
--- a/hacked-libtiled/tiled/core/MapObject.java
+++ b/hacked-libtiled/tiled/core/MapObject.java
@@ -43,7 +43,7 @@ public class MapObject implements Cloneable
{
private Properties properties = new Properties();
private ObjectGroup objectGroup;
- private Rectangle bounds = new Rectangle();
+ private Rectangle bounds;
private String name = "Object";
private String type = "";
private String imageSource = "";
diff --git a/hacked-libtiled/tiled/core/Sprite.java b/hacked-libtiled/tiled/core/Sprite.java
index 670bc4c..266c6ec 100644
--- a/hacked-libtiled/tiled/core/Sprite.java
+++ b/hacked-libtiled/tiled/core/Sprite.java
@@ -57,7 +57,7 @@ public class Sprite
private String name = null;
private int id = -1;
- private int flags = KEY_LOOP;
+ private int flags;
private float frameRate = 1.0f; //one fps
private Tile[] frames;
diff --git a/hacked-libtiled/tiled/io/TMXMapWriter.java b/hacked-libtiled/tiled/io/TMXMapWriter.java
index 9004af8..600a409 100644
--- a/hacked-libtiled/tiled/io/TMXMapWriter.java
+++ b/hacked-libtiled/tiled/io/TMXMapWriter.java
@@ -588,7 +588,7 @@ public class TMXMapWriter
}
// Iterate while parents are the same
- int shared = 0;
+ int shared;
int maxShared = Math.min(fromParents.size(), toParents.size());
for (shared = 0; shared < maxShared; shared++) {
String fromParent = fromParents.get(shared);
diff --git a/src/com/gpl/rpg/atcontentstudio/ATContentStudio.java b/src/com/gpl/rpg/atcontentstudio/ATContentStudio.java
index 2833a61..3d96057 100644
--- a/src/com/gpl/rpg/atcontentstudio/ATContentStudio.java
+++ b/src/com/gpl/rpg/atcontentstudio/ATContentStudio.java
@@ -1,10 +1,16 @@
package com.gpl.rpg.atcontentstudio;
-import java.awt.Color;
-import java.awt.Desktop;
-import java.awt.Dimension;
-import java.awt.Font;
-import java.awt.Toolkit;
+import com.gpl.rpg.atcontentstudio.model.Workspace;
+import com.gpl.rpg.atcontentstudio.ui.StudioFrame;
+import com.gpl.rpg.atcontentstudio.ui.WorkerDialog;
+import com.gpl.rpg.atcontentstudio.ui.WorkspaceSelector;
+import prefuse.data.expression.parser.ExpressionParser;
+
+import javax.swing.*;
+import javax.swing.event.HyperlinkEvent;
+import javax.swing.event.HyperlinkListener;
+import javax.swing.plaf.FontUIResource;
+import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.BufferedReader;
@@ -14,225 +20,212 @@ import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.net.URL;
+import java.util.List;
import java.util.*;
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 prefuse.data.expression.parser.ExpressionParser;
-
-import com.gpl.rpg.atcontentstudio.model.Workspace;
-import com.gpl.rpg.atcontentstudio.ui.StudioFrame;
-import com.gpl.rpg.atcontentstudio.ui.WorkerDialog;
-import com.gpl.rpg.atcontentstudio.ui.WorkspaceSelector;
-
public class ATContentStudio {
- public static final String APP_NAME = "Andor's Trail Content Studio";
-public static final String APP_VERSION = readVersionFromFile();
- 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 APP_NAME = "Andor's Trail Content Studio";
+ public static final String APP_VERSION = readVersionFromFile();
- public static final String FONT_SCALE_ENV_VAR_NAME = "FONT_SCALE";
+ 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 boolean STARTED = false;
- public static float SCALING = 1.0f;
- public static StudioFrame frame = null;
+ public static final String FONT_SCALE_ENV_VAR_NAME = "FONT_SCALE";
- // Need to keep a strong reference to it, to avoid garbage collection that'll
- // reset these loggers.
- public static final List configuredLoggers = new LinkedList();
+ public static boolean STARTED = false;
+ public static float SCALING = 1.0f;
+ public static StudioFrame frame = null;
- /**
- * @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();
- }
- }
+ // Need to keep a strong reference to it, to avoid garbage collection that'll
+ // reset these loggers.
+ public static final List configuredLoggers = new LinkedList();
- ConfigCache.init();
+ /**
+ * @param args
+ */
+ public static void main(String[] args) {
+ String fontScaling = System.getProperty(FONT_SCALE_ENV_VAR_NAME);
+ Float fontScale;
+ 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();
+ }
+ }
- try {
- String laf = ConfigCache.getFavoriteLaFClassName();
- if (laf == null)
- laf = UIManager.getSystemLookAndFeelClassName();
- UIManager.setLookAndFeel(laf);
- } catch (ClassNotFoundException e) {
- e.printStackTrace();
- } catch (InstantiationException e) {
- e.printStackTrace();
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- } catch (UnsupportedLookAndFeelException e) {
- e.printStackTrace();
- }
+ ConfigCache.init();
- scaleUIFont();
+ try {
+ String laf = ConfigCache.getFavoriteLaFClassName();
+ if (laf == null)
+ laf = UIManager.getSystemLookAndFeelClassName();
+ UIManager.setLookAndFeel(laf);
+ } catch (ClassNotFoundException e) {
+ e.printStackTrace();
+ } catch (InstantiationException e) {
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ } catch (UnsupportedLookAndFeelException e) {
+ e.printStackTrace();
+ }
- // Need to keep a strong reference to it, to avoid garbage collection that'll
- // reset this setting.
- Logger l = Logger.getLogger(ExpressionParser.class.getName());
- l.setLevel(Level.OFF);
- configuredLoggers.add(l);
+ scaleUIFont();
- final WorkspaceSelector wsSelect = new WorkspaceSelector();
- wsSelect.pack();
- Dimension sdim = Toolkit.getDefaultToolkit().getScreenSize();
- Dimension wdim = wsSelect.getSize();
- wsSelect.setLocation((sdim.width - wdim.width) / 2, (sdim.height - wdim.height) / 2);
- wsSelect.setVisible(true);
+ // Need to keep a strong reference to it, to avoid garbage collection that'll
+ // reset this setting.
+ Logger l = Logger.getLogger(ExpressionParser.class.getName());
+ l.setLevel(Level.OFF);
+ configuredLoggers.add(l);
- wsSelect.addWindowListener(new WindowAdapter() {
- @Override
- public synchronized void windowClosed(WindowEvent e) {
- if (wsSelect.selected != null && !STARTED) {
- ATContentStudio.STARTED = true;
- final File workspaceRoot = new File(wsSelect.selected);
- WorkerDialog.showTaskMessage("Loading your workspace...", null, new Runnable() {
- public void run() {
- Workspace.setActive(workspaceRoot);
- if (Workspace.activeWorkspace.settings.useInternet.getCurrentValue()
- && Workspace.activeWorkspace.settings.checkUpdates.getCurrentValue()) {
- new Thread() {
- public void run() {
- checkUpdate();
- }
- }.start();
- }
- frame = new StudioFrame(APP_NAME + " " + APP_VERSION);
- frame.setVisible(true);
- frame.setDefaultCloseOperation(StudioFrame.DO_NOTHING_ON_CLOSE);
- };
- });
- for (File f : ConfigCache.getKnownWorkspaces()) {
- if (workspaceRoot.equals(f)) {
- if (!workspaceRoot.equals(ConfigCache.getLatestWorkspace())) {
- ConfigCache.setLatestWorkspace(f);
- }
- return;
- }
- }
- ConfigCache.addWorkspace(workspaceRoot);
- ConfigCache.setLatestWorkspace(workspaceRoot);
+ final WorkspaceSelector wsSelect = new WorkspaceSelector();
+ wsSelect.pack();
+ Dimension sdim = Toolkit.getDefaultToolkit().getScreenSize();
+ Dimension wdim = wsSelect.getSize();
+ wsSelect.setLocation((sdim.width - wdim.width) / 2, (sdim.height - wdim.height) / 2);
+ wsSelect.setVisible(true);
- }
- }
- });
- }
+ wsSelect.addWindowListener(new WindowAdapter() {
+ @Override
+ public synchronized void windowClosed(WindowEvent e) {
+ if (wsSelect.selected != null && !STARTED) {
+ ATContentStudio.STARTED = true;
+ final File workspaceRoot = new File(wsSelect.selected);
+ WorkerDialog.showTaskMessage("Loading your workspace...", null, new Runnable() {
+ public void run() {
+ Workspace.setActive(workspaceRoot);
+ if (Workspace.activeWorkspace.settings.useInternet.getCurrentValue()
+ && Workspace.activeWorkspace.settings.checkUpdates.getCurrentValue()) {
+ new Thread() {
+ public void run() {
+ checkUpdate();
+ }
+ }.start();
+ }
+ frame = new StudioFrame(APP_NAME + " " + APP_VERSION);
+ frame.setVisible(true);
+ frame.setDefaultCloseOperation(StudioFrame.DO_NOTHING_ON_CLOSE);
+ }
- private static void checkUpdate() {
- BufferedReader in = null;
- try {
- URL url = new URL(CHECK_UPDATE_URL);
- in = new BufferedReader(new InputStreamReader(url.openStream()));
+ });
+ for (File f : ConfigCache.getKnownWorkspaces()) {
+ if (workspaceRoot.equals(f)) {
+ if (!workspaceRoot.equals(ConfigCache.getLatestWorkspace())) {
+ ConfigCache.setLatestWorkspace(f);
+ }
+ return;
+ }
+ }
+ ConfigCache.addWorkspace(workspaceRoot);
+ ConfigCache.setLatestWorkspace(workspaceRoot);
- String inputLine, lastLine = null;
- while ((inputLine = in.readLine()) != null) {
- lastLine = inputLine;
- }
- if (lastLine != null && !lastLine.equals(APP_VERSION)) {
+ }
+ }
+ });
+ }
- // for copying style
- JLabel label = new JLabel();
- Font font = label.getFont();
- Color color = label.getBackground();
+ private static void checkUpdate() {
+ BufferedReader in = null;
+ try {
+ URL url = new URL(CHECK_UPDATE_URL);
+ in = new BufferedReader(new InputStreamReader(url.openStream()));
- // create some css from the label's font
- StringBuffer style = new StringBuffer("font-family:" + font.getFamily() + ";");
- style.append("font-weight:" + (font.isBold() ? "bold" : "normal") + ";");
- style.append("font-size:" + font.getSize() + "pt;");
- style.append("background-color: rgb(" + color.getRed() + "," + color.getGreen() + "," + color.getBlue()
- + ");");
+ String inputLine, lastLine = null;
+ while ((inputLine = in.readLine()) != null) {
+ lastLine = inputLine;
+ }
+ if (lastLine != null && !lastLine.equals(APP_VERSION)) {
- JEditorPane ep = new JEditorPane("text/html",
- "" + "You are not running the latest ATCS version.
"
- + "You can get the latest version (" + lastLine + ") by clicking the link below.
"
- + "" + DOWNLOAD_URL + "
" + "
"
- + "");
+ // for copying style
+ JLabel label = new JLabel();
+ Font font = label.getFont();
+ Color color = label.getBackground();
- ep.setEditable(false);
- ep.setBorder(null);
+ // create some css from the label's font
+ StringBuffer style = new StringBuffer("font-family:" + font.getFamily() + ";");
+ style.append("font-weight:" + (font.isBold() ? "bold" : "normal") + ";");
+ style.append("font-size:" + font.getSize() + "pt;");
+ style.append("background-color: rgb(" + color.getRed() + "," + color.getGreen() + "," + color.getBlue()
+ + ");");
- ep.addHyperlinkListener(new HyperlinkListener() {
+ JEditorPane ep = new JEditorPane("text/html",
+ "" + "You are not running the latest ATCS version.
"
+ + "You can get the latest version (" + lastLine + ") by clicking the link below.
"
+ + "" + DOWNLOAD_URL + "
" + "
"
+ + "");
- @Override
- public void hyperlinkUpdate(HyperlinkEvent e) {
- try {
- if (e.getEventType().equals(HyperlinkEvent.EventType.ACTIVATED)) {
- Desktop.getDesktop().browse(e.getURL().toURI());
- }
- } catch (IOException e1) {
- e1.printStackTrace();
- } catch (URISyntaxException e1) {
- e1.printStackTrace();
- }
- }
- });
+ ep.setEditable(false);
+ ep.setBorder(null);
- JOptionPane.showMessageDialog(null, ep, "Update available", JOptionPane.INFORMATION_MESSAGE);
- }
- } catch (MalformedURLException e) {
- e.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- } finally {
- try {
- if (in != null)
- in.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
+ ep.addHyperlinkListener(new HyperlinkListener() {
- public static void scaleUIFont() {
- if (SCALING != 1.0f) {
- System.out.println("Scaling fonts to " + SCALING);
- UIDefaults defaults = UIManager.getLookAndFeelDefaults();
- Map