From c434e18f8f39803dbfeca4b9a8b590042d8f1248 Mon Sep 17 00:00:00 2001 From: ApsZoldat Date: Mon, 13 Nov 2023 23:25:44 +0300 Subject: [PATCH] Add drawing layers to markers --- core/assets/bundles/bundle.properties | 4 +- core/src/mindustry/core/Renderer.java | 9 ++++ core/src/mindustry/game/MapObjectives.java | 28 ++++++++--- .../mindustry/graphics/OverlayRenderer.java | 9 ---- core/src/mindustry/logic/LMarkerControl.java | 21 ++++---- core/src/mindustry/logic/LStatement.java | 20 ++++++++ core/src/mindustry/logic/LStatements.java | 48 ++++++++++++------- 7 files changed, 95 insertions(+), 44 deletions(-) diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 62c906fa56..9a2b49311f 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -2460,5 +2460,5 @@ lenum.within = Check if unit is near a position. lenum.boost = Start/stop boosting. lenum.texture = Texture name straight from game's texture atlas (using kebab-case naming style).\nSecond and third arguments are additional suffixes added using "-" separator.\nIf additional arguments are not strings, nothing is added to first string. -lenum.textureWidth = Width of texture in tiles. Zero value scales marker width to original texture's size. -lenum.textureHeight = Height of texture in tiles. Zero value scales marker height to original texture's size. +lenum.texturewidth = Width of texture in tiles. Zero value scales marker width to original texture's size. +lenum.textureheight = Height of texture in tiles. Zero value scales marker height to original texture's size. diff --git a/core/src/mindustry/core/Renderer.java b/core/src/mindustry/core/Renderer.java index f78a9da907..ba935f438d 100644 --- a/core/src/mindustry/core/Renderer.java +++ b/core/src/mindustry/core/Renderer.java @@ -371,6 +371,15 @@ public class Renderer implements ApplicationListener{ }); } + //draw objective markers + state.rules.objectives.eachRunning(obj -> { + for(var marker : obj.markers) marker.draw(); + }); + + for(var marker : state.markers.values()){ + if(marker != null) marker.draw(); + } + Draw.draw(Layer.overlayUI, overlays::drawTop); if(state.rules.fog) Draw.draw(Layer.fogOfWar, fog::drawFog); Draw.draw(Layer.space, this::drawLanding); diff --git a/core/src/mindustry/game/MapObjectives.java b/core/src/mindustry/game/MapObjectives.java index c648aecc6f..afc4608e9a 100644 --- a/core/src/mindustry/game/MapObjectives.java +++ b/core/src/mindustry/game/MapObjectives.java @@ -609,12 +609,14 @@ public class MapObjectives implements Iterable, Eachable