From a3aaef41df9184e9b6dc6a0b7230a2bf65390273 Mon Sep 17 00:00:00 2001 From: Stachelbeere1248 Date: Sun, 26 Nov 2023 17:36:04 +0100 Subject: [PATCH] st shortener config --- .../zombiesutils/ZombiesUtils.java | 2 +- .../config/ZombiesUtilsConfig.java | 19 +++++++++++++------ .../render/RenderGameOverlayHandler.java | 9 +++++---- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/github/stachelbeere1248/zombiesutils/ZombiesUtils.java b/src/main/java/com/github/stachelbeere1248/zombiesutils/ZombiesUtils.java index df80f4c..2987db7 100644 --- a/src/main/java/com/github/stachelbeere1248/zombiesutils/ZombiesUtils.java +++ b/src/main/java/com/github/stachelbeere1248/zombiesutils/ZombiesUtils.java @@ -35,7 +35,7 @@ public class ZombiesUtils { logger = event.getModLog(); ZombiesUtilsConfig.config = new Configuration( event.getSuggestedConfigurationFile(), - "1.2.1" + "1.2.0" ); ZombiesUtilsConfig.load(); } diff --git a/src/main/java/com/github/stachelbeere1248/zombiesutils/config/ZombiesUtilsConfig.java b/src/main/java/com/github/stachelbeere1248/zombiesutils/config/ZombiesUtilsConfig.java index 4e8ceea..5744ca7 100644 --- a/src/main/java/com/github/stachelbeere1248/zombiesutils/config/ZombiesUtilsConfig.java +++ b/src/main/java/com/github/stachelbeere1248/zombiesutils/config/ZombiesUtilsConfig.java @@ -10,6 +10,8 @@ public class ZombiesUtilsConfig { public static Configuration config; private static boolean slaToggle; private static boolean slaShortener; + private static boolean shortSpawntime; + private static String chatMacro; private static String defaultCategory; private static short waveOffset; @@ -21,13 +23,13 @@ public class ZombiesUtilsConfig { slaToggle = config.getBoolean( "SLA Launcher", Configuration.CATEGORY_GENERAL, - slaToggle, + false, "Should SLA be started when a game starts?" ); slaShortener = config.getBoolean( "shortened SLA", Configuration.CATEGORY_GENERAL, - slaShortener, + true, "If on, inactive windows / rooms will not show" ); chatMacro = config.getString( @@ -50,10 +52,12 @@ public class ZombiesUtilsConfig { 200, "max: 200 ticks" ); - - ZombiesUtils.getInstance().getLogger().debug("Saving Config..."); - config.save(); - ZombiesUtils.getInstance().getLogger().debug("Config saved."); + shortSpawntime = config.getBoolean( + "passed wave spawns", + Configuration.CATEGORY_GENERAL, + true, + "Display spawn-time for passed waves" + ); } public static short getWaveOffset() { @@ -73,6 +77,9 @@ public class ZombiesUtilsConfig { public static boolean isSlaShortened() { return slaShortener; } + public static boolean isSpawntimeNotShortened() { + return shortSpawntime; + } public static String getChatMacro() { return chatMacro; } diff --git a/src/main/java/com/github/stachelbeere1248/zombiesutils/render/RenderGameOverlayHandler.java b/src/main/java/com/github/stachelbeere1248/zombiesutils/render/RenderGameOverlayHandler.java index 9a6c6f6..892ced4 100644 --- a/src/main/java/com/github/stachelbeere1248/zombiesutils/render/RenderGameOverlayHandler.java +++ b/src/main/java/com/github/stachelbeere1248/zombiesutils/render/RenderGameOverlayHandler.java @@ -80,11 +80,12 @@ public class RenderGameOverlayHandler { int color = 0xFFFF55; for (byte waveTime: waveTimes) { + int clonedColor = color; final short waveTicks = (short) ((waveTime * 20)-rl); if (roundTicks>waveTicks) { - heightIndex++; - continue; + if (ZombiesUtilsConfig.isSpawntimeNotShortened()) clonedColor = 0x555555; + else continue; } final String time = getWaveString(waveTicks, heightIndex + 1); @@ -97,9 +98,9 @@ public class RenderGameOverlayHandler { time, screenWidth - width, screenHeight - fontRenderer.FONT_HEIGHT * (length-heightIndex), - color + clonedColor ); - color = 0xAAAAAA; + if (clonedColor!=0x555555) color = 0xAAAAAA; heightIndex++; } }