diff --git a/PaletteReference.png b/PaletteReference.png new file mode 100644 index 0000000..ce4ba4b Binary files /dev/null and b/PaletteReference.png differ diff --git a/README.md b/README.md index 5e0fba3..b29ddb7 100644 --- a/README.md +++ b/README.md @@ -27,4 +27,5 @@ The system will also use the SigScript updating system to keep files up-to-date. Configuration is modified at the top of the script file while the command list includes all included modules inside of `scripts`. Mizue (みずえ) 水恵 -Turn off inline hints: (F1, search "Preferences: Open Settings (JSON)) "editor.inlayHints.enabled": false \ No newline at end of file +Turn off inline hints: (F1, search "Preferences: Open Settings (JSON)) "editor.inlayHints.enabled": false +Profont: 7x14 per tile. \ No newline at end of file diff --git a/sprites/Profont.gif b/sprites/Profont.gif new file mode 100644 index 0000000..342e2d1 Binary files /dev/null and b/sprites/Profont.gif differ diff --git a/src/sig/DrawLoop.java b/src/sig/DrawLoop.java index f65d981..d4d9454 100644 --- a/src/sig/DrawLoop.java +++ b/src/sig/DrawLoop.java @@ -1,6 +1,7 @@ package sig; import sig.engine.Alpha; +import sig.engine.PaletteColor; import sig.engine.Panel; import sig.engine.Sprite; @@ -49,6 +50,10 @@ public class DrawLoop { } public static void Draw_Sprite_Partial_Ext(double x, double y, double xOffset, double yOffset, double w, double h, Sprite sprite, Alpha alpha){ + Draw_Sprite_Partial_Ext(x, y, xOffset, yOffset, w, h, sprite, alpha, PaletteColor.NORMAL); + } + + public static void Draw_Sprite_Partial_Ext(double x, double y, double xOffset, double yOffset, double w, double h, Sprite sprite, Alpha alpha, PaletteColor col){ byte[] p = panel.pixel; for(int X=(int)xOffset;X<(int)(w+xOffset);X++){ for(int Y=(int)yOffset;Y<(int)(h+yOffset);Y++){ @@ -59,7 +64,7 @@ public class DrawLoop { if (index<0||index>=p.length||sprite.getBi_array()[Y*sprite.getWidth()+X]==32||p[index]==sprite.getBi_array()[Y*sprite.getWidth()+X]) { continue; } else { - Draw(p,index,sprite.getBi_array()[Y*sprite.getWidth()+X],alpha); + Draw(p,index,col==PaletteColor.NORMAL?sprite.getBi_array()[Y*sprite.getWidth()+X]:(byte)col.ordinal(),alpha); } } } diff --git a/src/sig/engine/Object.java b/src/sig/engine/Object.java index ea2bd5b..713033b 100644 --- a/src/sig/engine/Object.java +++ b/src/sig/engine/Object.java @@ -62,6 +62,10 @@ public abstract class Object implements GameEntity{ DrawLoop.Draw_Sprite_Partial_Ext(x,y,xOffset,yOffset,w,h,sprite,alpha); } + protected void Draw_Sprite_Partial_Ext(double x, double y, double xOffset, double yOffset, double w, double h, Sprite sprite, Alpha alpha, PaletteColor col){ + DrawLoop.Draw_Sprite_Partial_Ext(x,y,xOffset,yOffset,w,h,sprite,alpha,col); + } + protected boolean KeyHeld(int key) { return panel.KEYS.getOrDefault(key,false); } diff --git a/src/sig/engine/PaletteColor.java b/src/sig/engine/PaletteColor.java new file mode 100644 index 0000000..487ae26 --- /dev/null +++ b/src/sig/engine/PaletteColor.java @@ -0,0 +1,37 @@ +package sig.engine; + +public enum PaletteColor { + EMERALD, + MANTIS, + YELLOW_GREEN, + YELLOW, + PEACH, + ORANGE, + CRIMSON, + RED, + PLUM, + VIOLET, + BYZANTIUM, + DEEP_RUBY, + PUCE, + OLD_ROSE, + MELON, + LIGHT_HOT_PINK, + PERSIAN_PINK, + SKY_MAGENTA, + RAZZMIC_BERRY, + BLACK, + JAPANESE_VIOLET, + FRENCH_LILAC, + AMETHYST, + ORCHID_PINK, + WHITE, + FRESH_AIR, + SKY_BLUE, + AZURE, + SLATE_BLUE, + DARK_ORCHID, + GRAPE, + MIDNIGHT_BLUE, + NORMAL; +} diff --git a/src/sig/engine/Sprite.java b/src/sig/engine/Sprite.java index cf32be9..ad024a8 100644 --- a/src/sig/engine/Sprite.java +++ b/src/sig/engine/Sprite.java @@ -13,6 +13,7 @@ public enum Sprite{ NANA_SMALL(new File(new File("..","sprites"),"1x.gif")), TILE_SHEET(new File(new File("..","sprites"),"tiles.gif")), MAP_TILE_INFO(new File(new File("..","sprites"),"maptileinfo.gif")), + PROFONT(new File(new File("..","sprites"),"Profont.gif")), ; diff --git a/src/sig/objects/EditorRenderer.java b/src/sig/objects/EditorRenderer.java index 32b8d27..40bea5a 100644 --- a/src/sig/objects/EditorRenderer.java +++ b/src/sig/objects/EditorRenderer.java @@ -6,6 +6,7 @@ import java.awt.event.MouseEvent; import sig.RabiClone; import sig.engine.Alpha; import sig.engine.MouseScrollValue; +import sig.engine.PaletteColor; import sig.engine.Panel; import sig.engine.Sprite; import sig.map.Map; @@ -58,7 +59,7 @@ public class EditorRenderer extends LevelRenderer{ @Override public void draw(byte[] p) { super.draw(p); - Draw_Sprite(16, 16, Sprite.MAP_TILE_INFO); + Draw_Sprite_Partial_Ext(16, 16, 0, 0, 96, 96, Sprite.PROFONT, Alpha.ALPHA0, PaletteColor.SKY_BLUE); } @Override