BIG UPDATE

This commit is contained in:
The Biggest skiddd 2023-06-02 23:57:34 +02:00
parent a0fc9c3f8c
commit ca2a57e181
344 changed files with 16463 additions and 7269 deletions

View File

@ -34,6 +34,12 @@
<version>20230227</version> <version>20230227</version>
</dependency> </dependency>
<dependency>
<groupId>javax.vecmath</groupId>
<artifactId>vecmath</artifactId>
<version>1.5.2</version>
</dependency>
<dependency> <dependency>
<groupId>org.reflections</groupId> <groupId>org.reflections</groupId>
<artifactId>reflections</artifactId> <artifactId>reflections</artifactId>

View File

@ -187,8 +187,14 @@ import org.lwjgl.util.glu.GLU;
import rip.athena.client.Athena; import rip.athena.client.Athena;
import rip.athena.client.events.Event; import rip.athena.client.events.Event;
import rip.athena.client.events.types.client.ClientTickEvent; import rip.athena.client.events.types.client.ClientTickEvent;
import rip.athena.client.events.types.entity.PlayerInteractEvent;
import rip.athena.client.events.types.input.KeyDownEvent; import rip.athena.client.events.types.input.KeyDownEvent;
import rip.athena.client.events.types.input.KeyUpEvent; import rip.athena.client.events.types.input.KeyUpEvent;
import rip.athena.client.events.types.input.MouseDownEvent;
import rip.athena.client.events.types.input.MouseMoveEvent;
import rip.athena.client.events.types.render.RenderEvent;
import rip.athena.client.events.types.render.RenderType;
import rip.athena.client.gui.menu.AthenaMenu;
public class Minecraft implements IThreadListener, IPlayerUsage public class Minecraft implements IThreadListener, IPlayerUsage
{ {
@ -315,7 +321,7 @@ public class Minecraft implements IThreadListener, IPlayerUsage
*/ */
private long debugCrashKeyPressTime = -1L; private long debugCrashKeyPressTime = -1L;
private IReloadableResourceManager mcResourceManager; private IReloadableResourceManager mcResourceManager;
private final IMetadataSerializer metadataSerializer_ = new IMetadataSerializer(); public final IMetadataSerializer metadataSerializer_ = new IMetadataSerializer();
private final List<IResourcePack> defaultResourcePacks = Lists.<IResourcePack>newArrayList(); private final List<IResourcePack> defaultResourcePacks = Lists.<IResourcePack>newArrayList();
private final DefaultResourcePack mcDefaultResourcePack; private final DefaultResourcePack mcDefaultResourcePack;
private ResourcePackRepository mcResourcePackRepository; private ResourcePackRepository mcResourcePackRepository;
@ -479,6 +485,8 @@ public class Minecraft implements IThreadListener, IPlayerUsage
this.displayHeight = this.gameSettings.overrideHeight; this.displayHeight = this.gameSettings.overrideHeight;
} }
Athena.INSTANCE.initClient();
logger.info("LWJGL Version: " + Sys.getVersion()); logger.info("LWJGL Version: " + Sys.getVersion());
this.setWindowIcon(); this.setWindowIcon();
this.setInitialDisplayMode(); this.setInitialDisplayMode();
@ -565,15 +573,13 @@ public class Minecraft implements IThreadListener, IPlayerUsage
this.checkGLError("Post startup"); this.checkGLError("Post startup");
this.ingameGUI = new GuiIngame(this); this.ingameGUI = new GuiIngame(this);
Athena.INSTANCE.initClient();
if (this.serverName != null) if (this.serverName != null)
{ {
this.displayGuiScreen(new GuiConnecting(new GuiMainMenu(), this, this.serverName, this.serverPort)); this.displayGuiScreen(new GuiConnecting(new AthenaMenu(), this, this.serverName, this.serverPort));
} }
else else
{ {
this.displayGuiScreen(new GuiMainMenu()); this.displayGuiScreen(new AthenaMenu());
} }
this.renderEngine.deleteTexture(this.mojangLogo); this.renderEngine.deleteTexture(this.mojangLogo);
@ -908,6 +914,18 @@ public class Minecraft implements IThreadListener, IPlayerUsage
GlStateManager.enableTexture2D(); GlStateManager.enableTexture2D();
InputStream inputstream = null; InputStream inputstream = null;
if(!Athena.INSTANCE.getEventBus().post(new RenderEvent(RenderType.SPLASH_SCREEN))) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
int j = 256;
int k = 256;
framebuffer.unbindFramebuffer();
framebuffer.framebufferRender(scaledresolution.getScaledWidth() * i, scaledresolution.getScaledHeight() * i);
GlStateManager.enableAlpha();
GlStateManager.alphaFunc(516, 0.1F);
this.updateDisplay();
return;
}
try try
{ {
inputstream = this.mcDefaultResourcePack.getInputStream(locationMojangPng); inputstream = this.mcDefaultResourcePack.getInputStream(locationMojangPng);
@ -977,14 +995,14 @@ public class Minecraft implements IThreadListener, IPlayerUsage
if (guiScreenIn == null && this.theWorld == null) if (guiScreenIn == null && this.theWorld == null)
{ {
guiScreenIn = new GuiMainMenu(); guiScreenIn = new AthenaMenu();
} }
else if (guiScreenIn == null && this.thePlayer.getHealth() <= 0.0F) else if (guiScreenIn == null && this.thePlayer.getHealth() <= 0.0F)
{ {
guiScreenIn = new GuiGameOver(); guiScreenIn = new GuiGameOver();
} }
if (guiScreenIn instanceof GuiMainMenu) if (guiScreenIn instanceof AthenaMenu)
{ {
this.gameSettings.showDebugInfo = false; this.gameSettings.showDebugInfo = false;
this.ingameGUI.getChatGUI().clearChatMessages(); this.ingameGUI.getChatGUI().clearChatMessages();
@ -1532,6 +1550,10 @@ public class Minecraft implements IThreadListener, IPlayerUsage
if (this.theWorld.getBlockState(blockpos).getBlock().getMaterial() != Material.air) if (this.theWorld.getBlockState(blockpos).getBlock().getMaterial() != Material.air)
{ {
if(!Athena.INSTANCE.getEventBus().post(new PlayerInteractEvent(PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK, blockpos, this.theWorld))) {
return;
}
this.playerController.clickBlock(blockpos, this.objectMouseOver.sideHit); this.playerController.clickBlock(blockpos, this.objectMouseOver.sideHit);
break; break;
} }
@ -1825,11 +1847,19 @@ public class Minecraft implements IThreadListener, IPlayerUsage
while (Mouse.next()) while (Mouse.next())
{ {
if(!Athena.INSTANCE.getEventBus().post(new MouseMoveEvent())) {
continue;
}
int i = Mouse.getEventButton(); int i = Mouse.getEventButton();
KeyBinding.setKeyBindState(i - 100, Mouse.getEventButtonState()); KeyBinding.setKeyBindState(i - 100, Mouse.getEventButtonState());
if (Mouse.getEventButtonState()) if (Mouse.getEventButtonState())
{ {
if(!Athena.INSTANCE.getEventBus().post(new MouseDownEvent(i))) {
continue;
}
if (this.thePlayer.isSpectator() && i == 2) if (this.thePlayer.isSpectator() && i == 2)
{ {
this.ingameGUI.getSpectatorGui().func_175261_b(); this.ingameGUI.getSpectatorGui().func_175261_b();

View File

@ -60,7 +60,7 @@ public abstract class AbstractClientPlayer extends EntityPlayer
return this.getPlayerInfo() != null; return this.getPlayerInfo() != null;
} }
protected NetworkPlayerInfo getPlayerInfo() public NetworkPlayerInfo getPlayerInfo()
{ {
if (this.playerInfo == null) if (this.playerInfo == null)
{ {

View File

@ -87,7 +87,7 @@ public class Gui
* Draws a rectangle with a vertical gradient between the specified colors (ARGB format). Args : x1, y1, x2, y2, * Draws a rectangle with a vertical gradient between the specified colors (ARGB format). Args : x1, y1, x2, y2,
* topColor, bottomColor * topColor, bottomColor
*/ */
protected void drawGradientRect(int left, int top, int right, int bottom, int startColor, int endColor) public void drawGradientRect(int left, int top, int right, int bottom, int startColor, int endColor)
{ {
float f = (float)(startColor >> 24 & 255) / 255.0F; float f = (float)(startColor >> 24 & 255) / 255.0F;
float f1 = (float)(startColor >> 16 & 255) / 255.0F; float f1 = (float)(startColor >> 16 & 255) / 255.0F;

View File

@ -5,6 +5,10 @@ import net.minecraft.client.audio.PositionedSoundRecord;
import net.minecraft.client.audio.SoundHandler; import net.minecraft.client.audio.SoundHandler;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import rip.athena.client.font.FontManager;
import rip.athena.client.utils.render.DrawUtils;
import java.awt.*;
public class GuiButton extends Gui public class GuiButton extends Gui
{ {
@ -87,11 +91,15 @@ public class GuiButton extends Gui
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.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.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; int j = 14737632;
DrawUtils.drawRoundedRect(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, 4, hovered ? new Color(200,200,200,100).getRGB() : new Color(100,100,100,100).getRGB());
DrawUtils.drawRoundedRect(this.xPosition + 1, this.yPosition + 1, (this.xPosition + this.width) - 1, (this.yPosition + this.height) - 1, 3, new Color(22, 24, 27,100).getRGB());
if (!this.enabled) if (!this.enabled)
{ {
j = 10526880; j = 10526880;
@ -101,7 +109,7 @@ public class GuiButton extends Gui
j = 16777120; j = 16777120;
} }
this.drawCenteredString(fontrenderer, this.displayString, this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, j); FontManager.baloo17.drawCenteredString(this.displayString, this.xPosition + this.width / 2, this.yPosition + (this.height - 12) / 2, -1);
} }
} }

View File

@ -169,7 +169,8 @@ public class GuiIngame extends Gui
this.mc.getTextureManager().bindTexture(icons); this.mc.getTextureManager().bindTexture(icons);
GlStateManager.enableBlend(); GlStateManager.enableBlend();
if (this.showCrosshair() && this.mc.gameSettings.thirdPersonView < 1) //if (this.showCrosshair() && this.mc.gameSettings.thirdPersonView < 1)
if (this.showCrosshair() && Athena.INSTANCE.getEventBus().post(new RenderEvent(RenderType.CROSSHAIR, partialTicks)))
{ {
GlStateManager.tryBlendFuncSeparate(775, 769, 1, 0); GlStateManager.tryBlendFuncSeparate(775, 769, 1, 0);
GlStateManager.enableAlpha(); GlStateManager.enableAlpha();

View File

@ -86,6 +86,8 @@ import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GLContext; import org.lwjgl.opengl.GLContext;
import org.lwjgl.util.glu.GLU; import org.lwjgl.util.glu.GLU;
import org.lwjgl.util.glu.Project; import org.lwjgl.util.glu.Project;
import rip.athena.client.Athena;
import rip.athena.client.modules.impl.mods.Zoom;
import shadersmod.client.Shaders; import shadersmod.client.Shaders;
import shadersmod.client.ShadersRender; import shadersmod.client.ShadersRender;
@ -318,7 +320,7 @@ public class EntityRenderer implements IResourceManagerReloadListener
} }
} }
private void loadShader(ResourceLocation resourceLocationIn) public void loadShader(ResourceLocation resourceLocationIn)
{ {
if (OpenGlHelper.isFramebufferEnabled()) if (OpenGlHelper.isFramebufferEnabled())
{ {
@ -623,15 +625,26 @@ public class EntityRenderer implements IResourceManagerReloadListener
if (flag) if (flag)
{ {
Zoom zoom = (Zoom) Athena.INSTANCE.getModuleManager().get(Zoom.class);
if (!Config.zoomMode) if (!Config.zoomMode)
{ {
Config.zoomMode = true; Config.zoomMode = true;
this.mc.gameSettings.smoothCamera = true; this.mc.gameSettings.smoothCamera = true;
if(zoom.isToggled()) {
this.mc.gameSettings.smoothCamera = zoom.smoothZoom;
}
this.mc.renderGlobal.displayListEntitiesDirty = true;
} }
if (Config.zoomMode) if (Config.zoomMode)
{ {
f /= 4.0F; f /= 4.0F;
if(zoom.isToggled()) {
f += zoom.scrollAmount;
f = MathHelper.clamp_float(f, 2.75F, 110.0F);
}
} }
} }
else if (Config.zoomMode) else if (Config.zoomMode)

View File

@ -184,10 +184,10 @@ public class RenderGlobal implements IWorldAccess, IResourceManagerReloadListene
private int renderEntitiesStartupCounter = 2; private int renderEntitiesStartupCounter = 2;
/** Count entities total */ /** Count entities total */
private int countEntitiesTotal; public int countEntitiesTotal;
/** Count entities rendered */ /** Count entities rendered */
private int countEntitiesRendered; public int countEntitiesRendered;
/** Count entities hidden */ /** Count entities hidden */
private int countEntitiesHidden; private int countEntitiesHidden;

View File

@ -18,6 +18,8 @@ import net.minecraft.scoreboard.Score;
import net.minecraft.scoreboard.ScoreObjective; import net.minecraft.scoreboard.ScoreObjective;
import net.minecraft.scoreboard.Scoreboard; import net.minecraft.scoreboard.Scoreboard;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import rip.athena.client.Athena;
import rip.athena.client.events.types.render.RenderPlayerEvent;
public class RenderPlayer extends RendererLivingEntity<AbstractClientPlayer> public class RenderPlayer extends RendererLivingEntity<AbstractClientPlayer>
{ {
@ -54,6 +56,10 @@ public class RenderPlayer extends RendererLivingEntity<AbstractClientPlayer>
*/ */
public void doRender(AbstractClientPlayer entity, double x, double y, double z, float entityYaw, float partialTicks) public void doRender(AbstractClientPlayer entity, double x, double y, double z, float entityYaw, float partialTicks)
{ {
if(!Athena.INSTANCE.getEventBus().post(new RenderPlayerEvent(entity, x, y, z, partialTicks))) {
return;
}
if (!entity.isUser() || this.renderManager.livingPlayer == entity) if (!entity.isUser() || this.renderManager.livingPlayer == entity)
{ {
double d0 = y; double d0 = y;

View File

@ -20,7 +20,7 @@ public class SimpleReloadableResourceManager implements IReloadableResourceManag
{ {
private static final Logger logger = LogManager.getLogger(); private static final Logger logger = LogManager.getLogger();
private static final Joiner joinerResourcePacks = Joiner.on(", "); private static final Joiner joinerResourcePacks = Joiner.on(", ");
private final Map<String, FallbackResourceManager> domainResourceManagers = Maps.<String, FallbackResourceManager>newHashMap(); public static final Map<String, FallbackResourceManager> domainResourceManagers = Maps.<String, FallbackResourceManager>newHashMap();
private final List<IResourceManagerReloadListener> reloadListeners = Lists.<IResourceManagerReloadListener>newArrayList(); private final List<IResourceManagerReloadListener> reloadListeners = Lists.<IResourceManagerReloadListener>newArrayList();
private final Set<String> setResourceDomains = Sets.<String>newLinkedHashSet(); private final Set<String> setResourceDomains = Sets.<String>newLinkedHashSet();
private final IMetadataSerializer rmMetadataSerializer; private final IMetadataSerializer rmMetadataSerializer;

View File

@ -46,6 +46,7 @@ import net.minecraft.util.Vec3;
import net.minecraft.world.Explosion; import net.minecraft.world.Explosion;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.WorldServer; import net.minecraft.world.WorldServer;
import net.minecraftforge.common.capabilities.Capability;
public abstract class Entity implements ICommandSender public abstract class Entity implements ICommandSender
{ {
@ -233,6 +234,8 @@ public abstract class Entity implements ICommandSender
/** The command result statistics for this Entity. */ /** The command result statistics for this Entity. */
private final CommandResultStats cmdResultStats; private final CommandResultStats cmdResultStats;
private net.minecraftforge.common.capabilities.CapabilityDispatcher capabilities;
public int getEntityId() public int getEntityId()
{ {
return this.entityId; return this.entityId;
@ -2792,4 +2795,17 @@ public abstract class Entity implements ICommandSender
EnchantmentHelper.applyArthropodEnchantments(entityLivingBaseIn, entityIn); EnchantmentHelper.applyArthropodEnchantments(entityLivingBaseIn, entityIn);
} }
public boolean hasCapability(Capability<?> capability, EnumFacing facing)
{
if (getCapability(capability, facing) != null)
return true;
return capabilities == null ? false : capabilities.hasCapability(capability, facing);
}
public <T> T getCapability(Capability<T> capability, EnumFacing facing)
{
return capabilities == null ? null : capabilities.getCapability(capability, facing);
}
} }

View File

@ -74,6 +74,9 @@ import net.minecraft.world.IInteractionObject;
import net.minecraft.world.LockCode; import net.minecraft.world.LockCode;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.WorldSettings; import net.minecraft.world.WorldSettings;
import rip.athena.client.Athena;
import rip.athena.client.events.types.entity.PlayerInteractEvent;
import rip.athena.client.events.types.entity.PlayerTickEvent;
@SuppressWarnings("incomplete-switch") @SuppressWarnings("incomplete-switch")
public abstract class EntityPlayer extends EntityLivingBase public abstract class EntityPlayer extends EntityLivingBase
@ -596,6 +599,8 @@ public abstract class EntityPlayer extends EntityLivingBase
*/ */
public void onLivingUpdate() public void onLivingUpdate()
{ {
Athena.INSTANCE.getEventBus().post(new PlayerTickEvent(this));
if (this.flyToggleTimer > 0) if (this.flyToggleTimer > 0)
{ {
--this.flyToggleTimer; --this.flyToggleTimer;
@ -2103,6 +2108,10 @@ public abstract class EntityPlayer extends EntityLivingBase
{ {
if (stack != this.itemInUse) if (stack != this.itemInUse)
{ {
duration = Athena.INSTANCE.getEventBus().post(new PlayerInteractEvent(PlayerInteractEvent.Action.USE_ITEM, getPosition(), worldObj)) ? duration : -1;
if (duration <= 0) return;
this.itemInUse = stack; this.itemInUse = stack;
this.itemInUseCount = duration; this.itemInUseCount = duration;

View File

@ -48,6 +48,8 @@ import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.Marker; import org.apache.logging.log4j.Marker;
import org.apache.logging.log4j.MarkerManager; import org.apache.logging.log4j.MarkerManager;
import rip.athena.client.Athena;
import rip.athena.client.events.types.network.IngoingPacketEvent;
public class NetworkManager extends SimpleChannelInboundHandler<Packet> public class NetworkManager extends SimpleChannelInboundHandler<Packet>
{ {
@ -152,6 +154,10 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet>
{ {
try try
{ {
if(!Athena.INSTANCE.getEventBus().post(new IngoingPacketEvent(p_channelRead0_2_))) {
return;
}
p_channelRead0_2_.processPacket(this.packetListener); p_channelRead0_2_.processPacket(this.packetListener);
} }
catch (ThreadQuickExitException var4) catch (ThreadQuickExitException var4)

View File

@ -0,0 +1,20 @@
package net.minecraftforge.client.util;
public final class Constants {
public static class NBT
{
public static final int TAG_END = 0;
public static final int TAG_BYTE = 1;
public static final int TAG_SHORT = 2;
public static final int TAG_INT = 3;
public static final int TAG_LONG = 4;
public static final int TAG_FLOAT = 5;
public static final int TAG_DOUBLE = 6;
public static final int TAG_BYTE_ARRAY = 7;
public static final int TAG_STRING = 8;
public static final int TAG_LIST = 9;
public static final int TAG_COMPOUND = 10;
public static final int TAG_INT_ARRAY = 11;
public static final int TAG_ANY_NUMERIC = 99;
}
}

View File

@ -0,0 +1,105 @@
package net.minecraftforge.common.capabilities;
import com.google.common.base.Throwables;
import net.minecraft.nbt.NBTBase;
import net.minecraft.util.EnumFacing;
import java.util.concurrent.Callable;
/**
* This is the core holder object Capabilities.
* Each capability will have ONE instance of this class,
* and it will the the one passed into the ICapabilityProvider functions.
*
* The CapabilityManager is in charge of creating this class.
*/
public class Capability<T>
{
public static interface IStorage<T>
{
/**
* Serialize the capability instance to a NBTTag.
* This allows for a central implementation of saving the data.
*
* It is important to note that it is up to the API defining
* the capability what requirements the 'instance' value must have.
*
* Due to the possibility of manipulating internal data, some
* implementations MAY require that the 'instance' be an instance
* of the 'default' implementation.
*
* Review the API docs for more info.
*
* @param capability The Capability being stored.
* @param instance An instance of that capabilities interface.
* @param side The side of the object the instance is associated with.
* @return a NBT holding the data. Null if no data needs to be stored.
*/
NBTBase writeNBT(Capability<T> capability, T instance, EnumFacing side);
/**
* Read the capability instance from a NBT tag.
*
* This allows for a central implementation of saving the data.
*
* It is important to note that it is up to the API defining
* the capability what requirements the 'instance' value must have.
*
* Due to the possibility of manipulating internal data, some
* implementations MAY require that the 'instance' be an instance
* of the 'default' implementation.
*
* Review the API docs for more info. *
*
* @param capability The Capability being stored.
* @param instance An instance of that capabilities interface.
* @param side The side of the object the instance is associated with.
* @param A NBT holding the data. Must not be null, as doesn't make sense to call this function with nothing to read...
*/
void readNBT(Capability<T> capability, T instance, EnumFacing side, NBTBase nbt);
}
/**
* @return The unique name of this capability, typically this is
* the fully qualified class name for the target interface.
*/
public String getName() { return name; }
/**
* @return An instance of the default storage handler. You can safely use this store your default implementation in NBT.
*/
public IStorage<T> getStorage() { return storage; }
/**
* A NEW instance of the default implementation.
*
* If it important to note that if you want to use the default storage
* you may be required to use this exact implementation.
* Refer to the owning API of the Capability in question.
*
* @return A NEW instance of the default implementation.
*/
public T getDefaultInstance()
{
try
{
return this.factory.call();
}
catch (Exception e)
{
Throwables.propagate(e);
}
return null;
}
// INTERNAL
private final String name;
private final IStorage<T> storage;
private final Callable<? extends T> factory;
public Capability(String name, IStorage<T> iStorage, Callable<? extends T> factory)
{
this.name = name;
this.storage = iStorage;
this.factory = factory;
}
}

View File

@ -0,0 +1,114 @@
package net.minecraftforge.common.capabilities;
import com.google.common.collect.Lists;
import net.minecraft.nbt.NBTBase;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import java.util.List;
import java.util.Map;
/**
* A high-speed implementation of a capability delegator.
* This is used to wrap the results of the AttachCapabilitiesEvent.
* It is HIGHLY recommended that you DO NOT use this approach unless
* you MUST delegate to multiple providers instead just implement y
* our handlers using normal if statements.
*
* Internally the handlers are baked into arrays for fast iteration.
* The ResourceLocations will be used for the NBT Key when serializing.
*/
public final class CapabilityDispatcher implements INBTSerializable<NBTTagCompound>, ICapabilityProvider
{
private ICapabilityProvider[] caps;
private INBTSerializable<NBTBase>[] writers;
private String[] names;
public CapabilityDispatcher(Map<ResourceLocation, ICapabilityProvider> list)
{
this(list, null);
}
public CapabilityDispatcher(Map<ResourceLocation, ICapabilityProvider> list, ICapabilityProvider parent)
{
List<ICapabilityProvider> lstCaps = Lists.newArrayList();
List<INBTSerializable<NBTBase>> lstWriters = Lists.newArrayList();
List<String> lstNames = Lists.newArrayList();
if (parent != null) // Parents go first!
{
lstCaps.add(parent);
if (parent instanceof INBTSerializable)
{
lstWriters.add((INBTSerializable<NBTBase>)parent);
lstNames.add("Parent");
}
}
for (Map.Entry<ResourceLocation, ICapabilityProvider> entry : list.entrySet())
{
ICapabilityProvider prov = entry.getValue();
lstCaps.add(prov);
if (prov instanceof INBTSerializable)
{
lstWriters.add((INBTSerializable<NBTBase>)prov);
lstNames.add(entry.getKey().toString());
}
}
caps = lstCaps.toArray(new ICapabilityProvider[lstCaps.size()]);
writers = lstWriters.toArray(new INBTSerializable[lstWriters.size()]);
names = lstNames.toArray(new String[lstNames.size()]);
}
@Override
public boolean hasCapability(Capability<?> capability, EnumFacing facing)
{
for (ICapabilityProvider cap : caps)
{
if (cap.hasCapability(capability, facing))
{
return true;
}
}
return false;
}
@Override
public <T> T getCapability(Capability<T> capability, EnumFacing facing)
{
for (ICapabilityProvider cap : caps)
{
T ret = cap.getCapability(capability, facing);
if (ret != null)
{
return ret;
}
}
return null;
}
@Override
public NBTTagCompound serializeNBT()
{
NBTTagCompound nbt = new NBTTagCompound();
for (int x = 0; x < writers.length; x++)
{
nbt.setTag(names[x], writers[x].serializeNBT());
}
return nbt;
}
@Override
public void deserializeNBT(NBTTagCompound nbt)
{
for (int x = 0; x < writers.length; x++)
{
if (nbt.hasKey(names[x]))
{
writers[x].deserializeNBT(nbt.getTag(names[x]));
}
}
}
}

View File

@ -0,0 +1,35 @@
package net.minecraftforge.common.capabilities;
import net.minecraft.util.EnumFacing;
public interface ICapabilityProvider
{
/**
* Determines if this object has support for the capability in question on the specific side.
* The return value of this MIGHT change during runtime if this object gains or looses support
* for a capability.
*
* Example:
* A Pipe getting a cover placed on one side causing it loose the Inventory attachment function for that side.
*
* This is a light weight version of getCapability, intended for metadata uses.
*
* @param capability The capability to check
* @param facing The Side to check from:
* CAN BE NULL. Null is defined to represent 'internal' or 'self'
* @return True if this object supports the capability.
*/
boolean hasCapability(Capability<?> capability, EnumFacing facing);
/**
* Retrieves the handler for the capability requested on the specific side.
* The return value CAN be null if the object does not support the capability.
* The return value CAN be the same for multiple faces.
*
* @param capability The capability to check
* @param facing The Side to check from:
* CAN BE NULL. Null is defined to represent 'internal' or 'self'
* @return True if this object supports the capability.
*/
<T> T getCapability(Capability<T> capability, EnumFacing facing);
}

View File

@ -0,0 +1,13 @@
package net.minecraftforge.common.capabilities;
import net.minecraft.nbt.NBTBase;
/**
* An interface designed to unify various things in the Minecraft
* code base that can be serialized to and from a NBT tag.
*/
public interface INBTSerializable<T extends NBTBase>
{
T serializeNBT();
void deserializeNBT(T nbt);
}

View File

@ -1,13 +1,16 @@
package rip.athena.client; package rip.athena.client;
import lombok.Getter; import lombok.Getter;
import org.apache.logging.log4j.Logger; import net.minecraft.client.Minecraft;
import org.apache.logging.log4j.LogManager;
import rip.athena.client.events.EventBus; import rip.athena.client.events.EventBus;
import rip.athena.client.gui.hud.HUDManager;
import rip.athena.client.modules.ModuleManager; import rip.athena.client.modules.ModuleManager;
import rip.athena.client.utils.PrefixedLogger; import rip.athena.client.utils.PrefixedLogger;
import rip.athena.client.utils.input.KeybindManager; import rip.athena.client.utils.input.KeybindManager;
import java.io.File;
import java.nio.file.Paths;
/** /**
* The Athena class represents the main class of the Athena Client. * The Athena class represents the main class of the Athena Client.
* It encapsulates the client's name, version, build, and provides * It encapsulates the client's name, version, build, and provides
@ -40,6 +43,8 @@ public class Athena {
public static final Athena INSTANCE = new Athena(); public static final Athena INSTANCE = new Athena();
public static final File MAIN_DIR = Paths.get(Minecraft.getMinecraft().mcDataDir.getAbsolutePath(), "Athena").toFile();
private final PrefixedLogger log = new PrefixedLogger("Athena"); private final PrefixedLogger log = new PrefixedLogger("Athena");
private final String clientName = "Athena"; private final String clientName = "Athena";
@ -47,6 +52,7 @@ public class Athena {
private final String clientBuild = "230601"; private final String clientBuild = "230601";
private ModuleManager moduleManager; private ModuleManager moduleManager;
private HUDManager hudManager;
private EventBus eventBus; private EventBus eventBus;
/** /**
@ -56,14 +62,22 @@ public class Athena {
* connections with servers or other systems. * connections with servers or other systems.
*/ */
public void initClient() { public void initClient() {
if(!MAIN_DIR.exists()) {
MAIN_DIR.mkdir();
}
this.moduleManager = new ModuleManager(); this.moduleManager = new ModuleManager();
this.hudManager = new HUDManager();
this.eventBus = new EventBus(); this.eventBus = new EventBus();
registerEvents(); registerEvents();
} }
public void registerEvents() { public void registerEvents() {
eventBus.register(new KeybindManager()); eventBus.register(new KeybindManager());
eventBus.register(hudManager);
eventBus.register(this);
} }
/** /**

View File

@ -0,0 +1,34 @@
package rip.athena.client.events.types.entity;
import com.google.common.collect.Maps;
import net.minecraftforge.common.capabilities.ICapabilityProvider;
import rip.athena.client.events.Event;
import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;
import java.util.Collections;
import java.util.Map;
public class AttachCapabilitiesEvent extends Event {
private Entity entity;
private Map<ResourceLocation, ICapabilityProvider> caps = Maps.newLinkedHashMap();
private Map<ResourceLocation, ICapabilityProvider> view = Collections.unmodifiableMap(caps);
public AttachCapabilitiesEvent(Entity entity) {
this.entity = entity;
}
public Entity getEntity() {
return this.entity;
}
public void addCapability(ResourceLocation key, ICapabilityProvider cap) {
if (caps.containsKey(key))
throw new IllegalStateException("Duplicate Capability Key: " + key + " " + cap);
this.caps.put(key, cap);
}
public Map<ResourceLocation, ICapabilityProvider> getCapabilities() {
return view;
}
}

View File

@ -0,0 +1,22 @@
package rip.athena.client.events.types.entity;
import rip.athena.client.events.Event;
import net.minecraft.entity.Entity;
public class AttackEntityEvent extends Event {
private Entity entity;
private Entity target;
public AttackEntityEvent(Entity entity, Entity target) {
this.entity = entity;
this.target = target;
}
public Entity getEntity() {
return entity;
}
public Entity getTarget() {
return target;
}
}

View File

@ -0,0 +1,23 @@
package rip.athena.client.events.types.entity;
import rip.athena.client.events.Event;
import net.minecraft.entity.Entity;
import net.minecraft.world.World;
public class EntityCreateEvent extends Event {
private Entity player;
private World world;
public EntityCreateEvent(Entity player, World world) {
this.player = player;
this.world = world;
}
public Entity getEntity() {
return player;
}
public World getWorld() {
return world;
}
}

View File

@ -0,0 +1,23 @@
package rip.athena.client.events.types.entity;
import rip.athena.client.events.Event;
import net.minecraft.entity.Entity;
import net.minecraft.util.DamageSource;
public class EntityDeathEvent extends Event {
private Entity entity;
private DamageSource cause;
public EntityDeathEvent(Entity entity, DamageSource cause) {
this.entity = entity;
this.cause = cause;
}
public Entity getEntity() {
return entity;
}
public DamageSource getCause() {
return cause;
}
}

View File

@ -0,0 +1,23 @@
package rip.athena.client.events.types.entity;
import rip.athena.client.events.Event;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
public class ItemPickupEvent extends Event {
private EntityLivingBase entity;
private Entity item;
public ItemPickupEvent(EntityLivingBase entity, Entity item) {
this.entity = entity;
this.item = item;
}
public EntityLivingBase getEntity() {
return entity;
}
public Entity getItem() {
return item;
}
}

View File

@ -0,0 +1,23 @@
package rip.athena.client.events.types.entity;
import rip.athena.client.events.Event;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityMinecart;
public class MinecartInteractEvent extends Event {
private Entity entity;
private EntityMinecart minecart;
public MinecartInteractEvent(Entity entity, EntityMinecart minecart) {
this.entity = entity;
this.minecart = minecart;
}
public Entity getEntity() {
return entity;
}
public EntityMinecart getMinecart() {
return minecart;
}
}

View File

@ -0,0 +1,35 @@
package rip.athena.client.events.types.entity;
import rip.athena.client.events.Event;
import net.minecraft.util.BlockPos;
import net.minecraft.world.World;
public class PlayerInteractEvent extends Event {
private Action action;
private BlockPos pos;
private World world;
public PlayerInteractEvent(Action action, BlockPos pos, World world) {
this.action = action;
this.pos = pos;
this.world = world;
}
public Action getAction() {
return action;
}
public BlockPos getPos() {
return pos;
}
public World getWorld() {
return world;
}
public enum Action {
USE_ITEM,
LEFT_CLICK_BLOCK,
RIGHT_CLICK_BLOCK;
}
}

View File

@ -0,0 +1,16 @@
package rip.athena.client.events.types.entity;
import rip.athena.client.events.Event;
import net.minecraft.entity.player.EntityPlayer;
public class PlayerTickEvent extends Event {
private EntityPlayer player;
public PlayerTickEvent(EntityPlayer player) {
this.player = player;
}
public EntityPlayer getPlayer() {
return player;
}
}

View File

@ -0,0 +1,20 @@
package rip.athena.client.events.types.input;
import rip.athena.client.events.Event;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class MouseDownEvent extends Event {
private int button;
public MouseDownEvent(int button) {
this.button = button;
}
public int getButton() {
return button;
}
}

View File

@ -0,0 +1,11 @@
package rip.athena.client.events.types.input;
import rip.athena.client.events.Event;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class MouseMoveEvent extends Event {
}

View File

@ -0,0 +1,21 @@
package rip.athena.client.events.types.network;
import net.minecraft.network.Packet;
import rip.athena.client.events.Event;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class IngoingPacketEvent extends Event {
private Packet<?> packet;
public IngoingPacketEvent(Packet<?> packet) {
this.packet = packet;
}
public Packet<?> getPacket() {
return packet;
}
}

View File

@ -0,0 +1,40 @@
package rip.athena.client.events.types.render;
import net.minecraft.entity.player.EntityPlayer;
import rip.athena.client.events.Event;
public class RenderPlayerEvent extends Event {
private EntityPlayer player;
private double x;
private double y;
private double z;
private float partialTicks;
public RenderPlayerEvent(EntityPlayer player, double x, double y, double z, float partialTicks) {
this.player = player;
this.x = x;
this.y = y;
this.z = z;
this.partialTicks = partialTicks;
}
public EntityPlayer getPlayer() {
return player;
}
public double getX() {
return x;
}
public double getY() {
return y;
}
public double getZ() {
return z;
}
public float getPartialTicks() {
return partialTicks;
}
}

View File

@ -23,6 +23,7 @@ public class FontManager {
public static FontUtils baloo16 = new FontUtils("Baloo.ttf", Font.PLAIN, 16, 7, false); public static FontUtils baloo16 = new FontUtils("Baloo.ttf", Font.PLAIN, 16, 7, false);
public static FontUtils baloo17 = new FontUtils("SFBOLD.ttf", Font.BOLD, 17, 7, false); public static FontUtils baloo17 = new FontUtils("SFBOLD.ttf", Font.BOLD, 17, 7, false);
public static FontUtils baloo30 = new FontUtils("SFBOLD.ttf", Font.PLAIN, 30, 7, false);
public static FontUtils SFBOLD = new FontUtils("SFBOLD.ttf", Font.BOLD, 30, 7, false); public static FontUtils SFBOLD = new FontUtils("SFBOLD.ttf", Font.BOLD, 30, 7, false);
public static FontUtils vision16 = new FontUtils("Vision.otf", Font.BOLD, 26, 7, false, 5); public static FontUtils vision16 = new FontUtils("Vision.otf", Font.BOLD, 26, 7, false, 5);
public static FontUtils vision30 = new FontUtils("Vision.otf", Font.BOLD, 30, 7, false, 5); public static FontUtils vision30 = new FontUtils("Vision.otf", Font.BOLD, 30, 7, false, 5);

View File

@ -62,7 +62,6 @@ public class FontUtils {
Font font = null; Font font = null;
try { try {
Athena.INSTANCE.getLog().warn(Minecraft.getMinecraft().getResourceManager().getResource(new ResourceLocation("Athena/font/" + fontName)).getInputStream() + "test");
InputStream ex = Minecraft.getMinecraft().getResourceManager().getResource(new ResourceLocation("Athena/font/" + fontName)).getInputStream(); InputStream ex = Minecraft.getMinecraft().getResourceManager().getResource(new ResourceLocation("Athena/font/" + fontName)).getInputStream();
font = Font.createFont(0, ex); font = Font.createFont(0, ex);
font = font.deriveFont(fontType, size); font = font.deriveFont(fontType, size);

Binary file not shown.

View File

@ -0,0 +1,21 @@
package rip.athena.client.gui.clickgui;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public enum Category {
MODS("MODS"), SETTINGS("SETTINGS"), MACROS("MACROS"), WAYPOINTS("WAYPOINTS"), PROFILES("PROFILES"), COSMETICS("COSMETICS"), GROUPS("GROUPS");
private String name;
Category(String name) {
this.name = name;
}
public String getName() {
return name;
}
}

View File

@ -1,4 +1,10 @@
package rip.athena.client.gui.hud; package rip.athena.client.gui.clickgui;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public interface IPage { public interface IPage {
void onInit(); void onInit();

View File

@ -1,8 +1,9 @@
package rip.athena.client.gui.hud; package rip.athena.client.gui.clickgui;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import rip.athena.client.Athena; import rip.athena.client.Athena;
import rip.athena.client.font.FontManager; import rip.athena.client.font.FontManager;
import rip.athena.client.gui.clickgui.pages.ModsPage;
import rip.athena.client.gui.framework.Menu; import rip.athena.client.gui.framework.Menu;
import rip.athena.client.gui.framework.MenuComponent; import rip.athena.client.gui.framework.MenuComponent;
import rip.athena.client.gui.framework.MinecraftMenuImpl; import rip.athena.client.gui.framework.MinecraftMenuImpl;
@ -10,18 +11,24 @@ import rip.athena.client.gui.framework.components.MenuButton;
import rip.athena.client.gui.framework.components.MenuDraggable; import rip.athena.client.gui.framework.components.MenuDraggable;
import rip.athena.client.gui.framework.components.MenuScrollPane; import rip.athena.client.gui.framework.components.MenuScrollPane;
import rip.athena.client.gui.framework.draw.DrawImpl; import rip.athena.client.gui.framework.draw.DrawImpl;
import rip.athena.client.gui.hud.components.mods.CategoryButton; import rip.athena.client.gui.clickgui.components.mods.CategoryButton;
import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import rip.athena.client.gui.hud.pages.ModsPage;
import rip.athena.client.modules.Module; import rip.athena.client.modules.Module;
import rip.athena.client.modules.impl.other.Settings;
import rip.athena.client.utils.render.AssetUtils; import rip.athena.client.utils.render.AssetUtils;
import java.awt.*; import java.awt.*;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class IngameMenu extends MinecraftMenuImpl implements DrawImpl { public class IngameMenu extends MinecraftMenuImpl implements DrawImpl {
public static int MENU_ALPHA = 255; public static int MENU_ALPHA = 255;
public static int MENU_TOP_BG_COLOR = new Color(30, 30, 30, MENU_ALPHA).getRGB(); public static int MENU_TOP_BG_COLOR = new Color(30, 30, 30, MENU_ALPHA).getRGB();
@ -88,8 +95,11 @@ public class IngameMenu extends MinecraftMenuImpl implements DrawImpl {
} }
menu.addComponent(comp); menu.addComponent(comp);
if(Settings.customGuiFont) {
x += FontManager.baloo17.getStringWidth(category.getName()) + 20; x += FontManager.baloo17.getStringWidth(category.getName()) + 20;
} else {
x += mc.fontRendererObj.getStringWidth(category.getName()) + 20;
}
} }
initPage(); initPage();
@ -120,6 +130,7 @@ public class IngameMenu extends MinecraftMenuImpl implements DrawImpl {
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(menu.getX(), menu.getY(), menu.getWidth(), 58, MENU_TOP_BG_COLOR); rip.athena.client.gui.framework.draw.DrawImpl.drawRect(menu.getX(), menu.getY(), menu.getWidth(), 58, MENU_TOP_BG_COLOR);
FontManager.font1.drawString(Athena.INSTANCE.getClientName().toUpperCase(), menu.getX() + 70, menu.getY() + 20, MENU_HEADER_TEXT_COLOR); FontManager.font1.drawString(Athena.INSTANCE.getClientName().toUpperCase(), menu.getX() + 70, menu.getY() + 20, MENU_HEADER_TEXT_COLOR);
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(menu.getX(), menu.getY() + 58, menu.getWidth(), menu.getHeight() - 58, MENU_PANE_BG_COLOR); rip.athena.client.gui.framework.draw.DrawImpl.drawRect(menu.getX(), menu.getY() + 58, menu.getWidth(), menu.getHeight() - 58, MENU_PANE_BG_COLOR);
drawShadowDown(menu.getX(), menu.getY() + 58, menu.getWidth()); drawShadowDown(menu.getX(), menu.getY() + 58, menu.getWidth());

View File

@ -1,9 +1,15 @@
package rip.athena.client.gui.hud; package rip.athena.client.gui.clickgui;
import rip.athena.client.gui.framework.Menu; import rip.athena.client.gui.framework.Menu;
import rip.athena.client.gui.framework.draw.DrawImpl; import rip.athena.client.gui.framework.draw.DrawImpl;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public abstract class Page implements IPage, DrawImpl { public abstract class Page implements IPage, DrawImpl {
protected Minecraft mc; protected Minecraft mc;
protected Menu menu; protected Menu menu;

View File

@ -1,12 +1,18 @@
package rip.athena.client.gui.hud; package rip.athena.client.gui.clickgui;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import rip.athena.client.gui.clickgui.pages.*;
import rip.athena.client.gui.framework.Menu; import rip.athena.client.gui.framework.Menu;
import rip.athena.client.gui.hud.pages.*;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class PageManager { public class PageManager {
private IngameMenu parent; private IngameMenu parent;
private Menu menu; private Menu menu;
@ -23,11 +29,11 @@ public class PageManager {
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.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.FPS, new FPSPage(mc, menu, parent));
pages.put(Category.GROUPS, new GroupsPage(mc, menu, parent)); pages.put(Category.GROUPS, new GroupsPage(mc, menu, parent));
} }

View File

@ -1,10 +1,16 @@
package rip.athena.client.gui.hud.components.cosmetics; package rip.athena.client.gui.clickgui.components.cosmetics;
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;
import java.awt.*; import java.awt.*;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class CosmeticActionButton extends CosmeticGenericButton { public class CosmeticActionButton extends CosmeticGenericButton {
private String id; private String id;

View File

@ -1,10 +1,16 @@
package rip.athena.client.gui.hud.components.cosmetics; package rip.athena.client.gui.clickgui.components.cosmetics;
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;
import java.awt.*; import java.awt.*;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class CosmeticBindButton extends CosmeticGenericButton { public class CosmeticBindButton extends CosmeticGenericButton {
private String type; private String type;
private boolean binding; private boolean binding;

View File

@ -1,10 +1,10 @@
package rip.athena.client.gui.hud.components.cosmetics; package rip.athena.client.gui.clickgui.components.cosmetics;
import rip.athena.client.gui.framework.MenuComponent; import rip.athena.client.gui.framework.MenuComponent;
import rip.athena.client.gui.framework.MenuPriority; import rip.athena.client.gui.framework.MenuPriority;
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;
import rip.athena.client.gui.hud.IngameMenu; import rip.athena.client.gui.clickgui.IngameMenu;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
@ -15,6 +15,12 @@ import org.lwjgl.opengl.GL11;
import java.awt.*; import java.awt.*;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class CosmeticCapeView extends MenuComponent { public class CosmeticCapeView extends MenuComponent {
//private Cape cape; //private Cape cape;

View File

@ -1,11 +1,16 @@
package rip.athena.client.gui.hud.components.cosmetics; package rip.athena.client.gui.clickgui.components.cosmetics;
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;
import rip.athena.client.gui.hud.components.macros.MacroButton; import rip.athena.client.gui.clickgui.components.macros.MacroButton;
import java.awt.*; import java.awt.*;
import java.nio.charset.MalformedInputException;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class CosmeticGenericButton extends MacroButton { public class CosmeticGenericButton extends MacroButton {
protected boolean filledBackground; protected boolean filledBackground;

View File

@ -1,5 +1,4 @@
package rip.athena.client.gui.hud.components.cosmetics; package rip.athena.client.gui.clickgui.components.cosmetics;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import rip.athena.client.gui.framework.MenuPriority; import rip.athena.client.gui.framework.MenuPriority;
@ -9,6 +8,12 @@ import rip.athena.client.gui.framework.draw.DrawType;
import java.awt.*; import java.awt.*;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class CosmeticList extends MenuDropdown { public class CosmeticList extends MenuDropdown {
protected int cursorWidth = 25; protected int cursorWidth = 25;

View File

@ -1,14 +1,19 @@
package rip.athena.client.gui.hud.components.cosmetics; package rip.athena.client.gui.clickgui.components.cosmetics;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import rip.athena.client.font.FontManager; import rip.athena.client.font.FontManager;
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;
import rip.athena.client.utils.render.DrawUtils; import rip.athena.client.modules.impl.other.Settings;
import java.awt.*; import java.awt.*;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class CosmeticRainbowButton extends CosmeticGenericButton { public class CosmeticRainbowButton extends CosmeticGenericButton {
public CosmeticRainbowButton(String text, int x, int y, int width, int height) { public CosmeticRainbowButton(String text, int x, int y, int width, int height) {
super(text, x, y, width, height, true); super(text, x, y, width, height, true);
@ -60,8 +65,11 @@ public class CosmeticRainbowButton extends CosmeticGenericButton {
drawShadowDown(x, y + height + 1, width + 1); drawShadowDown(x, y + height + 1, width + 1);
drawShadowRight(x + width + 1, y, height + 1); drawShadowRight(x + width + 1, y, height + 1);
FontManager.baloo17.drawString(text, x + (width / 2 - getStringWidth(text) / 2), y + (height / 2 - getStringHeight(text) / 2), -1); if(Settings.customGuiFont) {
FontManager.baloo17.drawString(text, x + (width / 2 - getStringWidth(text) / 2), y + (height / 2 - getStringHeight(text) / 2), -1);
} else {
Minecraft.getMinecraft().fontRendererObj.drawString(text, x + (width / 2 - getStringWidth(text) / 2), y + (height / 2 - getStringHeight(text) / 2), -1);
}
mouseDown = false; mouseDown = false;
} }
} }

View File

@ -1,12 +1,18 @@
package rip.athena.client.gui.hud.components.cosmetics; package rip.athena.client.gui.clickgui.components.cosmetics;
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;
import rip.athena.client.gui.hud.IngameMenu; import rip.athena.client.gui.clickgui.IngameMenu;
import rip.athena.client.gui.hud.components.macros.MacroButton; import rip.athena.client.gui.clickgui.components.macros.MacroButton;
import java.awt.*; import java.awt.*;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class CosmeticToggleButton extends MacroButton { public class CosmeticToggleButton extends MacroButton {
public CosmeticToggleButton(String text, int x, int y, int width, int height, boolean approve) { public CosmeticToggleButton(String text, int x, int y, int width, int height, boolean approve) {

View File

@ -1,9 +1,9 @@
package rip.athena.client.gui.hud.components.cosmetics; package rip.athena.client.gui.clickgui.components.cosmetics;
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;
import rip.athena.client.gui.hud.IngameMenu; import rip.athena.client.gui.clickgui.IngameMenu;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
@ -14,6 +14,12 @@ import org.lwjgl.opengl.GL11;
import java.awt.*; import java.awt.*;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class CosmeticUserPreview extends MenuComponent { public class CosmeticUserPreview extends MenuComponent {
public CosmeticUserPreview(int x, int y, int width, int height) { public CosmeticUserPreview(int x, int y, int width, int height) {
super(x, y, width, height); super(x, y, width, height);

View File

@ -1,11 +1,17 @@
package rip.athena.client.gui.hud.components.fps; package rip.athena.client.gui.clickgui.components.fps;
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;
import rip.athena.client.gui.hud.components.cosmetics.CosmeticGenericButton; import rip.athena.client.gui.clickgui.components.cosmetics.CosmeticGenericButton;
import java.awt.*; import java.awt.*;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class FPSGenericButton extends CosmeticGenericButton { public class FPSGenericButton extends CosmeticGenericButton {
public FPSGenericButton(String text, int x, int y, int width, int height, boolean filledBackground) { public FPSGenericButton(String text, int x, int y, int width, int height, boolean filledBackground) {

View File

@ -1,9 +1,15 @@
package rip.athena.client.gui.hud.components.fps; package rip.athena.client.gui.clickgui.components.fps;
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;
import rip.athena.client.gui.hud.components.macros.FlipButton; import rip.athena.client.gui.clickgui.components.macros.FlipButton;
import rip.athena.client.gui.hud.pages.fps.BlacklistModule; import rip.athena.client.gui.clickgui.pages.fps.BlacklistModule;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class FlipButtonFPS extends FlipButton { public class FlipButtonFPS extends FlipButton {
private BlacklistModule module; private BlacklistModule module;

View File

@ -1,9 +1,15 @@
package rip.athena.client.gui.hud.components.fps; package rip.athena.client.gui.clickgui.components.fps;
import rip.athena.client.gui.framework.MenuPriority; import rip.athena.client.gui.framework.MenuPriority;
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;
import rip.athena.client.gui.hud.components.waypoints.WaypointTextBarrier; import rip.athena.client.gui.clickgui.components.waypoints.WaypointTextBarrier;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class FlipButtonParent extends WaypointTextBarrier { public class FlipButtonParent extends WaypointTextBarrier {

View File

@ -1,13 +1,19 @@
package rip.athena.client.gui.hud.components.fps; package rip.athena.client.gui.clickgui.components.fps;
import rip.athena.client.gui.framework.MenuComponent; import rip.athena.client.gui.framework.MenuComponent;
import rip.athena.client.gui.framework.MenuPriority; import rip.athena.client.gui.framework.MenuPriority;
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;
import rip.athena.client.gui.hud.IngameMenu; import rip.athena.client.gui.clickgui.IngameMenu;
import java.awt.*; import java.awt.*;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class MainWindowBackgroundPS extends MenuComponent { public class MainWindowBackgroundPS extends MenuComponent {
public MainWindowBackgroundPS(int x, int y, int width, int height) { public MainWindowBackgroundPS(int x, int y, int width, int height) {
super(x, y, width, height); super(x, y, width, height);

View File

@ -1,4 +1,4 @@
package rip.athena.client.gui.hud.components.fps; package rip.athena.client.gui.clickgui.components.fps;
import rip.athena.client.gui.framework.components.MenuButton; import rip.athena.client.gui.framework.components.MenuButton;
import rip.athena.client.gui.framework.draw.ButtonState; import rip.athena.client.gui.framework.draw.ButtonState;
@ -10,6 +10,12 @@ import java.awt.*;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.awt.image.RescaleOp; import java.awt.image.RescaleOp;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class MenuImageButton extends MenuButton { public class MenuImageButton extends MenuButton {
private static Color DISABLED_COLOR = new Color(255, 255, 255, 200); private static Color DISABLED_COLOR = new Color(255, 255, 255, 200);
private static Color OVER_COLOR = new Color(255, 255, 255, 160); private static Color OVER_COLOR = new Color(255, 255, 255, 160);

View File

@ -1,16 +1,23 @@
package rip.athena.client.gui.hud.components.fps; package rip.athena.client.gui.clickgui.components.fps;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import rip.athena.client.font.FontManager;
import rip.athena.client.gui.framework.MenuComponent; import rip.athena.client.gui.framework.MenuComponent;
import rip.athena.client.gui.framework.MenuPriority; import rip.athena.client.gui.framework.MenuPriority;
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;
import rip.athena.client.gui.hud.IngameMenu; import rip.athena.client.gui.clickgui.IngameMenu;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import rip.athena.client.modules.impl.other.Settings;
import java.awt.*; import java.awt.*;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class OptifineParentBackground extends MenuComponent { public class OptifineParentBackground extends MenuComponent {
protected ResourceLocation image; protected ResourceLocation image;
protected String topText; protected String topText;
@ -64,17 +71,29 @@ public class OptifineParentBackground extends MenuComponent {
} }
@Override @Override
public void drawText(String string, int x, int y, int color) { public void drawText(String text, int x, int y, int color) {
Minecraft.getMinecraft().fontRendererObj.drawString(string, x, y, color); if(Settings.customGuiFont) {
FontManager.baloo17.drawString(text, x, y, color);
} else {
Minecraft.getMinecraft().fontRendererObj.drawString(text, x, y, color);
}
} }
@Override @Override
public int getStringWidth(String string) { public int getStringWidth(String string) {
return Minecraft.getMinecraft().fontRendererObj.getStringWidth(string); if(Settings.customGuiFont) {
return (int) FontManager.baloo17.getStringWidth(string);
} else {
return Minecraft.getMinecraft().fontRendererObj.getStringWidth(string);
}
} }
@Override @Override
public int getStringHeight(String string) { public int getStringHeight(String string) {
return Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT; if(Settings.customGuiFont) {
return (int) FontManager.baloo17.getHeight(string);
} else {
return Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT;
}
} }
} }

View File

@ -1,13 +1,18 @@
package rip.athena.client.gui.hud.components.groups; package rip.athena.client.gui.clickgui.components.groups;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
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;
import rip.athena.client.gui.hud.components.profiles.ProfilesBase; import rip.athena.client.gui.clickgui.components.profiles.ProfilesBase;
import java.awt.*; import java.awt.*;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class GroupBase extends ProfilesBase { public class GroupBase extends ProfilesBase {
protected static int GREEN_COLOR = new Color(2, 222, 9, 255).getRGB(); protected static int GREEN_COLOR = new Color(2, 222, 9, 255).getRGB();
protected static int GRAY_COLOR = new Color(164, 164, 164, 255).getRGB(); protected static int GRAY_COLOR = new Color(164, 164, 164, 255).getRGB();

View File

@ -1,15 +1,20 @@
package rip.athena.client.gui.hud.components.groups; package rip.athena.client.gui.clickgui.components.groups;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import rip.athena.client.gui.framework.MenuComponent; import rip.athena.client.gui.framework.MenuComponent;
import rip.athena.client.gui.framework.MenuPriority; import rip.athena.client.gui.framework.MenuPriority;
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;
import rip.athena.client.gui.hud.IngameMenu; import rip.athena.client.gui.clickgui.IngameMenu;
import java.awt.*; import java.awt.*;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class GroupListEntry extends MenuComponent { public class GroupListEntry extends MenuComponent {
protected String text; protected String text;

View File

@ -1,15 +1,20 @@
package rip.athena.client.gui.hud.components.groups; package rip.athena.client.gui.clickgui.components.groups;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import rip.athena.client.gui.framework.MenuComponent; import rip.athena.client.gui.framework.MenuComponent;
import rip.athena.client.gui.framework.MenuPriority; import rip.athena.client.gui.framework.MenuPriority;
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;
import rip.athena.client.gui.hud.IngameMenu; import rip.athena.client.gui.clickgui.IngameMenu;
import java.awt.*; import java.awt.*;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class GroupListMiniEntry extends MenuComponent { public class GroupListMiniEntry extends MenuComponent {
protected String name; protected String name;
protected String value; protected String value;

View File

@ -1,14 +1,19 @@
package rip.athena.client.gui.hud.components.groups; package rip.athena.client.gui.clickgui.components.groups;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import rip.athena.client.gui.framework.components.MenuButton; import rip.athena.client.gui.framework.components.MenuButton;
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;
import rip.athena.client.gui.hud.pages.groups.GroupSubTab; import rip.athena.client.gui.clickgui.pages.groups.GroupSubTab;
import java.awt.*; import java.awt.*;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class GroupTextButton extends MenuButton { public class GroupTextButton extends MenuButton {
public GroupTextButton(GroupSubTab category, int x, int y) { public GroupTextButton(GroupSubTab category, int x, int y) {
super(category.getText(), x, y); super(category.getText(), x, y);

View File

@ -1,14 +1,19 @@
package rip.athena.client.gui.hud.components.groups; package rip.athena.client.gui.clickgui.components.groups;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
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;
import rip.athena.client.gui.hud.IngameMenu; import rip.athena.client.gui.clickgui.IngameMenu;
import java.awt.*; import java.awt.*;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class GroupUserListHeader extends MenuComponent { public class GroupUserListHeader extends MenuComponent {
protected String text; protected String text;
protected int amount; protected int amount;

View File

@ -1,16 +1,21 @@
package rip.athena.client.gui.hud.components.groups; package rip.athena.client.gui.clickgui.components.groups;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
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;
import rip.athena.client.gui.hud.IngameMenu; import rip.athena.client.gui.clickgui.IngameMenu;
import rip.athena.client.utils.render.DrawUtils; import rip.athena.client.utils.render.DrawUtils;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import java.awt.*; import java.awt.*;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class GroupUserListUser extends MenuComponent { public class GroupUserListUser extends MenuComponent {
protected ResourceLocation location; protected ResourceLocation location;
protected String name; protected String name;

View File

@ -1,5 +1,4 @@
package rip.athena.client.gui.hud.components.groups; package rip.athena.client.gui.clickgui.components.groups;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import rip.athena.client.gui.framework.MenuPriority; import rip.athena.client.gui.framework.MenuPriority;
@ -9,6 +8,12 @@ import rip.athena.client.gui.framework.draw.DrawType;
import java.awt.*; import java.awt.*;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class GroupValueList extends MenuDropdown { public class GroupValueList extends MenuDropdown {
protected int cursorWidth = 25; protected int cursorWidth = 25;
protected String id; protected String id;

View File

@ -1,14 +1,19 @@
package rip.athena.client.gui.hud.components.macros; package rip.athena.client.gui.clickgui.components.macros;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import rip.athena.client.gui.framework.components.MenuButton; import rip.athena.client.gui.framework.components.MenuButton;
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;
import rip.athena.client.gui.hud.IngameMenu; import rip.athena.client.gui.clickgui.IngameMenu;
import java.awt.*; import java.awt.*;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class FlipButton extends MenuButton { public class FlipButton extends MenuButton {
public static final int NORMAL_ON = new Color(15, 58, 28, IngameMenu.MENU_ALPHA).getRGB(); public static final int NORMAL_ON = new Color(15, 58, 28, IngameMenu.MENU_ALPHA).getRGB();
public static final int NORMAL_OFF = new Color(58, 15, 17, IngameMenu.MENU_ALPHA).getRGB(); public static final int NORMAL_OFF = new Color(58, 15, 17, IngameMenu.MENU_ALPHA).getRGB();

View File

@ -1,15 +1,20 @@
package rip.athena.client.gui.hud.components.macros; package rip.athena.client.gui.clickgui.components.macros;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import rip.athena.client.gui.framework.MenuComponent; import rip.athena.client.gui.framework.MenuComponent;
import rip.athena.client.gui.framework.MenuPriority; import rip.athena.client.gui.framework.MenuPriority;
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;
import rip.athena.client.gui.hud.IngameMenu; import rip.athena.client.gui.clickgui.IngameMenu;
import java.awt.*; import java.awt.*;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class MacroBase extends MenuComponent { public class MacroBase extends MenuComponent {
protected String text; protected String text;
protected int spacing = 15; protected int spacing = 15;

View File

@ -1,13 +1,20 @@
package rip.athena.client.gui.hud.components.macros; package rip.athena.client.gui.clickgui.components.macros;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import rip.athena.client.font.FontManager; import rip.athena.client.font.FontManager;
import rip.athena.client.gui.framework.components.MenuButton; import rip.athena.client.gui.framework.components.MenuButton;
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;
import rip.athena.client.modules.impl.other.Settings;
import java.awt.*; import java.awt.*;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class MacroButton extends MenuButton { public class MacroButton extends MenuButton {
private boolean approve; private boolean approve;
@ -66,18 +73,30 @@ public class MacroButton extends MenuButton {
} }
@Override @Override
public void drawText(String string, int x, int y, int color) { public void drawText(String text, int x, int y, int color) {
FontManager.baloo17.drawString(string, x, y, color); if(Settings.customGuiFont) {
FontManager.baloo17.drawString(text, x, y, color);
} else {
Minecraft.getMinecraft().fontRendererObj.drawString(text, x, y, color);
}
} }
@Override @Override
public int getStringWidth(String string) { public int getStringWidth(String string) {
return (int) FontManager.baloo17.getStringWidth(string); if(Settings.customGuiFont) {
return (int) FontManager.baloo17.getStringWidth(string);
} else {
return Minecraft.getMinecraft().fontRendererObj.getStringWidth(string);
}
} }
@Override @Override
public int getStringHeight(String string) { public int getStringHeight(String string) {
return (int) FontManager.baloo17.getHeight(string); if(Settings.customGuiFont) {
return (int) FontManager.baloo17.getHeight(string);
} else {
return Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT;
}
} }
public void setApprove(boolean approve) { public void setApprove(boolean approve) {

View File

@ -1,16 +1,21 @@
package rip.athena.client.gui.hud.components.macros; package rip.athena.client.gui.clickgui.components.macros;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import rip.athena.client.gui.framework.TextPattern; import rip.athena.client.gui.framework.TextPattern;
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;
import rip.athena.client.gui.hud.IngameMenu; import rip.athena.client.gui.clickgui.IngameMenu;
import rip.athena.client.gui.hud.components.mods.SearchTextfield; import rip.athena.client.gui.clickgui.components.mods.SearchTextfield;
import org.lwjgl.input.Keyboard; import org.lwjgl.input.Keyboard;
import java.awt.*; import java.awt.*;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class MacroSlimTextField extends SearchTextfield { public class MacroSlimTextField extends SearchTextfield {
public MacroSlimTextField(TextPattern pattern, int x, int y, int width, int height) { public MacroSlimTextField(TextPattern pattern, int x, int y, int width, int height) {
super(pattern, x, y, width, height); super(pattern, x, y, width, height);

View File

@ -1,5 +1,4 @@
package rip.athena.client.gui.hud.components.macros; package rip.athena.client.gui.clickgui.components.macros;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
@ -7,13 +6,20 @@ import rip.athena.client.font.FontManager;
import rip.athena.client.gui.framework.TextPattern; import rip.athena.client.gui.framework.TextPattern;
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;
import rip.athena.client.gui.hud.IngameMenu; import rip.athena.client.gui.clickgui.IngameMenu;
import rip.athena.client.gui.hud.components.mods.SearchTextfield; import rip.athena.client.gui.clickgui.components.mods.SearchTextfield;
import rip.athena.client.modules.impl.other.Settings;
import rip.athena.client.utils.render.DrawUtils; import rip.athena.client.utils.render.DrawUtils;
import org.lwjgl.input.Keyboard; import org.lwjgl.input.Keyboard;
import java.awt.*; import java.awt.*;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class MacroTextfield extends SearchTextfield { public class MacroTextfield extends SearchTextfield {
protected String placeholderText; protected String placeholderText;
protected int textPadding = 5; protected int textPadding = 5;
@ -96,18 +102,33 @@ public class MacroTextfield extends SearchTextfield {
} }
} }
int labelWidth = (int)FontManager.baloo17.getStringWidth(textToDraw + 1); int labelWidth;
if(Settings.customGuiFont) {
labelWidth = (int) FontManager.baloo17.getStringWidth(textToDraw + 1);
} else {
labelWidth = (int) Minecraft.getMinecraft().fontRendererObj.getStringWidth(textToDraw + 1);
}
int comp = 0; int comp = 0;
int toRender = index; int toRender = index;
while(labelWidth >= width + textPadding * 2) { while(labelWidth >= width + textPadding * 2) {
if(comp < index){ if(comp < index){
textToDraw = textToDraw.substring(1); textToDraw = textToDraw.substring(1);
labelWidth = (int)FontManager.baloo17.getStringWidth(textToDraw + 1); if(Settings.customGuiFont) {
labelWidth = (int) FontManager.baloo17.getStringWidth(textToDraw + 1);
} else {
labelWidth = (int) Minecraft.getMinecraft().fontRendererObj.getStringWidth(textToDraw + 1);
}
toRender--; toRender--;
} else if(comp > index){ } else if(comp > index){
textToDraw = textToDraw.substring(0, textToDraw.length() - 1); textToDraw = textToDraw.substring(0, textToDraw.length() - 1);
labelWidth = (int)FontManager.baloo17.getStringWidth(textToDraw + 1);
if(Settings.customGuiFont) {
labelWidth = (int) FontManager.baloo17.getStringWidth(textToDraw + 1);
} else {
labelWidth = (int) Minecraft.getMinecraft().fontRendererObj.getStringWidth(textToDraw + 1);
}
} }
comp++; comp++;
@ -122,9 +143,20 @@ public class MacroTextfield extends SearchTextfield {
toRender = 0; toRender = 0;
} }
int textHeight = (int)FontManager.baloo17.FONT_HEIGHT; int textHeight;
drawVerticalLine(x + (int)FontManager.baloo17.getStringWidth(textToDraw.substring(0, toRender)) + 4, y + height / 2 - textHeight / 2, textHeight, 1, textColor); if(Settings.customGuiFont) {
textHeight = (int) FontManager.baloo17.FONT_HEIGHT;
} else {
textHeight = Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT;
}
if(Settings.customGuiFont) {
drawVerticalLine(x + (int) FontManager.baloo17.getStringWidth(textToDraw.substring(0, toRender)) + 4, y + height / 2 - textHeight / 2, textHeight, 1, textColor);
} else {
drawVerticalLine(x + (int) Minecraft.getMinecraft().fontRendererObj.getStringWidth(textToDraw.substring(0, toRender)) + 4, y + height / 2 - textHeight / 2, textHeight, 1, textColor);
}
} }
int renderIndex = comp; int renderIndex = comp;
@ -138,16 +170,22 @@ public class MacroTextfield extends SearchTextfield {
if(textToDraw.isEmpty() && !isFocused()) { if(textToDraw.isEmpty() && !isFocused()) {
textToDraw = placeholderText; textToDraw = placeholderText;
xAdd = (int) (width / 2 - FontManager.baloo17.getStringWidth(placeholderText) / 2); if(Settings.customGuiFont) {
xAdd = (int) (width / 2 - FontManager.baloo17.getStringWidth(placeholderText) / 2);
} else {
xAdd = (width / 2 - Minecraft.getMinecraft().fontRendererObj.getStringWidth(placeholderText) / 2);
}
textColor = PLACEHOLDER_COLOR.getRGB(); textColor = PLACEHOLDER_COLOR.getRGB();
if(textToDraw.length() == 3) { if(textToDraw.length() == 3) {
textColor = textColorDisabled; textColor = textColorDisabled;
} }
} }
if(Settings.customGuiFont) {
FontManager.baloo17.drawString(textToDraw, x + xAdd, y + height / 2 - (float) (int) FontManager.baloo17.getHeight(textToDraw) / 2, textColor); FontManager.baloo17.drawString(textToDraw, x + xAdd, y + height / 2 - (float) (int) FontManager.baloo17.getHeight(textToDraw) / 2, textColor);
} else {
Minecraft.getMinecraft().fontRendererObj.drawString(textToDraw, x + xAdd, (int) (y + height / 2 - (float) Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT / 2), textColor);
}
if(lastState == ButtonState.HOVER && mouseDown) { if(lastState == ButtonState.HOVER && mouseDown) {
focused = true; focused = true;
lineTime = getLinePrediction(); lineTime = getLinePrediction();
@ -174,7 +212,11 @@ public class MacroTextfield extends SearchTextfield {
bestIndex = i; bestIndex = i;
} }
position += (int)FontManager.baloo17.getStringWidth(text.charAt(i) + ""); if(Settings.customGuiFont) {
position += (int) FontManager.baloo17.getStringWidth(text.charAt(i) + "");
} else {
position += (int) Minecraft.getMinecraft().fontRendererObj.getStringWidth(text.charAt(i) + "");
}
} }
if(mouseX > position) { if(mouseX > position) {

View File

@ -1,14 +1,19 @@
package rip.athena.client.gui.hud.components.macros; package rip.athena.client.gui.clickgui.components.macros;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import rip.athena.client.gui.framework.components.MenuButton; import rip.athena.client.gui.framework.components.MenuButton;
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;
import rip.athena.client.gui.hud.IngameMenu; import rip.athena.client.gui.clickgui.IngameMenu;
import java.awt.*; import java.awt.*;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class SimpleTextButton extends MenuButton { public class SimpleTextButton extends MenuButton {
protected boolean leftColorChange; protected boolean leftColorChange;

View File

@ -1,14 +1,21 @@
package rip.athena.client.gui.hud.components.mods; package rip.athena.client.gui.clickgui.components.mods;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import rip.athena.client.font.FontManager; import rip.athena.client.font.FontManager;
import rip.athena.client.gui.framework.components.MenuButton; import rip.athena.client.gui.framework.components.MenuButton;
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;
import rip.athena.client.gui.hud.Category; import rip.athena.client.gui.clickgui.Category;
import rip.athena.client.modules.impl.other.Settings;
import java.awt.*; import java.awt.*;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class CategoryButton extends MenuButton { public class CategoryButton extends MenuButton {
public CategoryButton(Category category, int x, int y) { public CategoryButton(Category category, int x, int y) {
super(category.getName(), x, y); super(category.getName(), x, y);
@ -35,8 +42,11 @@ public class CategoryButton extends MenuButton {
int backgroundColor = getColor(DrawType.BACKGROUND, lastState); int backgroundColor = getColor(DrawType.BACKGROUND, lastState);
int textColor = getColor(DrawType.TEXT, lastState); int textColor = getColor(DrawType.TEXT, lastState);
FontManager.baloo17.drawString(text, x + (width / 2 - getStringWidth(text) / 2), y + height / 2 - (getStringHeight(text) / 2) - 3, textColor); if(Settings.customGuiFont) {
FontManager.baloo17.drawString(text, x + (width / 2 - getStringWidth(text) / 2), y + height / 2 - (getStringHeight(text) / 2) - 3, textColor);
} else {
Minecraft.getMinecraft().fontRendererObj.drawString(text, x + (width / 2 - getStringWidth(text) / 2), y + height / 2 - (getStringHeight(text) / 2) - 3, textColor);
}
if(isActive()) { if(isActive()) {
drawHorizontalLine(x + (width / 2 - getStringWidth(text) / 2), y + 29, (int)Minecraft.getMinecraft().fontRendererObj.getStringWidth(text), 2, textColor); drawHorizontalLine(x + (width / 2 - getStringWidth(text) / 2), y + 29, (int)Minecraft.getMinecraft().fontRendererObj.getStringWidth(text), 2, textColor);
} }
@ -46,11 +56,19 @@ public class CategoryButton extends MenuButton {
@Override @Override
public int getStringWidth(String string) { public int getStringWidth(String string) {
return Minecraft.getMinecraft().fontRendererObj.getStringWidth(string); if(Settings.customGuiFont) {
return (int) FontManager.baloo17.getStringWidth(string);
} else {
return Minecraft.getMinecraft().fontRendererObj.getStringWidth(string);
}
} }
@Override @Override
public int getStringHeight(String string) { public int getStringHeight(String string) {
return Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT; if(Settings.customGuiFont) {
return (int) FontManager.baloo17.getHeight(string);
} else {
return Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT;
}
} }
} }

View File

@ -1,13 +1,20 @@
package rip.athena.client.gui.hud.components.mods; package rip.athena.client.gui.clickgui.components.mods;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import rip.athena.client.font.FontManager; import rip.athena.client.font.FontManager;
import rip.athena.client.gui.framework.components.MenuLabel; import rip.athena.client.gui.framework.components.MenuLabel;
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;
import rip.athena.client.modules.impl.other.Settings;
import java.awt.*; import java.awt.*;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class FeatureText extends MenuLabel { public class FeatureText extends MenuLabel {
public FeatureText(String text, String tooltip, int x, int y) { public FeatureText(String text, String tooltip, int x, int y) {
@ -29,12 +36,20 @@ public class FeatureText extends MenuLabel {
@Override @Override
public void drawText(String text, int x, int y, int color) { public void drawText(String text, int x, int y, int color) {
FontManager.baloo17.drawString(text, x, y, color); if(Settings.customGuiFont) {
FontManager.baloo17.drawString(text, x, y, color);
} else {
Minecraft.getMinecraft().fontRendererObj.drawString(text, x, y, color);
}
} }
@Override @Override
public int getStringWidth(String text) { public int getStringWidth(String text) {
return (int) FontManager.baloo17.getStringWidth(text); if(Settings.customGuiFont) {
return (int) FontManager.baloo17.getStringWidth(text);
} else {
return Minecraft.getMinecraft().fontRendererObj.getStringWidth(text);
}
} }
@Override @Override

View File

@ -1,10 +1,16 @@
package rip.athena.client.gui.hud.components.mods; package rip.athena.client.gui.clickgui.components.mods;
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;
import java.awt.*; import java.awt.*;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class FeatureValueText extends FeatureText { public class FeatureValueText extends FeatureText {
public FeatureValueText(String text, String tooltip, int x, int y) { public FeatureValueText(String text, String tooltip, int x, int y) {

View File

@ -1,16 +1,22 @@
package rip.athena.client.gui.hud.components.mods; package rip.athena.client.gui.clickgui.components.mods;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import rip.athena.client.font.FontManager; import rip.athena.client.font.FontManager;
import rip.athena.client.gui.framework.components.MenuButton; import rip.athena.client.gui.framework.components.MenuButton;
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;
import rip.athena.client.gui.hud.IngameMenu; import rip.athena.client.gui.clickgui.IngameMenu;
import rip.athena.client.modules.impl.other.Settings;
import rip.athena.client.utils.render.DrawUtils; import rip.athena.client.utils.render.DrawUtils;
import java.awt.*; import java.awt.*;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class GoBackButton extends MenuButton { public class GoBackButton extends MenuButton {
public GoBackButton(int x, int y) { public GoBackButton(int x, int y) {
super("GO BACK", x, y, 120, 25); super("GO BACK", x, y, 120, 25);
@ -125,8 +131,11 @@ public class GoBackButton extends MenuButton {
DrawUtils.drawRoundedRect(x, y, x + width + 1, y + height + 1, rounding, lineColor); DrawUtils.drawRoundedRect(x, y, x + width + 1, y + height + 1, rounding, lineColor);
DrawUtils.drawRoundedRect(x + 1, y + 1, x + width, y + height, rounding, backgroundColor); DrawUtils.drawRoundedRect(x + 1, y + 1, x + width, y + height, rounding, backgroundColor);
FontManager.baloo17.drawString(text, x + (width / 2 - getStringWidth(text) / 2), y + height / 2 - (getStringHeight(text) / 2), textColor); if(Settings.customGuiFont) {
FontManager.baloo17.drawString(text, x + (width / 2 - getStringWidth(text) / 2), y + height / 2 - (getStringHeight(text) / 2), textColor);
} else {
Minecraft.getMinecraft().fontRendererObj.drawString(text, x + (width / 2 - getStringWidth(text) / 2), y + height / 2 - (getStringHeight(text) / 2), textColor);
}
x -= 20; x -= 20;
width = 30; width = 30;
@ -153,11 +162,19 @@ public class GoBackButton extends MenuButton {
@Override @Override
public int getStringWidth(String string) { public int getStringWidth(String string) {
return (int) FontManager.baloo17.getStringWidth(string); if(Settings.customGuiFont) {
return (int) FontManager.baloo17.getStringWidth(string);
} else {
return Minecraft.getMinecraft().fontRendererObj.getStringWidth(string);
}
} }
@Override @Override
public int getStringHeight(String string) { public int getStringHeight(String string) {
return (int) FontManager.baloo17.FONT_HEIGHT; if(Settings.customGuiFont) {
return (int) FontManager.baloo17.getHeight(string);
} else {
return Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT;
}
} }
} }

View File

@ -1,4 +1,4 @@
package rip.athena.client.gui.hud.components.mods; package rip.athena.client.gui.clickgui.components.mods;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
import rip.athena.client.gui.framework.components.MenuCheckbox; import rip.athena.client.gui.framework.components.MenuCheckbox;
@ -7,6 +7,12 @@ import rip.athena.client.gui.framework.draw.DrawType;
import java.awt.*; import java.awt.*;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class MenuModCheckbox extends MenuCheckbox { public class MenuModCheckbox extends MenuCheckbox {
public MenuModCheckbox(int x, int y, int width, int height) { public MenuModCheckbox(int x, int y, int width, int height) {
super("", x, y, width, height); super("", x, y, width, height);

View File

@ -1,4 +1,4 @@
package rip.athena.client.gui.hud.components.mods; package rip.athena.client.gui.clickgui.components.mods;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
import rip.athena.client.gui.framework.components.MenuColorPicker; import rip.athena.client.gui.framework.components.MenuColorPicker;
@ -8,6 +8,12 @@ import org.lwjgl.input.Mouse;
import java.awt.*; import java.awt.*;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class MenuModColorPicker extends MenuColorPicker { public class MenuModColorPicker extends MenuColorPicker {
public MenuModColorPicker(int x, int y, int width, int height, int defaultColor) { public MenuModColorPicker(int x, int y, int width, int height, int defaultColor) {
super(x, y, width, height, defaultColor); super(x, y, width, height, defaultColor);

View File

@ -1,5 +1,4 @@
package rip.athena.client.gui.hud.components.mods; package rip.athena.client.gui.clickgui.components.mods;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import rip.athena.client.font.FontManager; import rip.athena.client.font.FontManager;
@ -8,8 +7,16 @@ import rip.athena.client.gui.framework.MenuPriority;
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;
import org.lwjgl.input.Keyboard; import org.lwjgl.input.Keyboard;
import rip.athena.client.modules.impl.other.Settings;
import java.awt.*; import java.awt.*;
import java.util.Set;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class MenuModKeybind extends MenuComponent { public class MenuModKeybind extends MenuComponent {
public final static int mouseOffset = 500; public final static int mouseOffset = 500;
@ -188,17 +195,29 @@ public class MenuModKeybind extends MenuComponent {
@Override @Override
public void drawText(String text, int x, int y, int color) { public void drawText(String text, int x, int y, int color) {
FontManager.baloo17.drawString(text, x, y, color); if(Settings.customGuiFont) {
FontManager.baloo17.drawString(text, x, y, color);
} else {
Minecraft.getMinecraft().fontRendererObj.drawString(text, x, y, color);
}
} }
@Override @Override
public int getStringWidth(String string) { public int getStringWidth(String string) {
return Minecraft.getMinecraft().fontRendererObj.getStringWidth(string); if(Settings.customGuiFont) {
return (int) FontManager.baloo17.getStringWidth(string);
} else {
return Minecraft.getMinecraft().fontRendererObj.getStringWidth(string);
}
} }
@Override @Override
public int getStringHeight(String string) { public int getStringHeight(String string) {
return Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT; if(Settings.customGuiFont) {
return (int) FontManager.baloo17.getHeight(string);
} else {
return Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT;
}
} }
public boolean isBound() { public boolean isBound() {

View File

@ -1,15 +1,22 @@
package rip.athena.client.gui.hud.components.mods; package rip.athena.client.gui.clickgui.components.mods;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import rip.athena.client.font.FontManager; import rip.athena.client.font.FontManager;
import rip.athena.client.gui.framework.MenuPriority; import rip.athena.client.gui.framework.MenuPriority;
import rip.athena.client.gui.framework.components.MenuDropdown; import rip.athena.client.gui.framework.components.MenuDropdown;
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;
import rip.athena.client.modules.impl.other.Settings;
import java.awt.*; import java.awt.*;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class MenuModList extends MenuDropdown { public class MenuModList extends MenuDropdown {
protected int cursorWidth = 25; protected int cursorWidth = 25;
@ -103,6 +110,8 @@ public class MenuModList extends MenuDropdown {
int lineColor = getColor(DrawType.LINE, ButtonState.NORMAL); int lineColor = getColor(DrawType.LINE, ButtonState.NORMAL);
int textColor = getColor(DrawType.TEXT, ButtonState.NORMAL); int textColor = getColor(DrawType.TEXT, ButtonState.NORMAL);
GlStateManager.color(1,1,1);
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);
@ -139,16 +148,28 @@ public class MenuModList extends MenuDropdown {
@Override @Override
public void drawText(String text, int x, int y, int color) { public void drawText(String text, int x, int y, int color) {
FontManager.baloo17.drawString(text, x, y, color); if(Settings.customGuiFont) {
FontManager.baloo17.drawString(text, x, y, color);
} else {
Minecraft.getMinecraft().fontRendererObj.drawString(text, x, y, color);
}
} }
@Override @Override
public int getStringWidth(String string) { public int getStringWidth(String string) {
return (int) FontManager.baloo17.getStringWidth(string); if(Settings.customGuiFont) {
return (int) FontManager.baloo17.getStringWidth(string);
} else {
return Minecraft.getMinecraft().fontRendererObj.getStringWidth(string);
}
} }
@Override @Override
public int getStringHeight(String string) { public int getStringHeight(String string) {
return (int) FontManager.baloo17.FONT_HEIGHT; if(Settings.customGuiFont) {
return (int) FontManager.baloo17.getHeight(string);
} else {
return Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT;
}
} }
} }

View File

@ -1,5 +1,4 @@
package rip.athena.client.gui.hud.components.mods; package rip.athena.client.gui.clickgui.components.mods;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import rip.athena.client.font.FontManager; import rip.athena.client.font.FontManager;
@ -7,9 +6,16 @@ import rip.athena.client.gui.framework.components.MenuSlider;
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;
import org.lwjgl.input.Mouse; import org.lwjgl.input.Mouse;
import rip.athena.client.modules.impl.other.Settings;
import java.awt.*; import java.awt.*;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class MenuModSlider extends MenuSlider { public class MenuModSlider extends MenuSlider {
public MenuModSlider(double startValue, double minValue, double maxValue, int precision, int x, int y, int width, int height) { public MenuModSlider(double startValue, double minValue, double maxValue, int precision, int x, int y, int width, int height) {
@ -34,10 +40,11 @@ public class MenuModSlider extends MenuSlider {
setColor(DrawType.TEXT, ButtonState.HOVERACTIVE, new Color(182, 182, 182, 255)); setColor(DrawType.TEXT, ButtonState.HOVERACTIVE, new Color(182, 182, 182, 255));
setColor(DrawType.TEXT, ButtonState.DISABLED, new Color(100, 100, 100, 255)); setColor(DrawType.TEXT, ButtonState.DISABLED, new Color(100, 100, 100, 255));
setColor(DrawType.BACKGROUND, ButtonState.NORMAL, new Color(21, 67, 34, 255)); setColor(DrawType.BACKGROUND, ButtonState.ACTIVE, new Color(231, 27, 44, 255));
setColor(DrawType.BACKGROUND, ButtonState.ACTIVE, new Color(12, 83, 33, 255)); setColor(DrawType.BACKGROUND, ButtonState.HOVER, new Color(100, 40, 40, 255));
setColor(DrawType.BACKGROUND, ButtonState.HOVER, new Color(6, 42, 16, 255)); setColor(DrawType.BACKGROUND, ButtonState.HOVERACTIVE, new Color(239, 46, 90, 255));
setColor(DrawType.BACKGROUND, ButtonState.HOVERACTIVE, new Color(18, 126, 48, 255));
setColor(DrawType.BACKGROUND, ButtonState.NORMAL, new Color(231, 27, 44, 255));
setColor(DrawType.BACKGROUND, ButtonState.POPUP, new Color(35, 35, 35, 255)); setColor(DrawType.BACKGROUND, ButtonState.POPUP, new Color(35, 35, 35, 255));
setColor(DrawType.LINE, ButtonState.NORMAL, new Color(62, 62, 62, 255)); setColor(DrawType.LINE, ButtonState.NORMAL, new Color(62, 62, 62, 255));
@ -130,16 +137,28 @@ public class MenuModSlider extends MenuSlider {
@Override @Override
public void drawText(String text, int x, int y, int color) { public void drawText(String text, int x, int y, int color) {
FontManager.baloo17.drawString(text, x, y, color); if(Settings.customGuiFont) {
FontManager.baloo17.drawString(text, x, y, color);
} else {
Minecraft.getMinecraft().fontRendererObj.drawString(text, x, y, color);
}
} }
@Override @Override
public int getStringWidth(String string) { public int getStringWidth(String string) {
return (int) FontManager.baloo17.getStringWidth(string); if(Settings.customGuiFont) {
return (int) FontManager.baloo17.getStringWidth(string);
} else {
return Minecraft.getMinecraft().fontRendererObj.getStringWidth(string);
}
} }
@Override @Override
public int getStringHeight(String string) { public int getStringHeight(String string) {
return (int) FontManager.baloo17.getHeight(string); if(Settings.customGuiFont) {
return (int) FontManager.baloo17.getHeight(string);
} else {
return Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT;
}
} }
} }

View File

@ -1,18 +1,24 @@
package rip.athena.client.gui.hud.components.mods; package rip.athena.client.gui.clickgui.components.mods;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import rip.athena.client.font.FontManager; import rip.athena.client.font.FontManager;
import rip.athena.client.gui.framework.components.MenuButton; import rip.athena.client.gui.framework.components.MenuButton;
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;
import rip.athena.client.gui.hud.IngameMenu; import rip.athena.client.gui.clickgui.IngameMenu;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import rip.athena.client.modules.Category; import rip.athena.client.modules.Category;
import rip.athena.client.modules.impl.other.Settings;
import java.awt.*; import java.awt.*;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class ModCategoryButton extends MenuButton { public class ModCategoryButton extends MenuButton {
public static final int MAIN_COLOR = new Color(35, 35, 35, IngameMenu.MENU_ALPHA).getRGB(); public static final int MAIN_COLOR = new Color(35, 35, 35, IngameMenu.MENU_ALPHA).getRGB();
@ -51,13 +57,12 @@ public class ModCategoryButton extends MenuButton {
int textColor = getColor(DrawType.TEXT, lastState); int textColor = getColor(DrawType.TEXT, lastState);
GlStateManager.color(1, 1, 1); GlStateManager.color(1, 1, 1);
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x + 15, y, width - 35, height, backgroundColor); rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x, y, width - 10, height, backgroundColor);
if(image != null) { if(Settings.customGuiFont) {
//drawImage(image, x + 5, y + (height / 2 - IMAGE_SIZE / 2), IMAGE_SIZE, IMAGE_SIZE);
FontManager.baloo17.drawString(text, x + IMAGE_SIZE + 5 + 5, y + height / 2 - (getStringHeight(text) / 2) - 1, textColor);
} else {
FontManager.baloo17.drawString(text, x + (width / 2 - getStringWidth(text) / 2), y + height / 2 - (getStringHeight(text) / 2), textColor); FontManager.baloo17.drawString(text, x + (width / 2 - getStringWidth(text) / 2), y + height / 2 - (getStringHeight(text) / 2), textColor);
} else {
Minecraft.getMinecraft().fontRendererObj.drawString(text, x + (width / 2 - getStringWidth(text) / 2), y + height / 2 - (getStringHeight(text) / 2), textColor);
} }
mouseDown = false; mouseDown = false;
@ -65,11 +70,19 @@ public class ModCategoryButton extends MenuButton {
@Override @Override
public int getStringWidth(String string) { public int getStringWidth(String string) {
return Minecraft.getMinecraft().fontRendererObj.getStringWidth(string); if(Settings.customGuiFont) {
return (int) FontManager.baloo17.getStringWidth(string);
} else {
return Minecraft.getMinecraft().fontRendererObj.getStringWidth(string);
}
} }
@Override @Override
public int getStringHeight(String string) { public int getStringHeight(String string) {
return Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT; if(Settings.customGuiFont) {
return (int) FontManager.baloo17.getHeight(string);
} else {
return Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT;
}
} }
} }

View File

@ -1,4 +1,4 @@
package rip.athena.client.gui.hud.components.mods; package rip.athena.client.gui.clickgui.components.mods;
import rip.athena.client.gui.framework.MenuComponent; import rip.athena.client.gui.framework.MenuComponent;
import rip.athena.client.gui.framework.MenuPriority; import rip.athena.client.gui.framework.MenuPriority;
@ -13,6 +13,12 @@ import org.lwjgl.opengl.GL11;
import java.awt.*; import java.awt.*;
import java.util.Collections; import java.util.Collections;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class ModScrollPane extends MenuScrollPane { public class ModScrollPane extends MenuScrollPane {
private boolean fullHeightScroller; private boolean fullHeightScroller;

View File

@ -1,20 +1,25 @@
package rip.athena.client.gui.hud.components.mods; package rip.athena.client.gui.clickgui.components.mods;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager; import rip.athena.client.font.FontManager;
import rip.athena.client.gui.framework.TextPattern; import rip.athena.client.gui.framework.TextPattern;
import rip.athena.client.gui.framework.components.MenuTextField; import rip.athena.client.gui.framework.components.MenuTextField;
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;
import org.lwjgl.input.Keyboard; import org.lwjgl.input.Keyboard;
import rip.athena.client.gui.hud.IngameMenu; import rip.athena.client.gui.clickgui.IngameMenu;
import rip.athena.client.modules.impl.other.Settings;
import rip.athena.client.utils.render.DrawUtils; import rip.athena.client.utils.render.DrawUtils;
import java.awt.*; import java.awt.*;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class ModTextbox extends MenuTextField { public class ModTextbox extends MenuTextField {
private final static Color PLACEHOLDER_COLOR = new Color(80, 80, 82, IngameMenu.MENU_ALPHA);
public ModTextbox(TextPattern pattern, int x, int y, int width, int height) { public ModTextbox(TextPattern pattern, int x, int y, int width, int height) {
super(pattern, x, y, width, height); super(pattern, x, y, width, height);
@ -83,36 +88,59 @@ public class ModTextbox extends MenuTextField {
} }
} }
int labelWidth = (int)Minecraft.getMinecraft().fontRendererObj.getStringWidth(textToDraw + 1); int labelWidth;
if(Settings.customGuiFont) {
labelWidth = (int) FontManager.baloo17.getStringWidth(textToDraw + 1);
} else {
labelWidth = Minecraft.getMinecraft().fontRendererObj.getStringWidth(textToDraw + 1);
}
int comp = 0; int comp = 0;
int toRender = index; int toRender = index;
while(labelWidth >= width) { while(labelWidth >= width) {
if(comp < index){ if(comp < index){
textToDraw = textToDraw.substring(1); textToDraw = textToDraw.substring(1);
labelWidth = (int) Minecraft.getMinecraft().fontRendererObj.getStringWidth(textToDraw + 1); if(Settings.customGuiFont) {
labelWidth = (int) FontManager.baloo17.getStringWidth(textToDraw + 1);
} else {
labelWidth = Minecraft.getMinecraft().fontRendererObj.getStringWidth(textToDraw + 1);
}
toRender--; toRender--;
} else if(comp > index){ } else if(comp > index){
textToDraw = textToDraw.substring(0, textToDraw.length() - 1); textToDraw = textToDraw.substring(0, textToDraw.length() - 1);
labelWidth = (int)Minecraft.getMinecraft().fontRendererObj.getStringWidth(textToDraw + 1);
if(Settings.customGuiFont) {
labelWidth = (int) FontManager.baloo17.getStringWidth(textToDraw + 1);
} else {
labelWidth = Minecraft.getMinecraft().fontRendererObj.getStringWidth(textToDraw + 1);
}
} }
comp++; comp++;
} }
if(drawPointer) { if(drawPointer) {
if(toRender > textToDraw.length()) { if (toRender > textToDraw.length()) {
toRender = textToDraw.length() - 1; toRender = textToDraw.length() - 1;
} }
if(toRender < 0) { if (toRender < 0) {
toRender = 0; toRender = 0;
} }
int textHeight = (int)Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT; int textHeight;
drawVerticalLine(x + (int)Minecraft.getMinecraft().fontRendererObj.getStringWidth(textToDraw.substring(0, toRender)) + 1, y + height / 2 - textHeight / 2, textHeight, 1, textColor); if (Settings.customGuiFont) {
textHeight = (int) FontManager.baloo17.getHeight(textToDraw);
} else {
textHeight = Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT;
}
if (Settings.customGuiFont) {
drawVerticalLine(x + (int) FontManager.baloo17.getStringWidth(textToDraw.substring(0, toRender)) + 1, y + height / 2 - textHeight / 2, textHeight, 1, textColor);
} else {
drawVerticalLine(x + (int) Minecraft.getMinecraft().fontRendererObj.getStringWidth(textToDraw.substring(0, toRender)) + 1, y + height / 2 - textHeight / 2, textHeight, 1, textColor);
}
} }
int renderIndex = comp; int renderIndex = comp;
int renderStopIndex = comp + textToDraw.length(); int renderStopIndex = comp + textToDraw.length();
@ -122,8 +150,11 @@ public class ModTextbox extends MenuTextField {
int xAdd = 0; int xAdd = 0;
Minecraft.getMinecraft().fontRendererObj.drawString(textToDraw, x + minOffset + xAdd, y + height / 2 - (int)Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT / 2, textColor); if(Settings.customGuiFont) {
FontManager.baloo17.drawString(textToDraw, x + minOffset + xAdd, y + height / 2 - (int) FontManager.baloo17.getHeight(textToDraw) / 2, textColor);
} else {
Minecraft.getMinecraft().fontRendererObj.drawString(textToDraw, x + minOffset + xAdd, y + height / 2 - (int) Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT / 2, textColor);
}
if(lastState == ButtonState.HOVER && mouseDown) { if(lastState == ButtonState.HOVER && mouseDown) {
focused = true; focused = true;
lineTime = getLinePrediction(); lineTime = getLinePrediction();
@ -150,7 +181,11 @@ public class ModTextbox extends MenuTextField {
bestIndex = i; bestIndex = i;
} }
position += (int)Minecraft.getMinecraft().fontRendererObj.getStringWidth(text.charAt(i) + ""); if(Settings.customGuiFont) {
position += (int) FontManager.baloo17.getStringWidth(text.charAt(i) + "");
} else {
position += (int) Minecraft.getMinecraft().fontRendererObj.getStringWidth(text.charAt(i) + "");
}
} }
if(mouseX > position) { if(mouseX > position) {

View File

@ -1,14 +1,20 @@
package rip.athena.client.gui.hud.components.mods; package rip.athena.client.gui.clickgui.components.mods;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import rip.athena.client.font.FontManager; import rip.athena.client.font.FontManager;
import rip.athena.client.gui.framework.components.MenuButton; import rip.athena.client.gui.framework.components.MenuButton;
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;
import rip.athena.client.modules.impl.other.Settings;
import java.awt.*; import java.awt.*;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class ModsButton extends MenuButton { public class ModsButton extends MenuButton {
public ModsButton(String text, int x, int y) { public ModsButton(String text, int x, int y) {
super(text, x, y, 120, 20); super(text, x, y, 120, 20);
@ -111,17 +117,29 @@ public class ModsButton extends MenuButton {
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);
FontManager.baloo17.drawString(text, x + (width / 2 - getStringWidth(text) / 2), y + height / 2 - (getStringHeight(text) / 2), textColor); if(Settings.customGuiFont) {
FontManager.baloo17.drawString(text, x + (width / 2 - getStringWidth(text) / 2), y + height / 2 - (getStringHeight(text) / 2), textColor);
} else {
Minecraft.getMinecraft().fontRendererObj.drawString(text, x + (width / 2 - getStringWidth(text) / 2), y + height / 2 - (getStringHeight(text) / 2), textColor);
}
mouseDown = false; mouseDown = false;
} }
@Override @Override
public int getStringWidth(String string) { public int getStringWidth(String string) {
return (int) FontManager.baloo17.getStringWidth(string); if(Settings.customGuiFont) {
return (int) FontManager.baloo17.getStringWidth(string);
} else {
return Minecraft.getMinecraft().fontRendererObj.getStringWidth(string);
}
} }
@Override @Override
public int getStringHeight(String string) { public int getStringHeight(String string) {
return (int) FontManager.baloo17.getHeight(string); if(Settings.customGuiFont) {
return (int) FontManager.baloo17.getHeight(string);
} else {
return Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT;
}
} }
} }

View File

@ -1,21 +1,29 @@
package rip.athena.client.gui.hud.components.mods; package rip.athena.client.gui.clickgui.components.mods;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import rip.athena.client.font.FontManager; import rip.athena.client.font.FontManager;
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;
import rip.athena.client.gui.hud.IngameMenu; import rip.athena.client.gui.clickgui.IngameMenu;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import rip.athena.client.modules.Module; import rip.athena.client.modules.Module;
import rip.athena.client.modules.impl.other.Settings;
import java.awt.*; import java.awt.*;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List; import java.util.List;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class ModuleBox extends MenuComponent { public class ModuleBox extends MenuComponent {
protected static final int INACTIVE = new Color(10, 90, 32, IngameMenu.MENU_ALPHA).getRGB(); protected static final int INACTIVE = new Color(10, 90, 32, IngameMenu.MENU_ALPHA).getRGB();
protected static final int ACTIVE = new Color(90, 10, 12, IngameMenu.MENU_ALPHA).getRGB(); protected static final int ACTIVE = new Color(90, 10, 12, IngameMenu.MENU_ALPHA).getRGB();
@ -186,16 +194,21 @@ public class ModuleBox extends MenuComponent {
int yPos = y + (height / 2) - tHeight / 2 - 5; int yPos = y + (height / 2) - tHeight / 2 - 5;
for(String line : lines) { for (String line : lines) {
FontManager.vision30.drawString(line, x + (float) width / 2 - FontManager.vision30.getStringWidth(line) / 2, yPos, textColor); if(Settings.customGuiFont) {
yPos += FontManager.vision30.getHeight(line); FontManager.baloo30.drawString(line, x + (float) width / 2 - FontManager.baloo30.getStringWidth(line) / 2, yPos, textColor);
yPos += FontManager.baloo30.getHeight(line);
} else {
Minecraft.getMinecraft().fontRendererObj.drawString(line, (int) (x + (float) width / 2 - Minecraft.getMinecraft().fontRendererObj.getStringWidth(line) / 2), yPos, textColor);
yPos += Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT;
}
} }
int mouseX = parent.getMouseX(); int mouseX = parent.getMouseX();
int mouseY = parent.getMouseY(); int mouseY = parent.getMouseY();
if(mouseX >= x + 10 && mouseX <= x + width - 11) { if (mouseX >= x + 10 && mouseX <= x + width - 11) {
if(mouseY >= y + height - 10 - 20 && mouseY <= y + height - 10) { if (mouseY >= y + height - 10 - 20 && mouseY <= y + height - 10) {
drawColor = backgroundColor; drawColor = backgroundColor;
} }
} }
@ -206,35 +219,38 @@ public class ModuleBox extends MenuComponent {
drawShadowRight(x + width - 10, y + height - 30, 20);*/ drawShadowRight(x + width - 10, y + height - 30, 20);*/
drawHorizontalLine(x + 10, y + height - 30, width - 20, 1, new Color(43, 43, 43, 225).getRGB()); drawHorizontalLine(x + 10, y + height - 30, width - 20, 1, new Color(43, 43, 43, 225).getRGB());
drawVerticalLine(x + 10, y + height - 30, 20, 1, new Color(43, 43, 43, 225).getRGB()); drawVerticalLine(x + 10, y + height - 30, 20, 1, new Color(43, 43, 43, 225).getRGB());
drawHorizontalLine(x + 10, y + height - 10, width - 20, 1, new Color(43, 43, 43, 225).getRGB()); drawHorizontalLine(x + 10, y + height - 10, width - 20, 1, new Color(43, 43, 43, 225).getRGB());
drawVerticalLine(x + width - 10, y + height - 30, 20, 1, new Color(43, 43, 43, 225).getRGB()); drawVerticalLine(x + width - 10, y + height - 30, 20, 1, new Color(43, 43, 43, 225).getRGB());
//rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x + 10, y + height - 10 - 20, width - 20, 20, module.isToggled() ? INACTIVE : ACTIVE); rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x + 10, y + height - 10 - 20, width - 20, 20, module.isToggled() ? new Color(0, 200, 0, 255).getRGB() : new Color(200, 0, 0, 225).getRGB());
//rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x + 11, y + height - 10 - 19, width - 22, 18, drawColor); rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x + 11, y + height - 10 - 19, width - 22, 18, module.isToggled() ? new Color(40, 157, 93, 255).getRGB() : new Color(157, 40, 40, 225).getRGB());
String text = module.isToggled() ? "ENABLED" : "DISABLED"; String text = module.isToggled() ? "ENABLED" : "DISABLED";
FontManager.baloo17.drawString(text, x + (float) width / 2 - FontManager.baloo17.getStringWidth(text) / 2, y + height - 10 - 15, module.isToggled() ? new Color(0, 200, 0, 255).getRGB() : new Color(200, 0, 0, 225).getRGB()); if(Settings.customGuiFont) {
FontManager.baloo17.drawString(text, x + (float) width / 2 - FontManager.baloo17.getStringWidth(text) / 2, y + height - 10 - 15, -1);
if(!module.getEntries().isEmpty()) { } else {
Minecraft.getMinecraft().fontRendererObj.drawString(text, (int) (x + (float) width / 2 - Minecraft.getMinecraft().fontRendererObj.getStringWidth(text) / 2), y + height - 10 - 15, -1);
}
if (!module.getEntries().isEmpty()) {
drawColor = defaultColor; drawColor = defaultColor;
if(mouseX >= x + width - 14 - 17 - 4 && mouseX <= x + width - 14 - 17 - 4 + 24) { if (mouseX >= x + width - 14 - 17 - 4 && mouseX <= x + width - 14 - 17 - 4 + 24) {
if(mouseY >= y + 14 - 4 && mouseY <= y + 14 - 3 + 23) { if (mouseY >= y + 14 - 4 && mouseY <= y + 14 - 3 + 23) {
drawColor = Color.black.getRGB(); drawColor = Color.black.getRGB();
} }
} }
drawShadowUp(x + width - 14 - 17 - 4, y + 14 - 4, 25); /*drawShadowUp(x + width - 14 - 17 - 4, y + 14 - 4, 25);
drawShadowLeft(x + width - 14 - 17 - 4, y + 14 - 4, 25); drawShadowLeft(x + width - 14 - 17 - 4, y + 14 - 4, 25);
drawShadowDown(x + width - 14 - 17 - 4, y + 14 - 4 + 25, 25); drawShadowDown(x + width - 14 - 17 - 4, y + 14 - 4 + 25, 25);
drawShadowRight(x + width - 14 - 17 - 4 + 25, y + 14 - 4, 25); drawShadowRight(x + width - 14 - 17 - 4 + 25, y + 14 - 4, 25);*/
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x + width - 14 - 17 - 4, y + 14 - 4, 25, 25, COG_BORDER); //rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x + width - 14 - 17 - 4, y + 14 - 4, 25, 25, COG_BORDER);
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x + width - 14 - 17 - 3, y + 14 - 3, 23, 23, drawColor); rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x + width - 14 - 17 - 3, y + 14 - 3, 23, 23, drawColor);
//drawImage(COG, x + width - 14 - 17, y + 14, 17, 17); drawImage(new ResourceLocation("Athena/images/gear_white.png"), x + width - 14 - 17, y + 14, 17, 17);
} }
} }

View File

@ -1,18 +1,25 @@
package rip.athena.client.gui.hud.components.mods; package rip.athena.client.gui.clickgui.components.mods;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import rip.athena.client.font.FontManager; import rip.athena.client.font.FontManager;
import rip.athena.client.gui.framework.TextPattern; import rip.athena.client.gui.framework.TextPattern;
import rip.athena.client.gui.framework.components.MenuTextField; import rip.athena.client.gui.framework.components.MenuTextField;
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;
import rip.athena.client.gui.hud.IngameMenu; import rip.athena.client.gui.clickgui.IngameMenu;
import rip.athena.client.modules.impl.other.Settings;
import rip.athena.client.utils.render.DrawUtils; import rip.athena.client.utils.render.DrawUtils;
import org.lwjgl.input.Keyboard; import org.lwjgl.input.Keyboard;
import java.awt.*; import java.awt.*;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class SearchTextfield extends MenuTextField { public class SearchTextfield extends MenuTextField {
protected final static Color PLACEHOLDER_COLOR = new Color(80, 80, 82, IngameMenu.MENU_ALPHA); protected final static Color PLACEHOLDER_COLOR = new Color(80, 80, 82, IngameMenu.MENU_ALPHA);
@ -55,6 +62,8 @@ public class SearchTextfield extends MenuTextField {
int lineColor = getColor(DrawType.LINE, lastState); int lineColor = getColor(DrawType.LINE, lastState);
int textColor = getColor(DrawType.TEXT, lastState); int textColor = getColor(DrawType.TEXT, lastState);
GlStateManager.color(1, 1,1,1);
DrawUtils.drawRoundedRect(x - 4, y - 4, x + width + 5, y + height + 5, 10, 83886080); DrawUtils.drawRoundedRect(x - 4, y - 4, x + width + 5, y + height + 5, 10, 83886080);
DrawUtils.drawRoundedRect(x - 3, y - 3, x + width + 4, y + height + 4, 10, 369098752); DrawUtils.drawRoundedRect(x - 3, y - 3, x + width + 4, y + height + 4, 10, 369098752);
DrawUtils.drawRoundedRect(x - 2, y - 2, x + width + 3, y + height + 3, 10, 587202560); DrawUtils.drawRoundedRect(x - 2, y - 2, x + width + 3, y + height + 3, 10, 587202560);
@ -83,17 +92,31 @@ public class SearchTextfield extends MenuTextField {
} }
} }
int labelWidth = (int) FontManager.baloo17.getStringWidth(textToDraw + 1); int labelWidth;
if(Settings.customGuiFont) {
labelWidth = (int) FontManager.baloo17.getStringWidth(textToDraw + 1);
} else {
labelWidth = Minecraft.getMinecraft().fontRendererObj.getStringWidth(textToDraw + 1);
}
int comp = 0; int comp = 0;
int toRender = index; int toRender = index;
while(labelWidth >= width) { while(labelWidth >= width) {
if(comp < index){ if(comp < index){
textToDraw = textToDraw.substring(1); textToDraw = textToDraw.substring(1);
labelWidth = (int)FontManager.baloo17.getStringWidth(textToDraw + 1); if(Settings.customGuiFont) {
labelWidth = (int) FontManager.baloo17.getStringWidth(textToDraw + 1);
} else {
labelWidth = Minecraft.getMinecraft().fontRendererObj.getStringWidth(textToDraw + 1);
}
toRender--; toRender--;
} else if(comp > index){ } else if(comp > index){
textToDraw = textToDraw.substring(0, textToDraw.length() - 1); textToDraw = textToDraw.substring(0, textToDraw.length() - 1);
labelWidth = (int)FontManager.baloo17.getStringWidth(textToDraw + 1); if(Settings.customGuiFont) {
labelWidth = (int) FontManager.baloo17.getStringWidth(textToDraw + 1);
} else {
labelWidth = Minecraft.getMinecraft().fontRendererObj.getStringWidth(textToDraw + 1);
}
} }
comp++; comp++;
@ -108,9 +131,16 @@ public class SearchTextfield extends MenuTextField {
toRender = 0; toRender = 0;
} }
int textHeight = (int)FontManager.baloo17.getHeight(textToDraw); int textHeight;
if(Settings.customGuiFont) {
textHeight = (int) FontManager.baloo17.getHeight(textToDraw);
drawVerticalLine(x + 10 + (int)FontManager.baloo17.getStringWidth(textToDraw.substring(0, toRender)) + 1, y + height / 2 - textHeight / 2, textHeight, 1, textColor);
} else {
textHeight = Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT;
drawVerticalLine(x + 10 + (int)Minecraft.getMinecraft().fontRendererObj.getStringWidth(textToDraw.substring(0, toRender)) + 1, y + height / 2 - textHeight / 2, textHeight, 1, textColor);
}
drawVerticalLine(x + 10 + (int)FontManager.baloo17.getStringWidth(textToDraw.substring(0, toRender)) + 1, y + height / 2 - textHeight / 2, textHeight, 1, textColor);
} }
int renderIndex = comp; int renderIndex = comp;
@ -128,8 +158,11 @@ public class SearchTextfield extends MenuTextField {
textColor = PLACEHOLDER_COLOR.getRGB(); textColor = PLACEHOLDER_COLOR.getRGB();
} }
FontManager.baloo17.drawString(textToDraw, x + 10 + minOffset + xAdd, y + (float) height / 2 - (float) (int) FontManager.baloo17.getHeight(textToDraw) / 2, textColor); if(Settings.customGuiFont) {
FontManager.baloo17.drawString(textToDraw, x + 10 + minOffset + xAdd, y + (float) height / 2 - (float) (int) FontManager.baloo17.getHeight(textToDraw) / 2, textColor);
} else {
Minecraft.getMinecraft().fontRendererObj.drawString(textToDraw, x + 10 + minOffset + xAdd, (int) (y + (float) height / 2 - (float) (int) Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT / 2), textColor);
}
if(lastState == ButtonState.HOVER && mouseDown) { if(lastState == ButtonState.HOVER && mouseDown) {
focused = true; focused = true;
lineTime = getLinePrediction(); lineTime = getLinePrediction();

View File

@ -1,15 +1,20 @@
package rip.athena.client.gui.hud.components.profiles; package rip.athena.client.gui.clickgui.components.profiles;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import rip.athena.client.gui.framework.MenuComponent; import rip.athena.client.gui.framework.MenuComponent;
import rip.athena.client.gui.framework.MenuPriority; import rip.athena.client.gui.framework.MenuPriority;
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;
import rip.athena.client.gui.hud.IngameMenu; import rip.athena.client.gui.clickgui.IngameMenu;
import java.awt.*; import java.awt.*;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class ProfilesBase extends MenuComponent { public class ProfilesBase extends MenuComponent {
protected String text; protected String text;

View File

@ -1,11 +1,17 @@
package rip.athena.client.gui.hud.components.profiles; package rip.athena.client.gui.clickgui.components.profiles;
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;
import rip.athena.client.gui.hud.components.macros.MacroButton; import rip.athena.client.gui.clickgui.components.macros.MacroButton;
import java.awt.*; import java.awt.*;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class ProfilesBlueButton extends MacroButton { public class ProfilesBlueButton extends MacroButton {
public ProfilesBlueButton(String text, int x, int y, int width, int height) { public ProfilesBlueButton(String text, int x, int y, int width, int height) {

View File

@ -1,14 +1,21 @@
package rip.athena.client.gui.hud.components.waypoints; package rip.athena.client.gui.clickgui.components.waypoints;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import rip.athena.client.font.FontManager;
import rip.athena.client.gui.framework.MenuComponent; import rip.athena.client.gui.framework.MenuComponent;
import rip.athena.client.gui.framework.MenuPriority; import rip.athena.client.gui.framework.MenuPriority;
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;
import rip.athena.client.modules.impl.other.Settings;
import java.awt.*; import java.awt.*;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class WaypointTextBarrier extends MenuComponent { public class WaypointTextBarrier extends MenuComponent {
protected String text; protected String text;
@ -48,17 +55,29 @@ public class WaypointTextBarrier extends MenuComponent {
@Override @Override
public void drawText(String text, int x, int y, int color) { public void drawText(String text, int x, int y, int color) {
Minecraft.getMinecraft().fontRendererObj.drawString(text, x, y, color); if(Settings.customGuiFont) {
FontManager.baloo17.drawString(text, x, y, color);
} else {
Minecraft.getMinecraft().fontRendererObj.drawString(text, x, y, color);
}
} }
@Override @Override
public int getStringWidth(String text) { public int getStringWidth(String string) {
return Minecraft.getMinecraft().fontRendererObj.getStringWidth(text); if(Settings.customGuiFont) {
return (int) FontManager.baloo17.getStringWidth(string);
} else {
return Minecraft.getMinecraft().fontRendererObj.getStringWidth(string);
}
} }
@Override @Override
public int getStringHeight(String text) { public int getStringHeight(String string) {
return Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT; if(Settings.customGuiFont) {
return (int) FontManager.baloo17.getHeight(string);
} else {
return Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT;
}
} }
public String getText() { public String getText() {

View File

@ -1,17 +1,22 @@
package rip.athena.client.gui.hud.components.waypoints; package rip.athena.client.gui.clickgui.components.waypoints;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import rip.athena.client.gui.framework.TextPattern; import rip.athena.client.gui.framework.TextPattern;
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;
import rip.athena.client.gui.hud.IngameMenu; import rip.athena.client.gui.clickgui.IngameMenu;
import rip.athena.client.gui.hud.components.mods.SearchTextfield; import rip.athena.client.gui.clickgui.components.mods.SearchTextfield;
import rip.athena.client.utils.render.DrawUtils; import rip.athena.client.utils.render.DrawUtils;
import org.lwjgl.input.Keyboard; import org.lwjgl.input.Keyboard;
import java.awt.*; import java.awt.*;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class WaypointsTextfield extends SearchTextfield { public class WaypointsTextfield extends SearchTextfield {
protected int placeholderText; protected int placeholderText;
protected int textPadding = 5; protected int textPadding = 5;

View File

@ -1,24 +1,26 @@
package rip.athena.client.gui.hud.pages; package rip.athena.client.gui.clickgui.pages;
import rip.athena.client.Athena;
import rip.athena.client.font.FontManager; import rip.athena.client.font.FontManager;
import rip.athena.client.gui.framework.Menu; import rip.athena.client.gui.framework.Menu;
import rip.athena.client.gui.framework.MenuComponent; import rip.athena.client.gui.framework.MenuComponent;
import rip.athena.client.gui.hud.IngameMenu; import rip.athena.client.gui.clickgui.IngameMenu;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.I18n;
import org.lwjgl.input.Keyboard; import org.lwjgl.input.Keyboard;
import rip.athena.client.gui.hud.Page; import rip.athena.client.gui.clickgui.Page;
import rip.athena.client.gui.hud.components.cosmetics.*; import rip.athena.client.gui.clickgui.components.cosmetics.*;
import rip.athena.client.gui.hud.components.macros.MacroButton; import rip.athena.client.gui.clickgui.components.macros.MacroButton;
import rip.athena.client.gui.hud.components.mods.MenuModKeybind; import rip.athena.client.gui.clickgui.components.mods.MenuModKeybind;
import rip.athena.client.gui.hud.components.mods.ModCategoryButton; import rip.athena.client.gui.clickgui.components.mods.ModCategoryButton;
import rip.athena.client.gui.hud.components.mods.ModScrollPane; import rip.athena.client.gui.clickgui.components.mods.ModScrollPane;
import rip.athena.client.gui.hud.pages.cosmetics.BandanaSize; import rip.athena.client.gui.clickgui.pages.cosmetics.BandanaSize;
import rip.athena.client.gui.hud.pages.cosmetics.CapeType; import rip.athena.client.gui.clickgui.pages.cosmetics.CapeType;
import rip.athena.client.gui.hud.pages.cosmetics.CosmeticType; import rip.athena.client.gui.clickgui.pages.cosmetics.CosmeticType;
import java.awt.*; /**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class CosmeticsPage extends Page { public class CosmeticsPage extends Page {
private CosmeticType cosmeticType = CosmeticType.CAPES; private CosmeticType cosmeticType = CosmeticType.CAPES;

View File

@ -1,23 +1,19 @@
package rip.athena.client.gui.hud.pages; package rip.athena.client.gui.clickgui.pages;
import rip.athena.client.gui.framework.Menu; import rip.athena.client.gui.framework.Menu;
import rip.athena.client.gui.framework.MenuComponent; import rip.athena.client.gui.framework.MenuComponent;
import rip.athena.client.gui.framework.TextPattern; import rip.athena.client.gui.framework.TextPattern;
import rip.athena.client.gui.hud.IngameMenu; import rip.athena.client.gui.clickgui.IngameMenu;
import rip.athena.client.gui.hud.Page; import rip.athena.client.gui.clickgui.Page;
import rip.athena.client.gui.hud.components.cosmetics.CosmeticGenericButton; import rip.athena.client.gui.clickgui.components.cosmetics.CosmeticGenericButton;
import rip.athena.client.gui.hud.components.groups.*; import rip.athena.client.gui.clickgui.components.groups.*;
import rip.athena.client.gui.hud.components.macros.MacroButton; import rip.athena.client.gui.clickgui.components.macros.MacroButton;
import rip.athena.client.gui.hud.components.macros.MacroTextfield; import rip.athena.client.gui.clickgui.components.macros.MacroTextfield;
import rip.athena.client.gui.hud.components.macros.SimpleTextButton; import rip.athena.client.gui.clickgui.components.mods.*;
import rip.athena.client.gui.hud.components.mods.*; import rip.athena.client.gui.clickgui.pages.groups.GroupSubTab;
import rip.athena.client.gui.hud.components.profiles.ProfilesBase;
import rip.athena.client.gui.hud.components.profiles.ProfilesBlueButton;
import rip.athena.client.gui.hud.pages.groups.GroupSubTab;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import org.json.JSONObject;
import rip.athena.client.utils.render.AssetUtils; import rip.athena.client.utils.render.AssetUtils;
import java.awt.*; import java.awt.*;
@ -25,6 +21,12 @@ import java.io.IOException;
import java.net.URI; import java.net.URI;
import java.net.URISyntaxException; import java.net.URISyntaxException;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class GroupsPage extends Page { public class GroupsPage extends Page {
private final static int SUB_TAB_COLOR = new Color(35, 35, 35, 255).getRGB(); private final static int SUB_TAB_COLOR = new Color(35, 35, 35, 255).getRGB();

View File

@ -1,19 +1,24 @@
package rip.athena.client.gui.hud.pages; package rip.athena.client.gui.clickgui.pages;
import rip.athena.client.Athena;
import rip.athena.client.gui.framework.Menu; import rip.athena.client.gui.framework.Menu;
import rip.athena.client.gui.framework.TextPattern; import rip.athena.client.gui.framework.TextPattern;
import rip.athena.client.gui.hud.IngameMenu; import rip.athena.client.gui.clickgui.IngameMenu;
import rip.athena.client.gui.hud.Page; import rip.athena.client.gui.clickgui.Page;
import rip.athena.client.gui.hud.components.macros.*; import rip.athena.client.gui.clickgui.components.macros.*;
import rip.athena.client.gui.hud.components.mods.MenuModKeybind; import rip.athena.client.gui.clickgui.components.mods.MenuModKeybind;
import rip.athena.client.gui.hud.components.mods.ModCategoryButton; import rip.athena.client.gui.clickgui.components.mods.ModCategoryButton;
import rip.athena.client.gui.hud.components.mods.ModScrollPane; import rip.athena.client.gui.clickgui.components.mods.ModScrollPane;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import org.lwjgl.input.Keyboard; import org.lwjgl.input.Keyboard;
import java.awt.*; import java.awt.*;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class MacrosPage extends Page { public class MacrosPage extends Page {
public final int MENU_SIDE_HEADER_BG_COLOR = new Color(35, 35, 35, IngameMenu.MENU_ALPHA).getRGB(); public final int MENU_SIDE_HEADER_BG_COLOR = new Color(35, 35, 35, IngameMenu.MENU_ALPHA).getRGB();
public final static int MENU_SIDE_BG_COLOR = new Color(35, 35, 35, IngameMenu.MENU_ALPHA).getRGB(); public final static int MENU_SIDE_BG_COLOR = new Color(35, 35, 35, IngameMenu.MENU_ALPHA).getRGB();

View File

@ -1,7 +1,6 @@
package rip.athena.client.gui.hud.pages; package rip.athena.client.gui.clickgui.pages;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import rip.athena.client.Athena; import rip.athena.client.Athena;
import rip.athena.client.config.ConfigEntry; import rip.athena.client.config.ConfigEntry;
@ -11,19 +10,29 @@ import rip.athena.client.gui.framework.Menu;
import rip.athena.client.gui.framework.TextPattern; import rip.athena.client.gui.framework.TextPattern;
import rip.athena.client.gui.framework.components.MenuButton; import rip.athena.client.gui.framework.components.MenuButton;
import rip.athena.client.gui.framework.components.MenuTextField; import rip.athena.client.gui.framework.components.MenuTextField;
import rip.athena.client.gui.hud.IngameMenu; import rip.athena.client.gui.clickgui.IngameMenu;
import rip.athena.client.gui.hud.Page; import rip.athena.client.gui.clickgui.Page;
import rip.athena.client.gui.hud.components.mods.*; import rip.athena.client.gui.clickgui.components.mods.*;
import rip.athena.client.gui.hud.HUDEditor;
import rip.athena.client.modules.Category; import rip.athena.client.modules.Category;
import rip.athena.client.modules.Module; import rip.athena.client.modules.Module;
import rip.athena.client.modules.impl.other.Settings;
import rip.athena.client.modules.impl.render.Crosshair;
import rip.athena.client.utils.input.BindType; import rip.athena.client.utils.input.BindType;
import rip.athena.client.utils.render.AssetUtils; import rip.athena.client.utils.render.AssetUtils;
import java.awt.*; import java.awt.*;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Comparator;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class ModsPage extends Page { public class ModsPage extends Page {
public final int MENU_HEADER_TEXT_COLOR_MOD = new Color(129, 129, 129, IngameMenu.MENU_ALPHA).getRGB(); public final int MENU_HEADER_TEXT_COLOR_MOD = new Color(129, 129, 129, IngameMenu.MENU_ALPHA).getRGB();
@ -37,20 +46,20 @@ public class ModsPage extends Page {
public Module activeModule; public Module activeModule;
private String search; private String search;
//private HUDEditor hudEditor; private HUDEditor hudEditor;
public ModsPage(Minecraft mc, Menu menu, IngameMenu parent) { public ModsPage(Minecraft mc, Menu menu, IngameMenu parent) {
super(mc, menu, parent); super(mc, menu, parent);
//hudEditor = new HUDEditor(parent.getFeature()); hudEditor = new HUDEditor(parent.getFeature());
} }
@Override @Override
public void onInit() { public void onInit() {
for(Category category : Category.values()) { for (Category category : Category.values()) {
String icon = category.getIcon(); String icon = category.getIcon();
if(icon.trim().length() > 0 && !category.isHidden()) { if (icon.trim().length() > 0 && !category.isHidden()) {
MOD_TABS[category.getIndex()] = AssetUtils.getResource(icon); MOD_TABS[category.getIndex()] = AssetUtils.getResource(icon);
} }
} }
@ -62,32 +71,38 @@ public class ModsPage extends Page {
int y = menu.getY() + 59; int y = menu.getY() + 59;
int height = 32; int height = 32;
drawVerticalLine(menu.getX() + 215, y + height - 30, height + 398, 3, new Color(27, 27, 27, 225).getRGB()); drawVerticalLine(menu.getX() + 215, y + height - 30, height + 432, 3, new Color(27, 27, 27, 225).getRGB());
y += 50; y += 50;
for(Category category : Category.values()) { for (Category category : Category.values()) {
String icon = category.getIcon(); String icon = category.getIcon();
if(icon.trim().length() > 0 && !category.isHidden()) { if (icon.trim().length() > 0 && !category.isHidden()) {
drawShadowUp(menu.getX() + 15, y, 190); //drawShadowUp(menu.getX() + 15, y, 190);
drawShadowDown(menu.getX() + 15, y + height, 190); //drawShadowDown(menu.getX() + 15, y + height, 190);
y += height + 2 + 10; y += height + 2 + 10;
} }
} }
y = menu.getY() + menu.getHeight() - height; y = menu.getY() + menu.getHeight() - height;
drawShadowUp(menu.getX() + 15, y - 2, 200); drawShadowUp(menu.getX(), y - 2, 215);
if(modCategory != null) { if (modCategory != null) {
FontManager.baloo17.drawString(activeModule != null ? "SETTINGS | " : modCategory.getText(), menu.getX() + 255, menu.getY() + 80, IngameMenu.MENU_HEADER_TEXT_COLOR); if (Settings.customGuiFont) {
FontManager.baloo17.drawString(activeModule != null ? "SETTINGS | " : modCategory.getText(), menu.getX() + 255, menu.getY() + 80, IngameMenu.MENU_HEADER_TEXT_COLOR);
if(activeModule != null) { } else {
mc.fontRendererObj.drawString(activeModule != null ? "SETTINGS | " : modCategory.getText(), menu.getX() + 255, menu.getY() + 80, IngameMenu.MENU_HEADER_TEXT_COLOR);
}
if (activeModule != null) {
int offset = (int) FontManager.baloo17.getStringWidth("SETTINGS | "); int offset = (int) FontManager.baloo17.getStringWidth("SETTINGS | ");
String text = activeModule.getName().toUpperCase().trim(); String text = activeModule.getName().toUpperCase().trim();
FontManager.baloo17.drawString(text, menu.getX() + 255 + offset, menu.getY() + 80, MENU_HEADER_TEXT_COLOR_MOD); if (Settings.customGuiFont) {
FontManager.baloo17.drawString(text, menu.getX() + 255 + offset, menu.getY() + 80, MENU_HEADER_TEXT_COLOR_MOD);
} else {
mc.fontRendererObj.drawString(text, menu.getX() + 255 + offset, menu.getY() + 80, MENU_HEADER_TEXT_COLOR_MOD);
}
drawShadowUp(menu.getX() + 255, menu.getY() + 110 + 25 + 2, menu.getWidth() - 286); drawShadowUp(menu.getX() + 255, menu.getY() + 110 + 25 + 2, menu.getWidth() - 286);
drawShadowLeft(menu.getX() + 255 + 2, menu.getY() + 110 + 25, menu.getHeight() - 110 - 50 - 5); drawShadowLeft(menu.getX() + 255 + 2, menu.getY() + 110 + 25, menu.getHeight() - 110 - 50 - 5);
drawShadowDown(menu.getX() + 255, menu.getY() + menu.getHeight() - 27 - 5, menu.getWidth() - 286); drawShadowDown(menu.getX() + 255, menu.getY() + menu.getHeight() - 27 - 5, menu.getWidth() - 286);
@ -96,13 +111,13 @@ public class ModsPage extends Page {
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(menu.getX() + 255, menu.getY() + 110 + 25, menu.getWidth() - 255 - 31, menu.getHeight() - 110 - 50 - 5, MENU_BG_COLOR_MOD_BORDER); rip.athena.client.gui.framework.draw.DrawImpl.drawRect(menu.getX() + 255, menu.getY() + 110 + 25, menu.getWidth() - 255 - 31, menu.getHeight() - 110 - 50 - 5, MENU_BG_COLOR_MOD_BORDER);
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(menu.getX() + 255 + 1, menu.getY() + 110 + 25 + 1, menu.getWidth() - 255 - 33, menu.getHeight() - 110 - 52 - 5, MENU_BG_COLOR_MOD); rip.athena.client.gui.framework.draw.DrawImpl.drawRect(menu.getX() + 255 + 1, menu.getY() + 110 + 25 + 1, menu.getWidth() - 255 - 33, menu.getHeight() - 110 - 52 - 5, MENU_BG_COLOR_MOD);
/*if(activeModule instanceof Crosshair) { if (activeModule instanceof Crosshair) {
Crosshair crosshair = (Crosshair) activeModule; Crosshair crosshair = (Crosshair) activeModule;
int w = 86; int w = 86;
int h = 76; int h = 76;
crosshair.drawPicker(menu.getX() + 255 + 25, menu.getY() + 290, w, h, menu.getMouseX(), menu.getMouseY()); crosshair.drawPicker(menu.getX() + 255 + 25, menu.getY() + 290, w, h, menu.getMouseX(), menu.getMouseY());
}*/ }
} }
drawHorizontalLine(menu.getX() + 255, menu.getY() + 110, menu.getWidth() - 255 - 31, 3, IngameMenu.MENU_LINE_COLOR); drawHorizontalLine(menu.getX() + 255, menu.getY() + 110, menu.getWidth() - 255 - 31, 3, IngameMenu.MENU_LINE_COLOR);
@ -114,15 +129,15 @@ public class ModsPage extends Page {
int y = 59 + 50; int y = 59 + 50;
int height = 32; int height = 32;
for(Category category : Category.values()) { for (Category category : Category.values()) {
String icon = category.getIcon(); String icon = category.getIcon();
if(icon.trim().length() > 0 && !category.isHidden()) { if (icon.trim().length() > 0 && !category.isHidden()) {
MenuButton comp = new ModCategoryButton(category, MOD_TABS[category.getIndex()], 0, y, 225, height) { MenuButton comp = new ModCategoryButton(category, MOD_TABS[category.getIndex()], 0, y, 225, height) {
@Override @Override
public void onAction() { public void onAction() {
for(rip.athena.client.gui.framework.MenuComponent component : menu.getComponents()) { for (rip.athena.client.gui.framework.MenuComponent component : menu.getComponents()) {
if(component instanceof ModCategoryButton) { if (component instanceof ModCategoryButton) {
ModCategoryButton button = (ModCategoryButton) component; ModCategoryButton button = (ModCategoryButton) component;
button.setActive(component == this); button.setActive(component == this);
} }
@ -134,7 +149,7 @@ public class ModsPage extends Page {
} }
}; };
if(category == modCategory) { if (category == modCategory) {
comp.setActive(true); comp.setActive(true);
} }
@ -144,7 +159,7 @@ public class ModsPage extends Page {
} }
} }
if(activeModule == null) { if (activeModule == null) {
MenuTextField searchbar = new SearchTextfield(TextPattern.NONE, menu.getWidth() - 31 - 250 - 5, 110 - 38, 250, 30) { MenuTextField searchbar = new SearchTextfield(TextPattern.NONE, menu.getWidth() - 31 - 250 - 5, 110 - 38, 250, 30) {
@Override @Override
public void onAction() { public void onAction() {
@ -218,11 +233,11 @@ public class ModsPage extends Page {
@Override @Override
public void onAction() { public void onAction() {
setActive(false); setActive(false);
//mc.displayGuiScreen(hudEditor); mc.displayGuiScreen(hudEditor);
} }
}); });
if(activeModule == null) { if (activeModule == null) {
initModPage(pane); initModPage(pane);
} else { } else {
pane.setX(255 + 1); pane.setX(255 + 1);
@ -241,18 +256,18 @@ public class ModsPage extends Page {
int sliderWidth = pane.getWidth() - xSpacing * 2; int sliderWidth = pane.getWidth() - xSpacing * 2;
for(ConfigEntry configEntry : activeModule.getEntries()) { for (ConfigEntry configEntry : activeModule.getEntries()) {
final FeatureText label; final FeatureText label;
String key = configEntry.getKey().toUpperCase(); String key = configEntry.getKey().toUpperCase();
if(configEntry.hasDescription()) { if (configEntry.hasDescription()) {
toAdd.add(label = new FeatureText(key, 0, 0)); toAdd.add(label = new FeatureText(key, 0, 0));
} else { } else {
toAdd.add(label = new FeatureText(key, configEntry.getDescription(), 0, 0)); toAdd.add(label = new FeatureText(key, configEntry.getDescription(), 0, 0));
} }
if(configEntry instanceof BooleanEntry) { if (configEntry instanceof BooleanEntry) {
BooleanEntry entry = (BooleanEntry) configEntry; BooleanEntry entry = (BooleanEntry) configEntry;
MenuModCheckbox checkbox = new MenuModCheckbox(0, 0, 15, 15) { MenuModCheckbox checkbox = new MenuModCheckbox(0, 0, 15, 15) {
@ -265,7 +280,7 @@ public class ModsPage extends Page {
checkbox.setChecked((boolean) entry.getValue(activeModule)); checkbox.setChecked((boolean) entry.getValue(activeModule));
toAdd.add(checkbox); toAdd.add(checkbox);
} else if(configEntry instanceof ColorEntry) { } else if (configEntry instanceof ColorEntry) {
ColorEntry entry = (ColorEntry) configEntry; ColorEntry entry = (ColorEntry) configEntry;
toAdd.add(new MenuModColorPicker(0, 0, 15, 15, ((Color) entry.getValue(activeModule)).getRGB()) { toAdd.add(new MenuModColorPicker(0, 0, 15, 15, ((Color) entry.getValue(activeModule)).getRGB()) {
@ -274,18 +289,18 @@ public class ModsPage extends Page {
entry.setValue(activeModule, getColor()); entry.setValue(activeModule, getColor());
} }
}); });
} else if(configEntry instanceof DoubleEntry) { } else if (configEntry instanceof DoubleEntry) {
DoubleEntry entry = (DoubleEntry) configEntry; DoubleEntry entry = (DoubleEntry) configEntry;
FeatureValueText valueText = new FeatureValueText("", 0, 0); FeatureValueText valueText = new FeatureValueText("", 0, 0);
toAdd.add(valueText); toAdd.add(valueText);
MenuModSlider slider = new MenuModSlider((double)entry.getValue(activeModule), entry.getMin(), entry.getMax(), 2, 0, 0, sliderWidth, 15) { MenuModSlider slider = new MenuModSlider((double) entry.getValue(activeModule), entry.getMin(), entry.getMax(), 2, 0, 0, sliderWidth, 15) {
@Override @Override
public void onAction() { public void onAction() {
label.setText((entry.getKey() + " | ").toUpperCase()); label.setText((entry.getKey() + " | ").toUpperCase());
entry.setValue(activeModule, (double)getValue()); entry.setValue(activeModule, (double) getValue());
valueText.setText(getValue() + ""); valueText.setText(getValue() + "");
} }
@ -294,18 +309,18 @@ public class ModsPage extends Page {
slider.onAction(); slider.onAction();
toAdd.add(slider); toAdd.add(slider);
} else if(configEntry instanceof FloatEntry) { } else if (configEntry instanceof FloatEntry) {
FloatEntry entry = (FloatEntry) configEntry; FloatEntry entry = (FloatEntry) configEntry;
FeatureValueText valueText = new FeatureValueText("", 0, 0); FeatureValueText valueText = new FeatureValueText("", 0, 0);
toAdd.add(valueText); toAdd.add(valueText);
MenuModSlider slider = new MenuModSlider((float)entry.getValue(activeModule), entry.getMin(), entry.getMax(), 2, 0, 0, sliderWidth, 15) { MenuModSlider slider = new MenuModSlider((float) entry.getValue(activeModule), entry.getMin(), entry.getMax(), 2, 0, 0, sliderWidth, 15) {
@Override @Override
public void onAction() { public void onAction() {
label.setText((entry.getKey() + " | ").toUpperCase()); label.setText((entry.getKey() + " | ").toUpperCase());
entry.setValue(activeModule, (float)getValue()); entry.setValue(activeModule, (float) getValue());
valueText.setText(getValue() + ""); valueText.setText(getValue() + "");
} }
@ -314,14 +329,14 @@ public class ModsPage extends Page {
slider.onAction(); slider.onAction();
toAdd.add(slider); toAdd.add(slider);
} else if(configEntry instanceof IntEntry) { } else if (configEntry instanceof IntEntry) {
IntEntry entry = (IntEntry) configEntry; IntEntry entry = (IntEntry) configEntry;
FeatureValueText valueText = new FeatureValueText("", 0, 0); FeatureValueText valueText = new FeatureValueText("", 0, 0);
toAdd.add(valueText); toAdd.add(valueText);
if(entry.isKeyBind()) { if (entry.isKeyBind()) {
MenuModKeybind bind = new MenuModKeybind(0, 0, 175, 15) { MenuModKeybind bind = new MenuModKeybind(0, 0, 175, 15) {
@Override @Override
public void onAction() { public void onAction() {
@ -333,7 +348,7 @@ public class ModsPage extends Page {
toAdd.add(bind); toAdd.add(bind);
} else { } else {
MenuModSlider slider = new MenuModSlider((int)entry.getValue(activeModule), entry.getMin(), entry.getMax(), 0, 0, sliderWidth, 15) { MenuModSlider slider = new MenuModSlider((int) entry.getValue(activeModule), entry.getMin(), entry.getMax(), 0, 0, sliderWidth, 15) {
@Override @Override
public void onAction() { public void onAction() {
label.setText((entry.getKey() + " | ").toUpperCase()); label.setText((entry.getKey() + " | ").toUpperCase());
@ -347,7 +362,7 @@ public class ModsPage extends Page {
toAdd.add(slider); toAdd.add(slider);
} }
} else if(configEntry instanceof ListEntry) { } else if (configEntry instanceof ListEntry) {
ListEntry entry = (ListEntry) configEntry; ListEntry entry = (ListEntry) configEntry;
MenuModList list = new MenuModList(entry.getValues(), 0, 0, 15) { MenuModList list = new MenuModList(entry.getValues(), 0, 0, 15) {
@ -360,7 +375,7 @@ public class ModsPage extends Page {
list.setValue((String) configEntry.getValue(activeModule)); list.setValue((String) configEntry.getValue(activeModule));
toAdd.add(list); toAdd.add(list);
} else if(configEntry instanceof StringEntry) { } else if (configEntry instanceof StringEntry) {
StringEntry entry = (StringEntry) configEntry; StringEntry entry = (StringEntry) configEntry;
ModTextbox box = new ModTextbox(TextPattern.NONE, 0, 0, 175, 15) { ModTextbox box = new ModTextbox(TextPattern.NONE, 0, 0, 175, 15) {
@ -384,13 +399,13 @@ public class ModsPage extends Page {
boolean isText = false; boolean isText = false;
rip.athena.client.gui.framework.MenuComponent last = null; rip.athena.client.gui.framework.MenuComponent last = null;
for(rip.athena.client.gui.framework.MenuComponent component : toAdd) { for (rip.athena.client.gui.framework.MenuComponent component : toAdd) {
if(component instanceof FeatureValueText) { if (component instanceof FeatureValueText) {
if(last != null) { if (last != null) {
component.setX(xPos); component.setX(xPos);
component.setY(yPos); component.setY(yPos);
} }
} else if(component instanceof FeatureText) { } else if (component instanceof FeatureText) {
component.setX(xPos); component.setX(xPos);
component.setY(yPos); component.setY(yPos);
@ -400,14 +415,14 @@ public class ModsPage extends Page {
} else { } else {
xPos = defaultX; xPos = defaultX;
if(isText) { if (isText) {
if(component instanceof MenuModSlider) { if (component instanceof MenuModSlider) {
yPos += ySpacing; yPos += ySpacing;
component.setX(xPos); component.setX(xPos);
component.setY(yPos); component.setY(yPos);
} else { } else {
if(component instanceof MenuModList) { if (component instanceof MenuModList) {
component.setX(pane.getWidth() - component.getWidth() - xSpacing * 3 + 12); component.setX(pane.getWidth() - component.getWidth() - xSpacing * 3 + 12);
} else { } else {
component.setX(pane.getWidth() - component.getWidth() - xSpacing); component.setX(pane.getWidth() - component.getWidth() - xSpacing);
@ -449,8 +464,8 @@ public class ModsPage extends Page {
} }
private void updateStates() { private void updateStates() {
for(rip.athena.client.gui.framework.MenuComponent component : menu.getComponents()) { for (rip.athena.client.gui.framework.MenuComponent component : menu.getComponents()) {
if(component instanceof ModsButton) { if (component instanceof ModsButton) {
ModsButton button = (ModsButton) component; ModsButton button = (ModsButton) component;
button.setActive(activeModule.isToggled()); button.setActive(activeModule.isToggled());
@ -462,8 +477,8 @@ public class ModsPage extends Page {
} }
private void initModPage() { private void initModPage() {
for(rip.athena.client.gui.framework.MenuComponent component : menu.getComponents()) { for (rip.athena.client.gui.framework.MenuComponent component : menu.getComponents()) {
if(component instanceof ModScrollPane) { if (component instanceof ModScrollPane) {
initModPage((ModScrollPane) component); initModPage((ModScrollPane) component);
return; return;
} }
@ -473,8 +488,8 @@ public class ModsPage extends Page {
private void initModPage(ModScrollPane pane) { private void initModPage(ModScrollPane pane) {
pane.getComponents().clear(); pane.getComponents().clear();
for(rip.athena.client.gui.framework.MenuComponent c : menu.getComponents()) { for (rip.athena.client.gui.framework.MenuComponent c : menu.getComponents()) {
if(c instanceof ModsButton || c instanceof MenuModList) { if (c instanceof ModsButton || c instanceof MenuModList) {
menu.getComponents().remove(c); menu.getComponents().remove(c);
} }
} }
@ -485,10 +500,15 @@ public class ModsPage extends Page {
int height = 150; int height = 150;
int spacing = 16; int spacing = 16;
for(Module module : Athena.INSTANCE.getModuleManager().getModules().stream().filter(entry -> List<Module> modules = Athena.INSTANCE.getModuleManager().getModules().stream()
((search == null || search.isEmpty()) || entry.getName().toLowerCase().indexOf(search.toLowerCase()) >= 0) && .filter(entry ->
(entry.getCategory() == modCategory || modCategory == Category.ALL_MODS) && !entry.getCategory().isHidden()).collect(Collectors.toList())) { ((search == null || search.isEmpty()) || entry.getName().toLowerCase().contains(search.toLowerCase())) &&
(entry.getCategory() == modCategory || modCategory == Category.ALL_MODS) && !entry.getCategory().isHidden())
.collect(Collectors.toList());
modules.sort(Comparator.comparing(module -> module.getName().toLowerCase()));
for (Module module : modules) {
pane.addComponent(new ModuleBox(module, x, y, width, height) { pane.addComponent(new ModuleBox(module, x, y, width, height) {
@Override @Override
public void onOpenSettings() { public void onOpenSettings() {
@ -499,7 +519,7 @@ public class ModsPage extends Page {
x += width + spacing; x += width + spacing;
if(x + width >= pane.getWidth()) { if (x + width >= pane.getWidth()) {
x = 0; x = 0;
y += height + spacing; y += height + spacing;
} }

View File

@ -1,28 +1,23 @@
package rip.athena.client.gui.hud.pages; package rip.athena.client.gui.clickgui.pages;
import net.minecraft.client.renderer.GlStateManager;
import rip.athena.client.Athena;
import rip.athena.client.font.FontManager; import rip.athena.client.font.FontManager;
import rip.athena.client.gui.framework.Menu; import rip.athena.client.gui.framework.Menu;
import rip.athena.client.gui.framework.TextPattern; import rip.athena.client.gui.framework.TextPattern;
import rip.athena.client.gui.hud.IngameMenu; import rip.athena.client.gui.clickgui.IngameMenu;
import rip.athena.client.gui.hud.Page; import rip.athena.client.gui.clickgui.Page;
import rip.athena.client.gui.hud.components.macros.MacroButton; import rip.athena.client.gui.clickgui.components.macros.MacroButton;
import rip.athena.client.gui.hud.components.macros.MacroTextfield; import rip.athena.client.gui.clickgui.components.macros.MacroTextfield;
import rip.athena.client.gui.hud.components.macros.SimpleTextButton; import rip.athena.client.gui.clickgui.components.mods.ModCategoryButton;
import rip.athena.client.gui.hud.components.mods.ModCategoryButton; import rip.athena.client.gui.clickgui.components.mods.ModScrollPane;
import rip.athena.client.gui.hud.components.mods.ModScrollPane; import rip.athena.client.gui.clickgui.components.profiles.ProfilesBlueButton;
import rip.athena.client.gui.hud.components.profiles.ProfilesBase;
import rip.athena.client.gui.hud.components.profiles.ProfilesBlueButton;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen; import rip.athena.client.modules.impl.other.Settings;
import org.apache.commons.lang3.RandomStringUtils;
import org.json.JSONException;
import java.awt.*; /**
import java.io.IOException; * @author Athena Development
import java.net.URLEncoder; * @project Athena-Client
import java.util.NoSuchElementException; * @date 6/2/2023
*/
public class ProfilesPage extends Page { public class ProfilesPage extends Page {
private MacroTextfield nameNew; private MacroTextfield nameNew;
@ -75,7 +70,7 @@ public class ProfilesPage extends Page {
} }
/*try { /*try {
WebRequest request = new WebRequest(Falcun.PROFILES_URL + "/uploads/" + URLEncoder.encode(nameAdd.getText(), "UTF-8") + "/config.json", "GET", ContentType.FORM, false); WebRequest request = new WebRequest(Athena.PROFILES_URL + "/uploads/" + URLEncoder.encode(nameAdd.getText(), "UTF-8") + "/config.json", "GET", ContentType.FORM, false);
WebRequestResult result = request.connect(); WebRequestResult result = request.connect();
if(result.getResponse() == 200) { if(result.getResponse() == 200) {
@ -149,7 +144,7 @@ public class ProfilesPage extends Page {
try { try {
String code = URLEncoder.encode(RandomStringUtils.randomAlphabetic(12).toLowerCase(), "UTF-8"); String code = URLEncoder.encode(RandomStringUtils.randomAlphabetic(12).toLowerCase(), "UTF-8");
WebRequest request = new WebRequest(Falcun.PROFILES_URL + "/upload.php?id=" + code, "POST", ContentType.MULTIPART_FORM, false); WebRequest request = new WebRequest(Athena.PROFILES_URL + "/upload.php?id=" + code, "POST", ContentType.MULTIPART_FORM, false);
String boundary = "WebKitFormBoundaryYDPG5KWy5y4yolEf"; String boundary = "WebKitFormBoundaryYDPG5KWy5y4yolEf";
@ -216,32 +211,53 @@ public class ProfilesPage extends Page {
int y = menu.getY() + 59; int y = menu.getY() + 59;
int height = 32; int height = 32;
FontManager.baloo17.drawString("PROFILES", menu.getX() + 31, menu.getY() + 80, IngameMenu.MENU_HEADER_TEXT_COLOR); if(Settings.customGuiFont) {
FontManager.baloo17.drawString("PROFILES", menu.getX() + 31, menu.getY() + 80, IngameMenu.MENU_HEADER_TEXT_COLOR);
} else {
mc.fontRendererObj.drawString("PROFILES", menu.getX() + 31, menu.getY() + 80, IngameMenu.MENU_HEADER_TEXT_COLOR);
}
drawHorizontalLine(menu.getX() + 31, menu.getY() + 110, menu.getWidth() - width - 31 * 2, 3, IngameMenu.MENU_LINE_COLOR); drawHorizontalLine(menu.getX() + 31, menu.getY() + 110, menu.getWidth() - width - 31 * 2, 3, IngameMenu.MENU_LINE_COLOR);
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(menu.getX() + menu.getWidth() - width, menu.getY() + 58, width, menu.getHeight() - 58, MacrosPage.MENU_SIDE_BG_COLOR); rip.athena.client.gui.framework.draw.DrawImpl.drawRect(menu.getX() + menu.getWidth() - width, menu.getY() + 58, width, menu.getHeight() - 58, MacrosPage.MENU_SIDE_BG_COLOR);
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(menu.getX() + menu.getWidth() - width, menu.getY() + 58, width, height + 1, ModCategoryButton.MAIN_COLOR); rip.athena.client.gui.framework.draw.DrawImpl.drawRect(menu.getX() + menu.getWidth() - width, menu.getY() + 58, width, height + 1, ModCategoryButton.MAIN_COLOR);
drawShadowDown(menu.getX() + menu.getWidth() - width, y + height, width); drawShadowDown(menu.getX() + menu.getWidth() - width, y + height, width);
FontManager.baloo17.drawString("CREATE NEW PROFILE", menu.getX() + menu.getWidth() - (float) width / 2 - FontManager.baloo17.getStringWidth("CREATE NEW PROFILE") / 2, y + (float) height / 2 - FontManager.baloo17.getHeight("CREATE NEW PROFILE") / 2, IngameMenu.MENU_HEADER_TEXT_COLOR);
if(Settings.customGuiFont) {
FontManager.baloo17.drawString("CREATE NEW PROFILE", menu.getX() + menu.getWidth() - (float) width / 2 - FontManager.baloo17.getStringWidth("CREATE NEW PROFILE") / 2, y + (float) height / 2 - FontManager.baloo17.getHeight("CREATE NEW PROFILE") / 2, IngameMenu.MENU_HEADER_TEXT_COLOR);
} else {
mc.fontRendererObj.drawString("CREATE NEW PROFILE", (int) (menu.getX() + menu.getWidth() - (float) width / 2 - mc.fontRendererObj.getStringWidth("CREATE NEW PROFILE") / 2), (int) (y + (float) height / 2 - mc.fontRendererObj.FONT_HEIGHT / 2), IngameMenu.MENU_HEADER_TEXT_COLOR);
}
drawShadowDown(menu.getX() + menu.getWidth() - width, y - 1, width); drawShadowDown(menu.getX() + menu.getWidth() - width, y - 1, width);
y += 60; y += 60;
FontManager.baloo17.drawString("ENTER NAME", x, y, IngameMenu.MENU_HEADER_TEXT_COLOR); if(Settings.customGuiFont) {
FontManager.baloo17.drawString("ENTER NAME", x, y, IngameMenu.MENU_HEADER_TEXT_COLOR);
} else {
mc.fontRendererObj.drawString("ENTER NAME", x, y, IngameMenu.MENU_HEADER_TEXT_COLOR);
}
y += 120; y += 120;
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(menu.getX() + menu.getWidth() - width, y, width, height + 1, ModCategoryButton.MAIN_COLOR); rip.athena.client.gui.framework.draw.DrawImpl.drawRect(menu.getX() + menu.getWidth() - width, y, width, height + 1, ModCategoryButton.MAIN_COLOR);
drawShadowDown(menu.getX() + menu.getWidth() - width, y + height, width); drawShadowDown(menu.getX() + menu.getWidth() - width, y + height, width);
drawShadowUp(menu.getX() + menu.getWidth() - width, y, width); drawShadowUp(menu.getX() + menu.getWidth() - width, y, width);
FontManager.baloo17.drawString("DOWNLOAD PROFILE", menu.getX() + menu.getWidth() - (float) width / 2 - FontManager.baloo17.getStringWidth("DOWNLOAD PROFILE") / 2, y + (float) height / 2 - FontManager.baloo17.getHeight("DOWNLOAD PROFILE") / 2, IngameMenu.MENU_HEADER_TEXT_COLOR);
if(Settings.customGuiFont) {
FontManager.baloo17.drawString("DOWNLOAD PROFILE", menu.getX() + menu.getWidth() - (float) width / 2 - FontManager.baloo17.getStringWidth("DOWNLOAD PROFILE") / 2, y + (float) height / 2 - FontManager.baloo17.getHeight("DOWNLOAD PROFILE") / 2, IngameMenu.MENU_HEADER_TEXT_COLOR);
} else {
mc.fontRendererObj.drawString("DOWNLOAD PROFILE", (int) (menu.getX() + menu.getWidth() - (float) width / 2 - mc.fontRendererObj.getStringWidth("DOWNLOAD PROFILE") / 2), (int) (y + (float) height / 2 - mc.fontRendererObj.FONT_HEIGHT / 2), IngameMenu.MENU_HEADER_TEXT_COLOR);
}
y += 50; y += 50;
FontManager.baloo17.drawString("PROFILE CODE", x, y, IngameMenu.MENU_HEADER_TEXT_COLOR); if(Settings.customGuiFont) {
FontManager.baloo17.drawString("PROFILE CODE", x, y, IngameMenu.MENU_HEADER_TEXT_COLOR);
} else {
mc.fontRendererObj.drawString("PROFILE CODE", x, y, IngameMenu.MENU_HEADER_TEXT_COLOR);
}
} }
@Override @Override

View File

@ -1,4 +1,4 @@
package rip.athena.client.gui.hud.pages; package rip.athena.client.gui.clickgui.pages;
import rip.athena.client.Athena; import rip.athena.client.Athena;
import rip.athena.client.config.ConfigEntry; import rip.athena.client.config.ConfigEntry;
@ -6,7 +6,7 @@ import rip.athena.client.config.types.*;
import rip.athena.client.gui.framework.Menu; import rip.athena.client.gui.framework.Menu;
import rip.athena.client.gui.framework.MenuComponent; import rip.athena.client.gui.framework.MenuComponent;
import rip.athena.client.gui.framework.TextPattern; import rip.athena.client.gui.framework.TextPattern;
import rip.athena.client.gui.hud.IngameMenu; import rip.athena.client.gui.clickgui.IngameMenu;
import net.minecraft.block.*; import net.minecraft.block.*;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityOtherPlayerMP; import net.minecraft.client.entity.EntityOtherPlayerMP;
@ -22,23 +22,30 @@ import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.tileentity.*; import net.minecraft.tileentity.*;
import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import rip.athena.client.gui.hud.Page; import rip.athena.client.gui.clickgui.Page;
import rip.athena.client.gui.hud.components.cosmetics.CosmeticGenericButton; import rip.athena.client.gui.clickgui.components.cosmetics.CosmeticGenericButton;
import rip.athena.client.gui.hud.components.fps.*; import rip.athena.client.gui.clickgui.components.fps.*;
import rip.athena.client.gui.hud.components.macros.FlipButton; import rip.athena.client.gui.clickgui.components.macros.FlipButton;
import rip.athena.client.gui.hud.components.mods.*; import rip.athena.client.gui.clickgui.components.mods.*;
import rip.athena.client.gui.hud.pages.fps.BlacklistModule; import rip.athena.client.gui.clickgui.pages.fps.BlacklistModule;
import rip.athena.client.gui.hud.pages.fps.BlacklistType; import rip.athena.client.gui.clickgui.pages.fps.BlacklistType;
import rip.athena.client.gui.hud.pages.fps.FPSSubTab; import rip.athena.client.gui.clickgui.pages.fps.FPSSubTab;
import rip.athena.client.modules.Module; import rip.athena.client.modules.Module;
import rip.athena.client.modules.impl.fpssettings.OptimizerMod; import rip.athena.client.modules.impl.fpssettings.OptimizerMod;
import rip.athena.client.modules.impl.other.Settings;
import rip.athena.client.utils.render.AssetUtils; import rip.athena.client.utils.render.AssetUtils;
import java.awt.*; import java.awt.*;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
public class FPSPage extends Page { /**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class SettingsPage extends Page {
private static ResourceLocation OF_LOW; private static ResourceLocation OF_LOW;
private static ResourceLocation OF_MEDMED; private static ResourceLocation OF_MEDMED;
private static ResourceLocation OF_HIGH; private static ResourceLocation OF_HIGH;
@ -175,7 +182,7 @@ public class FPSPage extends Page {
registerEntity("Player (Other)", EntityOtherPlayerMP.class); registerEntity("Player (Other)", EntityOtherPlayerMP.class);
} }
public FPSPage(Minecraft mc, Menu menu, IngameMenu parent) { public SettingsPage(Minecraft mc, Menu menu, IngameMenu parent) {
super(mc, menu, parent); super(mc, menu, parent);
} }
@ -426,7 +433,7 @@ public class FPSPage extends Page {
} }
}); });
} else if(subTab == FPSSubTab.SETTINGS) { } else if(subTab == FPSSubTab.SETTINGS) {
initSettings(Athena.INSTANCE.getModuleManager().get(OptimizerMod.class)); initSettings(Athena.INSTANCE.getModuleManager().get(Settings.class));
} }
} }
@ -539,7 +546,6 @@ public class FPSPage extends Page {
Minecraft.getMinecraft().gameSettings.ofVoidParticles = false; Minecraft.getMinecraft().gameSettings.ofVoidParticles = false;
Minecraft.getMinecraft().gameSettings.ofWaterParticles = false; Minecraft.getMinecraft().gameSettings.ofWaterParticles = false;
Minecraft.getMinecraft().gameSettings.ofPortalParticles = false; Minecraft.getMinecraft().gameSettings.ofPortalParticles = false;
Minecraft.getMinecraft().gameSettings.ofPortalParticles = false;
Minecraft.getMinecraft().gameSettings.ofFireworkParticles = false; Minecraft.getMinecraft().gameSettings.ofFireworkParticles = false;
Minecraft.getMinecraft().gameSettings.ofDrippingWaterLava = false; Minecraft.getMinecraft().gameSettings.ofDrippingWaterLava = false;
Minecraft.getMinecraft().gameSettings.ofAnimatedTerrain = false; Minecraft.getMinecraft().gameSettings.ofAnimatedTerrain = false;
@ -608,7 +614,6 @@ public class FPSPage extends Page {
Minecraft.getMinecraft().gameSettings.ofVoidParticles = false; Minecraft.getMinecraft().gameSettings.ofVoidParticles = false;
Minecraft.getMinecraft().gameSettings.ofWaterParticles = false; Minecraft.getMinecraft().gameSettings.ofWaterParticles = false;
Minecraft.getMinecraft().gameSettings.ofPortalParticles = false; Minecraft.getMinecraft().gameSettings.ofPortalParticles = false;
Minecraft.getMinecraft().gameSettings.ofPortalParticles = false;
Minecraft.getMinecraft().gameSettings.ofFireworkParticles = false; Minecraft.getMinecraft().gameSettings.ofFireworkParticles = false;
Minecraft.getMinecraft().gameSettings.ofDrippingWaterLava = false; Minecraft.getMinecraft().gameSettings.ofDrippingWaterLava = false;
Minecraft.getMinecraft().gameSettings.ofAnimatedTerrain = true; Minecraft.getMinecraft().gameSettings.ofAnimatedTerrain = true;

View File

@ -1,19 +1,25 @@
package rip.athena.client.gui.hud.pages; package rip.athena.client.gui.clickgui.pages;
import rip.athena.client.gui.framework.Menu; import rip.athena.client.gui.framework.Menu;
import rip.athena.client.gui.framework.TextPattern; import rip.athena.client.gui.framework.TextPattern;
import rip.athena.client.gui.hud.IngameMenu; import rip.athena.client.gui.clickgui.IngameMenu;
import rip.athena.client.gui.hud.Page; import rip.athena.client.gui.clickgui.Page;
import rip.athena.client.gui.hud.components.macros.*; import rip.athena.client.gui.clickgui.components.macros.*;
import rip.athena.client.gui.hud.components.mods.MenuModColorPicker; import rip.athena.client.gui.clickgui.components.mods.MenuModColorPicker;
import rip.athena.client.gui.hud.components.mods.ModCategoryButton; import rip.athena.client.gui.clickgui.components.mods.ModCategoryButton;
import rip.athena.client.gui.hud.components.mods.ModScrollPane; import rip.athena.client.gui.clickgui.components.mods.ModScrollPane;
import rip.athena.client.gui.hud.components.waypoints.WaypointTextBarrier; import rip.athena.client.gui.clickgui.components.waypoints.WaypointTextBarrier;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import rip.athena.client.utils.StringUtils; import rip.athena.client.utils.StringUtils;
import java.awt.*; import java.awt.*;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class WaypointsPage extends Page { public class WaypointsPage extends Page {
private MacroTextfield name; private MacroTextfield name;
private MacroTextfield description; private MacroTextfield description;

View File

@ -1,4 +1,10 @@
package rip.athena.client.gui.hud.pages.cosmetics; package rip.athena.client.gui.clickgui.pages.cosmetics;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public enum BandanaSize { public enum BandanaSize {
SMALL("SMALL"), MEDIUM("MEDIUM"), LARGE("LARGE"); SMALL("SMALL"), MEDIUM("MEDIUM"), LARGE("LARGE");

View File

@ -1,4 +1,10 @@
package rip.athena.client.gui.hud.pages.cosmetics; package rip.athena.client.gui.clickgui.pages.cosmetics;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public enum CapeType { public enum CapeType {
NORMAL("NORMAL"), BEND("BEND"), SHOULDERS("SHOULDERS"), BEND_AND_SHOULDERS("BEND & SHOULDERS"); NORMAL("NORMAL"), BEND("BEND"), SHOULDERS("SHOULDERS"), BEND_AND_SHOULDERS("BEND & SHOULDERS");

View File

@ -1,4 +1,10 @@
package rip.athena.client.gui.hud.pages.cosmetics; package rip.athena.client.gui.clickgui.pages.cosmetics;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public enum CosmeticType { public enum CosmeticType {
CAPES("CAPES"), BANDANAS("BANDANAS"), EMOTES("EMOTES"), FLAGS("FLAGS"); CAPES("CAPES"), BANDANAS("BANDANAS"), EMOTES("EMOTES"), FLAGS("FLAGS");

View File

@ -1,11 +1,17 @@
package rip.athena.client.gui.hud.pages.fps; package rip.athena.client.gui.clickgui.pages.fps;
import rip.athena.client.gui.hud.pages.FPSPage; import rip.athena.client.gui.clickgui.pages.SettingsPage;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.EnumParticleTypes;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class BlacklistModule { public class BlacklistModule {
private String name; private String name;
private BlacklistType type; private BlacklistType type;
@ -20,15 +26,15 @@ public class BlacklistModule {
switch(type) { switch(type) {
case BLOCK: case BLOCK:
this.enabled = FPSPage.BLOCKS.contains(clazz); this.enabled = SettingsPage.BLOCKS.contains(clazz);
break; break;
case ENTITY: case ENTITY:
this.enabled = FPSPage.ENTITIES.contains(clazz); this.enabled = SettingsPage.ENTITIES.contains(clazz);
break; break;
case TILE_ENTITY: case TILE_ENTITY:
this.enabled = FPSPage.TILE_ENTITIES.contains(clazz); this.enabled = SettingsPage.TILE_ENTITIES.contains(clazz);
break; break;
default: default:
@ -40,7 +46,7 @@ public class BlacklistModule {
this.name = name; this.name = name;
this.type = BlacklistType.PARTICLE; this.type = BlacklistType.PARTICLE;
this.particle = particle; this.particle = particle;
this.enabled = FPSPage.PARTICLES.contains(particle); this.enabled = SettingsPage.PARTICLES.contains(particle);
} }
public String getName() { public String getName() {
@ -72,11 +78,11 @@ public class BlacklistModule {
Class<Block> block = (Class<Block>) clazz; Class<Block> block = (Class<Block>) clazz;
if(enabled) { if(enabled) {
if(!FPSPage.BLOCKS.contains(block)) { if(!SettingsPage.BLOCKS.contains(block)) {
FPSPage.BLOCKS.add(block); SettingsPage.BLOCKS.add(block);
} }
} else if(FPSPage.BLOCKS.contains(block)) { } else if(SettingsPage.BLOCKS.contains(block)) {
FPSPage.BLOCKS.remove(block); SettingsPage.BLOCKS.remove(block);
} }
} }
@ -87,11 +93,11 @@ public class BlacklistModule {
Class<Entity> entity = (Class<Entity>) clazz; Class<Entity> entity = (Class<Entity>) clazz;
if(enabled) { if(enabled) {
if(!FPSPage.ENTITIES.contains(entity)) { if(!SettingsPage.ENTITIES.contains(entity)) {
FPSPage.ENTITIES.add(entity); SettingsPage.ENTITIES.add(entity);
} }
} else if(FPSPage.ENTITIES.contains(entity)) { } else if(SettingsPage.ENTITIES.contains(entity)) {
FPSPage.ENTITIES.remove(entity); SettingsPage.ENTITIES.remove(entity);
} }
} }
break; break;
@ -101,11 +107,11 @@ public class BlacklistModule {
Class<TileEntity> tileEntity = (Class<TileEntity>) clazz; Class<TileEntity> tileEntity = (Class<TileEntity>) clazz;
if(enabled) { if(enabled) {
if(!FPSPage.TILE_ENTITIES.contains(tileEntity)) { if(!SettingsPage.TILE_ENTITIES.contains(tileEntity)) {
FPSPage.TILE_ENTITIES.add(tileEntity); SettingsPage.TILE_ENTITIES.add(tileEntity);
} }
} else if(FPSPage.TILE_ENTITIES.contains(tileEntity)) { } else if(SettingsPage.TILE_ENTITIES.contains(tileEntity)) {
FPSPage.TILE_ENTITIES.remove(tileEntity); SettingsPage.TILE_ENTITIES.remove(tileEntity);
} }
} }
break; break;
@ -113,11 +119,11 @@ public class BlacklistModule {
case PARTICLE: case PARTICLE:
if(particle != null) { if(particle != null) {
if(enabled) { if(enabled) {
if(!FPSPage.PARTICLES.contains(particle)) { if(!SettingsPage.PARTICLES.contains(particle)) {
FPSPage.PARTICLES.add(particle); SettingsPage.PARTICLES.add(particle);
} }
} else if(FPSPage.PARTICLES.contains(particle)) { } else if(SettingsPage.PARTICLES.contains(particle)) {
FPSPage.PARTICLES.remove(particle); SettingsPage.PARTICLES.remove(particle);
} }
} }
break; break;

View File

@ -0,0 +1,11 @@
package rip.athena.client.gui.clickgui.pages.fps;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public enum BlacklistType {
ENTITY, TILE_ENTITY, BLOCK, PARTICLE;
}

View File

@ -0,0 +1,11 @@
package rip.athena.client.gui.clickgui.pages.fps;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public enum FPSSubTab {
FPS, OPTIFINE, SETTINGS;
}

Some files were not shown because too many files have changed in this diff Show More