1
0
mirror of https://github.com/ynerant/Level-Editor.git synced 2025-06-21 01:48:21 +02:00

Ajouté entièrement l'enregistrement des sprites

This commit is contained in:
galaxyoyo
2015-01-07 22:50:11 +01:00
parent 5847486e2f
commit 968536742b
9 changed files with 139 additions and 9 deletions

View File

@ -4,6 +4,7 @@
package galaxyoyo.unknown.client.main;
import galaxyoyo.unknown.api.editor.EditorAPI;
import galaxyoyo.unknown.api.editor.sprites.SpriteRegister;
import galaxyoyo.unknown.frame.MainFrame;
import java.awt.Color;
@ -103,6 +104,8 @@ public class Main
}
}
SpriteRegister.refreshAllSprites();
if (set.has(edit))
{
launchEditMode();

View File

@ -1,14 +1,22 @@
package galaxyoyo.unknown.editor;
import java.util.ArrayList;
import java.util.List;
import galaxyoyo.unknown.api.editor.sprites.Sprite;
public class Editor
{
private final EditorFrame frame;
private byte[] bytes;
private List<List<Sprite>> sprites = new ArrayList<List<Sprite>>();
public Editor(byte[] bytes)
{
frame = new EditorFrame();
frame = new EditorFrame(this);
this.bytes = bytes;
getFrame().setVisible(true);
}
public EditorFrame getFrame()
@ -25,4 +33,9 @@ public class Editor
{
this.bytes = bytes;
}
public Sprite getSprite(int x, int y)
{
return sprites.get(x).get(y);
}
}

View File

@ -5,8 +5,12 @@ import javax.swing.JFrame;
public class EditorFrame extends JFrame
{
private static final long serialVersionUID = -2705122356101556462L;
@SuppressWarnings("unused")
private final Editor editor;
public EditorFrame()
public EditorFrame(Editor editor)
{
this.editor = editor;
}
}