Theme picker

This commit is contained in:
UnknownUser1789 2023-01-19 15:46:26 +00:00
parent be7ad251dd
commit 9c172f251d
11 changed files with 54479 additions and 54429 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,42 @@
package dev.resent.module;
import dev.resent.module.impl.misc.HUD;
import dev.resent.util.render.Color;
import dev.resent.util.render.RainbowUtil;
public class Theme {
public static int getFontColor(int id){
return getFontColor(id, 255);
}
public static int getFontColor(int id, int opacity){
switch(id){
case 1:
return Color.white.getRGB();
case 2:
return Color.black.getRGB();
case 3:
return Color.white.getGreen();
case 50:
return RainbowUtil.getRainbow(4f, 0.8f, 0.85f);
}
return -1;
}
public static int getId(){
switch(HUD.theme.getValue()){
case "Classic":
return 1;
case "Light":
return 2;
case "Dark":
return 3;
case "Rainbow":
return 50;
}
return -1;
}
}

View File

@ -27,6 +27,7 @@ import dev.resent.module.impl.misc.Crosshair;
import dev.resent.module.impl.misc.DynamicFOV;
import dev.resent.module.impl.misc.FPSB;
import dev.resent.module.impl.misc.Fullbright;
import dev.resent.module.impl.misc.HUD;
import dev.resent.module.impl.misc.HotbarAnimation;
import dev.resent.module.impl.misc.MinimalViewBobbing;
import dev.resent.module.impl.misc.NoParticles;
@ -78,11 +79,13 @@ public class ModManager {
public static Ping ping;
public static ServerInfo serverInfo;
public static Crosshair crosshair = new Crosshair();
public static HUD hud = new HUD();
public ModManager() {
//Hud
register(cosmetics);
register(hotbar);
register(hud = new HUD());
register(ping = new Ping());
register(serverInfo = new ServerInfo());
register(watermark = new Watermark());
@ -120,7 +123,7 @@ public class ModManager {
register(animations);
}
public void register(Mod m) {
public void register(final Mod m) {
this.modules.add(m);
}
}

View File

@ -3,6 +3,7 @@ package dev.resent.module.impl.hud;
import java.util.ArrayList;
import java.util.List;
import dev.resent.module.Theme;
import dev.resent.module.base.Category;
import dev.resent.module.base.RenderModule;
import dev.resent.setting.BooleanSetting;
@ -35,7 +36,7 @@ public class CPS extends RenderModule {
@Override
public void draw() {
mc.fontRendererObj.drawString(getText(), this.x + 2, this.y + 2, -1, tshadow.getValue());
mc.fontRendererObj.drawString(getText(), this.x + 2, this.y + 2, Theme.getFontColor(Theme.getId()), tshadow.getValue());
}
public String getText(){

View File

@ -2,17 +2,17 @@ package dev.resent.module.impl.hud;
import dev.resent.event.impl.Event;
import dev.resent.event.impl.EventAttack;
import dev.resent.module.Theme;
import dev.resent.module.base.Category;
import dev.resent.module.base.RenderModule;
import dev.resent.setting.BooleanSetting;
import net.minecraft.client.Minecraft;
import net.minecraft.network.play.server.S19PacketEntityStatus;
public class ComboCounter extends RenderModule {
public static boolean attacked = false;
public static int combo = 0;
public static BooleanSetting tshadow = new BooleanSetting("Text Shadow", "", true);
public static BooleanSetting tshadow = new BooleanSetting("Text shadow", "", true);
public ComboCounter() {
super("ComboCounter", Category.HUD, 4, 24, true);
@ -33,15 +33,19 @@ public class ComboCounter extends RenderModule {
}
public int getWidth() {
return Minecraft.getMinecraft().fontRendererObj.getStringWidth("[0 Combo]") + 4;
return mc.fontRendererObj.getStringWidth(getText()) + 4;
}
public int getHeight() {
return Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT + 4;
return mc.fontRendererObj.FONT_HEIGHT + 4;
}
private String getText(){
return "["+combo+" Combo]";
}
@Override
public void draw() {
Minecraft.getMinecraft().fontRendererObj.drawString("[" + combo + " Combo]", this.x + 2, this.y + 2, -1, tshadow.getValue());
mc.fontRendererObj.drawString(getText(), this.x + 2, this.y + 2, Theme.getFontColor(Theme.getId()), tshadow.getValue());
}
}

View File

@ -1,5 +1,6 @@
package dev.resent.module.impl.hud;
import dev.resent.module.Theme;
import dev.resent.module.base.Category;
import dev.resent.module.base.RenderModule;
import dev.resent.setting.BooleanSetting;
@ -17,19 +18,21 @@ public class FPS extends RenderModule {
public BooleanSetting tshadow = new BooleanSetting("Text Shadow", "", true);
public int getWidth() {
return mc.fontRendererObj.getStringWidth("[FPS: " + Minecraft.debugFPS + "]") + 4;
return mc.fontRendererObj.getStringWidth(getText()) + 4;
}
public int getHeight() {
return mc.fontRendererObj.FONT_HEIGHT + 4;
}
public String getText(){
return "[FPS: " + Minecraft.debugFPS + "]";
}
@Override
public void draw() {
if (mc.thePlayer != null) {
if (this.isEnabled()) {
mc.fontRendererObj.drawString("[FPS: " + Minecraft.debugFPS + "]", this.x + 2, this.y + 2, -1, tshadow.getValue());
}
mc.fontRendererObj.drawString(getText(), this.x + 2, this.y + 2, Theme.getFontColor(Theme.getId()), tshadow.getValue());
}
}
}

View File

@ -0,0 +1,17 @@
package dev.resent.module.impl.misc;
import dev.resent.module.base.Category;
import dev.resent.module.base.Mod;
import dev.resent.setting.BooleanSetting;
import dev.resent.setting.ModeSetting;
public class HUD extends Mod{
public HUD(){
super("Hud", Category.MISC, true);
addSetting(theme, animated);
}
public static final ModeSetting theme = new ModeSetting("Theme", "", "Classic", "Light", "Dark", "Rainbow");
public static final BooleanSetting animated = new BooleanSetting("Animated", "", true);
}

View File

@ -1,5 +0,0 @@
package dev.resent.util;
public class Theme {
}

View File

@ -32,7 +32,7 @@ public class Color {
/**
* The color dark gray. In the default sRGB space.
*/
public static final Color darkGray = new Color(64, 64, 64);
public static final Color darkGray = new Color(240, 240, 240);
/**
* The color dark gray. In the default sRGB space.

View File

@ -8,23 +8,6 @@ public class RainbowUtil {
return color;
}
public static int astolfoColorsDraw(int yOffset, int yTotal) {
return astolfoColorsDraw(yOffset, yTotal, 50000f);
}
public static int astolfoColorsDraw(int yOffset, int yTotal, float speed) {
float hue = (float) (System.currentTimeMillis() % (int) speed) + ((yTotal - yOffset) * 9);
while (hue > speed) {
hue -= speed;
}
hue /= speed;
if (hue > 0.5) {
hue = 0.5F - (hue - 0.5f);
}
hue += 0.5F;
return Color.HSBtoRGB(hue, 0.5f, 1F);
}
public static int getRainbow1(int delay) {
double rainbowState = Math.ceil((System.currentTimeMillis() + delay) / 20.0);
rainbowState %= 360;