diff --git a/.classpath b/.classpath
index 4c9cb38..34382c4 100644
--- a/.classpath
+++ b/.classpath
@@ -1,18 +1,18 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ATCS_JAR.jardesc b/ATCS_JAR.jardesc
index 167a5a5..209105e 100644
--- a/ATCS_JAR.jardesc
+++ b/ATCS_JAR.jardesc
@@ -1,6 +1,6 @@
-
+
diff --git a/itemScroll.xcf b/itemScroll.xcf
new file mode 100644
index 0000000..acce490
Binary files /dev/null and b/itemScroll.xcf differ
diff --git a/lib/AndorsTrainer_v0.1.3.jar b/lib/AndorsTrainer_v0.1.3.jar
deleted file mode 100644
index 15b48da..0000000
Binary files a/lib/AndorsTrainer_v0.1.3.jar and /dev/null differ
diff --git a/lib/AndorsTrainer_v0.1.4.jar b/lib/AndorsTrainer_v0.1.4.jar
new file mode 100644
index 0000000..24a488e
Binary files /dev/null and b/lib/AndorsTrainer_v0.1.4.jar differ
diff --git a/packaging/Windows/ATCS_Installer.nsi b/packaging/Windows/ATCS_Installer.nsi
index 52246c5..2ee86e3 100644
--- a/packaging/Windows/ATCS_Installer.nsi
+++ b/packaging/Windows/ATCS_Installer.nsi
@@ -1,7 +1,7 @@
!include MUI2.nsh
-!define VERSION "0.6.1"
-!define TRAINER_VERSION "0.1.3"
+!define VERSION "0.6.2"
+!define TRAINER_VERSION "0.1.4"
!define JAVA_BIN "javaw"
Name "Andor's Trail Content Studio v${VERSION}"
diff --git a/src/com/gpl/rpg/atcontentstudio/ATContentStudio.java b/src/com/gpl/rpg/atcontentstudio/ATContentStudio.java
index c6da36a..20715c6 100644
--- a/src/com/gpl/rpg/atcontentstudio/ATContentStudio.java
+++ b/src/com/gpl/rpg/atcontentstudio/ATContentStudio.java
@@ -24,7 +24,7 @@ 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 = "v0.6.1";
+ public static final String APP_VERSION = "v0.6.2";
public static boolean STARTED = false;
public static StudioFrame frame = null;
diff --git a/src/com/gpl/rpg/atcontentstudio/img/label.png b/src/com/gpl/rpg/atcontentstudio/img/label.png
new file mode 100644
index 0000000..3c5ca7d
Binary files /dev/null and b/src/com/gpl/rpg/atcontentstudio/img/label.png differ
diff --git a/src/com/gpl/rpg/atcontentstudio/model/maps/WorldmapSegment.java b/src/com/gpl/rpg/atcontentstudio/model/maps/WorldmapSegment.java
index c12d472..94f0776 100644
--- a/src/com/gpl/rpg/atcontentstudio/model/maps/WorldmapSegment.java
+++ b/src/com/gpl/rpg/atcontentstudio/model/maps/WorldmapSegment.java
@@ -32,6 +32,8 @@ public class WorldmapSegment extends GameDataElement {
private static final long serialVersionUID = 2658610076889592723L;
+ public static final String TEMP_LABEL_KEY = "ATCS_INTERNAL_TEMPORARY_KEY_FOR_LABEL";
+
public int segmentX;
public int segmentY;
public Map mapLocations = new LinkedHashMap();
@@ -154,6 +156,7 @@ public class WorldmapSegment extends GameDataElement {
map.setAttribute("x", Integer.toString(mapLocations.get(s).x + segmentX));
map.setAttribute("y", Integer.toString(mapLocations.get(s).y + segmentY));
for (String label : labelledMaps.keySet()) {
+ if (TEMP_LABEL_KEY.equals(label)) continue;
if (labelledMaps.get(label).contains(s)) {
map.setAttribute("area", label);
}
@@ -161,7 +164,9 @@ public class WorldmapSegment extends GameDataElement {
element.appendChild(map);
}
- for (NamedArea area : labels.values()) {
+ for (String key : labels.keySet()) {
+ if (TEMP_LABEL_KEY.equals(key)) continue;
+ NamedArea area = labels.get(key);
Element namedArea = doc.createElement("namedarea");
namedArea.setAttribute("id", area.id);
namedArea.setAttribute("name", area.name);
diff --git a/src/com/gpl/rpg/atcontentstudio/ui/DefaultIcons.java b/src/com/gpl/rpg/atcontentstudio/ui/DefaultIcons.java
index 8e599bf..c2fc23a 100644
--- a/src/com/gpl/rpg/atcontentstudio/ui/DefaultIcons.java
+++ b/src/com/gpl/rpg/atcontentstudio/ui/DefaultIcons.java
@@ -227,6 +227,10 @@ public class DefaultIcons {
public static Image getCreateTileLayerImage() { return getImage(CREATE_TILE_LAYER_RES); }
public static Image getCreateTileLayerIcon() { return getIcon(CREATE_TILE_LAYER_RES); }
+ private static String LABEL_RES = "/com/gpl/rpg/atcontentstudio/img/label.png";
+ public static Image getLabelImage() { return getImage(LABEL_RES); }
+ public static Image getLabelIcon() { return getIcon(LABEL_RES); }
+
private static String ZOOM_RES = "/com/gpl/rpg/atcontentstudio/img/zoom.png";
public static Image getZoomImage() { return getImage(ZOOM_RES); }
public static Image getZoomIcon() { return getIcon(ZOOM_RES); }
diff --git a/src/com/gpl/rpg/atcontentstudio/ui/map/WorldMapEditor.java b/src/com/gpl/rpg/atcontentstudio/ui/map/WorldMapEditor.java
index 8cfd3e2..67c038d 100644
--- a/src/com/gpl/rpg/atcontentstudio/ui/map/WorldMapEditor.java
+++ b/src/com/gpl/rpg/atcontentstudio/ui/map/WorldMapEditor.java
@@ -90,6 +90,7 @@ public class WorldMapEditor extends Editor implements FieldUpdateListener {
ListModel currentHighlightListModel = null;
JList mapsShown;
+ JList labelList;
JTextField labelIdField;
JTextField labelNameField;
@@ -343,9 +344,6 @@ public class WorldMapEditor extends Editor implements FieldUpdateListener {
// mapView.selected.add(selectedMap);
update = true;
}
- if (e.getClickCount() == 2) {
- ATContentStudio.frame.openEditor(worldmap.getProject().getMap(selectedMap));
- }
}
} else if (editMode == EditMode.addMap && mapBeingAddedID != null) {
if (e.getButton() == MouseEvent.BUTTON1) {
@@ -440,6 +438,26 @@ public class WorldMapEditor extends Editor implements FieldUpdateListener {
mapView.addMouseListener(mouseListener);
mapView.addMouseMotionListener(mouseListener);
+ mapView.addMapClickListener(new WorldMapView.MapClickListener() {
+ @Override
+ public void mapClicked(MouseEvent e, TMXMap m) {
+ if (e.getClickCount() == 2) {
+ ATContentStudio.frame.openEditor(m);
+ }
+ }
+
+ @Override
+ public void mapChangeClicked(MouseEvent e, TMXMap m, TMXMap changeTarget) {
+ if (e.getClickCount() == 2) {
+ ATContentStudio.frame.openEditor(changeTarget);
+ }
+ }
+
+ @Override
+ public void backgroundClicked(MouseEvent e) {
+ }
+ });
+
return pane;
}
@@ -496,13 +514,18 @@ public class WorldMapEditor extends Editor implements FieldUpdateListener {
labelEditPane.add(new JLabel("Labels on the worldmap"), JideBoxLayout.FIX);
mslListModel = new MapSegmentLabelsListModel(worldmap);
- final JList labelList = new JList(mslListModel);
+ labelList = new JList(mslListModel);
labelList.setCellRenderer(new MapLabelCellRenderer());
labelList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
labelEditPane.add(new JScrollPane(labelList), JideBoxLayout.FLEXIBLE);
JPanel labelListButtonsPane = new JPanel();
- //TODO Add the buttons
+ labelListButtonsPane.setLayout(new JideBoxLayout(labelListButtonsPane, JideBoxLayout.LINE_AXIS));
+ final JButton createLabel = new JButton(new ImageIcon(DefaultIcons.getCreateIcon()));
+ labelListButtonsPane.add(createLabel, JideBoxLayout.FIX);
+ final JButton deleteLabel = new JButton(new ImageIcon(DefaultIcons.getNullifyIcon()));
+ labelListButtonsPane.add(deleteLabel, JideBoxLayout.FIX);
+ labelListButtonsPane.add(new JPanel(), JideBoxLayout.VARY);
labelEditPane.add(labelListButtonsPane, JideBoxLayout.FIX);
final JPanel labelParametersPane = new JPanel();
@@ -511,15 +534,39 @@ public class WorldMapEditor extends Editor implements FieldUpdateListener {
labelList.addListSelectionListener(new ListSelectionListener() {
@Override
public void valueChanged(ListSelectionEvent e) {
- if (labelList.getSelectedValue() != null) {
- selectedLabel = labelList.getSelectedValue();
- updateLabelParamsPane(labelParametersPane, worldmap);
- labelEditPane.revalidate();
- labelEditPane.repaint();
- }
+ selectedLabel = labelList.getSelectedValue();
+ updateLabelParamsPane(labelParametersPane, worldmap);
+ labelEditPane.revalidate();
+ labelEditPane.repaint();
}
});
+ createLabel.addActionListener(new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ WorldmapSegment.NamedArea creation = new WorldmapSegment.NamedArea(null, null, null);
+ worldmap.labels.put(WorldmapSegment.TEMP_LABEL_KEY, creation);
+ worldmap.labelledMaps.put(WorldmapSegment.TEMP_LABEL_KEY, new ArrayList());
+ mslListModel.listChanged();
+ labelList.setSelectedValue(creation, true);
+ }
+ });
+
+ deleteLabel.addActionListener(new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ if (selectedLabel.id != null) {
+ worldmap.labelledMaps.remove(selectedLabel.id);
+ worldmap.labels.remove(selectedLabel.id);
+ } else {
+ worldmap.labelledMaps.remove(WorldmapSegment.TEMP_LABEL_KEY);
+ worldmap.labels.remove(WorldmapSegment.TEMP_LABEL_KEY);
+ }
+ labelList.clearSelection();
+ mslListModel.listChanged();
+ notifyModelModified();
+ }
+ });
tabPane.addTab("Labels", labelEditPane);
@@ -530,6 +577,10 @@ public class WorldMapEditor extends Editor implements FieldUpdateListener {
private void updateLabelParamsPane(JPanel labelParametersPane, final WorldmapSegment worldmap) {
labelParametersPane.removeAll();
+ if (selectedLabel == null) {
+ setCurrentHighlightModel(null);
+ return;
+ }
labelParametersPane.setLayout(new JideBoxLayout(labelParametersPane, JideBoxLayout.PAGE_AXIS));
labelIdField = addTextField(labelParametersPane, "Internal ID: ", selectedLabel.id, worldmap.writable, this);
@@ -553,7 +604,7 @@ public class WorldMapEditor extends Editor implements FieldUpdateListener {
});
JPanel labelCoverageButtonsPane = new JPanel();
- //TODO Add the buttons.
+ labelCoverageButtonsPane.setLayout(new JideBoxLayout(labelCoverageButtonsPane, JideBoxLayout.LINE_AXIS));
JButton addCoverage = new JButton("Add on-map selection");
labelCoverageButtonsPane.add(addCoverage, JideBoxLayout.FIX);
JButton replaceCoverage = new JButton("Replace by on-map selection");
@@ -565,11 +616,14 @@ public class WorldMapEditor extends Editor implements FieldUpdateListener {
addCoverage.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
- if (selectedLabel == null || selectedLabel.id == null) return;
- List currentCoverage = worldmap.labelledMaps.get(selectedLabel.id);
+ if (selectedLabel == null) return;
+ String labelId = selectedLabel.id;
+ if (labelId == null) labelId = WorldmapSegment.TEMP_LABEL_KEY;
+
+ List currentCoverage = worldmap.labelledMaps.get(labelId);
if (currentCoverage == null) {
- worldmap.labelledMaps.put(selectedLabel.id, new ArrayList());
- currentCoverage = worldmap.labelledMaps.get(selectedLabel.id);
+ worldmap.labelledMaps.put(labelId, new ArrayList());
+ currentCoverage = worldmap.labelledMaps.get(labelId);
}
for (int i = 0; i < msmListModel.getSize(); i++) {
if (msmListSelectionModel.isSelectedIndex(i)) {
@@ -586,11 +640,14 @@ public class WorldMapEditor extends Editor implements FieldUpdateListener {
replaceCoverage.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
- if (selectedLabel == null || selectedLabel.id == null) return;
- List currentCoverage = worldmap.labelledMaps.get(selectedLabel.id);
+ if (selectedLabel == null) return;
+ String labelId = selectedLabel.id;
+ if (labelId == null) labelId = WorldmapSegment.TEMP_LABEL_KEY;
+
+ List currentCoverage = worldmap.labelledMaps.get(labelId);
if (currentCoverage == null) {
- worldmap.labelledMaps.put(selectedLabel.id, new ArrayList());
- currentCoverage = worldmap.labelledMaps.get(selectedLabel.id);
+ worldmap.labelledMaps.put(labelId, new ArrayList());
+ currentCoverage = worldmap.labelledMaps.get(labelId);
} else {
currentCoverage.clear();
}
@@ -609,16 +666,21 @@ public class WorldMapEditor extends Editor implements FieldUpdateListener {
removeFromCoverage.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
- if (selectedLabel == null || selectedLabel.id == null) return;
- List currentCoverage = worldmap.labelledMaps.get(selectedLabel.id);
+ if (selectedLabel == null) return;
+ String labelId = selectedLabel.id;
+ if (labelId == null) labelId = WorldmapSegment.TEMP_LABEL_KEY;
+
+ List currentCoverage = worldmap.labelledMaps.get(labelId);
if (currentCoverage == null) return;
+ List toRemove = new ArrayList();
for (int i = 0; i < mslmListModel.getSize(); i++) {
if (mslmListSelectionModel.isSelectedIndex(i)) {
if (currentCoverage.contains(mslmListModel.getElementAt(i).id)) {
- currentCoverage.remove(mslmListModel.getElementAt(i).id);
+ toRemove.add(mslmListModel.getElementAt(i).id);
}
}
}
+ currentCoverage.removeAll(toRemove);
mslmListModel.listChanged();
repaintMap();
}
@@ -679,11 +741,13 @@ public class WorldMapEditor extends Editor implements FieldUpdateListener {
@Override
public int getSize() {
+ if (area.id == null) return segment.labelledMaps.get(WorldmapSegment.TEMP_LABEL_KEY).size();
return segment.labelledMaps.get(area.id).size();
}
@Override
public TMXMap getElementAt(int index) {
+ if (area.id == null) return segment.getProject().getMap(segment.labelledMaps.get(WorldmapSegment.TEMP_LABEL_KEY).get(index));
return segment.getProject().getMap(segment.labelledMaps.get(area.id).get(index));
}
@@ -790,7 +854,13 @@ public class WorldMapEditor extends Editor implements FieldUpdateListener {
label.setText("None");
} else {
WorldmapSegment.NamedArea area = (WorldmapSegment.NamedArea) value;
- label.setText(area.name+" ("+area.id+")");
+ if (area.id != null) {
+ label.setText(area.name+" ("+area.id+")");
+ label.setIcon(new ImageIcon(DefaultIcons.getLabelIcon()));
+ } else {
+ label.setText("Incomplete Label. Enter an ID.");
+ label.setIcon(new ImageIcon(DefaultIcons.getNullifyIcon()));
+ }
}
return label;
}
@@ -1012,12 +1082,20 @@ public class WorldMapEditor extends Editor implements FieldUpdateListener {
WorldmapSegment worldmap = (WorldmapSegment)target;
boolean changed = false;
if (source == labelIdField) {
- List coverage = worldmap.labelledMaps.get(selectedLabel.id);
- worldmap.labelledMaps.remove(selectedLabel.id);
- worldmap.labels.remove(selectedLabel.id);
+ List coverage;
+ if (selectedLabel.id != null) {
+ coverage = worldmap.labelledMaps.get(selectedLabel.id);
+ worldmap.labelledMaps.remove(selectedLabel.id);
+ worldmap.labels.remove(selectedLabel.id);
+ } else {
+ coverage = worldmap.labelledMaps.get(WorldmapSegment.TEMP_LABEL_KEY);
+ worldmap.labels.remove(WorldmapSegment.TEMP_LABEL_KEY);
+ }
selectedLabel.id = (String) value;
- worldmap.labelledMaps.put(selectedLabel.id, coverage);
- worldmap.labels.put(selectedLabel.id, selectedLabel);
+ if (value != null) {
+ worldmap.labelledMaps.put(selectedLabel.id, coverage);
+ worldmap.labels.put(selectedLabel.id, selectedLabel);
+ }
mslListModel.listChanged();
changed = true;
} else if (source == labelNameField) {
diff --git a/src/com/gpl/rpg/atcontentstudio/ui/map/WorldMapView.java b/src/com/gpl/rpg/atcontentstudio/ui/map/WorldMapView.java
index 51cf2d4..f9b449b 100644
--- a/src/com/gpl/rpg/atcontentstudio/ui/map/WorldMapView.java
+++ b/src/com/gpl/rpg/atcontentstudio/ui/map/WorldMapView.java
@@ -7,6 +7,7 @@ import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Graphics2D;
+import java.awt.Image;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.RenderingHints;
@@ -29,11 +30,15 @@ import javax.swing.JComponent;
import javax.swing.ListModel;
import javax.swing.ListSelectionModel;
import javax.swing.Scrollable;
+import javax.swing.ToolTipManager;
import tiled.view.MapRenderer;
import tiled.view.OrthogonalRenderer;
import com.gpl.rpg.atcontentstudio.model.Project;
+import com.gpl.rpg.atcontentstudio.model.maps.MapChange;
+import com.gpl.rpg.atcontentstudio.model.maps.MapObject;
+import com.gpl.rpg.atcontentstudio.model.maps.MapObjectGroup;
import com.gpl.rpg.atcontentstudio.model.maps.TMXMap;
import com.gpl.rpg.atcontentstudio.model.maps.WorldmapSegment;
@@ -91,12 +96,82 @@ public class WorldMapView extends JComponent implements Scrollable {
}
}
if (selectedMap != null) {
- mapClicked(e, WorldMapView.this.worldmap.getProject().getMap(selectedMap));
+ x = x - mapLocations.get(selectedMap).x;
+ y = y - mapLocations.get(selectedMap).y;
+ //Look for a mapchange there
+ TMXMap map = proj.getMap(selectedMap);
+
+ boolean mapchangeFound = false;
+ for (MapObjectGroup group : map.groups) {
+ for (MapObject obj : group.mapObjects) {
+ if (obj instanceof MapChange) {
+ if (x >= obj.x && x < obj.x + obj.w && y >= obj.y && y < obj.y + obj.h) {
+ String mapId = ((MapChange)obj).map != null ? ((MapChange)obj).map.id : ((MapChange)obj).map_id;
+ mapChangeClicked(e, proj.getMap(selectedMap), proj.getMap(mapId));
+ mapchangeFound = true;
+ }
+ }
+ }
+ }
+
+ if (!mapchangeFound) {
+ mapClicked(e, WorldMapView.this.worldmap.getProject().getMap(selectedMap));
+ }
} else {
backgroundClicked(e);
}
}
});
+
+ addMouseMotionListener(new MouseAdapter() {
+ @Override
+ public void mouseMoved(MouseEvent e) {
+ String selectedMap = null;
+ int x = (int) (e.getX() / zoomLevel);
+ int y = (int) (e.getY() / zoomLevel);
+ for (String s : mapLocations.keySet()) {
+ if (mapLocations.get(s).contains(x, y)) {
+ selectedMap = s;
+ break;
+ }
+ }
+ if (selectedMap != null) {
+ //Reuse x,y to indicate to tile-within-the-map coordinates.
+ x = x - mapLocations.get(selectedMap).x;
+ y = y - mapLocations.get(selectedMap).y;
+ //Look for a mapchange there
+ TMXMap map = proj.getMap(selectedMap);
+
+ boolean mapchangeFound = false;
+ for (MapObjectGroup group : map.groups) {
+ for (MapObject obj : group.mapObjects) {
+ if (obj instanceof MapChange) {
+ if (x >= obj.x && x < obj.x + obj.w && y >= obj.y && y < obj.y + obj.h) {
+ String mapId = ((MapChange)obj).map != null ? ((MapChange)obj).map.id : ((MapChange)obj).map_id;
+ setToolTipText(selectedMap+"->"+mapId);
+ mapchangeFound = true;
+ }
+ }
+ }
+ }
+
+ if (!mapchangeFound) {
+ setToolTipText(selectedMap);
+ }
+ ToolTipManager.sharedInstance().registerComponent(WorldMapView.this);
+ ToolTipManager.sharedInstance().setEnabled(true);
+ } else {
+ ToolTipManager.sharedInstance().setEnabled(false);
+ ToolTipManager.sharedInstance().unregisterComponent(WorldMapView.this);
+ setToolTipText(null);
+ }
+ }
+ });
+ }
+
+ @Override
+ public Point getToolTipLocation(MouseEvent event) {
+ return event.getPoint();
}
private void paintOnGraphics(Graphics2D g2) {
@@ -133,8 +208,8 @@ public class WorldMapView extends JComponent implements Scrollable {
if (layer instanceof tiled.core.TileLayer && layer.isVisible()) {
if (layer.getName().equalsIgnoreCase("walkable")) continue;
renderer.paintTileLayer(g2, (tiled.core.TileLayer) layer);
- } else if (layer instanceof tiled.core.ObjectGroup && layer.isVisible()) {
-// paintObjectGroup(g2, map, (tiled.core.ObjectGroup) layer);
+ } else if (layer instanceof tiled.core.ObjectGroup) {
+ paintObjectGroup(g2, map, (tiled.core.ObjectGroup) layer);
}
}
if (map.colorFilter != null) {
@@ -165,20 +240,58 @@ public class WorldMapView extends JComponent implements Scrollable {
for (String s : worldmap.labels.keySet()) {
String label = worldmap.labels.get(s).name;
- Rectangle areaCovered = new Rectangle(0, 0, -1, -1);
- for (String map : worldmap.labelledMaps.get(s)) {
- areaCovered.add(mapLocations.get(map));
+ if (label != null) {
+ Rectangle areaCovered = new Rectangle(0, 0, -1, -1);
+ for (String map : worldmap.labelledMaps.get(s)) {
+ areaCovered.add(mapLocations.get(map));
+ }
+
+ Rectangle2D stringBounds = fm.getStringBounds(label, g2);
+ GlyphVector gv = areaNameFont.createGlyphVector(frc, label);
+ g2.setColor(Color.WHITE);
+ g2.fill(gv.getOutline((int)(areaCovered.getCenterX() - stringBounds.getCenterX()), (int)(areaCovered.getCenterY() - stringBounds.getCenterY())));
+ g2.setColor(Color.BLACK);
+ g2.draw(gv.getOutline((int)(areaCovered.getCenterX() - stringBounds.getCenterX()), (int)(areaCovered.getCenterY() - stringBounds.getCenterY())));
}
-
- Rectangle2D stringBounds = fm.getStringBounds(label, g2);
- GlyphVector gv = areaNameFont.createGlyphVector(frc, label);
- g2.setColor(Color.WHITE);
- g2.fill(gv.getOutline((int)(areaCovered.getCenterX() - stringBounds.getCenterX()), (int)(areaCovered.getCenterY() - stringBounds.getCenterY())));
- g2.setColor(Color.BLACK);
- g2.draw(gv.getOutline((int)(areaCovered.getCenterX() - stringBounds.getCenterX()), (int)(areaCovered.getCenterY() - stringBounds.getCenterY())));
}
}
+ private void paintObjectGroup(Graphics2D g2d, TMXMap map, tiled.core.ObjectGroup layer) {
+ for (MapObjectGroup group : map.groups) {
+ if (group.tmxGroup == layer) {
+ for (MapObject object : group.mapObjects) {
+ if (object instanceof MapChange) {
+// Only show mapchange areas pointing to maps not shown in this worldmap
+ if (((MapChange)object).map != null && !mapLocations.containsKey(((MapChange)object).map.id)) {
+ drawObject(object, g2d, new Color(20, 20, 190));
+ }
+ }
+ }
+ break;
+ }
+ }
+ }
+
+ private void drawObject(MapObject object, Graphics2D g2d, Color color) {
+ g2d.setPaint(color);
+ g2d.drawRect(object.x+1, object.y+1, object.w-3, object.h-3);
+ g2d.drawRect(object.x+2, object.y+2, object.w-5, object.h-5);
+ g2d.setPaint(color.darker().darker());
+ g2d.drawLine(object.x, object.y + object.h - 1, object.x + object.w - 1, object.y + object.h - 1);
+ g2d.drawLine(object.x + object.w - 1, object.y, object.x + object.w - 1, object.y + object.h - 1);
+ g2d.drawLine(object.x + 3, object.y + 3, object.x + object.w - 4, object.y + 3);
+ g2d.drawLine(object.x + 3, object.y + 3, object.x + 3, object.y + object.h - 4);
+ g2d.setPaint(color.brighter().brighter().brighter());
+ g2d.drawLine(object.x, object.y, object.x + object.w - 1, object.y);
+ g2d.drawLine(object.x, object.y, object.x, object.y + object.h - 1);
+ g2d.drawLine(object.x + 3, object.y + object.h - 4, object.x + object.w - 4, object.y + object.h - 4);
+ g2d.drawLine(object.x + object.w - 4, object.y + 3, object.x + object.w - 4, object.y + object.h - 4);
+ Image img = object.getIcon();
+ g2d.setColor(new Color(255, 255, 255, 120));
+ g2d.fillRect(object.x + 2, object.y + 2, img.getWidth(null), img.getHeight(null));
+ g2d.drawImage(object.getIcon(), object.x + 2, object.y + 2, null);
+ }
+
private void outlineFromListModel(Graphics2D g2, ListModel listModel, ListSelectionModel selectionModel, Color outlineColor, Stroke outlineStroke, Font mapIdFont, int mapIdLabelHeight) {
for (int i =0; i