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:
@ -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();
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user