From b418ac1abe7995c874be9ab7f623fa12bb6bf385 Mon Sep 17 00:00:00 2001 From: S010MON Date: Sun, 20 Mar 2022 19:51:46 +0100 Subject: [PATCH] adds borders to mini-maps --- .../app/model/soundBoundary/SoundBoundaryImp.java | 2 +- src/main/java/app/view/simulation/Renderer.java | 14 ++++++++++++++ src/main/resources/map_1.txt | 4 +--- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/main/java/app/model/soundBoundary/SoundBoundaryImp.java b/src/main/java/app/model/soundBoundary/SoundBoundaryImp.java index 3e920ca4..f76a046e 100644 --- a/src/main/java/app/model/soundBoundary/SoundBoundaryImp.java +++ b/src/main/java/app/model/soundBoundary/SoundBoundaryImp.java @@ -32,7 +32,7 @@ public ArrayList getCorners() @Override public void draw(GraphicsContext gc) { - gc.setStroke(Color.BLACK); + gc.setStroke(Color.GREEN); gc.strokeLine(a.getX(), a.getY(), b.getX(), b.getY()); } diff --git a/src/main/java/app/view/simulation/Renderer.java b/src/main/java/app/view/simulation/Renderer.java index 73a1578c..5c413420 100644 --- a/src/main/java/app/view/simulation/Renderer.java +++ b/src/main/java/app/view/simulation/Renderer.java @@ -128,6 +128,13 @@ private void drawMiniMapGuard(GraphicsContext gc) DIAMETER * Info.getInfo().getZoom(), DIAMETER * Info.getInfo().getZoom()); } + + gc.setStroke(Color.BLACK); + gc.setLineWidth(2); + gc.strokeRect((xPos -2) * Info.getInfo().getZoom() + Info.getInfo().offsetX, + (yPos -2) * Info.getInfo().getZoom() + Info.getInfo().offsetY, + (mapWidthScaled + 4) * Info.getInfo().getZoom(), + (mapHeightScaled + 4) * Info.getInfo().getZoom()); } private void drawMiniMapIntruder(GraphicsContext gc) @@ -167,6 +174,13 @@ private void drawMiniMapIntruder(GraphicsContext gc) DIAMETER * Info.getInfo().getZoom(), DIAMETER * Info.getInfo().getZoom()); } + + gc.setStroke(Color.BLACK); + gc.setLineWidth(2); + gc.strokeRect((xPos -2) * Info.getInfo().getZoom() + Info.getInfo().offsetX, + (yPos -2) * Info.getInfo().getZoom() + Info.getInfo().offsetY, + (mapWidthScaled + 4) * Info.getInfo().getZoom(), + (mapHeightScaled + 4) * Info.getInfo().getZoom()); } private void handleScroll(ScrollEvent e) diff --git a/src/main/resources/map_1.txt b/src/main/resources/map_1.txt index a1ae6fba..8c6cf449 100644 --- a/src/main/resources/map_1.txt +++ b/src/main/resources/map_1.txt @@ -65,6 +65,4 @@ wall = 1001 740 1078 760 wall = 1139 740 1158 759 spawnAreaGuards = 200 320 300 421 spawnAreaIntruders = 1250 700 1350 800 -targetArea = 800 99 920 181 -soundSource = 300 300 200 - +targetArea = 800 99 920 181 \ No newline at end of file