From 543d12ff2eb3715be16a8e5bb67973f503d9e257 Mon Sep 17 00:00:00 2001 From: galaxyoyo Date: Sun, 11 Jan 2015 01:42:00 +0100 Subject: [PATCH] =?UTF-8?q?[BIG=20UPDATE]=20Termin=C3=A9e=20fen=C3=AAtre?= =?UTF-8?q?=20d'=C3=A9dition=20de=20carte?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 +- .../galaxyoyo/unknown/api/editor/Case.java | 6 + .../unknown/api/editor/EditorAPI.java | 38 ++- .../galaxyoyo/unknown/api/editor/RawCase.java | 12 + .../galaxyoyo/unknown/api/editor/RawMap.java | 17 ++ .../unknown/api/editor/RawSprite.java | 25 +- .../unknown/api/editor/sprites/Sprite.java | 47 +++- .../api/editor/sprites/SpriteRegister.java | 2 +- .../galaxyoyo/unknown/client/main/Main.java | 17 +- .../galaxyoyo/unknown/editor/EditorFrame.java | 231 ++++++++++++------ .../java/galaxyoyo/unknown/editor/Map.java | 42 +++- .../galaxyoyo/unknown/editor/MapPanel.java | 118 +++++++++ .../unknown/editor/ResourcePanel.java | 40 --- .../galaxyoyo/unknown/editor/SpriteComp.java | 20 ++ .../frame/listeners/MapMouseListener.java | 77 ++++++ .../frame/listeners/SpriteMouseListener.java | 32 +++ .../assets/unknown/textures/layer 1.png | Bin 0 -> 2460 bytes .../assets/unknown/textures/layer 2.png | Bin 0 -> 2662 bytes .../assets/unknown/textures/layer 3.png | Bin 0 -> 2882 bytes .../assets/unknown/textures/sprites/blank.png | Bin 0 -> 187 bytes .../unknown/textures/sprites/sprites.json | 3 + 21 files changed, 577 insertions(+), 153 deletions(-) create mode 100644 src/main/java/galaxyoyo/unknown/editor/MapPanel.java delete mode 100644 src/main/java/galaxyoyo/unknown/editor/ResourcePanel.java create mode 100644 src/main/java/galaxyoyo/unknown/frame/listeners/MapMouseListener.java create mode 100644 src/main/java/galaxyoyo/unknown/frame/listeners/SpriteMouseListener.java create mode 100644 src/main/resources/assets/unknown/textures/layer 1.png create mode 100644 src/main/resources/assets/unknown/textures/layer 2.png create mode 100644 src/main/resources/assets/unknown/textures/layer 3.png create mode 100644 src/main/resources/assets/unknown/textures/sprites/blank.png diff --git a/.gitignore b/.gitignore index 62b1a5c..6cee1a3 100644 --- a/.gitignore +++ b/.gitignore @@ -12,5 +12,6 @@ hs_err_pid* /target/ *.log -*.png +img.png +image.png /maps/ diff --git a/src/main/java/galaxyoyo/unknown/api/editor/Case.java b/src/main/java/galaxyoyo/unknown/api/editor/Case.java index 6182c3b..6e662cf 100644 --- a/src/main/java/galaxyoyo/unknown/api/editor/Case.java +++ b/src/main/java/galaxyoyo/unknown/api/editor/Case.java @@ -52,4 +52,10 @@ public class Case c.collision = collision; return c; } + + @Override + public String toString() + { + return "{Case x=" + x + " y=" + y + " couche1=" + couche1 + " couche2=" + couche2 + " couche3=" + couche3 + " collision=" + collision.name().toUpperCase() + "}\n"; + } } diff --git a/src/main/java/galaxyoyo/unknown/api/editor/EditorAPI.java b/src/main/java/galaxyoyo/unknown/api/editor/EditorAPI.java index 32240e0..26d5d67 100644 --- a/src/main/java/galaxyoyo/unknown/api/editor/EditorAPI.java +++ b/src/main/java/galaxyoyo/unknown/api/editor/EditorAPI.java @@ -22,6 +22,8 @@ import com.google.gson.GsonBuilder; public class EditorAPI { + private static File LAST_FILE; + public static RawMap toRawMap(int width, int height) { List cases = new ArrayList(); @@ -38,7 +40,7 @@ public class EditorAPI return RawMap.create(cases, width, height); } - private static Gson createGson() + public static Gson createGson() { GsonBuilder builder = new GsonBuilder(); @@ -66,20 +68,30 @@ public class EditorAPI { JFileChooser jfc = createJFC(); File file = null; - while (file == null) - { - jfc.showSaveDialog(null); - file = jfc.getSelectedFile(); - } + jfc.showSaveDialog(null); + file = jfc.getSelectedFile(); + + if (file == null) + return; if (!file.getName().toLowerCase().endsWith(".gmap") && !file.getName().toLowerCase().endsWith(".dat")) { file = new File(file.getParentFile(), file.getName() + ".gmap"); } + LAST_FILE = file; + save(file, map); } + public static void save(RawMap map) + { + if (LAST_FILE != null) + save(LAST_FILE, map); + else + saveAs(map); + } + public static void save(File file, RawMap map) { String json = createGson().toJson(map); @@ -111,11 +123,13 @@ public class EditorAPI JFileChooser jfc = createJFC(); File file = null; - while (file == null) - { - jfc.showOpenDialog(null); - file = jfc.getSelectedFile(); - } + jfc.showOpenDialog(null); + file = jfc.getSelectedFile(); + + if (file == null) + return null; + + LAST_FILE = file; return open(file); } @@ -181,6 +195,8 @@ public class EditorAPI { g.drawLine(0, y, width, y); } + + map.setFont(image); } return new Map(map); diff --git a/src/main/java/galaxyoyo/unknown/api/editor/RawCase.java b/src/main/java/galaxyoyo/unknown/api/editor/RawCase.java index 3611ce8..a1b4ea6 100644 --- a/src/main/java/galaxyoyo/unknown/api/editor/RawCase.java +++ b/src/main/java/galaxyoyo/unknown/api/editor/RawCase.java @@ -50,4 +50,16 @@ public class RawCase c.collision = collision;; return c; } + + public static RawCase create(Case c) + { + RawCase raw = new RawCase(); + raw.x = c.getPosX(); + raw.y = c.getPosY(); + raw.couche1 = RawSprite.create(c.getCoucheOne()); + raw.couche2 = RawSprite.create(c.getCoucheTwo()); + raw.couche3 = RawSprite.create(c.getCoucheThree()); + raw.collision = c.getCollision(); + return raw; + } } diff --git a/src/main/java/galaxyoyo/unknown/api/editor/RawMap.java b/src/main/java/galaxyoyo/unknown/api/editor/RawMap.java index 828d801..777a3a9 100644 --- a/src/main/java/galaxyoyo/unknown/api/editor/RawMap.java +++ b/src/main/java/galaxyoyo/unknown/api/editor/RawMap.java @@ -1,6 +1,9 @@ package galaxyoyo.unknown.api.editor; +import galaxyoyo.unknown.editor.Map; + import java.awt.image.BufferedImage; +import java.util.ArrayList; import java.util.List; public class RawMap @@ -43,4 +46,18 @@ public class RawMap { this.font = font; } + + public static RawMap create(Map map) + { + RawMap raw = new RawMap(); + raw.width = map.getWidth(); + raw.height = map.getHeight(); + raw.cases = new ArrayList(); + for (Case c : map.getAllCases()) + { + RawCase rc = RawCase.create(c); + raw.cases.add(rc); + } + return raw; + } } diff --git a/src/main/java/galaxyoyo/unknown/api/editor/RawSprite.java b/src/main/java/galaxyoyo/unknown/api/editor/RawSprite.java index a882c60..f2b2c7e 100644 --- a/src/main/java/galaxyoyo/unknown/api/editor/RawSprite.java +++ b/src/main/java/galaxyoyo/unknown/api/editor/RawSprite.java @@ -1,22 +1,29 @@ package galaxyoyo.unknown.api.editor; -import com.google.gson.annotations.Expose; +import galaxyoyo.unknown.api.editor.sprites.Sprite; public class RawSprite { - private int primaryIndex = 0; - private int secondaryIndex = 0; + private String category = "blank"; + private int index = 0; - @Expose(serialize = false, deserialize = false) - public static final RawSprite BLANK = new RawSprite(); + public static transient final RawSprite BLANK = new RawSprite(); - public int getPrimaryIndex() + public String getCategory() { - return primaryIndex; + return category; } - public int getSecondaryIndex() + public int getIndex() { - return secondaryIndex; + return index; + } + + public static RawSprite create(Sprite spr) + { + RawSprite raw = new RawSprite(); + raw.category = spr.getCategory().getName(); + raw.index = spr.getIndex(); + return raw; } } diff --git a/src/main/java/galaxyoyo/unknown/api/editor/sprites/Sprite.java b/src/main/java/galaxyoyo/unknown/api/editor/sprites/Sprite.java index 2454498..88cf708 100644 --- a/src/main/java/galaxyoyo/unknown/api/editor/sprites/Sprite.java +++ b/src/main/java/galaxyoyo/unknown/api/editor/sprites/Sprite.java @@ -1,19 +1,32 @@ package galaxyoyo.unknown.api.editor.sprites; +import java.awt.AlphaComposite; +import java.awt.Color; +import java.awt.Graphics2D; import java.awt.image.BufferedImage; import java.util.ArrayList; public class Sprite { - public static final Sprite BLANK = new Sprite(new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB), Category.create("blank", 0, new ArrayList())); - private Category cat; + public static final Sprite BLANK = new Sprite(new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB), Category.create("blank", 0, new ArrayList()), 0); + static + { + Graphics2D g = BLANK.getImage().createGraphics(); + g.setComposite(AlphaComposite.Clear); + g.setColor(new Color(0, true)); + g.fillRect(0, 0, 16, 16); + } + + private final Category cat; private final BufferedImage img; + private final int index; - public Sprite(BufferedImage img, Category cat) + public Sprite(BufferedImage img, Category cat, int index) { this.img = img; this.cat = cat; + this.index = index; if (!this.cat.getSprites().contains(this)) this.cat.getSprites().add(this); @@ -28,4 +41,32 @@ public class Sprite { return cat; } + + public int getIndex() + { + return index; + } + + @Override + public int hashCode() + { + return cat.hashCode() ^ getIndex(); + } + + @Override + public boolean equals(Object o) + { + if (!(o instanceof Sprite)) + return false; + + Sprite other = (Sprite) o; + + return hashCode() == other.hashCode(); + } + + @Override + public String toString() + { + return "{Sprite img=" + img + " cat=" + cat.getName() + "}"; + } } diff --git a/src/main/java/galaxyoyo/unknown/api/editor/sprites/SpriteRegister.java b/src/main/java/galaxyoyo/unknown/api/editor/sprites/SpriteRegister.java index a416f89..149985a 100644 --- a/src/main/java/galaxyoyo/unknown/api/editor/sprites/SpriteRegister.java +++ b/src/main/java/galaxyoyo/unknown/api/editor/sprites/SpriteRegister.java @@ -48,7 +48,7 @@ public class SpriteRegister int x = list.get(0).intValue(); int y = list.get(1).intValue(); BufferedImage child = img.getSubimage(x, y, 16, 16); - new Sprite(child, cat); + new Sprite(child, cat, nameToCoords.get(key).indexOf(list)); } sprites.put(key, cat); diff --git a/src/main/java/galaxyoyo/unknown/client/main/Main.java b/src/main/java/galaxyoyo/unknown/client/main/Main.java index eff6c31..101cecf 100644 --- a/src/main/java/galaxyoyo/unknown/client/main/Main.java +++ b/src/main/java/galaxyoyo/unknown/client/main/Main.java @@ -12,6 +12,7 @@ import java.awt.Color; import java.awt.Graphics2D; import java.awt.image.BufferedImage; import java.io.IOException; +import java.util.Locale; import javax.swing.JOptionPane; @@ -56,6 +57,8 @@ public class Main */ public static void main(String ... args) { + Locale.setDefault(Locale.FRANCE); + DEV = Main.class.getResource("/META-INF/MANIFEST.MF") == null; Logger LOGGER = (Logger) LogManager.getRootLogger(); @@ -128,7 +131,7 @@ public class Main * @see #launchFrame() * @since 0.1-aplha */ - private static void launchEditMode() + public static void launchEditMode() { System.out.println("Lancement de l'\u00e9diteur de monde ..."); int baseWidth; @@ -139,9 +142,11 @@ public class Main { try { - baseWidth = Integer.parseInt(JOptionPane.showInputDialog("Veuillez entrez le nombre de cases longueur de votre carte :")) * 16; - if (baseWidth <= 0) + baseWidth = Integer.parseInt(JOptionPane.showInputDialog("Veuillez entrez le nombre de cases longueur de votre carte (0 pour annuler) :")) * 16; + if (baseWidth < 0) throw new NumberFormatException(); + if (baseWidth == 0) + return; break; } catch (NumberFormatException ex) @@ -154,9 +159,11 @@ public class Main { try { - baseHeight = Integer.parseInt(JOptionPane.showInputDialog("Veuillez entrez le nombre de cases hauteur de votre carte :")) * 16; - if (baseHeight <= 0) + baseHeight = Integer.parseInt(JOptionPane.showInputDialog("Veuillez entrez le nombre de cases hauteur de votre carte (0 pour annuler) :")) * 16; + if (baseHeight < 0) throw new NumberFormatException(); + if (baseHeight == 0) + return; break; } catch (NumberFormatException ex) diff --git a/src/main/java/galaxyoyo/unknown/editor/EditorFrame.java b/src/main/java/galaxyoyo/unknown/editor/EditorFrame.java index cc44ddc..6c143ae 100644 --- a/src/main/java/galaxyoyo/unknown/editor/EditorFrame.java +++ b/src/main/java/galaxyoyo/unknown/editor/EditorFrame.java @@ -1,25 +1,37 @@ package galaxyoyo.unknown.editor; +import galaxyoyo.unknown.api.editor.EditorAPI; +import galaxyoyo.unknown.api.editor.RawMap; import galaxyoyo.unknown.api.editor.sprites.Category; import galaxyoyo.unknown.api.editor.sprites.Sprite; import galaxyoyo.unknown.api.editor.sprites.SpriteRegister; +import galaxyoyo.unknown.frame.listeners.CreateMapListener; +import galaxyoyo.unknown.frame.listeners.MapMouseListener; +import galaxyoyo.unknown.frame.listeners.OpenMapListener; +import galaxyoyo.unknown.frame.listeners.SpriteMouseListener; import java.awt.BorderLayout; +import java.awt.Color; import java.awt.Dimension; -import java.awt.event.ComponentEvent; -import java.awt.event.ComponentListener; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.KeyEvent; +import java.awt.event.WindowEvent; +import java.awt.event.WindowListener; import javax.swing.ImageIcon; import javax.swing.JFrame; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTabbedPane; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; -public class EditorFrame extends JFrame implements ComponentListener, MouseListener, ChangeListener +public class EditorFrame extends JFrame implements ChangeListener, ActionListener, WindowListener { private static final long serialVersionUID = -2705122356101556462L; @@ -27,14 +39,22 @@ public class EditorFrame extends JFrame implements ComponentListener, MouseListe private final JPanel content = new JPanel(); + private JMenuBar menuBar = new JMenuBar(); + private JMenu fichier = new JMenu("Fichier"); + private JMenuItem nouveau = new JMenuItem("Nouveau"); + private JMenuItem open = new JMenuItem("Ouvrir"); + private JMenuItem save = new JMenuItem("Sauvegarder"); + private JMenuItem saveAs = new JMenuItem("Sauvegarder sous ..."); + private JMenuItem exit = new JMenuItem("Quitter"); private final JTabbedPane tabs = new JTabbedPane(); private final JPanel tabEvents = new JPanel(); private final JPanel tabColl = new JPanel(); - private final JPanel mapPanel = new JPanel(); + private final MapPanel mapPanel = new MapPanel(this); private final JTabbedPane resources = new JTabbedPane(); private final JPanel couche1 = new JPanel(); private final JPanel couche2 = new JPanel(); private final JPanel couche3 = new JPanel(); + private SpriteComp selectedSprite; public EditorFrame(Map map) { @@ -46,15 +66,43 @@ public class EditorFrame extends JFrame implements ComponentListener, MouseListe this.setLocationRelativeTo(null); content.setLayout(new BorderLayout()); this.setContentPane(content); - this.addComponentListener(this); this.setVisible(true); this.setVisible(false); - tabs.addTab("Carte", mapPanel); - tabs.addTab("\u00c9vennments", tabEvents); - tabs.addTab("Collisions", tabColl); - tabs.addMouseListener(this); - tabs.addChangeListener(this); + nouveau.setMnemonic(KeyEvent.CTRL_DOWN_MASK + KeyEvent.VK_N); + nouveau.addActionListener(new CreateMapListener()); + fichier.add(nouveau); + + open.setMnemonic(KeyEvent.CTRL_DOWN_MASK + KeyEvent.VK_O); + open.addActionListener(new OpenMapListener()); + fichier.add(open); + + fichier.addSeparator(); + + save.setMnemonic(KeyEvent.CTRL_DOWN_MASK + KeyEvent.VK_S); + save.addActionListener(this); + fichier.add(save); + + saveAs.setMnemonic(KeyEvent.CTRL_DOWN_MASK + KeyEvent.SHIFT_MASK + KeyEvent.VK_S); + saveAs.addActionListener(this); + fichier.add(saveAs); + + fichier.addSeparator(); + + exit.setMnemonic(KeyEvent.CTRL_DOWN_MASK + KeyEvent.VK_Q); + exit.addActionListener(this); + fichier.add(exit); + + menuBar.add(fichier); + + this.setJMenuBar(menuBar); + + mapPanel.addMouseListener(new MapMouseListener(mapPanel, this)); + mapPanel.addMouseMotionListener(new MapMouseListener(mapPanel, this)); + + tabs.addTab("Carte", new JScrollPane(mapPanel, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED)); + tabs.addTab("\u00c9vennments", new JScrollPane(tabEvents)); + tabs.addTab("Collisions", new JScrollPane(tabColl)); content.add(tabs, BorderLayout.CENTER); @@ -73,37 +121,23 @@ public class EditorFrame extends JFrame implements ComponentListener, MouseListe resources.addTab("", new ImageIcon(getClass().getResource("/assets/unknown/textures/layer 1.png")), scroll1); resources.addTab("", new ImageIcon(getClass().getResource("/assets/unknown/textures/layer 2.png")), scroll2); resources.addTab("", new ImageIcon(getClass().getResource("/assets/unknown/textures/layer 3.png")), scroll3); - resources.addMouseListener(this); resources.addChangeListener(this); + resources.setBackgroundAt(0, Color.white); + resources.setBackgroundAt(1, Color.white); + resources.setBackgroundAt(2, Color.white); content.add(resources, BorderLayout.EAST); - this.componentResized(null); resize(); drawResources(); - drawMap(); - } - - private void drawMap() - { - if (mapPanel.getGraphics() == null) - { - mapPanel.repaint(); - } - - mapPanel.getGraphics().drawImage(map.getFont(), 0, 0, null); - mapPanel.revalidate(); - mapPanel.repaint(); + revalidate(); repaint(); } private void drawResources() { - int x = 0; - int y = 0; - couche1.removeAll(); couche2.removeAll(); couche3.removeAll(); @@ -124,22 +158,15 @@ public class EditorFrame extends JFrame implements ComponentListener, MouseListe { for (Sprite spr : cat.getSprites()) { - SpriteComp sprc1 = new SpriteComp(spr, 1); - SpriteComp sprc2 = new SpriteComp(spr, 2); - SpriteComp sprc3 = new SpriteComp(spr, 3); - sprc1.setLocation(x, y); - sprc2.setLocation(x, y); - sprc3.setLocation(x, y); + SpriteComp sprc1 = new SpriteComp(spr, 0); + SpriteComp sprc2 = new SpriteComp(spr, 1); + SpriteComp sprc3 = new SpriteComp(spr, 2); + sprc1.addMouseListener(new SpriteMouseListener(sprc1, this)); + sprc2.addMouseListener(new SpriteMouseListener(sprc2, this)); + sprc3.addMouseListener(new SpriteMouseListener(sprc3, this)); couche1.add(sprc1); couche2.add(sprc2); couche3.add(sprc3); - - x += 48; - if (couche1.getWidth() - x < 48) - { - x = 0; - y += 48; - } } } @@ -150,22 +177,6 @@ public class EditorFrame extends JFrame implements ComponentListener, MouseListe couche2.repaint(); couche3.repaint(); } - - @Override - public void componentHidden(ComponentEvent paramComponentEvent) - { - } - - @Override - public void componentMoved(ComponentEvent paramComponentEvent) - { - } - - @Override - public void componentResized(ComponentEvent paramComponentEvent) - { - } - public void resize() { @@ -190,44 +201,120 @@ public class EditorFrame extends JFrame implements ComponentListener, MouseListe ((JScrollPane) resources.getSelectedComponent()).getVerticalScrollBar().setValue(cursorPos); } + public Map getMap() + { + return map; + } + + public SpriteComp getSelectedSprite() + { + return selectedSprite; + } + + public void setSelectedSprite(SpriteComp sprite) + { + this.selectedSprite = sprite; + } + @Override - public void componentShown(ComponentEvent paramComponentEvent) + public void stateChanged(ChangeEvent event) + { + if (event.getSource() == resources) + { + if (getSelectedLayerIndex() == 0) + { + resources.setBackgroundAt(0, Color.white); + resources.setBackgroundAt(1, Color.white); + resources.setBackgroundAt(2, Color.white); + } + else if (getSelectedLayerIndex() == 1) + { + resources.setBackgroundAt(0, Color.black); + resources.setBackgroundAt(1, Color.white); + resources.setBackgroundAt(2, Color.white); + } + else if (getSelectedLayerIndex() == 2) + { + resources.setBackgroundAt(0, Color.black); + resources.setBackgroundAt(1, Color.black); + resources.setBackgroundAt(2, Color.white); + } + + repaint(); + } + } + + public int getSelectedLayerIndex() + { + return resources.getSelectedIndex(); + } + + @Override + public void actionPerformed(ActionEvent event) + { + if (event.getSource() == save) + { + EditorAPI.save(RawMap.create(map)); + } + else if (event.getSource() == saveAs) + { + EditorAPI.saveAs(RawMap.create(map)); + } + else if (event.getSource() == exit) + { + int result = JOptionPane.showConfirmDialog(null, "Voulez-vous sauvegarder votre carte avant de quitter ? Toute modification sera perdue", "Confirmation", JOptionPane.YES_NO_CANCEL_OPTION); + + if (result == 0) + save.doClick(); + + if (result != 2) + dispose(); + } + } + + @Override + public void windowActivated(WindowEvent event) { } @Override - public void mouseClicked(MouseEvent paramMouseEvent) + public void windowClosed(WindowEvent event) { - this.componentResized(null); } @Override - public void mouseEntered(MouseEvent paramMouseEvent) + public void windowClosing(WindowEvent event) { - this.componentResized(null); + int result = JOptionPane.showConfirmDialog(null, "Voulez-vous sauvegarder avant de quitter ?", "Confirmation", JOptionPane.YES_NO_CANCEL_OPTION); + + if (result == 0) + { + EditorAPI.save(RawMap.create(map)); + } + + if (result != 2) + { + dispose(); + } } @Override - public void mouseExited(MouseEvent paramMouseEvent) + public void windowDeactivated(WindowEvent event) { - this.componentResized(null); } @Override - public void mousePressed(MouseEvent paramMouseEvent) + public void windowDeiconified(WindowEvent event) { - this.componentResized(null); } @Override - public void mouseReleased(MouseEvent paramMouseEvent) + public void windowIconified(WindowEvent event) { - this.componentResized(null); } @Override - public void stateChanged(ChangeEvent paramChangeEvent) + public void windowOpened(WindowEvent event) { - this.componentResized(null); } } diff --git a/src/main/java/galaxyoyo/unknown/editor/Map.java b/src/main/java/galaxyoyo/unknown/editor/Map.java index 4068285..81e0990 100644 --- a/src/main/java/galaxyoyo/unknown/editor/Map.java +++ b/src/main/java/galaxyoyo/unknown/editor/Map.java @@ -5,7 +5,6 @@ import galaxyoyo.unknown.api.editor.RawCase; import galaxyoyo.unknown.api.editor.RawMap; import galaxyoyo.unknown.api.editor.sprites.SpriteRegister; -import java.awt.Point; import java.awt.image.BufferedImage; import java.util.ArrayList; import java.util.HashMap; @@ -13,24 +12,28 @@ import java.util.List; public class Map { + @Deprecated + private static List cases; private final EditorFrame frame; private int width; private int height; - private List cases = new ArrayList(); - private java.util.Map casesMap = new HashMap(); + private java.util.Map> casesMap = new HashMap>(); private transient BufferedImage font; public Map(RawMap raw) { + cases = new ArrayList(); this.width = raw.getWidth(); this.height = raw.getHeight(); this.font = raw.getFont(); for (RawCase rc : raw.getCases()) { - cases.add(Case.create(rc.getPosX(), rc.getPosY(), SpriteRegister.getCategory(rc.getCoucheOne().getPrimaryIndex()).getSprites().get(rc.getCoucheOne().getSecondaryIndex()), SpriteRegister.getCategory(rc.getCoucheTwo().getPrimaryIndex()).getSprites().get(rc.getCoucheTwo().getSecondaryIndex()), SpriteRegister.getCategory(rc.getCoucheThree().getPrimaryIndex()).getSprites().get(rc.getCoucheThree().getSecondaryIndex()), rc.getCollision())); + cases.add(Case.create(rc.getPosX(), rc.getPosY(), SpriteRegister.getCategory(rc.getCoucheOne().getCategory()).getSprites().get(rc.getCoucheOne().getIndex()), SpriteRegister.getCategory(rc.getCoucheTwo().getCategory()).getSprites().get(rc.getCoucheTwo().getIndex()), SpriteRegister.getCategory(rc.getCoucheThree().getCategory()).getSprites().get(rc.getCoucheThree().getIndex()), rc.getCollision())); } + reorganizeMap(); + frame = new EditorFrame(this); getFrame().setVisible(true); @@ -53,12 +56,12 @@ public class Map public Case getCase(int x, int y) { - if (casesMap.isEmpty()) - { - reorganizeMap(); - } - - return casesMap.get(new Point(x, y)); + return casesMap.getOrDefault(x, new HashMap()).get(y); + } + + public void setCase(int x, int y, Case c) + { + casesMap.get(x).put(y, c); } public BufferedImage getFont() @@ -73,9 +76,26 @@ public class Map private void reorganizeMap() { + for (int i = 0; i < width; ++i) + { + casesMap.put(i, new HashMap()); + } + for (Case c : cases) { - casesMap.put(new Point(c.getPosX() - c.getPosX() % 16, c.getPosY() - c.getPosY() % 16), c); + setCase(c.getPosX(), c.getPosY(), c); } } + + public List getAllCases() + { + List list = new ArrayList(); + + for (java.util.Map l : casesMap.values()) + { + list.addAll(l.values()); + } + + return list; + } } diff --git a/src/main/java/galaxyoyo/unknown/editor/MapPanel.java b/src/main/java/galaxyoyo/unknown/editor/MapPanel.java new file mode 100644 index 0000000..e191ef4 --- /dev/null +++ b/src/main/java/galaxyoyo/unknown/editor/MapPanel.java @@ -0,0 +1,118 @@ +package galaxyoyo.unknown.editor; + +import galaxyoyo.unknown.api.editor.Case; + +import java.awt.Color; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.image.BufferedImage; + +import javax.swing.JPanel; + +public class MapPanel extends JPanel +{ + private static final long serialVersionUID = 2629019576253690557L; + + private final EditorFrame frame; + + public MapPanel(EditorFrame frame) + { + super (); + this.frame = frame; + } + + public EditorFrame getFrame() + { + return frame; + } + + public Map getMap() + { + return frame.getMap(); + } + + @Override + public void paintComponent(Graphics g) + { + g.fillRect(0, 0, getWidth(), getHeight()); + BufferedImage img = getMap().getFont(); + int x = getWidth() / 2 - img.getWidth(); + int y = getHeight() / 2 - img.getHeight(); + int width = img.getWidth() * 2; + int height = img.getHeight() * 2; + g.drawImage(getMap().getFont(), x, y, width, height, null); + + for (Case c : getMap().getAllCases()) + { + if (isEmpty(c.getCoucheOne().getImage())) + continue; + + BufferedImage image; + + g.drawImage(c.getCoucheOne().getImage(), x + c.getPosX() * 34 + 2, y + c.getPosY() * 34 + 2, 32, 32, null); + if (frame.getSelectedLayerIndex() != 0) + { + image = recalculateAplha(c.getCoucheOne().getImage(), 0); + g.drawImage(image, x + c.getPosX() * 34 + 2, y + c.getPosY() * 34 + 2, 32, 32, null); + } + + if (isEmpty(c.getCoucheTwo().getImage()) || (frame.getSelectedLayerIndex() != 1 && frame.getSelectedLayerIndex() != 2)) + continue; + + g.drawImage(c.getCoucheTwo().getImage(), x + c.getPosX() * 34 + 2, y + c.getPosY() * 34 + 2, 32, 32, null); + if (frame.getSelectedLayerIndex() != 1) + { + image = recalculateAplha(c.getCoucheTwo().getImage(), 1); + g.drawImage(image, x + c.getPosX() * 34 + 2, y + c.getPosY() * 34 + 2, 32, 32, null); + } + + if (isEmpty(c.getCoucheThree().getImage()) || frame.getSelectedLayerIndex() != 2) + continue; + + g.drawImage(c.getCoucheThree().getImage(), x + c.getPosX() * 34 + 2, y + c.getPosY() * 34 + 2, 32, 32, null); + if (frame.getSelectedLayerIndex() != 2) + { + image = recalculateAplha(c.getCoucheThree().getImage(), 2); + g.drawImage(image, x + c.getPosX() * 34 + 2, y + c.getPosY() * 34 + 2, 32, 32, null); + } + } + } + + private BufferedImage recalculateAplha(BufferedImage image, int couche) + { + BufferedImage img = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB); + + for (int x = 0; x < image.getWidth(); ++x) + { + for (int y = 0; y < image.getHeight(); ++y) + { + Color ref = new Color(image.getRGB(x, y)); + int red = ref.getRed() / 2; + int green = ref.getGreen() / 2; + int blue = ref.getBlue() / 2; + if (image.getRGB(x, y) == 0xFFFFFF) + continue; + Graphics2D g = img.createGraphics(); + g.setColor(new Color(red / 3 * couche == 2 ? 1 : 2, green / 3 * couche == 2 ? 1 : 2, blue / 3 * couche == 2 ? 1 : 2, 100)); + g.drawLine(x, y, x, y); + } + } + + return img; + } + + private boolean isEmpty(BufferedImage image) + { + int allrgba = 0; + + for (int x = 0; x < image.getWidth(); ++x) + { + for (int y = 0; y < image.getHeight(); ++y) + { + allrgba += image.getRGB(x, y) + 1; + } + } + + return allrgba == 0; + } +} diff --git a/src/main/java/galaxyoyo/unknown/editor/ResourcePanel.java b/src/main/java/galaxyoyo/unknown/editor/ResourcePanel.java deleted file mode 100644 index 8adffce..0000000 --- a/src/main/java/galaxyoyo/unknown/editor/ResourcePanel.java +++ /dev/null @@ -1,40 +0,0 @@ -package galaxyoyo.unknown.editor; - -import galaxyoyo.unknown.api.editor.sprites.Category; -import galaxyoyo.unknown.api.editor.sprites.Sprite; -import galaxyoyo.unknown.api.editor.sprites.SpriteRegister; - -import java.awt.Color; -import java.awt.Graphics; - -import javax.swing.JPanel; - -public class ResourcePanel extends JPanel -{ - private static final long serialVersionUID = -5616765551654915921L; - - public void paintComponent(Graphics g) - { - g.setColor(Color.white); - g.fillRect(0, 0, getWidth(), getHeight()); - - int x = 0; - int y = 0; - - for (Category cat : SpriteRegister.getAllCategories()) - { - for (Sprite spr : cat.getSprites()) - { - g.drawImage(spr.getImage(), x, y, 64, 64, Color.black, null); - - x += 80; - - if (getWidth()- x < 80) - { - x = 0; - y += 80; - } - } - } - } -} diff --git a/src/main/java/galaxyoyo/unknown/editor/SpriteComp.java b/src/main/java/galaxyoyo/unknown/editor/SpriteComp.java index c534c90..4302f19 100644 --- a/src/main/java/galaxyoyo/unknown/editor/SpriteComp.java +++ b/src/main/java/galaxyoyo/unknown/editor/SpriteComp.java @@ -14,6 +14,7 @@ public class SpriteComp extends JComponent private final Sprite sprite; private final int couche; + private boolean selected; public SpriteComp(Sprite sprite, int couche) { @@ -38,6 +39,16 @@ public class SpriteComp extends JComponent return couche; } + public boolean isSelected() + { + return selected; + } + + public void setSelected(boolean selected) + { + this.selected = selected; + } + @Override public void paintComponent(Graphics g) { @@ -46,5 +57,14 @@ public class SpriteComp extends JComponent g.setColor(Color.white); g.fillRect(0, 0, getWidth(), getHeight()); g.drawImage(sprite.getImage(), 0, 0, 32, 32, Color.white, null); + + if (isSelected()) + { + g.setColor(Color.black); + g.drawLine(0, 0, getWidth() - 1, 0); + g.drawLine(0, 0, 0, getHeight() - 1); + g.drawLine(0, getHeight() - 1, getWidth() - 1, getHeight() - 1); + g.drawLine(getWidth() - 1, 0, getWidth() - 1, getHeight() - 1); + } } } diff --git a/src/main/java/galaxyoyo/unknown/frame/listeners/MapMouseListener.java b/src/main/java/galaxyoyo/unknown/frame/listeners/MapMouseListener.java new file mode 100644 index 0000000..ecf4c95 --- /dev/null +++ b/src/main/java/galaxyoyo/unknown/frame/listeners/MapMouseListener.java @@ -0,0 +1,77 @@ +package galaxyoyo.unknown.frame.listeners; + +import galaxyoyo.unknown.api.editor.Case; +import galaxyoyo.unknown.editor.EditorFrame; +import galaxyoyo.unknown.editor.Map; +import galaxyoyo.unknown.editor.MapPanel; + +import java.awt.Cursor; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +public class MapMouseListener extends MouseAdapter +{ + private final EditorFrame frame; + private final MapPanel panel; + + public MapMouseListener(MapPanel panel, EditorFrame frame) + { + this.frame = frame; + this.panel = panel; + } + + public EditorFrame getFrame() + { + return frame; + } + + @Override + public void mouseMoved(MouseEvent event) + { + Map map = getFrame().getMap(); + + int x = panel.getWidth() / 2 - map.getFont().getWidth(); + int y = panel.getHeight() / 2 - map.getFont().getHeight(); + + if (map.getCase((event.getX() - x - 2) / 34, (event.getY() - y - 2) / 34) != null && event.getX() - x >= 2 && event.getY() - y >= 2) + { + getFrame().setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); + } + else + { + getFrame().setCursor(Cursor.getDefaultCursor()); + } + } + + @Override + public void mouseReleased(MouseEvent event) + { + Map map = getFrame().getMap(); + + int x = panel.getWidth() / 2 - map.getFont().getWidth(); + int y = panel.getHeight() / 2 - map.getFont().getHeight(); + Case c = null; + + if ((c = map.getCase((event.getX() - x + 2) / 34, (event.getY() - y + 2) / 34)) != null && event.getX() - x >= 2 && event.getY() - y >= 2) + { + if (getFrame().getSelectedSprite() != null) + { + if (getFrame().getSelectedSprite().getCouche() - 1 > getFrame().getSelectedLayerIndex()) + return; + + Case n; + + switch (getFrame().getSelectedSprite().getCouche()) + { + case 0 : n = Case.create(c.getPosX(), c.getPosY(), getFrame().getSelectedSprite().getSprite(), c.getCoucheTwo(), c.getCoucheThree(), c.getCollision()); break; + case 1 : n = Case.create(c.getPosX(), c.getPosY(), c.getCoucheOne(), getFrame().getSelectedSprite().getSprite(), c.getCoucheThree(), c.getCollision()); break; + case 2 : n = Case.create(c.getPosX(), c.getPosY(), c.getCoucheOne(), c.getCoucheTwo(), getFrame().getSelectedSprite().getSprite(), c.getCollision()); break; + default : n = c; break; + } + + map.setCase((event.getX() - x + 2) / 34, (event.getY() - y + 2) / 34, n); + panel.repaint(); + } + } + } +} diff --git a/src/main/java/galaxyoyo/unknown/frame/listeners/SpriteMouseListener.java b/src/main/java/galaxyoyo/unknown/frame/listeners/SpriteMouseListener.java new file mode 100644 index 0000000..3fcd892 --- /dev/null +++ b/src/main/java/galaxyoyo/unknown/frame/listeners/SpriteMouseListener.java @@ -0,0 +1,32 @@ +package galaxyoyo.unknown.frame.listeners; + +import galaxyoyo.unknown.editor.EditorFrame; +import galaxyoyo.unknown.editor.SpriteComp; + +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +public class SpriteMouseListener extends MouseAdapter +{ + private final SpriteComp sprite; + private final EditorFrame frame; + + public SpriteMouseListener(SpriteComp sprc, EditorFrame frame) + { + this.sprite = sprc; + this.frame = frame; + } + + @Override + public void mouseReleased(MouseEvent event) + { + if (frame.getSelectedSprite() != null) + { + frame.getSelectedSprite().setSelected(false); + frame.getSelectedSprite().repaint(); + } + frame.setSelectedSprite(sprite); + sprite.setSelected(true); + sprite.repaint(); + } +} diff --git a/src/main/resources/assets/unknown/textures/layer 1.png b/src/main/resources/assets/unknown/textures/layer 1.png new file mode 100644 index 0000000000000000000000000000000000000000..bfa89dd9ff54243aea58e8bca8515bbd1f682b09 GIT binary patch literal 2460 zcmV;N31jw&P)qw(f|NPyZo&W$9{>FaO zIsgC(B1uF+RCwC#TW@R|XB~bnclG(sf6jJlyU8_8(zr=O^XEfTr_v-SNyi7a56wPp z(gX~NAwDovscQp#7)Yf`VN#)51s@m#RW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fYqI z7Jz4`-s4+e?PjpYPcoBd|I{*y?9zcJvw0Mci|!6D>0F+DQy*wV89hRBa?dSS6ZCs{ zu!31ujKS4(j({w!@d9frjD2nh+2cfZYyUN*WQ_ybgS%RPnu&S}JV``{?fQkj@o!1*UU(4$WS`Cpp;@4HNXc zbw&L02e(!>!KV(t4M1NN4=`3dnawjYppwkwb*YMqTc!NUl%G@QFH!`SV&=UEzgOFi zzb5QAov(OYCSq3-Iig!s6xm5KU4Y`pt!Gq({`_+BlD>}k+3yc%_kVAdUx)A9IZy-$ z`aKM94KXo$R(*~7+$QO+{rHPZCJ#7Yddw9!E~G5E zo#eB56FEgg#jPGJdM_eG7`mwPs1I=X^;KM)MPD zY1GwQs(@;W(9O}3^W_w=p1?PRfN~yTUBHCeq|!22UN@6(=Kufz literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/unknown/textures/layer 3.png b/src/main/resources/assets/unknown/textures/layer 3.png new file mode 100644 index 0000000000000000000000000000000000000000..b7e381087707cc39cc0ea981ace3939074d7530d GIT binary patch literal 2882 zcmV-I3%&G-P)qw(f|NPyZo&W$9{>FaO zIsgC)$Vo&&RCwC#TYYR3_Zfcd^T+w@^G9qaAx=n>3gVzak}X3ltx&b`C9$n#>L}8v zn2;u_p=r|8u9GT;Rtae;`(u<&YE{&AS|^najgN|HEuc}vvZ_JTC?DY?g(V~u+t`jj za{l)1kMr+xcfNCM=fl$I`_Gv-=kqsd zFd`O(fNFsoOcYiwZ^HGlP{W8=Py(t2-nXg);prq&nHOGd=J2&fe}0Z$^8$)Uw%K{Sy;BAF8Ntjz)d zOF~3l1XK&Wz0Cyxa64^v5kOS2n5|J00kr^kJ8h!WwT{=u?qlWhCQN)W4c2B6TR`i$ z7>cNhfLe!}wBpjrEAz@3APoXqEx(Y8s7OG)!%YcRE3Z_561dc3#Q|o>}JW4fQTt>xTDuE zs(}!3f6 zrmWIx3K)$?FnaK;?7S7r>>?4d(46NzaCV*wkNN^cdxdvV9(b?IF zplf}(+%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6dCS*(pQo z(cz{S4ETZ)P>Uj@z(^mH;YEg<#i)lzvKAmSU?G9m^lY%2*#7Me6uB`%#EVaNf-zBL z!%_74k|M|qA;XP0M?F)$p$e$RHKZ#$DR4DKEGFJnpyRo#(OfQ<$8%lth zBGi`5OHuKL5}>t?Xaw+v5}+ia5x^JR1!`tqr_=E~uLFRg!8MlQOP{40avxv*-{D6* gz9isLC*Xer02k|Ng~&Zst^fc407*qoM6N<$f{a>88~^|S literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/unknown/textures/sprites/blank.png b/src/main/resources/assets/unknown/textures/sprites/blank.png new file mode 100644 index 0000000000000000000000000000000000000000..ff8d25c0b429de6c54ebc3cd2066984269257532 GIT binary patch literal 187 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!6#=yXs@#Xw?AcrO0(btiIVPik{pF~z5pDoGT z-G$*l2rk&Wd@@jkv%n*=n1Ml08H5=tmfDvA1=&kHeO=k_Gjeh3i6p%IZwC~z@N{tu zu{fRl=l}oz^=v?(#-@>QM3;%#hbN<91J@xYi8O&Lji_@% literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/unknown/textures/sprites/sprites.json b/src/main/resources/assets/unknown/textures/sprites/sprites.json index 702214b..141d572 100644 --- a/src/main/resources/assets/unknown/textures/sprites/sprites.json +++ b/src/main/resources/assets/unknown/textures/sprites/sprites.json @@ -1,4 +1,7 @@ { + "blank": [ + [0,0] + ], "gazon": [ [0,0], [0,16],