From ce908f003345c44fbd9f9fa1d7c835d6e2dac861 Mon Sep 17 00:00:00 2001 From: Zukero Date: Fri, 12 Aug 2016 15:35:17 +0200 Subject: [PATCH] v0.4.8. Removed stupid feature (almost a bug) that made it painful to handle adding spritesheets. Fixed colorfilters not showing on the worldmap and replacements simulator. Added "display type" (a.k.a rarity) item field in the Items comparator. --- hacked-libtiled/tiled/view/MapRenderer.java | 2 +- .../tiled/view/OrthogonalRenderer.java | 6 +- packaging/Linux/ATCS/ATCS.cmd | 2 +- packaging/Linux/ATCS/ATCS.sh | 2 +- packaging/Windows/ATCS_Installer.nsi | 2 +- res/spritesheets.properties | 2 + .../rpg/atcontentstudio/ATContentStudio.java | 2 +- .../rpg/atcontentstudio/model/Project.java | 14 +- .../ui/map/MapColorFilters.java | 107 ++++++++++++ .../atcontentstudio/ui/map/TMXMapEditor.java | 164 ++---------------- .../atcontentstudio/ui/map/WorldMapView.java | 9 +- .../ui/tools/ItemsTableView.java | 161 ++++++++--------- 12 files changed, 225 insertions(+), 248 deletions(-) create mode 100644 src/com/gpl/rpg/atcontentstudio/ui/map/MapColorFilters.java diff --git a/hacked-libtiled/tiled/view/MapRenderer.java b/hacked-libtiled/tiled/view/MapRenderer.java index cd669fc..3a51b51 100644 --- a/hacked-libtiled/tiled/view/MapRenderer.java +++ b/hacked-libtiled/tiled/view/MapRenderer.java @@ -51,5 +51,5 @@ public interface MapRenderer * @param g the graphics context to paint to * @param layer the layer to paint */ - public void paintTileLayer(Graphics2D g, TileLayer layer, BufferedImageOp filter); + public void paintTileLayer(Graphics2D g, TileLayer layer); } diff --git a/hacked-libtiled/tiled/view/OrthogonalRenderer.java b/hacked-libtiled/tiled/view/OrthogonalRenderer.java index 1168422..ddf0b0b 100644 --- a/hacked-libtiled/tiled/view/OrthogonalRenderer.java +++ b/hacked-libtiled/tiled/view/OrthogonalRenderer.java @@ -53,7 +53,7 @@ public class OrthogonalRenderer implements MapRenderer map.getHeight() * map.getTileHeight()); } - public void paintTileLayer(Graphics2D g, TileLayer layer, BufferedImageOp filter ) { + public void paintTileLayer(Graphics2D g, TileLayer layer) { final Rectangle clip = g.getClipBounds(); final int tileWidth = map.getTileWidth(); final int tileHeight = map.getTileHeight(); @@ -84,9 +84,9 @@ public class OrthogonalRenderer implements MapRenderer g.drawImage( image, - filter, x * tileWidth, - (y + 1) * tileHeight - image.getHeight(null)); + (y + 1) * tileHeight - image.getHeight(null), + null); } } diff --git a/packaging/Linux/ATCS/ATCS.cmd b/packaging/Linux/ATCS/ATCS.cmd index e615e9a..3a67dc1 100644 --- a/packaging/Linux/ATCS/ATCS.cmd +++ b/packaging/Linux/ATCS/ATCS.cmd @@ -1 +1 @@ -start "" "javaw.exe" -Xmx512M -cp "lib\ATCS_v0.4.7.jar;lib\jide-oss.jar;lib\ui.jar;lib\junit-4.10.jar;lib\json_simple-1.1.jar;lib\rsyntaxtextarea.jar;lib\prefuse.jar;lib\AndorsTrainer_v0.1.2.jar;lib\bsh-2.0b4.jar" com.gpl.rpg.atcontentstudio.ATContentStudio +start "" "javaw.exe" -Xmx512M -cp "lib\ATCS_v0.4.8.jar;lib\jide-oss.jar;lib\ui.jar;lib\junit-4.10.jar;lib\json_simple-1.1.jar;lib\rsyntaxtextarea.jar;lib\prefuse.jar;lib\AndorsTrainer_v0.1.2.jar;lib\bsh-2.0b4.jar" com.gpl.rpg.atcontentstudio.ATContentStudio diff --git a/packaging/Linux/ATCS/ATCS.sh b/packaging/Linux/ATCS/ATCS.sh index bd3f8be..c0f1cd0 100644 --- a/packaging/Linux/ATCS/ATCS.sh +++ b/packaging/Linux/ATCS/ATCS.sh @@ -1,2 +1,2 @@ #!/bin/bash -java -Xmx512M -cp lib/AndorsTrainer_v0.1.2.jar:lib/ATCS_v0.4.7.jar:lib/prefuse.jar:lib/json_simple-1.1.jar:lib/jide-oss.jar:lib/ui.jar:lib/junit-4.10.jar:lib/rsyntaxtextarea.jar:lib/bsh-2.0b4.jar com.gpl.rpg.atcontentstudio.ATContentStudio +java -Xmx512M -cp lib/AndorsTrainer_v0.1.2.jar:lib/ATCS_v0.4.8.jar:lib/prefuse.jar:lib/json_simple-1.1.jar:lib/jide-oss.jar:lib/ui.jar:lib/junit-4.10.jar:lib/rsyntaxtextarea.jar:lib/bsh-2.0b4.jar com.gpl.rpg.atcontentstudio.ATContentStudio diff --git a/packaging/Windows/ATCS_Installer.nsi b/packaging/Windows/ATCS_Installer.nsi index 9aa9f96..35b1214 100644 --- a/packaging/Windows/ATCS_Installer.nsi +++ b/packaging/Windows/ATCS_Installer.nsi @@ -1,6 +1,6 @@ !include MUI2.nsh -!define VERSION "0.4.7" +!define VERSION "0.4.8" !define JAVA_BIN "java" Name "Andor's Trail Content Studio v${VERSION}" diff --git a/res/spritesheets.properties b/res/spritesheets.properties index 8d2e7a2..771c6ad 100644 --- a/res/spritesheets.properties +++ b/res/spritesheets.properties @@ -1,5 +1,6 @@ atcs.spritesheet.actorconditions_1.category=actorcondition atcs.spritesheet.actorconditions_2.category=actorcondition +atcs.spritesheet.actorconditions_japozero.category=actorcondition atcs.spritesheet.items_armours.category=item atcs.spritesheet.items_armours_2.category=item atcs.spritesheet.items_armours_3.category=item @@ -10,6 +11,7 @@ atcs.spritesheet.items_jewelry.category=item atcs.spritesheet.items_rings_1.category=item atcs.spritesheet.items_necklaces_1.category=item atcs.spritesheet.items_consumables.category=item +atcs.spritesheet.items_japozero.category=item atcs.spritesheet.items_books.category=item atcs.spritesheet.items_misc.category=item atcs.spritesheet.items_misc_2.category=item diff --git a/src/com/gpl/rpg/atcontentstudio/ATContentStudio.java b/src/com/gpl/rpg/atcontentstudio/ATContentStudio.java index a8f73cd..692a572 100644 --- a/src/com/gpl/rpg/atcontentstudio/ATContentStudio.java +++ b/src/com/gpl/rpg/atcontentstudio/ATContentStudio.java @@ -18,7 +18,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.4.7"; + public static final String APP_VERSION = "v0.4.8"; public static boolean STARTED = false; public static StudioFrame frame = null; diff --git a/src/com/gpl/rpg/atcontentstudio/model/Project.java b/src/com/gpl/rpg/atcontentstudio/model/Project.java index e02ef3e..c99e2e4 100644 --- a/src/com/gpl/rpg/atcontentstudio/model/Project.java +++ b/src/com/gpl/rpg/atcontentstudio/model/Project.java @@ -219,14 +219,12 @@ public class Project implements ProjectTreeNode, Serializable { public void refreshTransients(Workspace w) { this.parent = w; - if (knownSpritesheetsProperties == null) { - try { - knownSpritesheetsProperties = new Properties(); - knownSpritesheetsProperties.load(Project.class.getResourceAsStream("/spritesheets.properties")); - } catch (IOException e) { - Notification.addWarn("Unable to load default spritesheets properties."); - e.printStackTrace(); - } + try { + knownSpritesheetsProperties = new Properties(); + knownSpritesheetsProperties.load(Project.class.getResourceAsStream("/spritesheets.properties")); + } catch (IOException e) { + Notification.addWarn("Unable to load default spritesheets properties."); + e.printStackTrace(); } if (sourceSetToUse == null) { diff --git a/src/com/gpl/rpg/atcontentstudio/ui/map/MapColorFilters.java b/src/com/gpl/rpg/atcontentstudio/ui/map/MapColorFilters.java new file mode 100644 index 0000000..6b1a406 --- /dev/null +++ b/src/com/gpl/rpg/atcontentstudio/ui/map/MapColorFilters.java @@ -0,0 +1,107 @@ +package com.gpl.rpg.atcontentstudio.ui.map; + +import java.awt.Color; +import java.awt.Composite; +import java.awt.Graphics2D; +import java.awt.Rectangle; + +import com.gpl.rpg.atcontentstudio.model.maps.TMXMap; +import com.gpl.rpg.atcontentstudio.ui.tools.MatrixComposite; + +public class MapColorFilters { + + public static void applyColorfilter(TMXMap.ColorFilter colorFilter, Graphics2D g2d) { + Composite oldComp = g2d.getComposite(); + Rectangle clip = g2d.getClipBounds(); + MatrixComposite newComp = null; + float f=0.0f; + switch(colorFilter) { + case black20: + f=0.8f; + newComp = new MatrixComposite(new float[]{ + f, 0.00f, 0.00f, 0.0f, 0.0f, + 0.00f, f, 0.00f, 0.0f, 0.0f, + 0.00f, 0.00f, f, 0.0f, 0.0f, + 0.00f, 0.00f, 0.00f, 1.0f, 0.0f + }); + break; + case black40: + f=0.6f; + newComp = new MatrixComposite(new float[]{ + f, 0.00f, 0.00f, 0.0f, 0.0f, + 0.00f, f, 0.00f, 0.0f, 0.0f, + 0.00f, 0.00f, f, 0.0f, 0.0f, + 0.00f, 0.00f, 0.00f, 1.0f, 0.0f + }); + break; + case black60: + f=0.4f; + newComp = new MatrixComposite(new float[]{ + f, 0.00f, 0.00f, 0.0f, 0.0f, + 0.00f, f, 0.00f, 0.0f, 0.0f, + 0.00f, 0.00f, f, 0.0f, 0.0f, + 0.00f, 0.00f, 0.00f, 1.0f, 0.0f + }); + break; + case black80: + f=0.2f; + newComp = new MatrixComposite(new float[]{ + f, 0.00f, 0.00f, 0.0f, 0.0f, + 0.00f, f, 0.00f, 0.0f, 0.0f, + 0.00f, 0.00f, f, 0.0f, 0.0f, + 0.00f, 0.00f, 0.00f, 1.0f, 0.0f + }); + break; + case bw: + newComp = new MatrixComposite(new float[]{ + 0.33f, 0.59f, 0.11f, 0.0f, 0.0f, + 0.33f, 0.59f, 0.11f, 0.0f, 0.0f, + 0.33f, 0.59f, 0.11f, 0.0f, 0.0f, + 0.00f, 0.00f, 0.00f, 1.0f, 0.0f + }); + break; + case invert: + newComp = new MatrixComposite(new float[]{ + -1.00f, 0.00f, 0.00f, 0.0f, 255.0f, + 0.00f, -1.00f, 0.00f, 0.0f, 255.0f, + 0.00f, 0.00f, -1.00f, 0.0f, 255.0f, + 0.00f, 0.00f, 0.00f, 1.0f, 0.0f + }); + break; + case redtint: + newComp = new MatrixComposite(new float[]{ + 1.20f, 0.20f, 0.20f, 0.0f, 25.0f, + 0.00f, 0.80f, 0.00f, 0.0f, 0.0f, + 0.00f, 0.00f, 0.80f, 0.0f, 0.0f, + 0.00f, 0.00f, 0.00f, 1.0f, 0.0f + }); + break; + case greentint: + newComp = new MatrixComposite(new float[]{ + 0.85f, 0.00f, 0.00f, 0.0f, 0.0f, + 0.15f, 1.15f, 0.15f, 0.0f, 15.0f, + 0.00f, 0.00f, 0.85f, 0.0f, 0.0f, + 0.00f, 0.00f, 0.00f, 1.0f, 0.0f + }); + break; + case bluetint: + newComp = new MatrixComposite(new float[]{ + 0.70f, 0.00f, 0.00f, 0.0f, 0.0f, + 0.00f, 0.70f, 0.00f, 0.0f, 0.0f, + 0.30f, 0.30f, 1.30f, 0.0f, 40.0f, + 0.00f, 0.00f, 0.00f, 1.0f, 0.0f + }); + break; + default: + break; + + } + if (newComp != null) { + g2d.setComposite(newComp); + g2d.setPaint(new Color(1.0f, 1.0f, 1.0f, 1.0f)); + g2d.fill(clip); + g2d.setComposite(oldComp); + } + } + +} diff --git a/src/com/gpl/rpg/atcontentstudio/ui/map/TMXMapEditor.java b/src/com/gpl/rpg/atcontentstudio/ui/map/TMXMapEditor.java index b6f1931..bef6f94 100644 --- a/src/com/gpl/rpg/atcontentstudio/ui/map/TMXMapEditor.java +++ b/src/com/gpl/rpg/atcontentstudio/ui/map/TMXMapEditor.java @@ -3,7 +3,6 @@ package com.gpl.rpg.atcontentstudio.ui.map; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; -import java.awt.Composite; import java.awt.Cursor; import java.awt.Dimension; import java.awt.Graphics; @@ -102,7 +101,6 @@ import com.gpl.rpg.atcontentstudio.ui.Editor; import com.gpl.rpg.atcontentstudio.ui.FieldUpdateListener; import com.gpl.rpg.atcontentstudio.ui.IntegerBasedCheckBox; import com.gpl.rpg.atcontentstudio.ui.ScrollablePanel; -import com.gpl.rpg.atcontentstudio.ui.tools.MatrixComposite; import com.jidesoft.swing.JideBoxLayout; import com.jidesoft.swing.JideTabbedPane; @@ -1282,6 +1280,7 @@ public class TMXMapEditor extends Editor { // return new ColorConvertOp(ColorSpace.getInstance(ColorSpace.CS_GRAY), null); // } + public class TMXViewer extends JPanel implements Scrollable { private static final long serialVersionUID = 2845032142029325865L; @@ -1429,33 +1428,6 @@ public class TMXMapEditor extends Editor { final Graphics2D g2d = (Graphics2D) g.create(); final Rectangle clip = g2d.getClipBounds(); - BufferedImageOp filter = null; - - if (map.colorFilter != null) { - switch(map.colorFilter) { - case black20: - filter=colorFilterBlack20; - break; - case black40: - filter=colorFilterBlack40; - break; - case black60: - filter=colorFilterBlack60; - break; - case black80: - filter=colorFilterBlack80; - break; - case bw: - filter=colorFilterBW; - break; - case invert: - filter=colorFilterInvert; - break; - default: - break; - - } - } // Draw a gray background g2d.setPaint(new Color(100, 100, 100)); @@ -1464,101 +1436,12 @@ public class TMXMapEditor extends Editor { // Draw each tile map layer for (tiled.core.MapLayer layer : ((TMXMap)target).tmxMap) { if (layer instanceof tiled.core.TileLayer && layer.isVisible()) { - renderer.paintTileLayer(g2d, (tiled.core.TileLayer) layer, filter); + renderer.paintTileLayer(g2d, (tiled.core.TileLayer) layer); } } if (map.colorFilter != null) { - Composite oldComp = g2d.getComposite(); - MatrixComposite newComp = null; - float f=0.0f; - switch(map.colorFilter) { - case black20: - f=0.8f; - newComp = new MatrixComposite(new float[]{ - f, 0.00f, 0.00f, 0.0f, 0.0f, - 0.00f, f, 0.00f, 0.0f, 0.0f, - 0.00f, 0.00f, f, 0.0f, 0.0f, - 0.00f, 0.00f, 0.00f, 1.0f, 0.0f - }); - break; - case black40: - f=0.6f; - newComp = new MatrixComposite(new float[]{ - f, 0.00f, 0.00f, 0.0f, 0.0f, - 0.00f, f, 0.00f, 0.0f, 0.0f, - 0.00f, 0.00f, f, 0.0f, 0.0f, - 0.00f, 0.00f, 0.00f, 1.0f, 0.0f - }); - break; - case black60: - f=0.4f; - newComp = new MatrixComposite(new float[]{ - f, 0.00f, 0.00f, 0.0f, 0.0f, - 0.00f, f, 0.00f, 0.0f, 0.0f, - 0.00f, 0.00f, f, 0.0f, 0.0f, - 0.00f, 0.00f, 0.00f, 1.0f, 0.0f - }); - break; - case black80: - f=0.2f; - newComp = new MatrixComposite(new float[]{ - f, 0.00f, 0.00f, 0.0f, 0.0f, - 0.00f, f, 0.00f, 0.0f, 0.0f, - 0.00f, 0.00f, f, 0.0f, 0.0f, - 0.00f, 0.00f, 0.00f, 1.0f, 0.0f - }); - break; - case bw: - newComp = new MatrixComposite(new float[]{ - 0.33f, 0.59f, 0.11f, 0.0f, 0.0f, - 0.33f, 0.59f, 0.11f, 0.0f, 0.0f, - 0.33f, 0.59f, 0.11f, 0.0f, 0.0f, - 0.00f, 0.00f, 0.00f, 1.0f, 0.0f - }); - break; - case invert: - newComp = new MatrixComposite(new float[]{ - -1.00f, 0.00f, 0.00f, 0.0f, 255.0f, - 0.00f, -1.00f, 0.00f, 0.0f, 255.0f, - 0.00f, 0.00f, -1.00f, 0.0f, 255.0f, - 0.00f, 0.00f, 0.00f, 1.0f, 0.0f - }); - break; - case redtint: - newComp = new MatrixComposite(new float[]{ - 1.20f, 0.20f, 0.20f, 0.0f, 25.0f, - 0.00f, 0.80f, 0.00f, 0.0f, 0.0f, - 0.00f, 0.00f, 0.80f, 0.0f, 0.0f, - 0.00f, 0.00f, 0.00f, 1.0f, 0.0f - }); - break; - case greentint: - newComp = new MatrixComposite(new float[]{ - 0.85f, 0.00f, 0.00f, 0.0f, 0.0f, - 0.15f, 1.15f, 0.15f, 0.0f, 15.0f, - 0.00f, 0.00f, 0.85f, 0.0f, 0.0f, - 0.00f, 0.00f, 0.00f, 1.0f, 0.0f - }); - break; - case bluetint: - newComp = new MatrixComposite(new float[]{ - 0.70f, 0.00f, 0.00f, 0.0f, 0.0f, - 0.00f, 0.70f, 0.00f, 0.0f, 0.0f, - 0.30f, 0.30f, 1.30f, 0.0f, 40.0f, - 0.00f, 0.00f, 0.00f, 1.0f, 0.0f - }); - break; - default: - break; - - } - if (newComp != null) { - g2d.setComposite(newComp); - g2d.setPaint(new Color(1.0f, 1.0f, 1.0f, 1.0f)); - g2d.fill(clip); - g2d.setComposite(oldComp); - } + MapColorFilters.applyColorfilter(map.colorFilter, g2d); } @@ -2228,34 +2111,6 @@ public class TMXMapEditor extends Editor { public void paintComponent(Graphics g) { final Graphics2D g2d = (Graphics2D) g.create(); final Rectangle clip = g2d.getClipBounds(); - - BufferedImageOp filter = null; - - if (map.colorFilter != null) { - switch(map.colorFilter) { - case black20: - filter=colorFilterBlack20; - break; - case black40: - filter=colorFilterBlack40; - break; - case black60: - filter=colorFilterBlack60; - break; - case black80: - filter=colorFilterBlack80; - break; - case bw: - filter=colorFilterBW; - break; - case invert: - filter=colorFilterInvert; - break; - default: - break; - - } - } // Draw a gray background g2d.setPaint(new Color(100, 100, 100)); @@ -2264,21 +2119,26 @@ public class TMXMapEditor extends Editor { // Draw each tile map layer if (ground != null) { - renderer.paintTileLayer(g2d, ground, filter); + renderer.paintTileLayer(g2d, ground); } if (objects != null) { - renderer.paintTileLayer(g2d, objects, filter); + renderer.paintTileLayer(g2d, objects); } if (above != null) { - renderer.paintTileLayer(g2d, above, filter); + renderer.paintTileLayer(g2d, above); } if (walkable != null && showWalkable) { - renderer.paintTileLayer(g2d, walkable, filter); + renderer.paintTileLayer(g2d, walkable); } + if (map.colorFilter != null) { + MapColorFilters.applyColorfilter(map.colorFilter, g2d); + } + + if (highlighted != null) { drawObject(highlighted, g2d, new Color(190, 20, 20)); } diff --git a/src/com/gpl/rpg/atcontentstudio/ui/map/WorldMapView.java b/src/com/gpl/rpg/atcontentstudio/ui/map/WorldMapView.java index f6f5036..3efade6 100644 --- a/src/com/gpl/rpg/atcontentstudio/ui/map/WorldMapView.java +++ b/src/com/gpl/rpg/atcontentstudio/ui/map/WorldMapView.java @@ -10,6 +10,7 @@ import java.awt.Graphics2D; import java.awt.Point; import java.awt.Rectangle; import java.awt.RenderingHints; +import java.awt.Shape; import java.awt.font.FontRenderContext; import java.awt.font.GlyphVector; import java.awt.geom.Rectangle2D; @@ -81,11 +82,17 @@ public class WorldMapView extends JComponent implements Scrollable { for (tiled.core.MapLayer layer : ((TMXMap)map).tmxMap) { if (layer instanceof tiled.core.TileLayer && layer.isVisible()) { if (layer.getName().equalsIgnoreCase("walkable")) continue; - renderer.paintTileLayer(g2, (tiled.core.TileLayer) layer, null); + renderer.paintTileLayer(g2, (tiled.core.TileLayer) layer); } else if (layer instanceof tiled.core.ObjectGroup && layer.isVisible()) { // paintObjectGroup(g2, map, (tiled.core.ObjectGroup) layer); } } + if (map.colorFilter != null) { + Shape oldClip = g2.getClip(); + g2.setClip(0, 0, map.tmxMap.getWidth() * TILE_SIZE, map.tmxMap.getHeight() * TILE_SIZE); + MapColorFilters.applyColorfilter(map.colorFilter, g2); + g2.setClip(oldClip); + } if (selected.contains(s)) { g2.drawRect(0, 0, map.tmxMap.getWidth() * TILE_SIZE, map.tmxMap.getHeight() * TILE_SIZE); } diff --git a/src/com/gpl/rpg/atcontentstudio/ui/tools/ItemsTableView.java b/src/com/gpl/rpg/atcontentstudio/ui/tools/ItemsTableView.java index 552b84f..1a079d4 100644 --- a/src/com/gpl/rpg/atcontentstudio/ui/tools/ItemsTableView.java +++ b/src/com/gpl/rpg/atcontentstudio/ui/tools/ItemsTableView.java @@ -37,7 +37,7 @@ public class ItemsTableView extends ElementTableView { @Override public int getColumnCount() { - return 32; + return 33; } @Override @@ -49,32 +49,33 @@ public class ItemsTableView extends ElementTableView { case 3: return "Folder type"; //Source type (created, altered, source) case 4: return "Use type"; //Use type ("none", "use", or equip slot name). case 5: return "Category"; //Category id. - case 6: return "Manually set price ?"; //Has manual price - case 7: return "Price"; //Price - case 8: return "On use/hit - HP min"; - case 9: return "On use/hit - HP max"; - case 10: return "On use/hit - AP min"; - case 11: return "On use/hit - AP max"; - case 12: return "On use/hit - # conditions"; - case 13: return "On kill - HP min"; - case 14: return "On kill - HP max"; - case 15: return "On kill - AP min"; - case 16: return "On kill - AP max"; - case 17: return "On kill - # conditions"; - case 18: return "AD min"; - case 19: return "AD max"; - case 20: return "Max HP"; - case 21: return "Max AP"; - case 22: return "Attack cost"; - case 23: return "AC"; - case 24: return "BC"; - case 25: return "DR"; - case 26: return "CS"; - case 27: return "CM"; - case 28: return "Move cost"; - case 29: return "Use cost"; - case 30: return "Reequip cost"; - case 31: return "# conditions"; + case 6: return "DisplayType"; //Display type (ordinary, rare, extraordinary...) + case 7: return "Manually set price ?"; //Has manual price + case 8: return "Price"; //Price + case 9: return "On use/hit - HP min"; + case 10: return "On use/hit - HP max"; + case 11: return "On use/hit - AP min"; + case 12: return "On use/hit - AP max"; + case 13: return "On use/hit - # conditions"; + case 14: return "On kill - HP min"; + case 15: return "On kill - HP max"; + case 16: return "On kill - AP min"; + case 17: return "On kill - AP max"; + case 18: return "On kill - # conditions"; + case 19: return "AD min"; + case 20: return "AD max"; + case 21: return "Max HP"; + case 22: return "Max AP"; + case 23: return "Attack cost"; + case 24: return "AC"; + case 25: return "BC"; + case 26: return "DR"; + case 27: return "CS"; + case 28: return "CM"; + case 29: return "Move cost"; + case 30: return "Use cost"; + case 31: return "Reequip cost"; + case 32: return "# conditions"; } return null; } @@ -89,32 +90,33 @@ public class ItemsTableView extends ElementTableView { case 3: return String.class; //Source type (created, altered, source) case 4: return String.class; //Use type ("none", "use", or equip slot name). case 5: return String.class; //Category id. - case 6: return Boolean.class; //Has manual price - case 7: return Integer.class; //Price - case 8: return Integer.class;//"On use/hit - HP min"; - case 9: return Integer.class;//"On use/hit - HP max"; - case 10: return Integer.class;//"On use/hit - AP min"; - case 11: return Integer.class;//"On use/hit - AP max"; - case 12: return Integer.class;//"On use/hit - # conditions"; - case 13: return Integer.class;//"On kill - HP min"; - case 14: return Integer.class;//"On kill - HP max"; - case 15: return Integer.class;//"On kill - AP min"; - case 16: return Integer.class;//"On kill - AP max"; - case 17: return Integer.class;//"On kill - # conditions"; - case 18: return Integer.class;//"AD min"; - case 19: return Integer.class;//"AD max"; - case 20: return Integer.class;//"Max HP"; - case 21: return Integer.class;//"Max AP"; - case 22: return Integer.class;//"Attack cost"; - case 23: return Integer.class;//"AC"; - case 24: return Integer.class;//"BC"; - case 25: return Integer.class;//"DR"; - case 26: return Integer.class;//"CS"; - case 27: return Double.class;//"CM"; - case 28: return Integer.class;//"Move cost"; - case 29: return Integer.class;//"Use cost"; - case 30: return Integer.class;//"Reequip cost"; - case 31: return Integer.class;//"# conditions"; + case 6: return String.class; //Display type (ordinary, rare, extraordinary...) + case 7: return Boolean.class; //Has manual price + case 8: return Integer.class; //Price + case 9: return Integer.class;//"On use/hit - HP min"; + case 10: return Integer.class;//"On use/hit - HP max"; + case 11: return Integer.class;//"On use/hit - AP min"; + case 12: return Integer.class;//"On use/hit - AP max"; + case 13: return Integer.class;//"On use/hit - # conditions"; + case 14: return Integer.class;//"On kill - HP min"; + case 15: return Integer.class;//"On kill - HP max"; + case 16: return Integer.class;//"On kill - AP min"; + case 17: return Integer.class;//"On kill - AP max"; + case 18: return Integer.class;//"On kill - # conditions"; + case 19: return Integer.class;//"AD min"; + case 20: return Integer.class;//"AD max"; + case 21: return Integer.class;//"Max HP"; + case 22: return Integer.class;//"Max AP"; + case 23: return Integer.class;//"Attack cost"; + case 24: return Integer.class;//"AC"; + case 25: return Integer.class;//"BC"; + case 26: return Integer.class;//"DR"; + case 27: return Integer.class;//"CS"; + case 28: return Double.class;//"CM"; + case 29: return Integer.class;//"Move cost"; + case 30: return Integer.class;//"Use cost"; + case 31: return Integer.class;//"Reequip cost"; + case 32: return Integer.class;//"# conditions"; } return null; } @@ -144,15 +146,16 @@ public class ItemsTableView extends ElementTableView { if (item.category.action_type != ItemCategory.ActionType.equip) return item.category.action_type.toString(); return item.category.slot.toString(); case 5: return item.category != null ? item.category.id : (item.category_id != null ? item.category_id : null ); //Category id. - case 6: return item.has_manual_price == null ? false : (item.has_manual_price == 1); //Has manual price - case 7: //Price + case 6: return item.display_type != null ? item.display_type.toString() : null; //Category id. + case 7: return item.has_manual_price == null ? false : (item.has_manual_price == 1); //Has manual price + case 8: //Price if (item.has_manual_price == null || item.has_manual_price != 1) return item.computePrice(); return item.base_market_cost; - case 8: return canUse ? (item.kill_effect != null ? item.kill_effect.hp_boost_min : null) : (item.hit_effect != null ? item.hit_effect.hp_boost_min : null);//"On use/hit - HP min"; - case 9: return canUse ? (item.kill_effect != null ? item.kill_effect.hp_boost_max : null) : (item.hit_effect != null ? item.hit_effect.hp_boost_max : null);//"On use/hit - HP max"; - case 10: return canUse ? (item.kill_effect != null ? item.kill_effect.ap_boost_min : null) : (item.hit_effect != null ? item.hit_effect.ap_boost_min : null);//"On use/hit - AP min"; - case 11: return canUse ? (item.kill_effect != null ? item.kill_effect.ap_boost_max : null) : (item.hit_effect != null ? item.hit_effect.ap_boost_max : null);//"On use/hit - AP max"; - case 12: //"On use/hit - # conditions"; + case 9: return canUse ? (item.kill_effect != null ? item.kill_effect.hp_boost_min : null) : (item.hit_effect != null ? item.hit_effect.hp_boost_min : null);//"On use/hit - HP min"; + case 10: return canUse ? (item.kill_effect != null ? item.kill_effect.hp_boost_max : null) : (item.hit_effect != null ? item.hit_effect.hp_boost_max : null);//"On use/hit - HP max"; + case 11: return canUse ? (item.kill_effect != null ? item.kill_effect.ap_boost_min : null) : (item.hit_effect != null ? item.hit_effect.ap_boost_min : null);//"On use/hit - AP min"; + case 12: return canUse ? (item.kill_effect != null ? item.kill_effect.ap_boost_max : null) : (item.hit_effect != null ? item.hit_effect.ap_boost_max : null);//"On use/hit - AP max"; + case 13: //"On use/hit - # conditions"; if (canUse) { if (item.kill_effect != null && item.kill_effect.conditions_source != null) { return item.kill_effect.conditions_source.size(); @@ -169,25 +172,25 @@ public class ItemsTableView extends ElementTableView { return val; } return null; - case 13: return (!canUse && item.kill_effect != null) ? item.kill_effect.hp_boost_min : null;//"On kill - HP min"; - case 14: return (!canUse && item.kill_effect != null) ? item.kill_effect.hp_boost_max : null;//"On kill - HP max"; - case 15: return (!canUse && item.kill_effect != null) ? item.kill_effect.ap_boost_min : null;//"On kill - AP min"; - case 16: return (!canUse && item.kill_effect != null) ? item.kill_effect.ap_boost_max : null;//"On kill - AP max"; - case 17: return (!canUse && item.kill_effect != null && item.kill_effect.conditions_source != null) ? item.kill_effect.conditions_source.size() : null;//"On kill - # conditions"; - case 18: return (canEquip && item.equip_effect != null) ? item.equip_effect.damage_boost_min : null;//"AD min"; - case 19: return (canEquip && item.equip_effect != null) ? item.equip_effect.damage_boost_max : null;//"AD max"; - case 20: return (canEquip && item.equip_effect != null) ? item.equip_effect.max_hp_boost : null;//"Max HP"; - case 21: return (canEquip && item.equip_effect != null) ? item.equip_effect.max_ap_boost : null;//"Max AP"; - case 22: return (canEquip && item.equip_effect != null) ? item.equip_effect.increase_attack_cost : null;//"Attack cost"; - case 23: return (canEquip && item.equip_effect != null) ? item.equip_effect.increase_attack_chance : null;//"AC"; - case 24: return (canEquip && item.equip_effect != null) ? item.equip_effect.increase_block_chance : null;//"BC"; - case 25: return (canEquip && item.equip_effect != null) ? item.equip_effect.increase_damage_resistance : null;//"DR"; - case 26: return (canEquip && item.equip_effect != null) ? item.equip_effect.increase_critical_skill : null;//"CS"; - case 27: return (canEquip && item.equip_effect != null) ? item.equip_effect.critical_multiplier : null;//"CM"; - case 28: return (canEquip && item.equip_effect != null) ? item.equip_effect.increase_move_cost : null;//"Move cost"; - case 29: return (canEquip && item.equip_effect != null) ? item.equip_effect.increase_use_item_cost : null;//"Use cost"; - case 30: return (canEquip && item.equip_effect != null) ? item.equip_effect.increase_reequip_cost : null;//"Reequip cost"; - case 31: return (canEquip && item.equip_effect != null && item.equip_effect.conditions != null) ? item.equip_effect.conditions.size() : null;//"# conditions"; + case 14: return (!canUse && item.kill_effect != null) ? item.kill_effect.hp_boost_min : null;//"On kill - HP min"; + case 15: return (!canUse && item.kill_effect != null) ? item.kill_effect.hp_boost_max : null;//"On kill - HP max"; + case 16: return (!canUse && item.kill_effect != null) ? item.kill_effect.ap_boost_min : null;//"On kill - AP min"; + case 17: return (!canUse && item.kill_effect != null) ? item.kill_effect.ap_boost_max : null;//"On kill - AP max"; + case 18: return (!canUse && item.kill_effect != null && item.kill_effect.conditions_source != null) ? item.kill_effect.conditions_source.size() : null;//"On kill - # conditions"; + case 19: return (canEquip && item.equip_effect != null) ? item.equip_effect.damage_boost_min : null;//"AD min"; + case 20: return (canEquip && item.equip_effect != null) ? item.equip_effect.damage_boost_max : null;//"AD max"; + case 21: return (canEquip && item.equip_effect != null) ? item.equip_effect.max_hp_boost : null;//"Max HP"; + case 22: return (canEquip && item.equip_effect != null) ? item.equip_effect.max_ap_boost : null;//"Max AP"; + case 23: return (canEquip && item.equip_effect != null) ? item.equip_effect.increase_attack_cost : null;//"Attack cost"; + case 24: return (canEquip && item.equip_effect != null) ? item.equip_effect.increase_attack_chance : null;//"AC"; + case 25: return (canEquip && item.equip_effect != null) ? item.equip_effect.increase_block_chance : null;//"BC"; + case 26: return (canEquip && item.equip_effect != null) ? item.equip_effect.increase_damage_resistance : null;//"DR"; + case 27: return (canEquip && item.equip_effect != null) ? item.equip_effect.increase_critical_skill : null;//"CS"; + case 28: return (canEquip && item.equip_effect != null) ? item.equip_effect.critical_multiplier : null;//"CM"; + case 29: return (canEquip && item.equip_effect != null) ? item.equip_effect.increase_move_cost : null;//"Move cost"; + case 30: return (canEquip && item.equip_effect != null) ? item.equip_effect.increase_use_item_cost : null;//"Use cost"; + case 31: return (canEquip && item.equip_effect != null) ? item.equip_effect.increase_reequip_cost : null;//"Reequip cost"; + case 32: return (canEquip && item.equip_effect != null && item.equip_effect.conditions != null) ? item.equip_effect.conditions.size() : null;//"# conditions"; } return null; }