diff --git a/bin/RabiClone.jar b/bin/RabiClone.jar index 6c8ce04..2c1ba15 100644 Binary files a/bin/RabiClone.jar and b/bin/RabiClone.jar differ diff --git a/src/sig/map/Map.java b/src/sig/map/Map.java index cd9eb75..6762ba1 100644 --- a/src/sig/map/Map.java +++ b/src/sig/map/Map.java @@ -73,18 +73,14 @@ public class Map { return null; } - public static void SaveMap(Maps map) { - try { - DataOutputStream stream = new DataOutputStream(new FileOutputStream(map.getFile())); - saveCharData(stream,map.map.tiles); - saveByteData(stream,map.map.views); - saveByteData(stream,map.map.backgrounds); - saveByteData(stream,map.map.colors); - saveByteData(stream,map.map.types); - stream.close(); - } catch (IOException e) { - e.printStackTrace(); - } + public static void SaveMap(Maps map) throws IOException { + DataOutputStream stream = new DataOutputStream(new FileOutputStream(map.getFile())); + saveCharData(stream,map.map.tiles); + saveByteData(stream,map.map.views); + saveByteData(stream,map.map.backgrounds); + saveByteData(stream,map.map.colors); + saveByteData(stream,map.map.types); + stream.close(); } private static void saveCharData(DataOutputStream stream, char[] a) throws IOException { diff --git a/src/sig/objects/EditorRenderer.java b/src/sig/objects/EditorRenderer.java index cab0b6e..b757816 100644 --- a/src/sig/objects/EditorRenderer.java +++ b/src/sig/objects/EditorRenderer.java @@ -2,6 +2,7 @@ package sig.objects; import java.awt.event.KeyEvent; import java.awt.event.MouseEvent; +import java.io.IOException; import sig.RabiClone; import sig.engine.Alpha; @@ -17,12 +18,21 @@ public class EditorRenderer extends LevelRenderer{ Tile selectedTile = Tile.WALL; - final StringBuilder tempText = new StringBuilder("Hello World!\n\n Test newlines!\nTest\nTest2\nTest3"); - int frameCount=0; - StringBuilder frameCheck = new StringBuilder("I am blue! Frame:").append(frameCount); + StringBuilder messageLog = new StringBuilder(); + final static long MESSAGE_TIME = 5000; + long last_message_log = System.currentTimeMillis(); public EditorRenderer(Panel panel) { super(panel); + AddMessage("Level editing mode started."); + } + + private void AddMessage(String...s) { + messageLog.append('\n'); + for (int i=0;i0) { + if (System.currentTimeMillis()-last_message_log>MESSAGE_TIME) { + last_message_log=System.currentTimeMillis(); + messageLog.replace(messageLog.indexOf("\n"), messageLog.indexOf("\n",messageLog.indexOf("\n")), ""); + } } } @@ -64,8 +89,7 @@ public class EditorRenderer extends LevelRenderer{ @Override public void draw(byte[] p) { super.draw(p); - Draw_Text(32,16,tempText,Font.PROFONT_12); - Draw_Text_Ext(104,137,new StringBuilder("I am blue! Frame:").append(frameCount++),Font.PROFONT_12,Alpha.ALPHA0,PaletteColor.SLATE_BLUE); + Draw_Text(4,0,messageLog,Font.PROFONT_12); } @Override