st shortener config

This commit is contained in:
Stachelbeere1248 2023-11-26 17:36:04 +01:00
parent 656af97389
commit a3aaef41df
3 changed files with 19 additions and 11 deletions

View file

@ -35,7 +35,7 @@ public class ZombiesUtils {
logger = event.getModLog(); logger = event.getModLog();
ZombiesUtilsConfig.config = new Configuration( ZombiesUtilsConfig.config = new Configuration(
event.getSuggestedConfigurationFile(), event.getSuggestedConfigurationFile(),
"1.2.1" "1.2.0"
); );
ZombiesUtilsConfig.load(); ZombiesUtilsConfig.load();
} }

View file

@ -10,6 +10,8 @@ public class ZombiesUtilsConfig {
public static Configuration config; public static Configuration config;
private static boolean slaToggle; private static boolean slaToggle;
private static boolean slaShortener; private static boolean slaShortener;
private static boolean shortSpawntime;
private static String chatMacro; private static String chatMacro;
private static String defaultCategory; private static String defaultCategory;
private static short waveOffset; private static short waveOffset;
@ -21,13 +23,13 @@ public class ZombiesUtilsConfig {
slaToggle = config.getBoolean( slaToggle = config.getBoolean(
"SLA Launcher", "SLA Launcher",
Configuration.CATEGORY_GENERAL, Configuration.CATEGORY_GENERAL,
slaToggle, false,
"Should SLA be started when a game starts?" "Should SLA be started when a game starts?"
); );
slaShortener = config.getBoolean( slaShortener = config.getBoolean(
"shortened SLA", "shortened SLA",
Configuration.CATEGORY_GENERAL, Configuration.CATEGORY_GENERAL,
slaShortener, true,
"If on, inactive windows / rooms will not show" "If on, inactive windows / rooms will not show"
); );
chatMacro = config.getString( chatMacro = config.getString(
@ -50,10 +52,12 @@ public class ZombiesUtilsConfig {
200, 200,
"max: 200 ticks" "max: 200 ticks"
); );
shortSpawntime = config.getBoolean(
ZombiesUtils.getInstance().getLogger().debug("Saving Config..."); "passed wave spawns",
config.save(); Configuration.CATEGORY_GENERAL,
ZombiesUtils.getInstance().getLogger().debug("Config saved."); true,
"Display spawn-time for passed waves"
);
} }
public static short getWaveOffset() { public static short getWaveOffset() {
@ -73,6 +77,9 @@ public class ZombiesUtilsConfig {
public static boolean isSlaShortened() { public static boolean isSlaShortened() {
return slaShortener; return slaShortener;
} }
public static boolean isSpawntimeNotShortened() {
return shortSpawntime;
}
public static String getChatMacro() { public static String getChatMacro() {
return chatMacro; return chatMacro;
} }

View file

@ -80,11 +80,12 @@ public class RenderGameOverlayHandler {
int color = 0xFFFF55; int color = 0xFFFF55;
for (byte waveTime: waveTimes) { for (byte waveTime: waveTimes) {
int clonedColor = color;
final short waveTicks = (short) ((waveTime * 20)-rl); final short waveTicks = (short) ((waveTime * 20)-rl);
if (roundTicks>waveTicks) { if (roundTicks>waveTicks) {
heightIndex++; if (ZombiesUtilsConfig.isSpawntimeNotShortened()) clonedColor = 0x555555;
continue; else continue;
} }
final String time = getWaveString(waveTicks, heightIndex + 1); final String time = getWaveString(waveTicks, heightIndex + 1);
@ -97,9 +98,9 @@ public class RenderGameOverlayHandler {
time, time,
screenWidth - width, screenWidth - width,
screenHeight - fontRenderer.FONT_HEIGHT * (length-heightIndex), screenHeight - fontRenderer.FONT_HEIGHT * (length-heightIndex),
color clonedColor
); );
color = 0xAAAAAA; if (clonedColor!=0x555555) color = 0xAAAAAA;
heightIndex++; heightIndex++;
} }
} }