From 37b76eff30ae157924c4b03fa4b2c23795faaa3c Mon Sep 17 00:00:00 2001 From: yoyosource Date: Wed, 19 Apr 2023 18:08:36 +0200 Subject: [PATCH] Add ShowModeParameterType.TICKS_SINCE_START Signed-off-by: yoyosource --- .../bausystem/features/tracer/show/EntityShowMode.java | 2 ++ .../bausystem/features/tracer/show/ShowModeParameter.java | 5 +++++ .../features/tracer/show/ShowModeParameterType.java | 7 ++++--- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/show/EntityShowMode.java b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/show/EntityShowMode.java index bfcd15e5..6f61a08e 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/show/EntityShowMode.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/show/EntityShowMode.java @@ -202,6 +202,8 @@ public class EntityShowMode implements ShowMode { entity.setDisplayName(fuseTicks + ""); } else if (showModeParameter.isCount()) { entity.setDisplayName(new HashSet<>(records).size() + ""); + } else if (showModeParameter.isTicksSinceStart()) { + entity.setDisplayName((80 - fuseTicks) + tntPosition.getRecord().getOffset() + ""); } } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/show/ShowModeParameter.java b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/show/ShowModeParameter.java index d8e3a75f..4babe506 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/show/ShowModeParameter.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/show/ShowModeParameter.java @@ -31,6 +31,7 @@ public class ShowModeParameter { private boolean ticks = false; private boolean count = false; private boolean buildDestroyOnly = false; + private boolean ticksSinceStart = false; public void enableWater() { this.water = true; @@ -63,4 +64,8 @@ public class ShowModeParameter { public void enableBuildDestroyOnly() { this.buildDestroyOnly = true; } + + public void enableTicksSinceStart() { + this.ticksSinceStart = true; + } } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/show/ShowModeParameterType.java b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/show/ShowModeParameterType.java index 3d28237d..a80a3633 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/show/ShowModeParameterType.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/show/ShowModeParameterType.java @@ -38,9 +38,10 @@ public enum ShowModeParameterType { }, Arrays.asList("-advanced", "-a"), "INTERPOLATE_Y", "INTERPOLATE_XZ"), SOURCE(ShowModeParameter::enableSourceOnly, Arrays.asList("-source", "-sourceonly", "-ignite"), "TICKS", "ADVANCED", "INTERPOLATE_Y", "INTERPOLATE_XZ", "WATER"), EXPLODE(ShowModeParameter::enableExplodeOnly, Arrays.asList("-explode", "-explodeonly"), "TICKS", "ADVANCED", "INTERPOLATE_Y", "INTERPOLATE_XZ", "WATER"), - TICKS(ShowModeParameter::enableTicks, Arrays.asList("-ticks", "-t"), "EXPLODE", "SOURCE", "COUNT"), - COUNT(ShowModeParameter::enableCount, Arrays.asList("-count", "-c"), "COUNT"), - BUILD_DESTROY_ONLY(ShowModeParameter::enableBuildDestroyOnly, Arrays.asList("-builddestroy", "-builddestoryonly"), "WATER"); + TICKS(ShowModeParameter::enableTicks, Arrays.asList("-ticks", "-t"), "EXPLODE", "SOURCE", "COUNT", "TICKS_SINCE_START"), + COUNT(ShowModeParameter::enableCount, Arrays.asList("-count", "-c"), "TICKS", "TICKS_SINCE_START"), + BUILD_DESTROY_ONLY(ShowModeParameter::enableBuildDestroyOnly, Arrays.asList("-builddestroy", "-builddestoryonly"), "WATER"), + TICKS_SINCE_START(ShowModeParameter::enableTicksSinceStart, Arrays.asList("-tickssincestart", "-tss"), "TICKS", "COUNT"); @Getter private final Consumer showModeParameterConsumer;