From 148c0ce2a176df280d096096c24ca247b216ed22 Mon Sep 17 00:00:00 2001 From: sigonasr2 Date: Thu, 2 Jun 2022 21:54:20 -0500 Subject: [PATCH] Allow adjustments for all screen properties at each screen location through the editor Co-authored-by: r3cp3ct <45179536+r3cp3ct@users.noreply.github.com> Co-authored-by: sigonasr2 --- maps/world1.map | Bin 295488 -> 295488 bytes src/sig/engine/Object.java | 6 +++++ src/sig/engine/Panel.java | 6 +++++ src/sig/map/Maps.java | 30 ++++++++++++++++++++++++ src/sig/objects/EditorRenderer.java | 35 ++++++++++++++++++++++++---- 5 files changed, 72 insertions(+), 5 deletions(-) diff --git a/maps/world1.map b/maps/world1.map index 88ae8c9a60f337b882300529256f3fec6b8f7973..0798e2e716613f0eeab4a823357a97630dff4742 100644 GIT binary patch delta 60 tcmX@mB6OfdsG)_ig{g&k3kzd|ATt9BU}WAXIG<6F2}O{BfoY;(9RO!A2&Vu5 delta 21 ccmX@mB6OfdsG)_ig{g&k3kzezMg@B&09g|U3IG5A diff --git a/src/sig/engine/Object.java b/src/sig/engine/Object.java index 493e847..75edcbd 100644 --- a/src/sig/engine/Object.java +++ b/src/sig/engine/Object.java @@ -82,6 +82,12 @@ public abstract class Object implements GameEntity{ return panel.KEYS.getOrDefault(key,false); } + protected void KeyPressed(int key) { + } + + protected void KeyReleased(int key) { + } + protected boolean MouseHeld(int mb) { return panel.MOUSE.getOrDefault(mb,false); } diff --git a/src/sig/engine/Panel.java b/src/sig/engine/Panel.java index b026861..02a9cf1 100644 --- a/src/sig/engine/Panel.java +++ b/src/sig/engine/Panel.java @@ -421,12 +421,18 @@ public class Panel extends JPanel implements Runnable,KeyListener { @Override public void keyPressed(KeyEvent e) { KEYS.put(e.getKeyCode(),true); + for (int i=0;i=0&&index=0&&index=this.map.backgrounds.length) { + return Background.DEFAULT; + } else { + return Background.values()[this.map.backgrounds[index]]; + } + } + + public void setBackground(int x,int y,Background background) { + int index = (y/Tile.TILE_SCREEN_COUNT_Y)*(Map.MAP_WIDTH/Tile.TILE_WIDTH)+x/Tile.TILE_SCREEN_COUNT_X; + if (index>=0&&index