From 5503237b9b2a2b75188188341f2dd8abe477c9f5 Mon Sep 17 00:00:00 2001 From: syeyoung Date: Fri, 1 Jan 2021 20:29:29 +0900 Subject: ah yes? --- .../features/impl/FeatureCooldownCounter.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/main/java/kr/syeyoung/dungeonsguide/features/impl/FeatureCooldownCounter.java') diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/FeatureCooldownCounter.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/FeatureCooldownCounter.java index dc2b7dd8..76a942a2 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/FeatureCooldownCounter.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/FeatureCooldownCounter.java @@ -1,13 +1,18 @@ package kr.syeyoung.dungeonsguide.features.impl; +import kr.syeyoung.dungeonsguide.features.FeatureParameter; import kr.syeyoung.dungeonsguide.features.GuiFeature; +import kr.syeyoung.dungeonsguide.features.listener.TickListener; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import org.lwjgl.opengl.GL11; -public class FeatureCooldownCounter extends GuiFeature { +import java.awt.*; + +public class FeatureCooldownCounter extends GuiFeature implements TickListener { public FeatureCooldownCounter() { - super("QoL", "Dungeon Cooldown Counter", "Counts 10 seconds after leaving dungeon", "qol.cooldown", true, 100, 50); + super("QoL", "Dungeon Cooldown Counter", "Counts 10 seconds after leaving dungeon", "qol.cooldown", true, getFontRenderer().getStringWidth("Cooldown: 10s "), getFontRenderer().FONT_HEIGHT); + parameters.put("color", new FeatureParameter("color", "Color", "Color of text", Color.white, "color")); } @Override @@ -15,7 +20,7 @@ public class FeatureCooldownCounter extends GuiFeature { FontRenderer fr = Minecraft.getMinecraft().fontRendererObj; double scale = getFeatureRect().getHeight() / fr.FONT_HEIGHT; GL11.glScaled(scale, scale, 0); - fr.drawString("Cooldown: 1s", 0,0,0xFFFFFFFF); + fr.drawString("Cooldown: 1s", 0,0,this.getParameter("color").getValue().getRGB()); } @Override @@ -23,6 +28,11 @@ public class FeatureCooldownCounter extends GuiFeature { FontRenderer fr = Minecraft.getMinecraft().fontRendererObj; double scale = getFeatureRect().getHeight() / fr.FONT_HEIGHT; GL11.glScaled(scale, scale, 0); - fr.drawString("Cooldown: 1s", 0,0,0xFFFFFFFF); + fr.drawString("Cooldown: 10s", 0,0,this.getParameter("color").getValue().getRGB()); + } + + @Override + public void onTick() { + } } -- cgit