started on capes, edited alt manager ui
|
@ -21,6 +21,7 @@ import optifine.CapeUtils;
|
||||||
import optifine.Config;
|
import optifine.Config;
|
||||||
import optifine.PlayerConfigurations;
|
import optifine.PlayerConfigurations;
|
||||||
import optifine.Reflector;
|
import optifine.Reflector;
|
||||||
|
import rip.athena.client.Athena;
|
||||||
|
|
||||||
public abstract class AbstractClientPlayer extends EntityPlayer
|
public abstract class AbstractClientPlayer extends EntityPlayer
|
||||||
{
|
{
|
||||||
|
@ -90,6 +91,7 @@ public abstract class AbstractClientPlayer extends EntityPlayer
|
||||||
|
|
||||||
public ResourceLocation getLocationCape()
|
public ResourceLocation getLocationCape()
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!Config.isShowCapes())
|
if (!Config.isShowCapes())
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -21,7 +21,7 @@ public class GuiButton extends Gui
|
||||||
private SimpleAnimation rectHoverAnimation = new SimpleAnimation(100);
|
private SimpleAnimation rectHoverAnimation = new SimpleAnimation(100);
|
||||||
|
|
||||||
protected static final ResourceLocation buttonTextures = new ResourceLocation("textures/gui/widgets.png");
|
protected static final ResourceLocation buttonTextures = new ResourceLocation("textures/gui/widgets.png");
|
||||||
// The animations crashed the entire fucking game.
|
// The animations crashed the entire fucking game.
|
||||||
int opacity;
|
int opacity;
|
||||||
/** Button width in pixels */
|
/** Button width in pixels */
|
||||||
protected int width;
|
protected int width;
|
||||||
|
@ -92,49 +92,45 @@ public class GuiButton extends Gui
|
||||||
{
|
{
|
||||||
if (this.visible)
|
if (this.visible)
|
||||||
{
|
{
|
||||||
FontRenderer fontrenderer = mc.fontRendererObj;
|
|
||||||
mc.getTextureManager().bindTexture(buttonTextures);
|
mc.getTextureManager().bindTexture(buttonTextures);
|
||||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
this.hovered = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height;
|
this.hovered = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height;
|
||||||
int i = this.getHoverState(this.hovered);
|
|
||||||
GlStateManager.enableBlend();
|
GlStateManager.enableBlend();
|
||||||
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
|
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
|
||||||
GlStateManager.blendFunc(770, 771);
|
GlStateManager.blendFunc(770, 771);
|
||||||
//this.drawTexturedModalRect(this.xPosition, this.yPosition, 0, 46 + i * 20, this.width / 2, this.height);
|
|
||||||
//this.drawTexturedModalRect(this.xPosition + this.width / 2, this.yPosition, 200 - this.width / 2, 46 + i * 20, this.width / 2, this.height);
|
|
||||||
this.mouseDragged(mc, mouseX, mouseY);
|
this.mouseDragged(mc, mouseX, mouseY);
|
||||||
int j = 14737632;
|
|
||||||
if (hovered) {
|
if (hovered) {
|
||||||
opacity += 25;
|
opacity += 25;
|
||||||
if(opacity > 120) opacity = 120;
|
if(opacity > 150) opacity = 150;
|
||||||
} else {
|
} else {
|
||||||
opacity -= 25;
|
opacity -= 25;
|
||||||
if(opacity < 70) opacity = 70;
|
if(opacity < 100) opacity = 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
Color rectCol = new Color(100, 100, 100, opacity);
|
Color rectCol;
|
||||||
|
|
||||||
if(!this.enabled)
|
if(!this.enabled)
|
||||||
rectCol = new Color(10, 10, 10, 120);
|
rectCol = new Color(10, 10, 10, 120);
|
||||||
else
|
else
|
||||||
rectCol = new Color(30, 30, 30, opacity);
|
rectCol = new Color(150, 150, 150, opacity);
|
||||||
|
|
||||||
//Gui.drawRect(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, rectCol.getRGB());
|
//Gui.drawRect(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, rectCol.getRGB());
|
||||||
RoundedUtils.drawRound(this.xPosition, this.yPosition, this.width, (this.height), 4, rectCol);
|
RoundedUtils.drawRound(this.xPosition + 1, this.yPosition + 1, this.width - 1, (this.height) - 2, 4, rectCol);
|
||||||
RoundedUtils.drawRoundedGradientOutlineCorner(this.xPosition, this.yPosition, (this.width + xPosition), (this.height + yPosition), 1, 6, ColorUtil.getClientColor(0, 255).getRGB(), ColorUtil.getClientColor(90, 255).getRGB(), ColorUtil.getClientColor(180, 255).getRGB(), ColorUtil.getClientColor(270, 255).getRGB());
|
RoundedUtils.drawRoundedGradientOutlineCorner(this.xPosition, this.yPosition + 1, (this.width + xPosition), (this.height + yPosition) - 1, 1, 6, ColorUtil.getClientColor(0, 255).getRGB(), ColorUtil.getClientColor(90, 255).getRGB(), ColorUtil.getClientColor(180, 255).getRGB(), ColorUtil.getClientColor(270, 255).getRGB());
|
||||||
|
|
||||||
if(this.hovered && this.enabled) {
|
if(this.hovered && this.enabled) {
|
||||||
if (!(lineHoverAnimation.getValue() > width / 2 - 2)) {
|
if (!(lineHoverAnimation.getValue() > (float) width / 2 - 2)) {
|
||||||
lineHoverAnimation.setAnimation(width / 2 - 2, 10);
|
lineHoverAnimation.setAnimation((float) width / 2 - 2, 10);
|
||||||
|
|
||||||
this.drawHorizontalLine(this.xPosition + width / 2 , (int) ((xPosition + width/2) - lineHoverAnimation.getValue()), this.yPosition + height - 1, -1);
|
drawHorizontalLine(this.xPosition + width / 2 , (int) ((xPosition + width/2) - lineHoverAnimation.getValue()), this.yPosition + height - 1, -1);
|
||||||
this.drawHorizontalLine(this.xPosition + width / 2 , (int) ((xPosition + width/2) + lineHoverAnimation.getValue()), this.yPosition + height - 1, -1);
|
drawHorizontalLine(this.xPosition + width / 2 , (int) ((xPosition + width/2) + lineHoverAnimation.getValue()), this.yPosition + height - 1, -1);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else if(lineHoverAnimation.getValue() >= width / 2) {
|
else if(lineHoverAnimation.getValue() >= (float) width / 2) {
|
||||||
this.drawHorizontalLine(this.xPosition + width / 2 , (int) ((xPosition + width/2) - lineHoverAnimation.getValue()), this.yPosition + height - 1, -1);
|
drawHorizontalLine(this.xPosition + width / 2 , (int) ((xPosition + width/2) - lineHoverAnimation.getValue()), this.yPosition + height - 1, -1);
|
||||||
this.drawHorizontalLine(this.xPosition + width / 2 , (int) ((xPosition + width/2) + lineHoverAnimation.getValue()), this.yPosition + height - 1, -1);
|
drawHorizontalLine(this.xPosition + width / 2 , (int) ((xPosition + width/2) + lineHoverAnimation.getValue()), this.yPosition + height - 1, -1);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -142,29 +138,18 @@ public class GuiButton extends Gui
|
||||||
else if(!hovered){
|
else if(!hovered){
|
||||||
lineHoverAnimation.setAnimation(0, 4);
|
lineHoverAnimation.setAnimation(0, 4);
|
||||||
if(!(lineHoverAnimation.getValue() <= 0 || lineHoverAnimation.getValue() <= 2)) {
|
if(!(lineHoverAnimation.getValue() <= 0 || lineHoverAnimation.getValue() <= 2)) {
|
||||||
this.drawHorizontalLine(this.xPosition + width / 2 , (int) ((xPosition + width/2) - lineHoverAnimation.getValue() - 1), this.yPosition + height - 1, -1);
|
drawHorizontalLine(this.xPosition + width / 2 , (int) ((xPosition + width/2) - lineHoverAnimation.getValue() - 1), this.yPosition + height - 1, -1);
|
||||||
this.drawHorizontalLine(this.xPosition + width / 2 , (int) ((xPosition + width/2) + lineHoverAnimation.getValue() + 1), this.yPosition + height - 1, -1);
|
drawHorizontalLine(this.xPosition + width / 2 , (int) ((xPosition + width/2) + lineHoverAnimation.getValue() + 1), this.yPosition + height - 1, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (this.enabled)
|
|
||||||
{
|
|
||||||
j = -1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
j = Color.BLACK.getRGB();
|
|
||||||
}
|
|
||||||
|
|
||||||
rip.athena.client.utils.font.FontManager.getProductSansBold(19).drawCenteredString(displayString.toUpperCase(),
|
rip.athena.client.utils.font.FontManager.getProductSansBold(19).drawCenteredString(displayString.toUpperCase(),
|
||||||
xPosition + (width / 2), this.enabled ? yPosition + (height / 2) - 3 : yPosition + (height / 2) - 6, -1);
|
xPosition + (float) (width / 2), this.enabled ? yPosition + (float) (height / 2) - 3 : yPosition + (float) (height / 2) - 6, -1);
|
||||||
|
|
||||||
if (!this.enabled)
|
if (!this.enabled)
|
||||||
rip.athena.client.utils.font.FontManager.getProductSansBold(10).drawCenteredString("DISABLED",
|
rip.athena.client.utils.font.FontManager.getProductSansBold(10).drawCenteredString("DISABLED",
|
||||||
xPosition + (width / 2), yPosition + (height / 2) + 4, -1);
|
xPosition + (float) (width / 2), yPosition + (float) (height / 2) + 4, -1);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -397,6 +397,7 @@ public abstract class Render<T extends Entity>
|
||||||
rankTexture = new ResourceLocation("Athena/ranks/mod.png");
|
rankTexture = new ResourceLocation("Athena/ranks/mod.png");
|
||||||
break;
|
break;
|
||||||
case "PARTNER":
|
case "PARTNER":
|
||||||
|
case "MEDIA":
|
||||||
rankTexture = new ResourceLocation("Athena/ranks/partner.png");
|
rankTexture = new ResourceLocation("Athena/ranks/partner.png");
|
||||||
break;
|
break;
|
||||||
case "PREMIUM":
|
case "PREMIUM":
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
package net.minecraft.client.renderer.entity.layers;
|
package net.minecraft.client.renderer.entity.layers;
|
||||||
|
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.entity.AbstractClientPlayer;
|
import net.minecraft.client.entity.AbstractClientPlayer;
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
import net.minecraft.client.renderer.entity.RenderPlayer;
|
import net.minecraft.client.renderer.entity.RenderPlayer;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EnumPlayerModelParts;
|
import net.minecraft.entity.player.EnumPlayerModelParts;
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import rip.athena.client.Athena;
|
||||||
|
import rip.athena.client.modules.impl.other.Settings;
|
||||||
|
import rip.athena.client.socket.SocketClient;
|
||||||
|
|
||||||
public class LayerCape implements LayerRenderer
|
public class LayerCape implements LayerRenderer
|
||||||
{
|
{
|
||||||
|
@ -19,38 +24,35 @@ public class LayerCape implements LayerRenderer
|
||||||
|
|
||||||
public void doRenderLayer(AbstractClientPlayer entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale)
|
public void doRenderLayer(AbstractClientPlayer entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale)
|
||||||
{
|
{
|
||||||
if (entitylivingbaseIn.hasPlayerInfo() && !entitylivingbaseIn.isInvisible() && entitylivingbaseIn.isWearing(EnumPlayerModelParts.CAPE) && entitylivingbaseIn.getLocationCape() != null)
|
if (entitylivingbaseIn.hasPlayerInfo() && !entitylivingbaseIn.isInvisible() && entitylivingbaseIn.getLocationCape() != null) {
|
||||||
{
|
|
||||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
this.playerRenderer.bindTexture(entitylivingbaseIn.getLocationCape());
|
this.playerRenderer.bindTexture(entitylivingbaseIn.getLocationCape());
|
||||||
|
|
||||||
GlStateManager.pushMatrix();
|
GlStateManager.pushMatrix();
|
||||||
GlStateManager.translate(0.0F, 0.0F, 0.125F);
|
GlStateManager.translate(0.0F, 0.0F, 0.125F);
|
||||||
double d0 = entitylivingbaseIn.prevChasingPosX + (entitylivingbaseIn.chasingPosX - entitylivingbaseIn.prevChasingPosX) * (double)partialTicks - (entitylivingbaseIn.prevPosX + (entitylivingbaseIn.posX - entitylivingbaseIn.prevPosX) * (double)partialTicks);
|
double d0 = entitylivingbaseIn.prevChasingPosX + (entitylivingbaseIn.chasingPosX - entitylivingbaseIn.prevChasingPosX) * (double) partialTicks - (entitylivingbaseIn.prevPosX + (entitylivingbaseIn.posX - entitylivingbaseIn.prevPosX) * (double) partialTicks);
|
||||||
double d1 = entitylivingbaseIn.prevChasingPosY + (entitylivingbaseIn.chasingPosY - entitylivingbaseIn.prevChasingPosY) * (double)partialTicks - (entitylivingbaseIn.prevPosY + (entitylivingbaseIn.posY - entitylivingbaseIn.prevPosY) * (double)partialTicks);
|
double d1 = entitylivingbaseIn.prevChasingPosY + (entitylivingbaseIn.chasingPosY - entitylivingbaseIn.prevChasingPosY) * (double) partialTicks - (entitylivingbaseIn.prevPosY + (entitylivingbaseIn.posY - entitylivingbaseIn.prevPosY) * (double) partialTicks);
|
||||||
double d2 = entitylivingbaseIn.prevChasingPosZ + (entitylivingbaseIn.chasingPosZ - entitylivingbaseIn.prevChasingPosZ) * (double)partialTicks - (entitylivingbaseIn.prevPosZ + (entitylivingbaseIn.posZ - entitylivingbaseIn.prevPosZ) * (double)partialTicks);
|
double d2 = entitylivingbaseIn.prevChasingPosZ + (entitylivingbaseIn.chasingPosZ - entitylivingbaseIn.prevChasingPosZ) * (double) partialTicks - (entitylivingbaseIn.prevPosZ + (entitylivingbaseIn.posZ - entitylivingbaseIn.prevPosZ) * (double) partialTicks);
|
||||||
float f = entitylivingbaseIn.prevRenderYawOffset + (entitylivingbaseIn.renderYawOffset - entitylivingbaseIn.prevRenderYawOffset) * partialTicks;
|
float f = entitylivingbaseIn.prevRenderYawOffset + (entitylivingbaseIn.renderYawOffset - entitylivingbaseIn.prevRenderYawOffset) * partialTicks;
|
||||||
double d3 = (double)MathHelper.sin(f * (float)Math.PI / 180.0F);
|
double d3 = (double) MathHelper.sin(f * (float) Math.PI / 180.0F);
|
||||||
double d4 = (double)(-MathHelper.cos(f * (float)Math.PI / 180.0F));
|
double d4 = (double) (-MathHelper.cos(f * (float) Math.PI / 180.0F));
|
||||||
float f1 = (float)d1 * 10.0F;
|
float f1 = (float) d1 * 10.0F;
|
||||||
f1 = MathHelper.clamp_float(f1, -6.0F, 32.0F);
|
f1 = MathHelper.clamp_float(f1, -6.0F, 32.0F);
|
||||||
float f2 = (float)(d0 * d3 + d2 * d4) * 100.0F;
|
float f2 = (float) (d0 * d3 + d2 * d4) * 100.0F;
|
||||||
float f3 = (float)(d0 * d4 - d2 * d3) * 100.0F;
|
float f3 = (float) (d0 * d4 - d2 * d3) * 100.0F;
|
||||||
|
|
||||||
if (f2 < 0.0F)
|
if (f2 < 0.0F) {
|
||||||
{
|
|
||||||
f2 = 0.0F;
|
f2 = 0.0F;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (f2 > 165.0F)
|
if (f2 > 165.0F) {
|
||||||
{
|
|
||||||
f2 = 165.0F;
|
f2 = 165.0F;
|
||||||
}
|
}
|
||||||
|
|
||||||
float f4 = entitylivingbaseIn.prevCameraYaw + (entitylivingbaseIn.cameraYaw - entitylivingbaseIn.prevCameraYaw) * partialTicks;
|
float f4 = entitylivingbaseIn.prevCameraYaw + (entitylivingbaseIn.cameraYaw - entitylivingbaseIn.prevCameraYaw) * partialTicks;
|
||||||
f1 = f1 + MathHelper.sin((entitylivingbaseIn.prevDistanceWalkedModified + (entitylivingbaseIn.distanceWalkedModified - entitylivingbaseIn.prevDistanceWalkedModified) * partialTicks) * 6.0F) * 32.0F * f4;
|
f1 = f1 + MathHelper.sin((entitylivingbaseIn.prevDistanceWalkedModified + (entitylivingbaseIn.distanceWalkedModified - entitylivingbaseIn.prevDistanceWalkedModified) * partialTicks) * 6.0F) * 32.0F * f4;
|
||||||
|
|
||||||
if (entitylivingbaseIn.isSneaking())
|
if (entitylivingbaseIn.isSneaking()) {
|
||||||
{
|
|
||||||
f1 += 25.0F;
|
f1 += 25.0F;
|
||||||
GlStateManager.translate(0.0F, 0.142F, -0.0178F);
|
GlStateManager.translate(0.0F, 0.142F, -0.0178F);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ import net.minecraft.client.Minecraft;
|
||||||
import org.lwjgl.opengl.Display;
|
import org.lwjgl.opengl.Display;
|
||||||
import rip.athena.client.account.AccountManager;
|
import rip.athena.client.account.AccountManager;
|
||||||
import rip.athena.client.config.save.ConfigManager;
|
import rip.athena.client.config.save.ConfigManager;
|
||||||
|
import rip.athena.client.cosmetics.CosmeticsController;
|
||||||
import rip.athena.client.events.EventBus;
|
import rip.athena.client.events.EventBus;
|
||||||
import rip.athena.client.events.SubscribeEvent;
|
import rip.athena.client.events.SubscribeEvent;
|
||||||
import rip.athena.client.events.types.client.ClientTickEvent;
|
import rip.athena.client.events.types.client.ClientTickEvent;
|
||||||
|
@ -48,10 +49,11 @@ public class Athena {
|
||||||
private final PrefixedLogger log = new PrefixedLogger("Athena");
|
private final PrefixedLogger log = new PrefixedLogger("Athena");
|
||||||
|
|
||||||
private final String clientName = "Athena";
|
private final String clientName = "Athena";
|
||||||
private final String clientVersion = "0.0.1";
|
private final String clientVersion = "0.0.2";
|
||||||
private final String clientBuild = "061723";
|
private final String clientBuild = "062323";
|
||||||
|
|
||||||
private NotificationManager notificationManager;
|
private NotificationManager notificationManager;
|
||||||
|
private CosmeticsController cosmeticsController;
|
||||||
private AccountManager accountManager;
|
private AccountManager accountManager;
|
||||||
private ConfigManager configManager;
|
private ConfigManager configManager;
|
||||||
private ModuleManager moduleManager;
|
private ModuleManager moduleManager;
|
||||||
|
@ -76,17 +78,8 @@ public class Athena {
|
||||||
this.discordRPC = new DiscordRPC();
|
this.discordRPC = new DiscordRPC();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!MAIN_DIR.exists()) {
|
createDirectoryIfNotExists(MAIN_DIR);
|
||||||
MAIN_DIR.mkdir();
|
createFileIfNotExists(ACCOUNTS_DIR);
|
||||||
}
|
|
||||||
|
|
||||||
if(!ACCOUNTS_DIR.exists()) {
|
|
||||||
try {
|
|
||||||
ACCOUNTS_DIR.createNewFile();
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(SocketClient.isClientRunning()) {
|
if(SocketClient.isClientRunning()) {
|
||||||
JOptionPane.showMessageDialog(null, "Port 45376 already in use.");
|
JOptionPane.showMessageDialog(null, "Port 45376 already in use.");
|
||||||
|
@ -100,11 +93,17 @@ public class Athena {
|
||||||
this.macroManager = new MacroManager();
|
this.macroManager = new MacroManager();
|
||||||
this.hudManager = new HUDManager();
|
this.hudManager = new HUDManager();
|
||||||
this.eventBus = new EventBus();
|
this.eventBus = new EventBus();
|
||||||
|
|
||||||
this.notificationManager = new NotificationManager();
|
this.notificationManager = new NotificationManager();
|
||||||
|
this.cosmeticsController = new CosmeticsController();
|
||||||
|
|
||||||
registerEvents();
|
registerEvents();
|
||||||
|
|
||||||
configManager.postInit();
|
configManager.postInit();
|
||||||
|
|
||||||
|
if(this.cosmeticsController.getCapeManager().getSelectedCape() == null) {
|
||||||
|
this.cosmeticsController.getCapeManager().setSelectedCape(this.cosmeticsController.getCapeManager().getCape("None"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -157,6 +156,22 @@ public class Athena {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void createDirectoryIfNotExists(File directory) {
|
||||||
|
if (!directory.exists()) {
|
||||||
|
directory.mkdir();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void createFileIfNotExists(File file) {
|
||||||
|
if (!file.exists()) {
|
||||||
|
try {
|
||||||
|
file.createNewFile();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cleans up and shuts down the client.
|
* Cleans up and shuts down the client.
|
||||||
* This method is responsible for any necessary cleanup tasks,
|
* This method is responsible for any necessary cleanup tasks,
|
||||||
|
|
|
@ -9,6 +9,7 @@ import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
import rip.athena.client.Athena;
|
import rip.athena.client.Athena;
|
||||||
import rip.athena.client.config.ConfigEntry;
|
import rip.athena.client.config.ConfigEntry;
|
||||||
|
import rip.athena.client.cosmetics.cape.Cape;
|
||||||
import rip.athena.client.events.types.client.ConfigChangeEvent;
|
import rip.athena.client.events.types.client.ConfigChangeEvent;
|
||||||
import rip.athena.client.gui.clickgui.pages.SettingsPage;
|
import rip.athena.client.gui.clickgui.pages.SettingsPage;
|
||||||
import rip.athena.client.gui.hud.HUDElement;
|
import rip.athena.client.gui.hud.HUDElement;
|
||||||
|
@ -40,10 +41,10 @@ public class Config {
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.file = new FileHandler(file);
|
this.file = new FileHandler(file);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
this.file.init();
|
this.file.init();
|
||||||
|
|
||||||
if(this.file.isFresh()) {
|
if(this.file.isFresh()) {
|
||||||
save(file.getName());
|
save(file.getName());
|
||||||
}
|
}
|
||||||
|
@ -51,76 +52,76 @@ public class Config {
|
||||||
Athena.INSTANCE.getLog().error("Failed to initiate config " + name + "." + e);
|
Athena.INSTANCE.getLog().error("Failed to initiate config " + name + "." + e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void load() {
|
public void load() {
|
||||||
String content = "";
|
String content = "";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
content = file.getContent(false);
|
content = file.getContent(false);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Athena.INSTANCE.getLog().error("Failed to load config " + name + " from file." + e);
|
Athena.INSTANCE.getLog().error("Failed to load config " + name + " from file." + e);
|
||||||
}
|
}
|
||||||
|
|
||||||
load(content);
|
load(content);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void load(String content) {
|
public void load(String content) {
|
||||||
parent.updateLast(this);
|
parent.updateLast(this);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
JSONObject obj = new JSONObject(content);
|
JSONObject obj = new JSONObject(content);
|
||||||
|
|
||||||
for(Module mod : Athena.INSTANCE.getModuleManager().getModules()) {
|
for(Module mod : Athena.INSTANCE.getModuleManager().getModules()) {
|
||||||
mod.setEnabled(false);
|
mod.setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
Athena.INSTANCE.getMacroManager().getMacros().clear();
|
Athena.INSTANCE.getMacroManager().getMacros().clear();
|
||||||
|
|
||||||
SettingsPage.TILE_ENTITIES.clear();
|
SettingsPage.TILE_ENTITIES.clear();
|
||||||
SettingsPage.ENTITIES.clear();
|
SettingsPage.ENTITIES.clear();
|
||||||
SettingsPage.BLOCKS.clear();
|
SettingsPage.BLOCKS.clear();
|
||||||
SettingsPage.PARTICLES.clear();
|
SettingsPage.PARTICLES.clear();
|
||||||
|
|
||||||
for(String key : obj.keySet()) {
|
for(String key : obj.keySet()) {
|
||||||
if(key.equalsIgnoreCase("macros") || key.equalsIgnoreCase("crosshair-data")) {
|
if(key.equalsIgnoreCase("macros") || key.equalsIgnoreCase("crosshair-data")) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Module module = Athena.INSTANCE.getModuleManager().getModule(key);
|
Module module = Athena.INSTANCE.getModuleManager().getModule(key);
|
||||||
|
|
||||||
if(module == null) {
|
if(module == null) {
|
||||||
Athena.INSTANCE.getLog().warn("Loaded config " + name + " with left over setting " + key + " which is no longer used.");
|
Athena.INSTANCE.getLog().warn("Loaded config " + name + " with left over setting " + key + " which is no longer used.");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
JSONObject json = obj.getJSONObject(key);
|
JSONObject json = obj.getJSONObject(key);
|
||||||
|
|
||||||
if(!json.has("enabled") || !json.has("bind")) {
|
if(!json.has("enabled") || !json.has("bind")) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean enabled = json.getBoolean("enabled");
|
boolean enabled = json.getBoolean("enabled");
|
||||||
int bind = json.getInt("bind");
|
int bind = json.getInt("bind");
|
||||||
BindType bindType = BindType.getBind(json.getString("bindtype"));
|
BindType bindType = BindType.getBind(json.getString("bindtype"));
|
||||||
|
|
||||||
module.setEnabled(enabled);
|
module.setEnabled(enabled);
|
||||||
module.setKeyBind(bind);
|
module.setKeyBind(bind);
|
||||||
module.setBindType(bindType);
|
module.setBindType(bindType);
|
||||||
|
|
||||||
JSONObject settings = json.getJSONObject("settings");
|
JSONObject settings = json.getJSONObject("settings");
|
||||||
|
|
||||||
for(String setting : settings.keySet()) {
|
for(String setting : settings.keySet()) {
|
||||||
for(ConfigEntry entry : module.getEntries()) {
|
for(ConfigEntry entry : module.getEntries()) {
|
||||||
if(entry.getKey().equalsIgnoreCase(setting)) {
|
if(entry.getKey().equalsIgnoreCase(setting)) {
|
||||||
Object value = settings.get(setting);
|
Object value = settings.get(setting);
|
||||||
|
|
||||||
if(value instanceof JSONObject) {
|
if(value instanceof JSONObject) {
|
||||||
JSONObject color = (JSONObject) value;
|
JSONObject color = (JSONObject) value;
|
||||||
value = new Color(color.getInt("red"), color.getInt("green"), color.getInt("blue"), color.getInt("alpha"));
|
value = new Color(color.getInt("red"), color.getInt("green"), color.getInt("blue"), color.getInt("alpha"));
|
||||||
} else if(entry.getType() == float.class) {
|
} else if(entry.getType() == float.class) {
|
||||||
value = (float)settings.getDouble(setting);
|
value = (float)settings.getDouble(setting);
|
||||||
}
|
}
|
||||||
|
|
||||||
entry.setValue(module, value);
|
entry.setValue(module, value);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -128,11 +129,11 @@ public class Config {
|
||||||
}
|
}
|
||||||
|
|
||||||
JSONObject hud = json.getJSONObject("hud");
|
JSONObject hud = json.getJSONObject("hud");
|
||||||
|
|
||||||
for(String element : hud.keySet()) {
|
for(String element : hud.keySet()) {
|
||||||
String identifier = element;
|
String identifier = element;
|
||||||
JSONObject elementObj = hud.getJSONObject(identifier);
|
JSONObject elementObj = hud.getJSONObject(identifier);
|
||||||
|
|
||||||
for(HUDElement modElement : module.getHUDElements()) {
|
for(HUDElement modElement : module.getHUDElements()) {
|
||||||
if(modElement.getIdentifier().equalsIgnoreCase(identifier)) {
|
if(modElement.getIdentifier().equalsIgnoreCase(identifier)) {
|
||||||
modElement.setX(elementObj.getInt("x"));
|
modElement.setX(elementObj.getInt("x"));
|
||||||
|
@ -154,36 +155,45 @@ public class Config {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String capeIdentifier = obj.getString("cape");
|
||||||
|
for (Cape cape : Athena.INSTANCE.getCosmeticsController().getCapeManager().getCapes()) {
|
||||||
|
if (cape.getName().equalsIgnoreCase(capeIdentifier)) {
|
||||||
|
Athena.INSTANCE.getLog().info(cape + capeIdentifier + cape.getName());
|
||||||
|
Athena.INSTANCE.getCosmeticsController().getCapeManager().setSelectedCape(cape);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
JSONArray macroList = obj.getJSONArray("macros");
|
JSONArray macroList = obj.getJSONArray("macros");
|
||||||
|
|
||||||
for(int i = 0; i < macroList.length(); i++) {
|
for(int i = 0; i < macroList.length(); i++) {
|
||||||
JSONObject macro = macroList.getJSONObject(i);
|
JSONObject macro = macroList.getJSONObject(i);
|
||||||
|
|
||||||
Athena.INSTANCE.getMacroManager().getMacros().add(new Macro(macro.getString("name"), macro.getString("command"), macro.getInt("key"), macro.getBoolean("enabled")));
|
Athena.INSTANCE.getMacroManager().getMacros().add(new Macro(macro.getString("name"), macro.getString("command"), macro.getInt("key"), macro.getBoolean("enabled")));
|
||||||
}
|
}
|
||||||
|
|
||||||
JSONObject fps = obj.getJSONObject("fps");
|
JSONObject fps = obj.getJSONObject("fps");
|
||||||
|
|
||||||
JSONArray blocks = fps.getJSONArray("blocks");
|
JSONArray blocks = fps.getJSONArray("blocks");
|
||||||
JSONArray entities = fps.getJSONArray("entities");
|
JSONArray entities = fps.getJSONArray("entities");
|
||||||
JSONArray tileentities = fps.getJSONArray("tile-entities");
|
JSONArray tileentities = fps.getJSONArray("tile-entities");
|
||||||
JSONArray particles = fps.getJSONArray("particles");
|
JSONArray particles = fps.getJSONArray("particles");
|
||||||
|
|
||||||
List<String> list = new ArrayList<>();
|
List<String> list = new ArrayList<>();
|
||||||
|
|
||||||
for(int i = 0; i < blocks.length(); i++) {
|
for(int i = 0; i < blocks.length(); i++) {
|
||||||
list.add(blocks.getString(i));
|
list.add(blocks.getString(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
for(String item : list) {
|
for(String item : list) {
|
||||||
try {
|
try {
|
||||||
String string = new String(item);
|
String string = new String(item);
|
||||||
|
|
||||||
Class<?> clazz = Class.forName(string);
|
Class<?> clazz = Class.forName(string);
|
||||||
|
|
||||||
if(Block.class.isAssignableFrom(clazz)) {
|
if(Block.class.isAssignableFrom(clazz)) {
|
||||||
Class<? extends Block> block = (Class<? extends Block>)clazz;
|
Class<? extends Block> block = (Class<? extends Block>)clazz;
|
||||||
|
|
||||||
if(!SettingsPage.BLOCKS.contains(block)) {
|
if(!SettingsPage.BLOCKS.contains(block)) {
|
||||||
SettingsPage.BLOCKS.add(block);
|
SettingsPage.BLOCKS.add(block);
|
||||||
}
|
}
|
||||||
|
@ -192,25 +202,25 @@ public class Config {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
list.clear();
|
list.clear();
|
||||||
for(int i = 0; i < entities.length(); i++) {
|
for(int i = 0; i < entities.length(); i++) {
|
||||||
list.add(entities.getString(i));
|
list.add(entities.getString(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
for(String item : list) {
|
for(String item : list) {
|
||||||
try {
|
try {
|
||||||
String string = new String(item);
|
String string = new String(item);
|
||||||
|
|
||||||
if(string.contains(" ")) {
|
if(string.contains(" ")) {
|
||||||
string = string.split(" ", 2)[1];
|
string = string.split(" ", 2)[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
Class<?> clazz = Class.forName(string);
|
Class<?> clazz = Class.forName(string);
|
||||||
|
|
||||||
if(Entity.class.isAssignableFrom(clazz)) {
|
if(Entity.class.isAssignableFrom(clazz)) {
|
||||||
Class<? extends Entity> entity = (Class<? extends Entity>)clazz;
|
Class<? extends Entity> entity = (Class<? extends Entity>)clazz;
|
||||||
|
|
||||||
if(!SettingsPage.ENTITIES.contains(entity)) {
|
if(!SettingsPage.ENTITIES.contains(entity)) {
|
||||||
SettingsPage.ENTITIES.add(entity);
|
SettingsPage.ENTITIES.add(entity);
|
||||||
}
|
}
|
||||||
|
@ -218,22 +228,22 @@ public class Config {
|
||||||
} catch(IllegalArgumentException | LinkageError | ClassNotFoundException e) {
|
} catch(IllegalArgumentException | LinkageError | ClassNotFoundException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
list.clear();
|
list.clear();
|
||||||
for(int i = 0; i < tileentities.length(); i++) {
|
for(int i = 0; i < tileentities.length(); i++) {
|
||||||
list.add(tileentities.getString(i));
|
list.add(tileentities.getString(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
for(String item : list) {
|
for(String item : list) {
|
||||||
try {
|
try {
|
||||||
String string = new String(item);
|
String string = new String(item);
|
||||||
|
|
||||||
Class<?> clazz = Class.forName(string);
|
Class<?> clazz = Class.forName(string);
|
||||||
|
|
||||||
if(TileEntity.class.isAssignableFrom(clazz)) {
|
if(TileEntity.class.isAssignableFrom(clazz)) {
|
||||||
Class<? extends TileEntity> tileEntity = (Class<? extends TileEntity>) clazz;
|
Class<? extends TileEntity> tileEntity = (Class<? extends TileEntity>) clazz;
|
||||||
|
|
||||||
if(!SettingsPage.TILE_ENTITIES.contains(tileEntity)) {
|
if(!SettingsPage.TILE_ENTITIES.contains(tileEntity)) {
|
||||||
SettingsPage.TILE_ENTITIES.add(tileEntity);
|
SettingsPage.TILE_ENTITIES.add(tileEntity);
|
||||||
}
|
}
|
||||||
|
@ -242,21 +252,21 @@ public class Config {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
list.clear();
|
list.clear();
|
||||||
for(int i = 0; i < particles.length(); i++) {
|
for(int i = 0; i < particles.length(); i++) {
|
||||||
list.add(particles.getString(i));
|
list.add(particles.getString(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
for(String item : list) {
|
for(String item : list) {
|
||||||
try {
|
try {
|
||||||
String string = new String(item);
|
String string = new String(item);
|
||||||
EnumParticleTypes particle = EnumParticleTypes.valueOf(string);
|
EnumParticleTypes particle = EnumParticleTypes.valueOf(string);
|
||||||
|
|
||||||
if(particle == null) {
|
if(particle == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!SettingsPage.PARTICLES.contains(particle)) {
|
if(!SettingsPage.PARTICLES.contains(particle)) {
|
||||||
SettingsPage.PARTICLES.add(particle);
|
SettingsPage.PARTICLES.add(particle);
|
||||||
}
|
}
|
||||||
|
@ -264,71 +274,71 @@ public class Config {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
list.clear();
|
list.clear();
|
||||||
|
|
||||||
int[][] data = Crosshair.crosshair;
|
int[][] data = Crosshair.crosshair;
|
||||||
|
|
||||||
for(int i = 0; i < data.length; i++) {
|
for(int i = 0; i < data.length; i++) {
|
||||||
for(int ii = 0; ii < data[i].length; ii++) {
|
for(int ii = 0; ii < data[i].length; ii++) {
|
||||||
data[i][ii] = 0;
|
data[i][ii] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String[] parts = obj.getString("crosshair-data").split("]");
|
String[] parts = obj.getString("crosshair-data").split("]");
|
||||||
|
|
||||||
List<List<Integer>> crosshairData = new ArrayList<>();
|
List<List<Integer>> crosshairData = new ArrayList<>();
|
||||||
|
|
||||||
for(String part : parts) {
|
for(String part : parts) {
|
||||||
String formatted = part;
|
String formatted = part;
|
||||||
|
|
||||||
if(formatted.startsWith("[")) {
|
if(formatted.startsWith("[")) {
|
||||||
formatted = formatted.substring(1);
|
formatted = formatted.substring(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
formatted = formatted.trim();
|
formatted = formatted.trim();
|
||||||
|
|
||||||
List<Integer> row = new ArrayList<>();
|
List<Integer> row = new ArrayList<>();
|
||||||
|
|
||||||
for(String rowEntry : formatted.split(",")) {
|
for(String rowEntry : formatted.split(",")) {
|
||||||
String entry = rowEntry.trim();
|
String entry = rowEntry.trim();
|
||||||
|
|
||||||
if(!StringUtils.isInteger(entry)) {
|
if(!StringUtils.isInteger(entry)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
row.add(Integer.parseInt(entry));
|
row.add(Integer.parseInt(entry));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(row.size() > 0) {
|
if(row.size() > 0) {
|
||||||
crosshairData.add(row);
|
crosshairData.add(row);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int i = 0; i < crosshairData.size(); i++) {
|
for(int i = 0; i < crosshairData.size(); i++) {
|
||||||
List<Integer> crosshairList = crosshairData.get(i);
|
List<Integer> crosshairList = crosshairData.get(i);
|
||||||
|
|
||||||
if(i >= data.length) {
|
if(i >= data.length) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
for(int ii = 0; ii < crosshairList.size(); ii++) {
|
for(int ii = 0; ii < crosshairList.size(); ii++) {
|
||||||
int row = crosshairList.get(ii);
|
int row = crosshairList.get(ii);
|
||||||
|
|
||||||
if(ii >= data[i].length) {
|
if(ii >= data[i].length) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
data[i][ii] = row;
|
data[i][ii] = row;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch(JSONException e) {
|
} catch(JSONException e) {
|
||||||
Athena.INSTANCE.getLog().error("Failed to load config " + name + ", improper json." + e);
|
Athena.INSTANCE.getLog().error("Failed to load config " + name + ", improper json." + e);
|
||||||
}
|
}
|
||||||
|
|
||||||
Athena.INSTANCE.getEventBus().post(new ConfigChangeEvent());
|
Athena.INSTANCE.getEventBus().post(new ConfigChangeEvent());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void save(String content) {
|
public void save(String content) {
|
||||||
try {
|
try {
|
||||||
file.writeToFile(content, false);
|
file.writeToFile(content, false);
|
||||||
|
@ -336,32 +346,32 @@ public class Config {
|
||||||
Athena.INSTANCE.getLog().error("Failed to save config " + name + "." + e);
|
Athena.INSTANCE.getLog().error("Failed to save config " + name + "." + e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void save() {
|
public void save() {
|
||||||
save(toString());
|
save(toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
JSONObject config = new JSONObject();
|
JSONObject config = new JSONObject();
|
||||||
|
|
||||||
for(Module mod : Athena.INSTANCE.getModuleManager().getModules()) {
|
for(Module mod : Athena.INSTANCE.getModuleManager().getModules()) {
|
||||||
JSONObject obj = new JSONObject();
|
JSONObject obj = new JSONObject();
|
||||||
JSONObject settingsObj = new JSONObject();
|
JSONObject settingsObj = new JSONObject();
|
||||||
|
|
||||||
JSONObject hudObj = new JSONObject();
|
JSONObject hudObj = new JSONObject();
|
||||||
|
|
||||||
for(HUDElement element : mod.getHUDElements()) {
|
for(HUDElement element : mod.getHUDElements()) {
|
||||||
JSONObject elementObj = new JSONObject();
|
JSONObject elementObj = new JSONObject();
|
||||||
|
|
||||||
elementObj.put("x", element.getX());
|
elementObj.put("x", element.getX());
|
||||||
elementObj.put("y", element.getY());
|
elementObj.put("y", element.getY());
|
||||||
elementObj.put("scale", element.getScale());
|
elementObj.put("scale", element.getScale());
|
||||||
elementObj.put("visible", element.isVisible());
|
elementObj.put("visible", element.isVisible());
|
||||||
|
|
||||||
hudObj.put(element.getIdentifier(), elementObj);
|
hudObj.put(element.getIdentifier(), elementObj);
|
||||||
}
|
}
|
||||||
|
|
||||||
obj.put("enabled", mod.isToggled());
|
obj.put("enabled", mod.isToggled());
|
||||||
obj.put("bind", mod.getKeyBind());
|
obj.put("bind", mod.getKeyBind());
|
||||||
obj.put("bindtype", mod.getBindType().toString());
|
obj.put("bindtype", mod.getBindType().toString());
|
||||||
|
@ -369,88 +379,89 @@ public class Config {
|
||||||
for(ConfigEntry entry : mod.getEntries()) {
|
for(ConfigEntry entry : mod.getEntries()) {
|
||||||
entry.appendToConfig(entry.getKey(), entry.getValue(mod), settingsObj);
|
entry.appendToConfig(entry.getKey(), entry.getValue(mod), settingsObj);
|
||||||
}
|
}
|
||||||
|
|
||||||
obj.put("settings", settingsObj);
|
obj.put("settings", settingsObj);
|
||||||
obj.put("hud", hudObj);
|
obj.put("hud", hudObj);
|
||||||
config.put(mod.getName(), obj);
|
config.put(mod.getName(), obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
config.put("theme", Athena.INSTANCE.getThemeManager().getTheme().name());
|
config.put("theme", Athena.INSTANCE.getThemeManager().getTheme().name());
|
||||||
|
config.put("cape", Athena.INSTANCE.getCosmeticsController().getCapeManager().getSelectedCape().getName());
|
||||||
|
|
||||||
JSONArray macros = new JSONArray();
|
JSONArray macros = new JSONArray();
|
||||||
|
|
||||||
for(Macro macro : Athena.INSTANCE.getMacroManager().getMacros()) {
|
for(Macro macro : Athena.INSTANCE.getMacroManager().getMacros()) {
|
||||||
JSONObject obj = new JSONObject();
|
JSONObject obj = new JSONObject();
|
||||||
|
|
||||||
obj.put("name", macro.getName());
|
obj.put("name", macro.getName());
|
||||||
obj.put("command", macro.getCommand());
|
obj.put("command", macro.getCommand());
|
||||||
obj.put("key", macro.getKey());
|
obj.put("key", macro.getKey());
|
||||||
obj.put("enabled", macro.isEnabled());
|
obj.put("enabled", macro.isEnabled());
|
||||||
|
|
||||||
macros.put(obj);
|
macros.put(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
config.put("macros", macros);
|
config.put("macros", macros);
|
||||||
JSONObject fps = new JSONObject();
|
JSONObject fps = new JSONObject();
|
||||||
|
|
||||||
List<String> buffer = new ArrayList<>();
|
List<String> buffer = new ArrayList<>();
|
||||||
|
|
||||||
for(Class<?> clazz : SettingsPage.BLOCKS) {
|
for(Class<?> clazz : SettingsPage.BLOCKS) {
|
||||||
buffer.add(clazz.getCanonicalName());
|
buffer.add(clazz.getCanonicalName());
|
||||||
}
|
}
|
||||||
|
|
||||||
fps.put("blocks", new JSONArray(buffer.toArray(new String[buffer.size()])));
|
fps.put("blocks", new JSONArray(buffer.toArray(new String[buffer.size()])));
|
||||||
buffer.clear();
|
buffer.clear();
|
||||||
|
|
||||||
for(Class<?> clazz : SettingsPage.ENTITIES) {
|
for(Class<?> clazz : SettingsPage.ENTITIES) {
|
||||||
buffer.add(clazz.getCanonicalName());
|
buffer.add(clazz.getCanonicalName());
|
||||||
}
|
}
|
||||||
|
|
||||||
fps.put("entities", new JSONArray(buffer.toArray(new String[buffer.size()])));
|
fps.put("entities", new JSONArray(buffer.toArray(new String[buffer.size()])));
|
||||||
buffer.clear();
|
buffer.clear();
|
||||||
|
|
||||||
for(Class<?> clazz : SettingsPage.TILE_ENTITIES) {
|
for(Class<?> clazz : SettingsPage.TILE_ENTITIES) {
|
||||||
buffer.add(clazz.getCanonicalName());
|
buffer.add(clazz.getCanonicalName());
|
||||||
}
|
}
|
||||||
|
|
||||||
fps.put("tile-entities", new JSONArray(buffer.toArray(new String[buffer.size()])));
|
fps.put("tile-entities", new JSONArray(buffer.toArray(new String[buffer.size()])));
|
||||||
buffer.clear();
|
buffer.clear();
|
||||||
|
|
||||||
for(EnumParticleTypes particle : SettingsPage.PARTICLES) {
|
for(EnumParticleTypes particle : SettingsPage.PARTICLES) {
|
||||||
buffer.add(particle.toString());
|
buffer.add(particle.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
fps.put("particles", new JSONArray(buffer.toArray(new String[buffer.size()])));
|
fps.put("particles", new JSONArray(buffer.toArray(new String[buffer.size()])));
|
||||||
buffer.clear();
|
buffer.clear();
|
||||||
|
|
||||||
config.put("fps", fps);
|
config.put("fps", fps);
|
||||||
|
|
||||||
StringBuilder crosshairData = new StringBuilder();
|
StringBuilder crosshairData = new StringBuilder();
|
||||||
int[][] data = Crosshair.crosshair;
|
int[][] data = Crosshair.crosshair;
|
||||||
|
|
||||||
for(int i = 0; i < data.length; i++) {
|
for(int i = 0; i < data.length; i++) {
|
||||||
StringBuilder inner = new StringBuilder();
|
StringBuilder inner = new StringBuilder();
|
||||||
|
|
||||||
inner.append("[");
|
inner.append("[");
|
||||||
for(int ii = 0; ii < data[i].length; ii++) {
|
for(int ii = 0; ii < data[i].length; ii++) {
|
||||||
if(inner.length() > 1) {
|
if(inner.length() > 1) {
|
||||||
inner.append(",");
|
inner.append(",");
|
||||||
}
|
}
|
||||||
|
|
||||||
inner.append(data[i][ii]);
|
inner.append(data[i][ii]);
|
||||||
}
|
}
|
||||||
|
|
||||||
inner.append("]");
|
inner.append("]");
|
||||||
|
|
||||||
if(!crosshairData.toString().isEmpty()) {
|
if(!crosshairData.toString().isEmpty()) {
|
||||||
crosshairData.append(", ");
|
crosshairData.append(", ");
|
||||||
}
|
}
|
||||||
|
|
||||||
crosshairData.append(inner.toString());
|
crosshairData.append(inner.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
config.put("crosshair-data", crosshairData);
|
config.put("crosshair-data", crosshairData);
|
||||||
|
|
||||||
return config.toString(4);
|
return config.toString(4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -462,10 +473,10 @@ public class Config {
|
||||||
if(parent.lastLoadedConfig == this) {
|
if(parent.lastLoadedConfig == this) {
|
||||||
parent.lastLoadedConfig = null;
|
parent.lastLoadedConfig = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
file.getFile().delete();
|
file.getFile().delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
public FileHandler getFileHandler() {
|
public FileHandler getFileHandler() {
|
||||||
return file;
|
return file;
|
||||||
}
|
}
|
||||||
|
@ -474,7 +485,7 @@ public class Config {
|
||||||
if(parent.getLoadedConfig() == null) {
|
if(parent.getLoadedConfig() == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return parent.getLoadedConfig().getName().equalsIgnoreCase(getName());
|
return parent.getLoadedConfig().getName().equalsIgnoreCase(getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,22 @@
|
||||||
package rip.athena.client.cosmetics;/**
|
package rip.athena.client.cosmetics;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import rip.athena.client.cosmetics.cape.CapeManager;
|
||||||
|
|
||||||
|
/**
|
||||||
* @project Athena-Client
|
* @project Athena-Client
|
||||||
* @author Athena Development
|
* @author Athena Development
|
||||||
* @date 6/12/2023
|
* @date 6/12/2023
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@Getter
|
||||||
public class CosmeticsController {
|
public class CosmeticsController {
|
||||||
|
|
||||||
|
private final CapeManager capeManager;
|
||||||
|
|
||||||
|
public CosmeticsController() {
|
||||||
|
capeManager = new CapeManager();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
package rip.athena.client.cosmetics.cape;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Athena Development
|
||||||
|
* @project Athena-Client
|
||||||
|
* @date 6/23/2023
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
public class Cape {
|
||||||
|
|
||||||
|
private final String name;
|
||||||
|
private final ResourceLocation location;
|
||||||
|
private final ResourceLocation displayTexture;
|
||||||
|
|
||||||
|
public Cape(String name, String location, String displayTexture) {
|
||||||
|
this.name = name;
|
||||||
|
this.location = new ResourceLocation("Athena/cosmetics/capes/" + location + ".png");
|
||||||
|
this.displayTexture = new ResourceLocation("Athena/cosmetics/capes/" + displayTexture + ".png");
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,44 @@
|
||||||
|
package rip.athena.client.cosmetics.cape;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import rip.athena.client.Athena;
|
||||||
|
import rip.athena.client.modules.Module;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Athena Development
|
||||||
|
* @project Athena-Client
|
||||||
|
* @date 6/23/2023
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class CapeManager {
|
||||||
|
|
||||||
|
private final ArrayList<Cape> capes = new ArrayList<>();
|
||||||
|
private Cape selectedCape;
|
||||||
|
|
||||||
|
public CapeManager() {
|
||||||
|
capes.add(new Cape("Minecon 2012", "Minecon-2012", "Minecon-2012-display"));
|
||||||
|
capes.add(new Cape("Minecon 2016", "Minecon-2016", "Minecon-2016-display"));
|
||||||
|
capes.add(new Cape("ziue's head", "ziue-head", "ziue-head-display"));
|
||||||
|
capes.add(new Cape("Cat", "cat", "cat-display"));
|
||||||
|
capes.add(new Cape("None", "None", "None"));
|
||||||
|
}
|
||||||
|
|
||||||
|
public Cape getCape(String name) {
|
||||||
|
Cape requestedCape = capes
|
||||||
|
.stream()
|
||||||
|
.filter(m -> m.getName().equalsIgnoreCase(name))
|
||||||
|
.findFirst()
|
||||||
|
.orElse(null);
|
||||||
|
if (requestedCape == null) {
|
||||||
|
// Log a message indicating that the cape is not found
|
||||||
|
Athena.INSTANCE.getLog().warn("Tried accessing non-existing cape: " + name);
|
||||||
|
}
|
||||||
|
return requestedCape;
|
||||||
|
}
|
||||||
|
}
|
|
@ -12,7 +12,8 @@ public enum Category {
|
||||||
MACROS("MACROS", "Athena/gui/mods/cps.png"),
|
MACROS("MACROS", "Athena/gui/mods/cps.png"),
|
||||||
WAYPOINTS("WAYPOINTS", "Athena/gui/menu/waypoints.png"),
|
WAYPOINTS("WAYPOINTS", "Athena/gui/menu/waypoints.png"),
|
||||||
PROFILES("PROFILES", "Athena/gui/menu/profiles.png"),
|
PROFILES("PROFILES", "Athena/gui/menu/profiles.png"),
|
||||||
COSMETICS("COSMETICS", "Athena/gui/menu/cosmetics.png"),
|
CAPES("CAPES", "Athena/gui/menu/cosmetics.png"),
|
||||||
|
//COSMETICS("COSMETICS", "Athena/gui/menu/cosmetics.png"),
|
||||||
THEMES("THEMES", "Athena/gui/menu/themes.png");
|
THEMES("THEMES", "Athena/gui/menu/themes.png");
|
||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
|
|
|
@ -17,34 +17,35 @@ public class PageManager {
|
||||||
private IngameMenu parent;
|
private IngameMenu parent;
|
||||||
private Menu menu;
|
private Menu menu;
|
||||||
private Map<Category, Page> pages;
|
private Map<Category, Page> pages;
|
||||||
|
|
||||||
public PageManager(IngameMenu parent, Menu menu) {
|
public PageManager(IngameMenu parent, Menu menu) {
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
this.menu = menu;
|
this.menu = menu;
|
||||||
this.pages = new HashMap<>();
|
this.pages = new HashMap<>();
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void init() {
|
private void init() {
|
||||||
Minecraft mc = Minecraft.getMinecraft();
|
Minecraft mc = Minecraft.getMinecraft();
|
||||||
|
|
||||||
pages.put(Category.MODS, new ModsPage(mc, menu, parent));
|
pages.put(Category.MODS, new ModsPage(mc, menu, parent));
|
||||||
pages.put(Category.SETTINGS, new SettingsPage(mc, menu, parent));
|
pages.put(Category.SETTINGS, new SettingsPage(mc, menu, parent));
|
||||||
pages.put(Category.MACROS, new MacrosPage(mc, menu, parent));
|
pages.put(Category.MACROS, new MacrosPage(mc, menu, parent));
|
||||||
pages.put(Category.WAYPOINTS, new WaypointsPage(mc, menu, parent));
|
pages.put(Category.WAYPOINTS, new WaypointsPage(mc, menu, parent));
|
||||||
pages.put(Category.PROFILES, new ProfilesPage(mc, menu, parent));
|
pages.put(Category.PROFILES, new ProfilesPage(mc, menu, parent));
|
||||||
pages.put(Category.COSMETICS, new CosmeticsPage(mc, menu, parent));
|
//pages.put(Category.COSMETICS, new CosmeticsPage(mc, menu, parent));
|
||||||
|
pages.put(Category.CAPES, new CapesPage(mc, menu, parent));
|
||||||
pages.put(Category.THEMES, new ThemesPage(mc, menu, parent));
|
pages.put(Category.THEMES, new ThemesPage(mc, menu, parent));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<Category, Page> getPages() {
|
public Map<Category, Page> getPages() {
|
||||||
return pages;
|
return pages;
|
||||||
}
|
}
|
||||||
|
|
||||||
public <T extends Page> T getPage(Category category) {
|
public <T extends Page> T getPage(Category category) {
|
||||||
return (T) pages.get(category);
|
return (T) pages.get(category);
|
||||||
}
|
}
|
||||||
|
|
||||||
public <T extends Page> T getPage(Class<T> cast, Category category) {
|
public <T extends Page> T getPage(Class<T> cast, Category category) {
|
||||||
return (T) pages.get(category);
|
return (T) pages.get(category);
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,117 @@
|
||||||
|
package rip.athena.client.gui.clickgui.components.capes;
|
||||||
|
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
|
import rip.athena.client.Athena;
|
||||||
|
import rip.athena.client.cosmetics.cape.Cape;
|
||||||
|
import rip.athena.client.font.FontManager;
|
||||||
|
import rip.athena.client.gui.clickgui.IngameMenu;
|
||||||
|
import rip.athena.client.gui.framework.components.MenuButton;
|
||||||
|
import rip.athena.client.gui.framework.draw.ButtonState;
|
||||||
|
import rip.athena.client.gui.framework.draw.DrawType;
|
||||||
|
import rip.athena.client.modules.impl.other.Settings;
|
||||||
|
import rip.athena.client.theme.impl.AccentTheme;
|
||||||
|
import rip.athena.client.utils.render.ColorUtil;
|
||||||
|
import rip.athena.client.utils.render.DrawUtils;
|
||||||
|
import rip.athena.client.utils.render.RoundedUtils;
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Athena Development
|
||||||
|
* @project Athena-Client
|
||||||
|
* @date 6/2/2023
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class CapeButton extends MenuButton {
|
||||||
|
|
||||||
|
private boolean selected;
|
||||||
|
|
||||||
|
public CapeButton(Cape cape, int x, int y, int width, int height) {
|
||||||
|
super(cape, x, y, width, height);
|
||||||
|
this.selected = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onInitColors() {
|
||||||
|
setColor(DrawType.BACKGROUND, ButtonState.NORMAL, new Color(35, 35, 35, IngameMenu.MENU_ALPHA));
|
||||||
|
setColor(DrawType.BACKGROUND, ButtonState.ACTIVE, new Color(35, 35, 35, IngameMenu.MENU_ALPHA));
|
||||||
|
setColor(DrawType.BACKGROUND, ButtonState.HOVER, new Color(35, 35, 35, IngameMenu.MENU_ALPHA));
|
||||||
|
setColor(DrawType.BACKGROUND, ButtonState.HOVERACTIVE, new Color(35, 35, 35, IngameMenu.MENU_ALPHA));
|
||||||
|
setColor(DrawType.BACKGROUND, ButtonState.DISABLED, new Color(255, 255, 255, IngameMenu.MENU_ALPHA));
|
||||||
|
|
||||||
|
setColor(DrawType.LINE, ButtonState.NORMAL, new Color(52, 52, 53, IngameMenu.MENU_ALPHA));
|
||||||
|
setColor(DrawType.LINE, ButtonState.ACTIVE, new Color(52, 52, 53, IngameMenu.MENU_ALPHA));
|
||||||
|
setColor(DrawType.LINE, ButtonState.HOVER, new Color(52, 52, 53, IngameMenu.MENU_ALPHA));
|
||||||
|
setColor(DrawType.LINE, ButtonState.HOVERACTIVE, new Color(52, 52, 53, IngameMenu.MENU_ALPHA));
|
||||||
|
setColor(DrawType.LINE, ButtonState.DISABLED, new Color(255, 255, 255, IngameMenu.MENU_ALPHA));
|
||||||
|
setColor(DrawType.LINE, ButtonState.POPUP, new Color(28, 28, 30, IngameMenu.MENU_ALPHA));
|
||||||
|
|
||||||
|
setColor(DrawType.TEXT, ButtonState.NORMAL, new Color(56, 56, 58, IngameMenu.MENU_ALPHA));
|
||||||
|
setColor(DrawType.TEXT, ButtonState.ACTIVE, new Color(90, 90, 94, IngameMenu.MENU_ALPHA));
|
||||||
|
setColor(DrawType.TEXT, ButtonState.HOVER, new Color(75, 75, 78, IngameMenu.MENU_ALPHA));
|
||||||
|
setColor(DrawType.TEXT, ButtonState.HOVERACTIVE, new Color(100, 100, 104, IngameMenu.MENU_ALPHA));
|
||||||
|
setColor(DrawType.TEXT, ButtonState.DISABLED, new Color(255, 255, 255, IngameMenu.MENU_ALPHA));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRender() {
|
||||||
|
int x = this.getRenderX();
|
||||||
|
int y = this.getRenderY();
|
||||||
|
int width = this.width;
|
||||||
|
|
||||||
|
RoundedUtils.drawGradientRound(x, y, width, height, 18, ColorUtil.getClientColor(0, 255), ColorUtil.getClientColor(90, 255), ColorUtil.getClientColor(180, 255), ColorUtil.getClientColor(270, 255));
|
||||||
|
RoundedUtils.drawRound(x + 1, y + 1, width - 2, height - 2, 16, new Color(Athena.INSTANCE.getThemeManager().getPrimaryTheme().getThirdColor()));
|
||||||
|
|
||||||
|
if (!cape.getName().equals("None")) {
|
||||||
|
DrawUtils.drawImage(cape.getDisplayTexture(), x + 25, y + 15, width - 50, height - 50);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(selected) {
|
||||||
|
text = cape.getName() + " selected";
|
||||||
|
} else {
|
||||||
|
text = cape.getName();
|
||||||
|
}
|
||||||
|
|
||||||
|
drawText(text, x + (width / 2 - getStringWidth(text) / 2), y + height - 20, -1);
|
||||||
|
|
||||||
|
GlStateManager.color(1,1,1);
|
||||||
|
|
||||||
|
mouseDown = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawText(String string, int x, int y, int color) {
|
||||||
|
if(Settings.customGuiFont) {
|
||||||
|
rip.athena.client.utils.font.FontManager.getProductSansRegular(30).drawString(string, x - 3, y, color);
|
||||||
|
} else {
|
||||||
|
Minecraft.getMinecraft().fontRendererObj.drawString(string, x, y, color);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStringWidth(String string) {
|
||||||
|
if(Settings.customGuiFont) {
|
||||||
|
return (int) rip.athena.client.utils.font.FontManager.getProductSansRegular(30).width(string) - 1;
|
||||||
|
} else {
|
||||||
|
return Minecraft.getMinecraft().fontRendererObj.getStringWidth(string);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStringHeight(String string) {
|
||||||
|
if(Settings.customGuiFont) {
|
||||||
|
return (int) FontManager.baloo17.getHeight(string) + 1;
|
||||||
|
} else {
|
||||||
|
return Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSelected(boolean selected) {
|
||||||
|
this.selected = selected;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isSelected() {
|
||||||
|
return selected;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,103 @@
|
||||||
|
package rip.athena.client.gui.clickgui.pages;
|
||||||
|
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
|
||||||
|
import rip.athena.client.Athena;
|
||||||
|
import rip.athena.client.cosmetics.cape.Cape;
|
||||||
|
import rip.athena.client.gui.clickgui.IngameMenu;
|
||||||
|
import rip.athena.client.gui.clickgui.Page;
|
||||||
|
import rip.athena.client.gui.clickgui.components.capes.CapeButton;
|
||||||
|
import rip.athena.client.gui.clickgui.components.mods.ModScrollPane;
|
||||||
|
import rip.athena.client.gui.framework.Menu;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Athena Development
|
||||||
|
* @project Athena-Client
|
||||||
|
* @date 6/2/2023
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class CapesPage extends Page {
|
||||||
|
private ModScrollPane scrollPane;
|
||||||
|
|
||||||
|
public CapesPage(Minecraft mc, Menu menu, IngameMenu parent) {
|
||||||
|
super(mc, menu, parent);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onInit() {
|
||||||
|
int width = 300;
|
||||||
|
|
||||||
|
scrollPane = new ModScrollPane(260, 100, menu.getWidth() - width, menu.getHeight() - 101, false);
|
||||||
|
|
||||||
|
populateScrollPane();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void populateScrollPane() {
|
||||||
|
scrollPane.getComponents().clear();
|
||||||
|
|
||||||
|
int spacing = 15;
|
||||||
|
int height = 250;
|
||||||
|
|
||||||
|
int defaultX = spacing;
|
||||||
|
|
||||||
|
int y = spacing;
|
||||||
|
int x = spacing;
|
||||||
|
|
||||||
|
int width = 190;
|
||||||
|
|
||||||
|
int maxWidth = scrollPane.getWidth() - spacing * 2;
|
||||||
|
|
||||||
|
for(Cape cape : Athena.INSTANCE.getCosmeticsController().getCapeManager().getCapes()) {
|
||||||
|
CapeButton capeButton = new CapeButton(cape, x, y, width, height) {
|
||||||
|
@Override
|
||||||
|
public void onAction() {
|
||||||
|
setActive(false);
|
||||||
|
Athena.INSTANCE.getCosmeticsController().getCapeManager().setSelectedCape(cape);
|
||||||
|
populateScrollPane();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
capeButton.setSelected(cape == Athena.INSTANCE.getCosmeticsController().getCapeManager().getSelectedCape());
|
||||||
|
|
||||||
|
scrollPane.addComponent(capeButton);
|
||||||
|
|
||||||
|
x += spacing + width;
|
||||||
|
|
||||||
|
if(x + spacing + width > maxWidth) {
|
||||||
|
x = defaultX;
|
||||||
|
y += height + spacing;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRender() {
|
||||||
|
int width = 300;
|
||||||
|
int x = menu.getX() + menu.getWidth() - width + 20;
|
||||||
|
int y = menu.getY() + 59;
|
||||||
|
int height = 32;
|
||||||
|
|
||||||
|
drawVerticalLine(menu.getX() + 215, y + height - 30, height + 432, 3, Athena.INSTANCE.getThemeManager().getPrimaryTheme().getSecondColor());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onLoad() {
|
||||||
|
menu.addComponent(scrollPane);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUnload() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onOpen() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClose() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,6 +1,7 @@
|
||||||
package rip.athena.client.gui.framework.components;
|
package rip.athena.client.gui.framework.components;
|
||||||
|
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
|
import rip.athena.client.cosmetics.cape.Cape;
|
||||||
import rip.athena.client.gui.framework.MenuComponent;
|
import rip.athena.client.gui.framework.MenuComponent;
|
||||||
import rip.athena.client.gui.framework.draw.ButtonState;
|
import rip.athena.client.gui.framework.draw.ButtonState;
|
||||||
import rip.athena.client.gui.framework.draw.DrawType;
|
import rip.athena.client.gui.framework.draw.DrawType;
|
||||||
|
@ -20,15 +21,16 @@ public class MenuButton extends MenuComponent {
|
||||||
protected int minOffset = 2;
|
protected int minOffset = 2;
|
||||||
protected boolean mouseDown = false;
|
protected boolean mouseDown = false;
|
||||||
protected boolean active = false;
|
protected boolean active = false;
|
||||||
|
protected Cape cape;
|
||||||
protected AccentTheme theme;
|
protected AccentTheme theme;
|
||||||
protected PrimaryTheme primaryTheme;
|
protected PrimaryTheme primaryTheme;
|
||||||
protected ButtonState lastState = ButtonState.NORMAL;
|
protected ButtonState lastState = ButtonState.NORMAL;
|
||||||
|
|
||||||
public MenuButton(String text, int x, int y){
|
public MenuButton(String text, int x, int y){
|
||||||
super(x, y, -1, -1);
|
super(x, y, -1, -1);
|
||||||
this.text = text;
|
this.text = text;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MenuButton(String text, int x, int y, int width, int height) {
|
public MenuButton(String text, int x, int y, int width, int height) {
|
||||||
super(x, y, width, height);
|
super(x, y, width, height);
|
||||||
this.text = text;
|
this.text = text;
|
||||||
|
@ -39,19 +41,24 @@ public class MenuButton extends MenuComponent {
|
||||||
this.theme = theme;
|
this.theme = theme;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public MenuButton(Cape cape, int x, int y, int width, int height) {
|
||||||
|
super(x, y, width, height);
|
||||||
|
this.cape = cape;
|
||||||
|
}
|
||||||
|
|
||||||
public MenuButton(PrimaryTheme theme, int x, int y, int width, int height) {
|
public MenuButton(PrimaryTheme theme, int x, int y, int width, int height) {
|
||||||
super(x, y, width, height);
|
super(x, y, width, height);
|
||||||
this.primaryTheme = theme;
|
this.primaryTheme = theme;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onInitColors() {
|
public void onInitColors() {
|
||||||
setColor(DrawType.BACKGROUND, ButtonState.NORMAL, new Color(35, 35, 35, 255));
|
setColor(DrawType.BACKGROUND, ButtonState.NORMAL, new Color(35, 35, 35, 255));
|
||||||
setColor(DrawType.BACKGROUND, ButtonState.ACTIVE, new Color(65, 65, 65, 255));
|
setColor(DrawType.BACKGROUND, ButtonState.ACTIVE, new Color(65, 65, 65, 255));
|
||||||
setColor(DrawType.BACKGROUND, ButtonState.HOVER, new Color(50, 50, 50, 255));
|
setColor(DrawType.BACKGROUND, ButtonState.HOVER, new Color(50, 50, 50, 255));
|
||||||
setColor(DrawType.BACKGROUND, ButtonState.HOVERACTIVE, new Color(75, 75, 75, 255));
|
setColor(DrawType.BACKGROUND, ButtonState.HOVERACTIVE, new Color(75, 75, 75, 255));
|
||||||
setColor(DrawType.BACKGROUND, ButtonState.DISABLED, new Color(100, 100, 100, 255));
|
setColor(DrawType.BACKGROUND, ButtonState.DISABLED, new Color(100, 100, 100, 255));
|
||||||
|
|
||||||
setColor(DrawType.LINE, ButtonState.NORMAL, new Color(35, 35, 35, 255));
|
setColor(DrawType.LINE, ButtonState.NORMAL, new Color(35, 35, 35, 255));
|
||||||
setColor(DrawType.LINE, ButtonState.ACTIVE, new Color(65, 65, 65, 255));
|
setColor(DrawType.LINE, ButtonState.ACTIVE, new Color(65, 65, 65, 255));
|
||||||
setColor(DrawType.LINE, ButtonState.HOVER, new Color(50, 50, 50, 255));
|
setColor(DrawType.LINE, ButtonState.HOVER, new Color(50, 50, 50, 255));
|
||||||
|
@ -64,28 +71,28 @@ public class MenuButton extends MenuComponent {
|
||||||
setColor(DrawType.TEXT, ButtonState.HOVERACTIVE, new Color(235, 235, 235, 255));
|
setColor(DrawType.TEXT, ButtonState.HOVERACTIVE, new Color(235, 235, 235, 255));
|
||||||
setColor(DrawType.TEXT, ButtonState.DISABLED, new Color(255, 255, 255, 255));
|
setColor(DrawType.TEXT, ButtonState.DISABLED, new Color(255, 255, 255, 255));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMouseClick(int button) {
|
public void onMouseClick(int button) {
|
||||||
if(button == 0) {
|
if(button == 0) {
|
||||||
mouseDown = true;
|
mouseDown = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean passesThrough() {
|
public boolean passesThrough() {
|
||||||
if(disabled || parent == null) {
|
if(disabled || parent == null) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int width = (this.width == -1 && this.height == -1) ? (getStringWidth(text) + minOffset * 2) : this.width;
|
int width = (this.width == -1 && this.height == -1) ? (getStringWidth(text) + minOffset * 2) : this.width;
|
||||||
int height = (this.width == -1 && this.height == -1) ? (getStringHeight(text) + minOffset * 2) : this.height;
|
int height = (this.width == -1 && this.height == -1) ? (getStringHeight(text) + minOffset * 2) : this.height;
|
||||||
|
|
||||||
int x = this.getRenderX();
|
int x = this.getRenderX();
|
||||||
int y = this.getRenderY();
|
int y = this.getRenderY();
|
||||||
int mouseX = parent.getMouseX();
|
int mouseX = parent.getMouseX();
|
||||||
int mouseY = parent.getMouseY();
|
int mouseY = parent.getMouseY();
|
||||||
|
|
||||||
if(mouseDown) {
|
if(mouseDown) {
|
||||||
if(mouseX >= x && mouseX <= x + width) {
|
if(mouseX >= x && mouseX <= x + width) {
|
||||||
if(mouseY >= y && mouseY <= y + height + 1) {
|
if(mouseY >= y && mouseY <= y + height + 1) {
|
||||||
|
@ -93,10 +100,10 @@ public class MenuButton extends MenuComponent {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPreSort() {
|
public void onPreSort() {
|
||||||
int x = this.getRenderX();
|
int x = this.getRenderX();
|
||||||
|
@ -105,14 +112,14 @@ public class MenuButton extends MenuComponent {
|
||||||
int height = (this.width == -1 && this.height == -1) ? (getStringHeight(text) + minOffset * 2) : this.height;
|
int height = (this.width == -1 && this.height == -1) ? (getStringHeight(text) + minOffset * 2) : this.height;
|
||||||
int mouseX = parent.getMouseX();
|
int mouseX = parent.getMouseX();
|
||||||
int mouseY = parent.getMouseY();
|
int mouseY = parent.getMouseY();
|
||||||
|
|
||||||
ButtonState state = active ? ButtonState.ACTIVE : ButtonState.NORMAL;
|
ButtonState state = active ? ButtonState.ACTIVE : ButtonState.NORMAL;
|
||||||
|
|
||||||
if(!disabled) {
|
if(!disabled) {
|
||||||
if(mouseX >= x && mouseX <= x + width) {
|
if(mouseX >= x && mouseX <= x + width) {
|
||||||
if(mouseY >= y && mouseY <= y + height + 1) {
|
if(mouseY >= y && mouseY <= y + height + 1) {
|
||||||
state = ButtonState.HOVER;
|
state = ButtonState.HOVER;
|
||||||
|
|
||||||
if(mouseDown) {
|
if(mouseDown) {
|
||||||
active = !active;
|
active = !active;
|
||||||
onAction();
|
onAction();
|
||||||
|
@ -122,17 +129,17 @@ public class MenuButton extends MenuComponent {
|
||||||
} else {
|
} else {
|
||||||
state = ButtonState.DISABLED;
|
state = ButtonState.DISABLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
lastState = state;
|
lastState = state;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRender() {
|
public void onRender() {
|
||||||
int x = this.getRenderX();
|
int x = this.getRenderX();
|
||||||
int y = this.getRenderY();
|
int y = this.getRenderY();
|
||||||
int width = (this.width == -1 && this.height == -1) ? (getStringWidth(text) + minOffset * 2) : this.width;
|
int width = (this.width == -1 && this.height == -1) ? (getStringWidth(text) + minOffset * 2) : this.width;
|
||||||
int height = (this.width == -1 && this.height == -1) ? (getStringHeight(text) + minOffset * 2) : this.height;
|
int height = (this.width == -1 && this.height == -1) ? (getStringHeight(text) + minOffset * 2) : this.height;
|
||||||
|
|
||||||
int backgroundColor = getColor(DrawType.BACKGROUND, lastState);
|
int backgroundColor = getColor(DrawType.BACKGROUND, lastState);
|
||||||
int lineColor = getColor(DrawType.LINE, lastState);
|
int lineColor = getColor(DrawType.LINE, lastState);
|
||||||
int textColor = getColor(DrawType.TEXT, lastState);
|
int textColor = getColor(DrawType.TEXT, lastState);
|
||||||
|
@ -140,16 +147,16 @@ public class MenuButton extends MenuComponent {
|
||||||
GlStateManager.color(1, 1,1);
|
GlStateManager.color(1, 1,1);
|
||||||
|
|
||||||
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x + 1, y + 1, width - 1, height - 1, backgroundColor);
|
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x + 1, y + 1, width - 1, height - 1, backgroundColor);
|
||||||
|
|
||||||
drawHorizontalLine(x, y, width + 1, 1, lineColor);
|
drawHorizontalLine(x, y, width + 1, 1, lineColor);
|
||||||
drawVerticalLine(x, y + 1, height - 1, 1, lineColor);
|
drawVerticalLine(x, y + 1, height - 1, 1, lineColor);
|
||||||
drawHorizontalLine(x, y + height, width + 1, 1, lineColor);
|
drawHorizontalLine(x, y + height, width + 1, 1, lineColor);
|
||||||
drawVerticalLine(x + width, y + 1, height - 1, 1, lineColor);
|
drawVerticalLine(x + width, y + 1, height - 1, 1, lineColor);
|
||||||
drawText(text, x + (width / 2 - getStringWidth(text) / 2), y + (height / 2 - getStringHeight(text) / 2), textColor);
|
drawText(text, x + (width / 2 - getStringWidth(text) / 2), y + (height / 2 - getStringHeight(text) / 2), textColor);
|
||||||
|
|
||||||
mouseDown = false;
|
mouseDown = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getText() {
|
public String getText() {
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
|
|
@ -207,8 +207,8 @@ public class AthenaMenu extends GuiScreen implements GuiYesNoCallback
|
||||||
{
|
{
|
||||||
if (button.id == 0)
|
if (button.id == 0)
|
||||||
{
|
{
|
||||||
this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings));
|
this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (button.id == 5)
|
if (button.id == 5)
|
||||||
{
|
{
|
||||||
|
@ -293,7 +293,7 @@ public class AthenaMenu extends GuiScreen implements GuiYesNoCallback
|
||||||
|
|
||||||
public void drawScreen(int mouseX, int mouseY, float partialTicks)
|
public void drawScreen(int mouseX, int mouseY, float partialTicks)
|
||||||
{
|
{
|
||||||
DrawUtils.drawImage(new ResourceLocation("Athena/menu/test5.jpg"), 0, 0, width, height);
|
DrawUtils.drawImage(new ResourceLocation("Athena/menu/wallpaper3.jpg"), 0, 0, width, height);
|
||||||
|
|
||||||
int[] size = InputUtils.getWindowsSize();
|
int[] size = InputUtils.getWindowsSize();
|
||||||
int startX = size[0] / 2;
|
int startX = size[0] / 2;
|
||||||
|
@ -305,7 +305,7 @@ public class AthenaMenu extends GuiScreen implements GuiYesNoCallback
|
||||||
int height = 100;
|
int height = 100;
|
||||||
|
|
||||||
rip.athena.client.utils.font.FontManager.getProductSansBold(60).drawCenteredString(Athena.INSTANCE.getClientName(),
|
rip.athena.client.utils.font.FontManager.getProductSansBold(60).drawCenteredString(Athena.INSTANCE.getClientName(),
|
||||||
this.width / 2, y, new Color(255, 255, 255).getRGB());
|
(float) this.width / 2, y, new Color(255, 255, 255).getRGB());
|
||||||
|
|
||||||
GlStateManager.pushMatrix();
|
GlStateManager.pushMatrix();
|
||||||
DrawUtils.drawImage(new ResourceLocation("Athena/menu/exit.png"),startX + startX - 20, 10, 10, 10);
|
DrawUtils.drawImage(new ResourceLocation("Athena/menu/exit.png"),startX + startX - 20, 10, 10, 10);
|
||||||
|
|
|
@ -107,11 +107,7 @@ public class GuiAccountManager extends GuiScreen {
|
||||||
int index = 1;
|
int index = 1;
|
||||||
|
|
||||||
if(closeAccountManager) {
|
if(closeAccountManager) {
|
||||||
showAccountAnimation.setDirection(Direction.BACKWARDS);
|
mc.displayGuiScreen(prevGuiScreen);
|
||||||
if(showAccountAnimation.isDone(Direction.BACKWARDS)) {
|
|
||||||
closeAccountManager = false;
|
|
||||||
mc.displayGuiScreen(prevGuiScreen);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(click) {
|
if(click) {
|
||||||
|
@ -122,7 +118,7 @@ public class GuiAccountManager extends GuiScreen {
|
||||||
clickTimer.reset();
|
clickTimer.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
DrawUtils.drawImage(new ResourceLocation("Athena/menu/test5.jpg"), 0, 0, sr.getScaledWidth(), sr.getScaledHeight());
|
DrawUtils.drawImage(new ResourceLocation("Athena/menu/wallpaper3.jpg"), 0, 0, sr.getScaledWidth(), sr.getScaledHeight());
|
||||||
|
|
||||||
GlStateManager.pushMatrix();
|
GlStateManager.pushMatrix();
|
||||||
|
|
||||||
|
@ -134,6 +130,9 @@ public class GuiAccountManager extends GuiScreen {
|
||||||
RoundedUtils.drawRound(x + 1, y + 180, width - 2, height - 150, 6, new Color(Athena.INSTANCE.getThemeManager().getPrimaryTheme().getFirstColor()));
|
RoundedUtils.drawRound(x + 1, y + 180, width - 2, height - 150, 6, new Color(Athena.INSTANCE.getThemeManager().getPrimaryTheme().getFirstColor()));
|
||||||
FontManager.getProductSansRegular(22).drawString("Add Account", x + 5, y + 186, Athena.INSTANCE.getThemeManager().getPrimaryTheme().getTextColor());
|
FontManager.getProductSansRegular(22).drawString("Add Account", x + 5, y + 186, Athena.INSTANCE.getThemeManager().getPrimaryTheme().getTextColor());
|
||||||
|
|
||||||
|
RoundedUtils.drawGradientRound(x , y + 206, width, height - 148, 6, ColorUtil.getClientColor(0, 255), ColorUtil.getClientColor(90, 255), ColorUtil.getClientColor(180, 255), ColorUtil.getClientColor(270, 255));
|
||||||
|
RoundedUtils.drawRound(x + 1, y + 207, width - 2, height - 150, 6, new Color(Athena.INSTANCE.getThemeManager().getPrimaryTheme().getFirstColor()));
|
||||||
|
FontManager.getProductSansRegular(22).drawString("Go back", x + 5, y + 213, Athena.INSTANCE.getThemeManager().getPrimaryTheme().getTextColor());
|
||||||
|
|
||||||
StencilUtils.initStencilToWrite();
|
StencilUtils.initStencilToWrite();
|
||||||
RoundedUtils.drawRound(x, y + 28, width, height - 28.5F, 6, Color.WHITE);
|
RoundedUtils.drawRound(x, y + 28, width, height - 28.5F, 6, Color.WHITE);
|
||||||
|
@ -150,11 +149,13 @@ public class GuiAccountManager extends GuiScreen {
|
||||||
for(Account a : Athena.INSTANCE.getAccountManager().getAccounts()) {
|
for(Account a : Athena.INSTANCE.getAccountManager().getAccounts()) {
|
||||||
|
|
||||||
RoundedUtils.drawRound(x + 9, y + offsetY + scrollAnimation.getValue() - 1, width - 18, 37, 4, new Color(Athena.INSTANCE.getThemeManager().getPrimaryTheme().getSecondColor()));
|
RoundedUtils.drawRound(x + 9, y + offsetY + scrollAnimation.getValue() - 1, width - 18, 37, 4, new Color(Athena.INSTANCE.getThemeManager().getPrimaryTheme().getSecondColor()));
|
||||||
|
|
||||||
RoundedUtils.drawRound(x + 10, y + offsetY + scrollAnimation.getValue(), width - 20, 35, 4, new Color(Athena.INSTANCE.getThemeManager().getPrimaryTheme().getFirstColor()));
|
RoundedUtils.drawRound(x + 10, y + offsetY + scrollAnimation.getValue(), width - 20, 35, 4, new Color(Athena.INSTANCE.getThemeManager().getPrimaryTheme().getFirstColor()));
|
||||||
|
|
||||||
|
RoundedUtils.drawGradientRound(x + width - 36, y + offsetY + 7 + scrollAnimation.getValue(), 20, 20, 4, ColorUtil.getClientColor(0, 255), ColorUtil.getClientColor(90, 255), ColorUtil.getClientColor(180, 255), ColorUtil.getClientColor(270, 255));
|
||||||
|
|
||||||
if(a.getAccountType().equals(AccountType.MICROSOFT)) {
|
if(a.getAccountType().equals(AccountType.MICROSOFT)) {
|
||||||
//mc.getTextureManager().bindTexture(face(a.getUsername(), UUID.fromString(a.getUuid())));
|
//mc.getTextureManager().bindTexture(face(a.getUsername(), UUID.fromString(a.getUuid())));
|
||||||
|
mc.getTextureManager().bindTexture(new ResourceLocation("Athena/menu/head.png"));
|
||||||
} else {
|
} else {
|
||||||
mc.getTextureManager().bindTexture(new ResourceLocation("Athena/menu/head.png"));
|
mc.getTextureManager().bindTexture(new ResourceLocation("Athena/menu/head.png"));
|
||||||
}
|
}
|
||||||
|
@ -163,11 +164,15 @@ public class GuiAccountManager extends GuiScreen {
|
||||||
RoundedUtils.drawRoundTextured(x + 17, y + offsetY + 6 + scrollAnimation.getValue(), 24, 24, 4, 1.0F);
|
RoundedUtils.drawRoundTextured(x + 17, y + offsetY + 6 + scrollAnimation.getValue(), 24, 24, 4, 1.0F);
|
||||||
GlStateManager.disableBlend();
|
GlStateManager.disableBlend();
|
||||||
|
|
||||||
|
GlStateManager.pushMatrix();
|
||||||
|
DrawUtils.drawImage(new ResourceLocation("Athena/menu/exit.png"),x + width - 31, (int) (y + offsetY + 12 + scrollAnimation.getValue()), 10, 10);
|
||||||
|
GlStateManager.popMatrix();
|
||||||
|
|
||||||
FontManager.getProductSansRegular(22).drawString(a.getUsername(), x + 50, y + offsetY + 15 + scrollAnimation.getValue(), Athena.INSTANCE.getThemeManager().getPrimaryTheme().getTextColor());
|
FontManager.getProductSansRegular(22).drawString(a.getUsername(), x + 50, y + offsetY + 15 + scrollAnimation.getValue(), Athena.INSTANCE.getThemeManager().getPrimaryTheme().getTextColor());
|
||||||
|
|
||||||
a.opacityAnimation.setAnimation(a.isDone ? 0 : 255, 16);
|
a.opacityAnimation.setAnimation(a.isDone ? 0 : 255, 16);
|
||||||
|
|
||||||
FontManager.getProductSansRegular(22).drawCenteredString(a.getInfo(), x + width - 54, y + 14.5F + offsetY + scrollAnimation.getValue(), Athena.INSTANCE.getThemeManager().getPrimaryTheme().getTextColor());
|
FontManager.getProductSansRegular(22).drawCenteredString(a.getInfo(), x + width - 64, y + 14.5F + offsetY + scrollAnimation.getValue(), Athena.INSTANCE.getThemeManager().getPrimaryTheme().getTextColor());
|
||||||
|
|
||||||
if(a.getInfo().equals("Success") || a.getInfo().equals("Error")) {
|
if(a.getInfo().equals("Success") || a.getInfo().equals("Error")) {
|
||||||
if(a.getTimer().hasTimeElapsed(3500)) {
|
if(a.getTimer().hasTimeElapsed(3500)) {
|
||||||
|
@ -263,14 +268,14 @@ public class GuiAccountManager extends GuiScreen {
|
||||||
showAddAccount = true;
|
showAddAccount = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(MouseUtils.isInside(mouseX, mouseY, x , y + 179, width, height - 148)) {
|
if(MouseUtils.isInside(mouseX, mouseY, x , y + 206, width, 25)) {
|
||||||
|
mc.displayGuiScreen(prevGuiScreen);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(MouseUtils.isInside(mouseX, mouseY, x , y + 179, width, 25)) {
|
||||||
mc.displayGuiScreen(new GuiAltManager());
|
mc.displayGuiScreen(new GuiAltManager());
|
||||||
//Soar.instance.settingsManager.getSettingByClass(ClientMod.class, "DarkMode").setValBoolean(!Soar.instance.settingsManager.getSettingByClass(ClientMod.class, "DarkMode").getValBoolean());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MouseUtils.isInside(mouseX, mouseY, sr.getScaledWidth() - 25, 5.0, 20.0, 20.0)) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if(showAddAccount) {
|
if(showAddAccount) {
|
||||||
|
|
||||||
|
@ -316,7 +321,6 @@ public class GuiAccountManager extends GuiScreen {
|
||||||
}
|
}
|
||||||
|
|
||||||
for(Account a : Athena.INSTANCE.getAccountManager().getAccounts()) {
|
for(Account a : Athena.INSTANCE.getAccountManager().getAccounts()) {
|
||||||
|
|
||||||
if(MouseUtils.isInside(mouseX, mouseY, x + width - 36, y + offsetY + 7 + scrollAnimation.getValue(), 20, 20)) {
|
if(MouseUtils.isInside(mouseX, mouseY, x + width - 36, y + offsetY + 7 + scrollAnimation.getValue(), 20, 20)) {
|
||||||
deleteAccount = a;
|
deleteAccount = a;
|
||||||
delete = true;
|
delete = true;
|
||||||
|
|
|
@ -66,7 +66,7 @@ public class GuiAltManager extends GuiScreen {
|
||||||
int yOffset = (screenHeight - getTotalPanelsHeight()) / 2; // Calculate vertical offset to center the panels
|
int yOffset = (screenHeight - getTotalPanelsHeight()) / 2; // Calculate vertical offset to center the panels
|
||||||
int width = screenWidth - (2 * xOffset);
|
int width = screenWidth - (2 * xOffset);
|
||||||
|
|
||||||
DrawUtils.drawImage(new ResourceLocation("Athena/menu/test5.jpg"), 0, 0, (int) screenWidth, (int) screenHeight);
|
DrawUtils.drawImage(new ResourceLocation("Athena/menu/wallpaper3.jpg"), 0, 0, (int) screenWidth, (int) screenHeight);
|
||||||
|
|
||||||
RoundedUtils.drawGradientRound(xOffset + 15, yOffset - 1, width + 1, getTotalPanelsHeight() - 23, 6, ColorUtil.getClientColor(0, 255), ColorUtil.getClientColor(90, 255), ColorUtil.getClientColor(180, 255), ColorUtil.getClientColor(270, 255));
|
RoundedUtils.drawGradientRound(xOffset + 15, yOffset - 1, width + 1, getTotalPanelsHeight() - 23, 6, ColorUtil.getClientColor(0, 255), ColorUtil.getClientColor(90, 255), ColorUtil.getClientColor(180, 255), ColorUtil.getClientColor(270, 255));
|
||||||
|
|
||||||
|
|
|
@ -38,13 +38,11 @@ public class LoginPanel extends Panel {
|
||||||
|
|
||||||
private final List<AltButton> actionButtons = new ArrayList<>();
|
private final List<AltButton> actionButtons = new ArrayList<>();
|
||||||
public final List<TextField> textFields = new ArrayList<>();
|
public final List<TextField> textFields = new ArrayList<>();
|
||||||
private String status = "Session:";
|
private String status = "";
|
||||||
|
|
||||||
public LoginPanel() {
|
public LoginPanel() {
|
||||||
setHeight(200);
|
setHeight(200);
|
||||||
actionButtons.add(new AltButton("Cracked"));
|
actionButtons.add(new AltButton("Offline Login"));
|
||||||
actionButtons.add(new AltButton("Session"));
|
|
||||||
actionButtons.add(new AltButton("Login"));
|
|
||||||
textFields.add(new TextField());
|
textFields.add(new TextField());
|
||||||
textFields.add(new TextField());
|
textFields.add(new TextField());
|
||||||
}
|
}
|
||||||
|
@ -120,60 +118,14 @@ public class LoginPanel extends Panel {
|
||||||
actionButton.setHeight(20);
|
actionButton.setHeight(20);
|
||||||
|
|
||||||
actionButton.setClickAction(() -> {
|
actionButton.setClickAction(() -> {
|
||||||
switch (actionButton.getName()) {
|
if (actionButton.getName().equals("Offline Login")) {
|
||||||
case "Cracked":
|
TextField cracked = textFields.get(0);
|
||||||
TextField cracked = textFields.get(0);
|
Athena.INSTANCE.getAccountManager().getAccounts().add(new Account(AccountType.CRACKED, cracked.getText(), "0", "0"));
|
||||||
Athena.INSTANCE.getAccountManager().getAccounts().add(new Account(AccountType.CRACKED, cracked.getText(), "0", "0"));
|
Minecraft.getMinecraft().session = new Session(cracked.getText(), "0", "0", "legacy");
|
||||||
Minecraft.getMinecraft().session = new Session(cracked.getText(), "0", "0", "legacy");
|
status = "Logged into " + cracked.getText();
|
||||||
status = "Logged into " + cracked.getText();
|
Athena.INSTANCE.getAccountManager().setCurrentAccount(Athena.INSTANCE.getAccountManager().getAccountByUsername(cracked.getText()));
|
||||||
Athena.INSTANCE.getAccountManager().setCurrentAccount(Athena.INSTANCE.getAccountManager().getAccountByUsername(cracked.getText()));
|
Athena.INSTANCE.getAccountManager().isFirstLogin = false;
|
||||||
Athena.INSTANCE.getAccountManager().isFirstLogin = false;
|
Athena.INSTANCE.getAccountManager().save();
|
||||||
Athena.INSTANCE.getAccountManager().save();
|
|
||||||
|
|
||||||
break;
|
|
||||||
case "Session":
|
|
||||||
TextField sessionID = textFields.get(0);
|
|
||||||
|
|
||||||
try {
|
|
||||||
String user, uuid, token, session = sessionID.getText();
|
|
||||||
|
|
||||||
if (session.contains(":")) { //if fully formatted string (ign:uuid:token)
|
|
||||||
//split string to data
|
|
||||||
user = session.split(":")[0];
|
|
||||||
uuid = session.split(":")[1];
|
|
||||||
token = session.split(":")[2];
|
|
||||||
} else { //if only token
|
|
||||||
//make request
|
|
||||||
HttpURLConnection c = (HttpURLConnection) new URL("https://api.minecraftservices.com/minecraft/profile/").openConnection();
|
|
||||||
c.setRequestProperty("Content-type", "application/json");
|
|
||||||
c.setRequestProperty("Authorization", "Bearer " + sessionID.getText());
|
|
||||||
c.setDoOutput(true);
|
|
||||||
|
|
||||||
//get json
|
|
||||||
JsonObject json = new JsonParser().parse(IOUtils.toString(c.getInputStream())).getAsJsonObject();
|
|
||||||
|
|
||||||
//get data
|
|
||||||
user = json.get("name").getAsString();
|
|
||||||
uuid = json.get("id").getAsString();
|
|
||||||
token = session;
|
|
||||||
}
|
|
||||||
|
|
||||||
//set session and return to previous screen
|
|
||||||
Minecraft.getMinecraft().session = new Session(user, uuid, token, "mojang");
|
|
||||||
status = "Logged into " + user;
|
|
||||||
Athena.INSTANCE.getAccountManager().getAccounts().add(new Account(AccountType.SESSION, user, uuid, token));
|
|
||||||
Athena.INSTANCE.getAccountManager().setCurrentAccount(Athena.INSTANCE.getAccountManager().getAccountByUsername(user));
|
|
||||||
Athena.INSTANCE.getAccountManager().isFirstLogin = false;
|
|
||||||
Athena.INSTANCE.getAccountManager().save();
|
|
||||||
Athena.INSTANCE.getLog().info("Success: Logged into " + user);
|
|
||||||
//mc.displayGuiScreen(previousScreen);
|
|
||||||
} catch (Exception e) {
|
|
||||||
status = "Failed to login";
|
|
||||||
Athena.INSTANCE.getLog().error("Failed to login");
|
|
||||||
System.out.println(sessionID.getText());
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -188,9 +140,8 @@ public class LoginPanel extends Panel {
|
||||||
hoverMicrosoftAnim.setDirection(hoveringMicrosoft ? Direction.FORWARDS : Direction.BACKWARDS);
|
hoverMicrosoftAnim.setDirection(hoveringMicrosoft ? Direction.FORWARDS : Direction.BACKWARDS);
|
||||||
|
|
||||||
RoundedUtils.drawRound(microX, microsoftY, microWidth, microHeight, 5, ColorUtil.applyOpacity(Color.BLACK, .2f + (.25f * hoverMicrosoftAnim.getOutput().floatValue())));
|
RoundedUtils.drawRound(microX, microsoftY, microWidth, microHeight, 5, ColorUtil.applyOpacity(Color.BLACK, .2f + (.25f * hoverMicrosoftAnim.getOutput().floatValue())));
|
||||||
|
|
||||||
FontManager.getProductSansRegular(26).drawString("Microsoft Login", microX + 10, microsoftY + 4, -1);
|
FontManager.getProductSansRegular(26).drawString("Microsoft Login", microX + 10, microsoftY + 4, -1);
|
||||||
FontManager.getProductSansRegular(16).drawString("Login to your migrated account", microX + 10, microsoftY + 23, -1);
|
FontManager.getProductSansRegular(16).drawString("Login by entering login details and clicking here", microX + 10, microsoftY + 23, -1);
|
||||||
|
|
||||||
float logoSize = 22;
|
float logoSize = 22;
|
||||||
DrawUtils.drawMicrosoftLogo(microX + microWidth - (10 + logoSize), microsoftY + (microHeight / 2f) - (logoSize / 2f), logoSize, 1.5f);
|
DrawUtils.drawMicrosoftLogo(microX + microWidth - (10 + logoSize), microsoftY + (microHeight / 2f) - (logoSize / 2f), logoSize, 1.5f);
|
||||||
|
|
|
@ -8,7 +8,6 @@ import rip.athena.client.events.SubscribeEvent;
|
||||||
import rip.athena.client.events.types.input.KeyDownEvent;
|
import rip.athena.client.events.types.input.KeyDownEvent;
|
||||||
import rip.athena.client.events.types.input.MouseDownEvent;
|
import rip.athena.client.events.types.input.MouseDownEvent;
|
||||||
import rip.athena.client.gui.clickgui.components.mods.MenuModKeybind;
|
import rip.athena.client.gui.clickgui.components.mods.MenuModKeybind;
|
||||||
import sun.rmi.transport.proxy.RMIHttpToCGISocketFactory;
|
|
||||||
|
|
||||||
import javax.crypto.Mac;
|
import javax.crypto.Mac;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
@ -2,6 +2,7 @@ package rip.athena.client.modules.impl.other;
|
||||||
|
|
||||||
import com.mojang.authlib.GameProfile;
|
import com.mojang.authlib.GameProfile;
|
||||||
import net.minecraft.client.entity.EntityOtherPlayerMP;
|
import net.minecraft.client.entity.EntityOtherPlayerMP;
|
||||||
|
import net.minecraft.client.gui.Gui;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.util.Vec3;
|
import net.minecraft.util.Vec3;
|
||||||
import rip.athena.client.Athena;
|
import rip.athena.client.Athena;
|
||||||
|
@ -110,7 +111,7 @@ public class AimTrainer extends Module {
|
||||||
} else if (backgroundMode.equalsIgnoreCase("Fade")) {
|
} else if (backgroundMode.equalsIgnoreCase("Fade")) {
|
||||||
RoundedUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 8.0f, Athena.INSTANCE.getThemeManager().getTheme().getAccentColor().getRGB());
|
RoundedUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 8.0f, Athena.INSTANCE.getThemeManager().getTheme().getAccentColor().getRGB());
|
||||||
} else {
|
} else {
|
||||||
RoundedUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 12,background.getRGB());
|
Gui.drawRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, background.getRGB());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package rip.athena.client.modules.impl.render;
|
package rip.athena.client.modules.impl.render;
|
||||||
|
|
||||||
|
import net.minecraft.client.gui.Gui;
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
import rip.athena.client.Athena;
|
import rip.athena.client.Athena;
|
||||||
import rip.athena.client.config.ConfigValue;
|
import rip.athena.client.config.ConfigValue;
|
||||||
|
@ -96,7 +97,7 @@ public class CPS extends Module {
|
||||||
} else if (backgroundMode.equalsIgnoreCase("Fade")) {
|
} else if (backgroundMode.equalsIgnoreCase("Fade")) {
|
||||||
RoundedUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 8.0f, Athena.INSTANCE.getThemeManager().getTheme().getAccentColor().getRGB());
|
RoundedUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 8.0f, Athena.INSTANCE.getThemeManager().getTheme().getAccentColor().getRGB());
|
||||||
} else {
|
} else {
|
||||||
RoundedUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 12,background.getRGB());
|
Gui.drawRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, background.getRGB());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -113,7 +113,7 @@ public class Clock extends Module {
|
||||||
} else if (backgroundMode.equalsIgnoreCase("Fade")) {
|
} else if (backgroundMode.equalsIgnoreCase("Fade")) {
|
||||||
RoundedUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 8.0f, Athena.INSTANCE.getThemeManager().getTheme().getAccentColor().getRGB());
|
RoundedUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 8.0f, Athena.INSTANCE.getThemeManager().getTheme().getAccentColor().getRGB());
|
||||||
} else {
|
} else {
|
||||||
RoundedUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 12, background.getRGB());
|
Gui.drawRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, background.getRGB());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@ package rip.athena.client.modules.impl.render;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.FontRenderer;
|
import net.minecraft.client.gui.FontRenderer;
|
||||||
|
import net.minecraft.client.gui.Gui;
|
||||||
import net.minecraft.client.gui.GuiScreen;
|
import net.minecraft.client.gui.GuiScreen;
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
import net.minecraft.client.renderer.WorldRenderer;
|
import net.minecraft.client.renderer.WorldRenderer;
|
||||||
|
@ -92,17 +93,6 @@ public class Coordinates extends Module {
|
||||||
int myPosZ;
|
int myPosZ;
|
||||||
int myAngle;
|
int myAngle;
|
||||||
int myDir;
|
int myDir;
|
||||||
int myMoveX;
|
|
||||||
int myMoveZ;
|
|
||||||
int myFind;
|
|
||||||
|
|
||||||
int coordLocation;
|
|
||||||
int myXLine, myYLine, myZLine, myBiomeLine;
|
|
||||||
int myBaseOffset;
|
|
||||||
int myCoord1Offset, myCoord2Offset;
|
|
||||||
int myRHSlocation;
|
|
||||||
int coordBoxW, coordBoxH;
|
|
||||||
int coordBoxL, coordBoxR, coordBoxTop, coordBoxBase;
|
|
||||||
|
|
||||||
private static final String[] myCardinalPoint = new String[] {"N", "NE", "E", "SE", "S", "SW", "W", "NW"};
|
private static final String[] myCardinalPoint = new String[] {"N", "NE", "E", "SE", "S", "SW", "W", "NW"};
|
||||||
|
|
||||||
|
@ -280,7 +270,7 @@ public class Coordinates extends Module {
|
||||||
} else if (backgroundMode.equalsIgnoreCase("Circle")) {
|
} else if (backgroundMode.equalsIgnoreCase("Circle")) {
|
||||||
RoundedUtils.drawGradientRound(hud.getX(), hud.getY(), hud.getWidth(), hud.getHeight(), 6, ColorUtil.getClientColor(0, transparency), ColorUtil.getClientColor(90, transparency), ColorUtil.getClientColor(180, transparency), ColorUtil.getClientColor(270, transparency));
|
RoundedUtils.drawGradientRound(hud.getX(), hud.getY(), hud.getWidth(), hud.getHeight(), 6, ColorUtil.getClientColor(0, transparency), ColorUtil.getClientColor(90, transparency), ColorUtil.getClientColor(180, transparency), ColorUtil.getClientColor(270, transparency));
|
||||||
} else {
|
} else {
|
||||||
DrawUtils.drawGradientRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, backgroundColor.getRGB(), backgroundColor.getRGB());
|
Gui.drawRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, backgroundColor.getRGB());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package rip.athena.client.modules.impl.render;
|
package rip.athena.client.modules.impl.render;
|
||||||
|
|
||||||
|
import net.minecraft.client.gui.Gui;
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
import rip.athena.client.Athena;
|
import rip.athena.client.Athena;
|
||||||
import rip.athena.client.config.ConfigValue;
|
import rip.athena.client.config.ConfigValue;
|
||||||
|
@ -87,7 +88,7 @@ public class CustomText extends Module {
|
||||||
} else if (backgroundMode.equalsIgnoreCase("Fade")) {
|
} else if (backgroundMode.equalsIgnoreCase("Fade")) {
|
||||||
RoundedUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 8.0f, Athena.INSTANCE.getThemeManager().getTheme().getAccentColorWave().getRGB());
|
RoundedUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 8.0f, Athena.INSTANCE.getThemeManager().getTheme().getAccentColorWave().getRGB());
|
||||||
} else {
|
} else {
|
||||||
RoundedUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 12,background.getRGB());
|
Gui.drawRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, background.getRGB());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package rip.athena.client.modules.impl.render;
|
package rip.athena.client.modules.impl.render;
|
||||||
|
|
||||||
|
import net.minecraft.client.gui.Gui;
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
import rip.athena.client.Athena;
|
import rip.athena.client.Athena;
|
||||||
import rip.athena.client.config.ConfigValue;
|
import rip.athena.client.config.ConfigValue;
|
||||||
|
@ -87,7 +88,7 @@ public class EntityHUD extends Module {
|
||||||
} else if (backgroundMode.equalsIgnoreCase("Fade")) {
|
} else if (backgroundMode.equalsIgnoreCase("Fade")) {
|
||||||
RoundedUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 8.0f, Athena.INSTANCE.getThemeManager().getTheme().getAccentColorWave().getRGB());
|
RoundedUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 8.0f, Athena.INSTANCE.getThemeManager().getTheme().getAccentColorWave().getRGB());
|
||||||
} else {
|
} else {
|
||||||
RoundedUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 12,background.getRGB());
|
Gui.drawRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, background.getRGB());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package rip.athena.client.modules.impl.render;
|
package rip.athena.client.modules.impl.render;
|
||||||
|
|
||||||
|
import net.minecraft.client.gui.Gui;
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
import org.lwjgl.input.Keyboard;
|
import org.lwjgl.input.Keyboard;
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
@ -96,7 +97,7 @@ public class FPSMod extends Module {
|
||||||
} else if (backgroundMode.equalsIgnoreCase("Fade")) {
|
} else if (backgroundMode.equalsIgnoreCase("Fade")) {
|
||||||
RoundedUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 8.0f, Athena.INSTANCE.getThemeManager().getTheme().getAccentColor().getRGB());
|
RoundedUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 8.0f, Athena.INSTANCE.getThemeManager().getTheme().getAccentColor().getRGB());
|
||||||
} else {
|
} else {
|
||||||
RoundedUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 12,background.getRGB());
|
Gui.drawRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, background.getRGB());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package rip.athena.client.modules.impl.render;
|
package rip.athena.client.modules.impl.render;
|
||||||
|
|
||||||
|
import net.minecraft.client.gui.Gui;
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
import rip.athena.client.Athena;
|
import rip.athena.client.Athena;
|
||||||
import rip.athena.client.config.ConfigValue;
|
import rip.athena.client.config.ConfigValue;
|
||||||
|
@ -103,7 +104,7 @@ public class MemoryUsage extends Module {
|
||||||
} else if (backgroundMode.equalsIgnoreCase("Fade")) {
|
} else if (backgroundMode.equalsIgnoreCase("Fade")) {
|
||||||
RoundedUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 8.0f, Athena.INSTANCE.getThemeManager().getTheme().getAccentColor().getRGB());
|
RoundedUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 8.0f, Athena.INSTANCE.getThemeManager().getTheme().getAccentColor().getRGB());
|
||||||
} else {
|
} else {
|
||||||
RoundedUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 12,background.getRGB());
|
Gui.drawRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, background.getRGB());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package rip.athena.client.modules.impl.render;
|
package rip.athena.client.modules.impl.render;
|
||||||
|
|
||||||
|
import net.minecraft.client.gui.Gui;
|
||||||
import net.minecraft.client.renderer.texture.DynamicTexture;
|
import net.minecraft.client.renderer.texture.DynamicTexture;
|
||||||
import net.minecraft.client.renderer.texture.TextureUtil;
|
import net.minecraft.client.renderer.texture.TextureUtil;
|
||||||
import net.minecraft.client.resources.IResourcePack;
|
import net.minecraft.client.resources.IResourcePack;
|
||||||
|
@ -107,7 +108,7 @@ public class PackDisplay extends Module {
|
||||||
} else if (backgroundMode.equalsIgnoreCase("Fade")) {
|
} else if (backgroundMode.equalsIgnoreCase("Fade")) {
|
||||||
RoundedUtils.drawRoundedRect(hud.getX() - 10, hud.getY(), hud.getX() + width + rip.athena.client.utils.font.FontManager.getProductSansRegular(20).width(this.convertNormalText(pack.getPackName())) / 2, hud.getY() + height + 20, 12.0f, Athena.INSTANCE.getThemeManager().getTheme().getAccentColor().getRGB());
|
RoundedUtils.drawRoundedRect(hud.getX() - 10, hud.getY(), hud.getX() + width + rip.athena.client.utils.font.FontManager.getProductSansRegular(20).width(this.convertNormalText(pack.getPackName())) / 2, hud.getY() + height + 20, 12.0f, Athena.INSTANCE.getThemeManager().getTheme().getAccentColor().getRGB());
|
||||||
} else {
|
} else {
|
||||||
RoundedUtils.drawRoundedRect(hud.getX() - 10, hud.getY(), hud.getX() + width + rip.athena.client.utils.font.FontManager.getProductSansRegular(20).width(this.convertNormalText(pack.getPackName())) / 2, hud.getY() + height + 20, 12,background.getRGB());
|
Gui.drawRect(hud.getX() - 10, hud.getY(), hud.getX() + width + rip.athena.client.utils.font.FontManager.getProductSansRegular(20).width(this.convertNormalText(pack.getPackName())) / 2, hud.getY() + height + 20, background.getRGB());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package rip.athena.client.modules.impl.render;
|
package rip.athena.client.modules.impl.render;
|
||||||
|
|
||||||
import net.minecraft.client.entity.EntityPlayerSP;
|
import net.minecraft.client.entity.EntityPlayerSP;
|
||||||
|
import net.minecraft.client.gui.Gui;
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
@ -109,7 +110,7 @@ public class PotCounter extends Module {
|
||||||
} else if (backgroundMode.equalsIgnoreCase("Fade")) {
|
} else if (backgroundMode.equalsIgnoreCase("Fade")) {
|
||||||
RoundedUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 8.0f, Athena.INSTANCE.getThemeManager().getTheme().getAccentColor().getRGB());
|
RoundedUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 8.0f, Athena.INSTANCE.getThemeManager().getTheme().getAccentColor().getRGB());
|
||||||
} else {
|
} else {
|
||||||
RoundedUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 12,backgroundColor.getRGB());
|
Gui.drawRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, backgroundColor.getRGB());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package rip.athena.client.modules.impl.render;
|
package rip.athena.client.modules.impl.render;
|
||||||
|
|
||||||
|
import net.minecraft.client.gui.Gui;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
@ -115,7 +116,7 @@ public class ReachDisplay extends Module {
|
||||||
} else if (backgroundMode.equalsIgnoreCase("Fade")) {
|
} else if (backgroundMode.equalsIgnoreCase("Fade")) {
|
||||||
RoundedUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 8.0f, Athena.INSTANCE.getThemeManager().getTheme().getAccentColor().getRGB());
|
RoundedUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 8.0f, Athena.INSTANCE.getThemeManager().getTheme().getAccentColor().getRGB());
|
||||||
} else {
|
} else {
|
||||||
RoundedUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 12,background.getRGB());
|
Gui.drawRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, background.getRGB());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@ package rip.athena.client.modules.impl.render;
|
||||||
|
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
import net.minecraft.client.gui.Gui;
|
||||||
import net.minecraft.client.gui.GuiScreen;
|
import net.minecraft.client.gui.GuiScreen;
|
||||||
import net.minecraft.client.gui.ScaledResolution;
|
import net.minecraft.client.gui.ScaledResolution;
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
|
@ -36,7 +37,7 @@ import rip.athena.client.utils.render.RoundedUtils;
|
||||||
public class Scoreboard extends Module {
|
public class Scoreboard extends Module {
|
||||||
|
|
||||||
@ConfigValue.List(name = "Display Mode", values = {"Modern", "Fade", "Custom", "Default"}, description = "Chose display of background")
|
@ConfigValue.List(name = "Display Mode", values = {"Modern", "Fade", "Custom", "Default"}, description = "Chose display of background")
|
||||||
private String backgroundMode = "Modern";
|
private String backgroundMode = "Default";
|
||||||
|
|
||||||
@ConfigValue.Color(name = "Background Color")
|
@ConfigValue.Color(name = "Background Color")
|
||||||
private Color backgroundColor = new Color(0, 0, 0, 150);
|
private Color backgroundColor = new Color(0, 0, 0, 150);
|
||||||
|
@ -159,7 +160,7 @@ public class Scoreboard extends Module {
|
||||||
} else if (backgroundMode.equalsIgnoreCase("Fade")) {
|
} else if (backgroundMode.equalsIgnoreCase("Fade")) {
|
||||||
RoundedUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 8.0f, Athena.INSTANCE.getThemeManager().getTheme().getAccentColor().getRGB());
|
RoundedUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 8.0f, Athena.INSTANCE.getThemeManager().getTheme().getAccentColor().getRGB());
|
||||||
} else {
|
} else {
|
||||||
RoundedUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 12,backgroundColor.getRGB());
|
Gui.drawRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, backgroundColor.getRGB());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 452 B |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 421 B |
After Width: | Height: | Size: 123 KiB |
After Width: | Height: | Size: 111 KiB |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 1018 B |
After Width: | Height: | Size: 2.1 MiB |
Before Width: | Height: | Size: 5.4 MiB After Width: | Height: | Size: 1.2 MiB |
After Width: | Height: | Size: 53 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 835 B |
After Width: | Height: | Size: 4.6 KiB |
After Width: | Height: | Size: 670 B |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 719 B |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.3 KiB |
646780
workspace/logs/latest.log
|
@ -10,7 +10,7 @@ bobView:true
|
||||||
anaglyph3d:false
|
anaglyph3d:false
|
||||||
maxFps:260
|
maxFps:260
|
||||||
fboEnable:true
|
fboEnable:true
|
||||||
difficulty:1
|
difficulty:2
|
||||||
fancyGraphics:false
|
fancyGraphics:false
|
||||||
ao:0
|
ao:0
|
||||||
renderClouds:false
|
renderClouds:false
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"stat.walkOneCm":128091,"achievement.openInventory":11,"stat.leaveGame":74,"stat.damageTaken":50,"stat.killEntity.Spider":1,"stat.mobKills":34,"stat.killEntity.Creeper":33,"stat.useItem.minecraft.diamond_sword":76,"stat.flyOneCm":210056,"stat.drop":21,"stat.jump":638,"stat.playOneMinute":497598,"stat.fallOneCm":422,"stat.damageDealt":8415,"stat.crouchOneCm":373,"stat.timeSinceDeath":497598,"stat.sprintOneCm":69728,"stat.useItem.minecraft.spawn_egg":128,"achievement.exploreAllBiomes":{"value":0,"progress":["DesertHills","River","Desert"]}}
|
{"stat.walkOneCm":130758,"achievement.openInventory":11,"stat.leaveGame":78,"stat.damageTaken":50,"stat.killEntity.Spider":1,"stat.mobKills":34,"stat.killEntity.Creeper":33,"stat.useItem.minecraft.diamond_sword":76,"stat.flyOneCm":221475,"stat.drop":21,"stat.jump":651,"stat.playOneMinute":515922,"stat.fallOneCm":422,"stat.damageDealt":8415,"stat.crouchOneCm":373,"stat.timeSinceDeath":515922,"stat.sprintOneCm":71583,"stat.useItem.minecraft.spawn_egg":128,"achievement.exploreAllBiomes":{"value":0,"progress":["DesertHills","River","Desert"]}}
|
|
@ -0,0 +1 @@
|
||||||
|
{"stat.flyOneCm":578,"stat.walkOneCm":1003,"stat.jump":5,"stat.playOneMinute":1823,"stat.leaveGame":1,"stat.timeSinceDeath":1823,"stat.sprintOneCm":544,"achievement.exploreAllBiomes":{"value":0,"progress":["Desert"]}}
|
|
@ -1 +1 @@
|
||||||
{"stat.walkOneCm":11824,"achievement.openInventory":3,"stat.leaveGame":27,"stat.damageTaken":45,"stat.flyOneCm":16020,"stat.jump":85,"stat.playOneMinute":91240,"stat.fallOneCm":211,"stat.timeSinceDeath":91240,"stat.sprintOneCm":7810,"achievement.exploreAllBiomes":{"value":0,"progress":["Beach"]}}
|
{"stat.walkOneCm":13240,"achievement.openInventory":3,"stat.leaveGame":28,"stat.damageTaken":45,"stat.flyOneCm":18267,"stat.jump":94,"stat.playOneMinute":213167,"stat.fallOneCm":211,"stat.timeSinceDeath":213167,"stat.sprintOneCm":8888,"achievement.exploreAllBiomes":{"value":0,"progress":["Beach","Desert"]}}
|
|
@ -27,6 +27,23 @@
|
||||||
"bindtype": "Toggle",
|
"bindtype": "Toggle",
|
||||||
"enabled": false
|
"enabled": false
|
||||||
},
|
},
|
||||||
|
"Crosshair": {
|
||||||
|
"settings": {
|
||||||
|
"Draw color": {
|
||||||
|
"red": 255,
|
||||||
|
"green": 0,
|
||||||
|
"blue": 0,
|
||||||
|
"alpha": 255
|
||||||
|
},
|
||||||
|
"Brush size": 2,
|
||||||
|
"Rainbow color": false,
|
||||||
|
"Delete mode": false
|
||||||
|
},
|
||||||
|
"bind": 0,
|
||||||
|
"hud": {},
|
||||||
|
"bindtype": "Toggle",
|
||||||
|
"enabled": false
|
||||||
|
},
|
||||||
"CPS": {
|
"CPS": {
|
||||||
"settings": {
|
"settings": {
|
||||||
"Transparency": 255,
|
"Transparency": 255,
|
||||||
|
@ -69,23 +86,6 @@
|
||||||
"bindtype": "Toggle",
|
"bindtype": "Toggle",
|
||||||
"enabled": false
|
"enabled": false
|
||||||
},
|
},
|
||||||
"Crosshair": {
|
|
||||||
"settings": {
|
|
||||||
"Draw color": {
|
|
||||||
"red": 255,
|
|
||||||
"green": 0,
|
|
||||||
"blue": 0,
|
|
||||||
"alpha": 255
|
|
||||||
},
|
|
||||||
"Brush size": 2,
|
|
||||||
"Rainbow color": false,
|
|
||||||
"Delete mode": false
|
|
||||||
},
|
|
||||||
"bind": 0,
|
|
||||||
"hud": {},
|
|
||||||
"bindtype": "Toggle",
|
|
||||||
"enabled": false
|
|
||||||
},
|
|
||||||
"FPS": {
|
"FPS": {
|
||||||
"settings": {
|
"settings": {
|
||||||
"Transparency": 255,
|
"Transparency": 255,
|
||||||
|
@ -247,7 +247,7 @@
|
||||||
"alpha": 153
|
"alpha": 153
|
||||||
},
|
},
|
||||||
"Free Move": false,
|
"Free Move": false,
|
||||||
"Display Mode": "Fade",
|
"Display Mode": "Default",
|
||||||
"Show Numbers": false
|
"Show Numbers": false
|
||||||
},
|
},
|
||||||
"bind": 0,
|
"bind": 0,
|
||||||
|
@ -258,6 +258,36 @@
|
||||||
"scale": 1
|
"scale": 1
|
||||||
}},
|
}},
|
||||||
"bindtype": "Toggle",
|
"bindtype": "Toggle",
|
||||||
|
"enabled": true
|
||||||
|
},
|
||||||
|
"TPS": {
|
||||||
|
"settings": {
|
||||||
|
"Custom Font": false,
|
||||||
|
"Background": true,
|
||||||
|
"Mode": "Number",
|
||||||
|
"Background Color": {
|
||||||
|
"red": 0,
|
||||||
|
"green": 0,
|
||||||
|
"blue": 0,
|
||||||
|
"alpha": 102
|
||||||
|
},
|
||||||
|
"Display Mode": "Modern",
|
||||||
|
"Preset Color": true,
|
||||||
|
"TPS Color": {
|
||||||
|
"red": 255,
|
||||||
|
"green": 255,
|
||||||
|
"blue": 255,
|
||||||
|
"alpha": 255
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"bind": 0,
|
||||||
|
"hud": {"tps": {
|
||||||
|
"visible": true,
|
||||||
|
"x": 13,
|
||||||
|
"y": 6,
|
||||||
|
"scale": 1
|
||||||
|
}},
|
||||||
|
"bindtype": "Toggle",
|
||||||
"enabled": false
|
"enabled": false
|
||||||
},
|
},
|
||||||
"Memory usage": {
|
"Memory usage": {
|
||||||
|
@ -299,36 +329,6 @@
|
||||||
"bindtype": "Toggle",
|
"bindtype": "Toggle",
|
||||||
"enabled": true
|
"enabled": true
|
||||||
},
|
},
|
||||||
"TPS": {
|
|
||||||
"settings": {
|
|
||||||
"Custom Font": false,
|
|
||||||
"Background": true,
|
|
||||||
"Mode": "Number",
|
|
||||||
"Background Color": {
|
|
||||||
"red": 0,
|
|
||||||
"green": 0,
|
|
||||||
"blue": 0,
|
|
||||||
"alpha": 90
|
|
||||||
},
|
|
||||||
"Display Mode": "Circle",
|
|
||||||
"Preset Color": true,
|
|
||||||
"TPS Color": {
|
|
||||||
"red": 255,
|
|
||||||
"green": 255,
|
|
||||||
"blue": 255,
|
|
||||||
"alpha": 255
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"bind": 0,
|
|
||||||
"hud": {"tps": {
|
|
||||||
"visible": true,
|
|
||||||
"x": 0,
|
|
||||||
"y": 0,
|
|
||||||
"scale": 1
|
|
||||||
}},
|
|
||||||
"bindtype": "Toggle",
|
|
||||||
"enabled": false
|
|
||||||
},
|
|
||||||
"Armor Status": {
|
"Armor Status": {
|
||||||
"settings": {
|
"settings": {
|
||||||
"Value Display": "Value Damage",
|
"Value Display": "Value Damage",
|
||||||
|
@ -537,7 +537,14 @@
|
||||||
"scale": 1
|
"scale": 1
|
||||||
}},
|
}},
|
||||||
"bindtype": "Toggle",
|
"bindtype": "Toggle",
|
||||||
"enabled": false
|
"enabled": true
|
||||||
|
},
|
||||||
|
"ItemPhysics": {
|
||||||
|
"settings": {},
|
||||||
|
"bind": 0,
|
||||||
|
"hud": {},
|
||||||
|
"bindtype": "Toggle",
|
||||||
|
"enabled": true
|
||||||
},
|
},
|
||||||
"Key Strokes": {
|
"Key Strokes": {
|
||||||
"settings": {
|
"settings": {
|
||||||
|
@ -576,13 +583,6 @@
|
||||||
"bindtype": "Toggle",
|
"bindtype": "Toggle",
|
||||||
"enabled": false
|
"enabled": false
|
||||||
},
|
},
|
||||||
"ItemPhysics": {
|
|
||||||
"settings": {},
|
|
||||||
"bind": 0,
|
|
||||||
"hud": {},
|
|
||||||
"bindtype": "Toggle",
|
|
||||||
"enabled": true
|
|
||||||
},
|
|
||||||
"Old Animations": {
|
"Old Animations": {
|
||||||
"settings": {
|
"settings": {
|
||||||
"Armor Damage Flash": true,
|
"Armor Damage Flash": true,
|
||||||
|
@ -672,8 +672,8 @@
|
||||||
"bind": 0,
|
"bind": 0,
|
||||||
"hud": {"packdisplay": {
|
"hud": {"packdisplay": {
|
||||||
"visible": true,
|
"visible": true,
|
||||||
"x": 16,
|
"x": 199,
|
||||||
"y": 4,
|
"y": 43,
|
||||||
"scale": 1
|
"scale": 1
|
||||||
}},
|
}},
|
||||||
"bindtype": "Toggle",
|
"bindtype": "Toggle",
|
||||||
|
@ -717,6 +717,7 @@
|
||||||
"bindtype": "Toggle",
|
"bindtype": "Toggle",
|
||||||
"enabled": true
|
"enabled": true
|
||||||
},
|
},
|
||||||
|
"cape": "Minecon 2016",
|
||||||
"NoHurtCam": {
|
"NoHurtCam": {
|
||||||
"settings": {},
|
"settings": {},
|
||||||
"bind": 0,
|
"bind": 0,
|
||||||
|
|