From 8c777e79fa28385b28c1a753bbb7a5fb5d0a440c Mon Sep 17 00:00:00 2001 From: ApsZoldat <128713348+ApsZoldat@users.noreply.github.com> Date: Thu, 28 Sep 2023 00:17:59 +0300 Subject: [PATCH] Add marker instruction to world processors (#9087) * Basic implementation of world processor marker control * Add line marker, some marker control fixes * Add remote for setting markers, add marker writer/reader to TypeIO * Add sides cap to ShapeTextMarker's draw() method * Marker instruction code refactor, revert accident auto-formatting, fix marker control bugs * Cleanup LMarkerControl.java * Remove deleted marker controls from MapObjectives * Marker control method refactor, fix minimap marker rendering * Refactor, proper double comparsion in MapObjectives * Fix line marker's color not changing through world processors --- core/assets/bundles/bundle.properties | 2 + core/src/mindustry/game/MapObjectives.java | 193 +++++++++++++++++- core/src/mindustry/game/Rules.java | 3 + .../mindustry/graphics/MinimapRenderer.java | 4 + .../mindustry/graphics/OverlayRenderer.java | 4 + core/src/mindustry/io/TypeIO.java | 15 ++ core/src/mindustry/logic/LExecutor.java | 59 ++++++ core/src/mindustry/logic/LMarkerControl.java | 37 ++++ core/src/mindustry/logic/LStatements.java | 85 +++++++- 9 files changed, 400 insertions(+), 2 deletions(-) create mode 100644 core/src/mindustry/logic/LMarkerControl.java diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 29fe75771a..f11c906248 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -663,6 +663,7 @@ marker.shapetext.name = Shape Text marker.minimap.name = Minimap marker.shape.name = Shape marker.text.name = Text +marker.line.name = Line marker.background = Background marker.outline = Outline @@ -2301,6 +2302,7 @@ lst.getflag = Check if a global flag is set. lst.setprop = Sets a property of a unit or building. lst.effect = Create a particle effect. lst.sync = Sync a variable across the network.\nLimited to 20 times a second per variable. +lst.marker = Control markers displayed in world.\nCannot control markers created by objectives.\nEach marker created by this instruction has its own id. logic.nounitbuild = [red]Unit building logic is not allowed here. diff --git a/core/src/mindustry/game/MapObjectives.java b/core/src/mindustry/game/MapObjectives.java index 21717202bc..d15c50e511 100644 --- a/core/src/mindustry/game/MapObjectives.java +++ b/core/src/mindustry/game/MapObjectives.java @@ -16,6 +16,7 @@ import mindustry.game.MapObjectives.*; import mindustry.gen.*; import mindustry.graphics.*; import mindustry.io.*; +import mindustry.logic.*; import mindustry.type.*; import mindustry.world.*; @@ -60,7 +61,8 @@ public class MapObjectives implements Iterable, Eachable, Eachable