Theme picker
This commit is contained in:
parent
be7ad251dd
commit
9c172f251d
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
42
src/main/java/dev/resent/module/Theme.java
Normal file
42
src/main/java/dev/resent/module/Theme.java
Normal 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -27,6 +27,7 @@ import dev.resent.module.impl.misc.Crosshair;
|
||||||
import dev.resent.module.impl.misc.DynamicFOV;
|
import dev.resent.module.impl.misc.DynamicFOV;
|
||||||
import dev.resent.module.impl.misc.FPSB;
|
import dev.resent.module.impl.misc.FPSB;
|
||||||
import dev.resent.module.impl.misc.Fullbright;
|
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.HotbarAnimation;
|
||||||
import dev.resent.module.impl.misc.MinimalViewBobbing;
|
import dev.resent.module.impl.misc.MinimalViewBobbing;
|
||||||
import dev.resent.module.impl.misc.NoParticles;
|
import dev.resent.module.impl.misc.NoParticles;
|
||||||
|
@ -78,11 +79,13 @@ public class ModManager {
|
||||||
public static Ping ping;
|
public static Ping ping;
|
||||||
public static ServerInfo serverInfo;
|
public static ServerInfo serverInfo;
|
||||||
public static Crosshair crosshair = new Crosshair();
|
public static Crosshair crosshair = new Crosshair();
|
||||||
|
public static HUD hud = new HUD();
|
||||||
|
|
||||||
public ModManager() {
|
public ModManager() {
|
||||||
//Hud
|
//Hud
|
||||||
register(cosmetics);
|
register(cosmetics);
|
||||||
register(hotbar);
|
register(hotbar);
|
||||||
|
register(hud = new HUD());
|
||||||
register(ping = new Ping());
|
register(ping = new Ping());
|
||||||
register(serverInfo = new ServerInfo());
|
register(serverInfo = new ServerInfo());
|
||||||
register(watermark = new Watermark());
|
register(watermark = new Watermark());
|
||||||
|
@ -120,7 +123,7 @@ public class ModManager {
|
||||||
register(animations);
|
register(animations);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void register(Mod m) {
|
public void register(final Mod m) {
|
||||||
this.modules.add(m);
|
this.modules.add(m);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ package dev.resent.module.impl.hud;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import dev.resent.module.Theme;
|
||||||
import dev.resent.module.base.Category;
|
import dev.resent.module.base.Category;
|
||||||
import dev.resent.module.base.RenderModule;
|
import dev.resent.module.base.RenderModule;
|
||||||
import dev.resent.setting.BooleanSetting;
|
import dev.resent.setting.BooleanSetting;
|
||||||
|
@ -35,7 +36,7 @@ public class CPS extends RenderModule {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw() {
|
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(){
|
public String getText(){
|
||||||
|
|
|
@ -2,17 +2,17 @@ package dev.resent.module.impl.hud;
|
||||||
|
|
||||||
import dev.resent.event.impl.Event;
|
import dev.resent.event.impl.Event;
|
||||||
import dev.resent.event.impl.EventAttack;
|
import dev.resent.event.impl.EventAttack;
|
||||||
|
import dev.resent.module.Theme;
|
||||||
import dev.resent.module.base.Category;
|
import dev.resent.module.base.Category;
|
||||||
import dev.resent.module.base.RenderModule;
|
import dev.resent.module.base.RenderModule;
|
||||||
import dev.resent.setting.BooleanSetting;
|
import dev.resent.setting.BooleanSetting;
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.network.play.server.S19PacketEntityStatus;
|
import net.minecraft.network.play.server.S19PacketEntityStatus;
|
||||||
|
|
||||||
public class ComboCounter extends RenderModule {
|
public class ComboCounter extends RenderModule {
|
||||||
|
|
||||||
public static boolean attacked = false;
|
public static boolean attacked = false;
|
||||||
public static int combo = 0;
|
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() {
|
public ComboCounter() {
|
||||||
super("ComboCounter", Category.HUD, 4, 24, true);
|
super("ComboCounter", Category.HUD, 4, 24, true);
|
||||||
|
@ -33,15 +33,19 @@ public class ComboCounter extends RenderModule {
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getWidth() {
|
public int getWidth() {
|
||||||
return Minecraft.getMinecraft().fontRendererObj.getStringWidth("[0 Combo]") + 4;
|
return mc.fontRendererObj.getStringWidth(getText()) + 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getHeight() {
|
public int getHeight() {
|
||||||
return Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT + 4;
|
return mc.fontRendererObj.FONT_HEIGHT + 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getText(){
|
||||||
|
return "["+combo+" Combo]";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw() {
|
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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package dev.resent.module.impl.hud;
|
package dev.resent.module.impl.hud;
|
||||||
|
|
||||||
|
import dev.resent.module.Theme;
|
||||||
import dev.resent.module.base.Category;
|
import dev.resent.module.base.Category;
|
||||||
import dev.resent.module.base.RenderModule;
|
import dev.resent.module.base.RenderModule;
|
||||||
import dev.resent.setting.BooleanSetting;
|
import dev.resent.setting.BooleanSetting;
|
||||||
|
@ -17,19 +18,21 @@ public class FPS extends RenderModule {
|
||||||
public BooleanSetting tshadow = new BooleanSetting("Text Shadow", "", true);
|
public BooleanSetting tshadow = new BooleanSetting("Text Shadow", "", true);
|
||||||
|
|
||||||
public int getWidth() {
|
public int getWidth() {
|
||||||
return mc.fontRendererObj.getStringWidth("[FPS: " + Minecraft.debugFPS + "]") + 4;
|
return mc.fontRendererObj.getStringWidth(getText()) + 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getHeight() {
|
public int getHeight() {
|
||||||
return mc.fontRendererObj.FONT_HEIGHT + 4;
|
return mc.fontRendererObj.FONT_HEIGHT + 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getText(){
|
||||||
|
return "[FPS: " + Minecraft.debugFPS + "]";
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw() {
|
public void draw() {
|
||||||
if (mc.thePlayer != null) {
|
if (mc.thePlayer != null) {
|
||||||
if (this.isEnabled()) {
|
mc.fontRendererObj.drawString(getText(), this.x + 2, this.y + 2, Theme.getFontColor(Theme.getId()), tshadow.getValue());
|
||||||
mc.fontRendererObj.drawString("[FPS: " + Minecraft.debugFPS + "]", this.x + 2, this.y + 2, -1, tshadow.getValue());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
17
src/main/java/dev/resent/module/impl/misc/HUD.java
Normal file
17
src/main/java/dev/resent/module/impl/misc/HUD.java
Normal 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);
|
||||||
|
|
||||||
|
}
|
|
@ -1,5 +0,0 @@
|
||||||
package dev.resent.util;
|
|
||||||
|
|
||||||
public class Theme {
|
|
||||||
|
|
||||||
}
|
|
|
@ -32,7 +32,7 @@ public class Color {
|
||||||
/**
|
/**
|
||||||
* The color dark gray. In the default sRGB space.
|
* 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.
|
* The color dark gray. In the default sRGB space.
|
||||||
|
|
|
@ -8,23 +8,6 @@ public class RainbowUtil {
|
||||||
return color;
|
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) {
|
public static int getRainbow1(int delay) {
|
||||||
double rainbowState = Math.ceil((System.currentTimeMillis() + delay) / 20.0);
|
double rainbowState = Math.ceil((System.currentTimeMillis() + delay) / 20.0);
|
||||||
rainbowState %= 360;
|
rainbowState %= 360;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user