added notifications and online configs

This commit is contained in:
The Biggest skiddd 2023-06-06 22:18:48 +02:00
parent 1df6ef8e5a
commit 648d9406d6
260 changed files with 5490 additions and 430 deletions

View File

@ -63,6 +63,10 @@ public abstract class Render<T extends Entity>
*/ */
public void doRender(T entity, double x, double y, double z, float entityYaw, float partialTicks) public void doRender(T entity, double x, double y, double z, float entityYaw, float partialTicks)
{ {
if(entity.dontRenderNameTag) {
return;
}
this.renderName(entity, x, y, z); this.renderName(entity, x, y, z);
} }

View File

@ -235,6 +235,7 @@ public abstract class Entity implements ICommandSender
private final CommandResultStats cmdResultStats; private final CommandResultStats cmdResultStats;
private net.minecraftforge.common.capabilities.CapabilityDispatcher capabilities; private net.minecraftforge.common.capabilities.CapabilityDispatcher capabilities;
public boolean dontRenderNameTag;
public boolean isMobSpawner; public boolean isMobSpawner;
public int getEntityId() public int getEntityId()

View File

@ -2,21 +2,31 @@ package rip.athena.client;
import lombok.Getter; import lombok.Getter;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import org.json.JSONException;
import org.lwjgl.Sys; import org.lwjgl.Sys;
import org.lwjgl.opengl.Display; import org.lwjgl.opengl.Display;
import rip.athena.client.config.save.ConfigManager;
import rip.athena.client.events.EventBus; import rip.athena.client.events.EventBus;
import rip.athena.client.events.SubscribeEvent; import rip.athena.client.events.SubscribeEvent;
import rip.athena.client.events.types.client.ClientTickEvent; import rip.athena.client.events.types.client.ClientTickEvent;
import rip.athena.client.gui.hud.HUDManager; import rip.athena.client.gui.hud.HUDManager;
import rip.athena.client.gui.notifications.NotificationManager;
import rip.athena.client.macros.MacroManager; import rip.athena.client.macros.MacroManager;
import rip.athena.client.modules.ModuleManager; import rip.athena.client.modules.ModuleManager;
import rip.athena.client.requests.ContentType;
import rip.athena.client.requests.WebRequest;
import rip.athena.client.requests.WebRequestResult;
import rip.athena.client.socket.SocketClient; import rip.athena.client.socket.SocketClient;
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 javax.swing.*; import javax.swing.*;
import java.awt.*;
import java.io.File; import java.io.File;
import java.io.IOException;
import java.net.URLEncoder;
import java.nio.file.Paths; import java.nio.file.Paths;
import java.util.NoSuchElementException;
/** /**
* The Athena class represents the main class of the Athena Client. * The Athena class represents the main class of the Athena Client.
@ -35,7 +45,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(); public static final File MAIN_DIR = Paths.get(Minecraft.getMinecraft().mcDataDir.getAbsolutePath(), "settings").toFile();
public static final File CONFIGS_DIR = Paths.get(MAIN_DIR.getAbsolutePath(), "configs").toFile();
private final PrefixedLogger log = new PrefixedLogger("Athena"); private final PrefixedLogger log = new PrefixedLogger("Athena");
@ -43,6 +54,8 @@ public class Athena {
private final String clientVersion = "1.0.0"; private final String clientVersion = "1.0.0";
private final String clientBuild = "230601"; private final String clientBuild = "230601";
private NotificationManager notificationManager;
private ConfigManager configManager;
private ModuleManager moduleManager; private ModuleManager moduleManager;
private MacroManager macroManager; private MacroManager macroManager;
private HUDManager hudManager; private HUDManager hudManager;
@ -60,17 +73,24 @@ public class Athena {
if(!MAIN_DIR.exists()) { if(!MAIN_DIR.exists()) {
MAIN_DIR.mkdir(); MAIN_DIR.mkdir();
} }
if(SocketClient.isClientRunning()) { if(SocketClient.isClientRunning()) {
JOptionPane.showMessageDialog(null, "If the client is currently running, please close it before proceeding. \nOtherwise, delete the 'client.lock' file in the '.minecraft/Athena' directory."); JOptionPane.showMessageDialog(null, "If the client is currently running, please close it before proceeding. \nOtherwise, delete the 'client.lock' file in the '.minecraft/Athena' directory.");
System.exit(0); System.exit(0);
} }
this.configManager = new ConfigManager(CONFIGS_DIR);
this.moduleManager = new ModuleManager(); this.moduleManager = new ModuleManager();
this.macroManager = new MacroManager(); this.macroManager = new MacroManager();
this.hudManager = new HUDManager(); this.hudManager = new HUDManager();
this.eventBus = new EventBus(); this.eventBus = new EventBus();
this.notificationManager = new NotificationManager();
registerEvents(); registerEvents();
configManager.postInit();
} }
/** /**

View File

@ -4,6 +4,11 @@ import java.lang.reflect.Field;
import rip.athena.client.Athena; import rip.athena.client.Athena;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/6/2023
*/
public abstract class ConfigEntry implements IConfigEntry { public abstract class ConfigEntry implements IConfigEntry {
private Field field; private Field field;
private String key; private String key;

View File

@ -7,6 +7,11 @@ import java.lang.annotation.Target;
import org.lwjgl.input.Keyboard; import org.lwjgl.input.Keyboard;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/6/2023
*/
public class ConfigValue { public class ConfigValue {
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD) @Target(ElementType.FIELD)

View File

@ -2,6 +2,11 @@ package rip.athena.client.config;
import org.json.JSONObject; import org.json.JSONObject;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/6/2023
*/
public interface IConfigEntry { public interface IConfigEntry {
Class<?> getType(); Class<?> getType();
void appendToConfig(String key, Object value, JSONObject config); void appendToConfig(String key, Object value, JSONObject config);

View File

@ -0,0 +1,80 @@
package rip.athena.client.config.cloud;
import net.minecraft.client.gui.GuiScreen;
import org.apache.commons.lang3.RandomStringUtils;
import org.json.JSONException;
import rip.athena.client.Athena;
import java.awt.*;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.net.URLEncoder;
import java.net.URL;
import java.util.NoSuchElementException;
import java.net.HttpURLConnection;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/6/2023
*/
public class ProfileHandler {
private static final String UPLOAD_URL = "https://athena.rip/api/v1/profiles/upload";
public void uploadProfileConfig(String configFilePath) {
try {
String code = URLEncoder.encode(RandomStringUtils.randomAlphabetic(12).toLowerCase(), "UTF-8");
String uploadUrl = UPLOAD_URL + "?id=" + code;
URL url = new URL(uploadUrl);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("POST");
connection.setDoOutput(true);
String boundary = "WebKitFormBoundaryYDPG5KWy5y4yolEf";
String formData = "------" + boundary + "\r\n" +
"Content-Disposition: form-data; name=\"fileToUpload\"; filename=\"config.json\"\r\n" +
"Content-Type: application/json\r\n" +
"\r\n" +
readFile(configFilePath) +
"\r\n" +
"------" + boundary + "\r\n" +
"Content-Disposition: form-data; name=\"submit\"\r\n" +
"\r\n" +
"Upload Image\r\n" +
"------" + boundary + "--\r\n";
connection.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + boundary);
connection.getOutputStream().write(formData.getBytes());
int responseCode = connection.getResponseCode();
if (responseCode == 200) {
//Athena.INSTANCE.notificationManager.showNotification("Config uploaded, config code: " + code + ", copied to clipboard.", Color.RED);
} else {
//Athena.INSTANCE.notificationManager.showNotification("Config failed to upload.", Color.RED);
}
GuiScreen.setClipboardString(code);
} catch (JSONException | NoSuchElementException | IOException e) {
//Athena.INSTANCE.log.error("Failed to upload config.", e);
}
}
private String readFile(String filePath) throws IOException {
StringBuilder contentBuilder = new StringBuilder();
try (BufferedReader reader = new BufferedReader(new FileReader(filePath))) {
String line;
while ((line = reader.readLine()) != null) {
contentBuilder.append(line).append("\n");
}
}
return contentBuilder.toString();
}
}

View File

@ -0,0 +1,468 @@
package rip.athena.client.config.save;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumParticleTypes;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import rip.athena.client.Athena;
import rip.athena.client.config.ConfigEntry;
import rip.athena.client.events.types.client.ConfigChangeEvent;
import rip.athena.client.gui.clickgui.pages.SettingsPage;
import rip.athena.client.gui.hud.HUDElement;
import rip.athena.client.macros.Macro;
import rip.athena.client.modules.Module;
import rip.athena.client.modules.impl.render.Crosshair;
import rip.athena.client.utils.StringUtils;
import rip.athena.client.utils.file.FileHandler;
import rip.athena.client.utils.input.BindType;
import java.awt.*;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/6/2023
*/
public class Config {
private ConfigManager parent;
private FileHandler file;
private String name;
public Config(ConfigManager parent, String name, File file) {
this.parent = parent;
this.name = name;
this.file = new FileHandler(file);
try {
this.file.init();
if(this.file.isFresh()) {
save();
}
} catch (IOException e) {
Athena.INSTANCE.getLog().error("Failed to initiate config " + name + "." + e);
}
}
public void load() {
String content = "";
try {
content = file.getContent(false);
} catch (IOException e) {
Athena.INSTANCE.getLog().error("Failed to load config " + name + " from file." + e);
}
load(content);
}
public void load(String content) {
parent.updateLast(this);
try {
JSONObject obj = new JSONObject(content);
for(Module mod : Athena.INSTANCE.getModuleManager().getModules()) {
mod.setEnabled(false);
}
Athena.INSTANCE.getMacroManager().getMacros().clear();
SettingsPage.TILE_ENTITIES.clear();
SettingsPage.ENTITIES.clear();
SettingsPage.BLOCKS.clear();
SettingsPage.PARTICLES.clear();
for(String key : obj.keySet()) {
if(key.equalsIgnoreCase("macros") || key.equalsIgnoreCase("crosshair-data")) {
continue;
}
Module module = Athena.INSTANCE.getModuleManager().getModule(key);
if(module == null) {
Athena.INSTANCE.getLog().warn("Loaded config " + name + " with left over setting " + key + " which is no longer used.");
continue;
}
JSONObject json = obj.getJSONObject(key);
if(!json.has("enabled") || !json.has("bind")) {
continue;
}
boolean enabled = json.getBoolean("enabled");
int bind = json.getInt("bind");
BindType bindType = BindType.getBind(json.getString("bindtype"));
module.setEnabled(enabled);
module.setKeyBind(bind);
module.setBindType(bindType);
JSONObject settings = json.getJSONObject("settings");
for(String setting : settings.keySet()) {
for(ConfigEntry entry : module.getEntries()) {
if(entry.getKey().equalsIgnoreCase(setting)) {
Object value = settings.get(setting);
if(value instanceof JSONObject) {
JSONObject color = (JSONObject) value;
value = new Color(color.getInt("red"), color.getInt("green"), color.getInt("blue"), color.getInt("alpha"));
} else if(entry.getType() == float.class) {
value = (float)settings.getDouble(setting);
}
entry.setValue(module, value);
break;
}
}
}
JSONObject hud = json.getJSONObject("hud");
for(String element : hud.keySet()) {
String identifier = element;
JSONObject elementObj = hud.getJSONObject(identifier);
for(HUDElement modElement : module.getHUDElements()) {
if(modElement.getIdentifier().equalsIgnoreCase(identifier)) {
modElement.setX(elementObj.getInt("x"));
modElement.setY(elementObj.getInt("y"));
modElement.setScale(elementObj.getDouble("scale"));
modElement.setVisible(elementObj.getBoolean("visible"));
break;
}
}
}
}
JSONArray macroList = obj.getJSONArray("macros");
for(int i = 0; i < macroList.length(); i++) {
JSONObject macro = macroList.getJSONObject(i);
Athena.INSTANCE.getMacroManager().getMacros().add(new Macro(macro.getString("name"), macro.getString("command"), macro.getInt("key"), macro.getBoolean("enabled")));
}
JSONObject fps = obj.getJSONObject("fps");
JSONArray blocks = fps.getJSONArray("blocks");
JSONArray entities = fps.getJSONArray("entities");
JSONArray tileentities = fps.getJSONArray("tile-entities");
JSONArray particles = fps.getJSONArray("particles");
List<String> list = new ArrayList<>();
for(int i = 0; i < blocks.length(); i++) {
list.add(blocks.getString(i));
}
for(String item : list) {
try {
String string = new String(item);
Class<?> clazz = Class.forName(string);
if(Block.class.isAssignableFrom(clazz)) {
Class<? extends Block> block = (Class<? extends Block>)clazz;
if(!SettingsPage.BLOCKS.contains(block)) {
SettingsPage.BLOCKS.add(block);
}
}
} catch(IllegalArgumentException | LinkageError | ClassNotFoundException e) {
e.printStackTrace();
}
}
list.clear();
for(int i = 0; i < entities.length(); i++) {
list.add(entities.getString(i));
}
for(String item : list) {
try {
String string = new String(item);
if(string.contains(" ")) {
string = string.split(" ", 2)[1];
}
Class<?> clazz = Class.forName(string);
if(Entity.class.isAssignableFrom(clazz)) {
Class<? extends Entity> entity = (Class<? extends Entity>)clazz;
if(!SettingsPage.ENTITIES.contains(entity)) {
SettingsPage.ENTITIES.add(entity);
}
}
} catch(IllegalArgumentException | LinkageError | ClassNotFoundException e) {
e.printStackTrace();
}
}
list.clear();
for(int i = 0; i < tileentities.length(); i++) {
list.add(tileentities.getString(i));
}
for(String item : list) {
try {
String string = new String(item);
Class<?> clazz = Class.forName(string);
if(TileEntity.class.isAssignableFrom(clazz)) {
Class<? extends TileEntity> tileEntity = (Class<? extends TileEntity>) clazz;
if(!SettingsPage.TILE_ENTITIES.contains(tileEntity)) {
SettingsPage.TILE_ENTITIES.add(tileEntity);
}
}
} catch(IllegalArgumentException | LinkageError | ClassNotFoundException e) {
e.printStackTrace();
}
}
list.clear();
for(int i = 0; i < particles.length(); i++) {
list.add(particles.getString(i));
}
for(String item : list) {
try {
String string = new String(item);
EnumParticleTypes particle = EnumParticleTypes.valueOf(string);
if(particle == null) {
continue;
}
if(!SettingsPage.PARTICLES.contains(particle)) {
SettingsPage.PARTICLES.add(particle);
}
} catch(IllegalArgumentException e) {
e.printStackTrace();
}
}
list.clear();
int[][] data = Crosshair.crosshair;
for(int i = 0; i < data.length; i++) {
for(int ii = 0; ii < data[i].length; ii++) {
data[i][ii] = 0;
}
}
String[] parts = obj.getString("crosshair-data").split("]");
List<List<Integer>> crosshairData = new ArrayList<>();
for(String part : parts) {
String formatted = part;
if(formatted.startsWith("[")) {
formatted = formatted.substring(1);
}
formatted = formatted.trim();
List<Integer> row = new ArrayList<>();
for(String rowEntry : formatted.split(",")) {
String entry = rowEntry.trim();
if(!StringUtils.isInteger(entry)) {
continue;
}
row.add(Integer.parseInt(entry));
}
if(row.size() > 0) {
crosshairData.add(row);
}
}
for(int i = 0; i < crosshairData.size(); i++) {
List<Integer> crosshairList = crosshairData.get(i);
if(i >= data.length) {
continue;
}
for(int ii = 0; ii < crosshairList.size(); ii++) {
int row = crosshairList.get(ii);
if(ii >= data[i].length) {
continue;
}
data[i][ii] = row;
}
}
} catch(JSONException e) {
Athena.INSTANCE.getLog().error("Failed to load config " + name + ", improper json." + e);
}
Athena.INSTANCE.getEventBus().post(new ConfigChangeEvent());
}
public void save(String content) {
try {
file.writeToFile(content, false);
} catch (IOException e) {
Athena.INSTANCE.getLog().error("Failed to save config " + name + "." + e);
}
}
public void save() {
save(toString());
}
@Override
public String toString() {
JSONObject config = new JSONObject();
for(Module mod : Athena.INSTANCE.getModuleManager().getModules()) {
JSONObject obj = new JSONObject();
JSONObject settingsObj = new JSONObject();
JSONObject hudObj = new JSONObject();
for(HUDElement element : mod.getHUDElements()) {
JSONObject elementObj = new JSONObject();
elementObj.put("x", element.getX());
elementObj.put("y", element.getY());
elementObj.put("scale", element.getScale());
elementObj.put("visible", element.isVisible());
hudObj.put(element.getIdentifier(), elementObj);
}
obj.put("enabled", mod.isToggled());
obj.put("bind", mod.getKeyBind());
obj.put("bindtype", mod.getBindType().toString());
for(ConfigEntry entry : mod.getEntries()) {
entry.appendToConfig(entry.getKey(), entry.getValue(mod), settingsObj);
}
obj.put("settings", settingsObj);
obj.put("hud", hudObj);
config.put(mod.getName(), obj);
}
JSONArray macros = new JSONArray();
for(Macro macro : Athena.INSTANCE.getMacroManager().getMacros()) {
JSONObject obj = new JSONObject();
obj.put("name", macro.getName());
obj.put("command", macro.getCommand());
obj.put("key", macro.getKey());
obj.put("enabled", macro.isEnabled());
macros.put(obj);
}
config.put("macros", macros);
JSONObject fps = new JSONObject();
List<String> buffer = new ArrayList<>();
for(Class<?> clazz : SettingsPage.BLOCKS) {
buffer.add(clazz.getCanonicalName());
}
fps.put("blocks", new JSONArray(buffer.toArray(new String[buffer.size()])));
buffer.clear();
for(Class<?> clazz : SettingsPage.ENTITIES) {
buffer.add(clazz.getCanonicalName());
}
fps.put("entities", new JSONArray(buffer.toArray(new String[buffer.size()])));
buffer.clear();
for(Class<?> clazz : SettingsPage.TILE_ENTITIES) {
buffer.add(clazz.getCanonicalName());
}
fps.put("tile-entities", new JSONArray(buffer.toArray(new String[buffer.size()])));
buffer.clear();
for(EnumParticleTypes particle : SettingsPage.PARTICLES) {
buffer.add(particle.toString());
}
fps.put("particles", new JSONArray(buffer.toArray(new String[buffer.size()])));
buffer.clear();
config.put("fps", fps);
StringBuilder crosshairData = new StringBuilder();
int[][] data = Crosshair.crosshair;
for(int i = 0; i < data.length; i++) {
StringBuilder inner = new StringBuilder();
inner.append("[");
for(int ii = 0; ii < data[i].length; ii++) {
if(inner.length() > 1) {
inner.append(",");
}
inner.append(data[i][ii]);
}
inner.append("]");
if(!crosshairData.toString().isEmpty()) {
crosshairData.append(", ");
}
crosshairData.append(inner.toString());
}
config.put("crosshair-data", crosshairData);
return config.toString(4);
}
public String getName() {
return name;
}
public void delete() {
if(parent.lastLoadedConfig == this) {
parent.lastLoadedConfig = null;
}
file.getFile().delete();
}
public FileHandler getFileHandler() {
return file;
}
public boolean isEnabled() {
if(parent.getLoadedConfig() == null) {
return false;
}
return parent.getLoadedConfig().getName().equalsIgnoreCase(getName());
}
}

View File

@ -0,0 +1,135 @@
package rip.athena.client.config.save;
import rip.athena.client.Athena;
import rip.athena.client.utils.file.FileHandler;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.ArrayList;
import java.util.List;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/6/2023
*/
public class ConfigManager {
public static final String EXTENSION = ".json";
public static final String DATA_FILE = "last.txt";
protected static File directory;
protected Config lastLoadedConfig;
protected FileHandler lastFile;
public ConfigManager(File directory) {
if(!directory.exists()) {
directory.mkdir();
}
File file = Paths.get(directory.getAbsolutePath(), DATA_FILE).toFile();
lastFile = new FileHandler(file);
try {
lastFile.init();
} catch (IOException e) {
Athena.INSTANCE.getLog().error("Failed to initiate last config handler." + e);
}
this.directory = directory;
}
public void postInit() {
try {
boolean foundConfig = false;
String found = lastFile.getContent(true).trim();
for(Config config : getConfigs()) {
if(config.getName().equalsIgnoreCase(found.trim())) {
config.load();
foundConfig = true;
break;
}
}
if(!foundConfig) {
getConfig("default").load();
}
} catch (IOException e) {
Athena.INSTANCE.getLog().error("Failed to initiate post config init." + e);
}
}
public List<Config> getConfigs() {
List<Config> files = new ArrayList<>();
for(File file : directory.listFiles()) {
String name = file.getName();
if(name.toLowerCase().endsWith(EXTENSION.toLowerCase())) {
files.add(getConfig(name.substring(0, name.length() - EXTENSION.length())));
}
}
files.sort((first, second) -> {
File firstFile = first.getFileHandler().getFile();
File secondFile = second.getFileHandler().getFile();
long firstVal = firstFile.lastModified();
long secondVal = secondFile.lastModified();
try {
BasicFileAttributes firstAttr = Files.readAttributes(firstFile.toPath(), BasicFileAttributes.class);
BasicFileAttributes secondAttr = Files.readAttributes(secondFile.toPath(), BasicFileAttributes.class);
firstVal = firstAttr.creationTime().toMillis();
secondVal = secondAttr.creationTime().toMillis();
} catch (IOException e) {
Athena.INSTANCE.getLog().error("Failed to read file attributes, resorting to last edit for config sorting." + e);
}
if(first.getName().equalsIgnoreCase("default")) {
firstVal = -Long.MAX_VALUE;
} else if(second.getName().equalsIgnoreCase("default")) {
secondVal = -Long.MAX_VALUE;
}
return Long.compare(firstVal, secondVal);
});
return files;
}
public Config getConfig(String name) {
String safeName = name;
return new Config(this, name, Paths.get(directory.getAbsolutePath(), safeName + EXTENSION).toFile());
}
public Config getLoadedConfig() {
return lastLoadedConfig;
}
public void deleteAllConfigs() {
for(Config config : getConfigs()) {
config.delete();
}
lastLoadedConfig = null;
}
public void updateLast(Config config) {
lastLoadedConfig = config;
String name = lastLoadedConfig.getName();
try {
lastFile.writeToFile(name, false);
} catch (IOException e) {
Athena.INSTANCE.getLog().error("Failed to initiate last config handler." + e);
}
}
}

View File

@ -5,6 +5,11 @@ import java.lang.reflect.Field;
import org.json.JSONObject; import org.json.JSONObject;
import rip.athena.client.config.ConfigEntry; import rip.athena.client.config.ConfigEntry;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/6/2023
*/
public class BooleanEntry extends ConfigEntry { public class BooleanEntry extends ConfigEntry {
public BooleanEntry(Field field, String key, String description, boolean visible) { public BooleanEntry(Field field, String key, String description, boolean visible) {
super(field, key, description, visible); super(field, key, description, visible);

View File

@ -7,6 +7,11 @@ import org.json.JSONObject;
import rip.athena.client.config.ConfigEntry; import rip.athena.client.config.ConfigEntry;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/6/2023
*/
public class ColorEntry extends ConfigEntry { public class ColorEntry extends ConfigEntry {
public ColorEntry(Field field, String key, String description, boolean visible) { public ColorEntry(Field field, String key, String description, boolean visible) {
super(field, key, description, visible); super(field, key, description, visible);

View File

@ -6,6 +6,11 @@ import org.json.JSONObject;
import rip.athena.client.config.ConfigEntry; import rip.athena.client.config.ConfigEntry;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/6/2023
*/
public class DoubleEntry extends ConfigEntry { public class DoubleEntry extends ConfigEntry {
private double min; private double min;
private double max; private double max;

View File

@ -6,6 +6,11 @@ import org.json.JSONObject;
import rip.athena.client.config.ConfigEntry; import rip.athena.client.config.ConfigEntry;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/6/2023
*/
public class FloatEntry extends ConfigEntry { public class FloatEntry extends ConfigEntry {
private float min; private float min;
private float max; private float max;

View File

@ -6,6 +6,11 @@ import org.json.JSONObject;
import rip.athena.client.config.ConfigEntry; import rip.athena.client.config.ConfigEntry;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/6/2023
*/
public class IntEntry extends ConfigEntry { public class IntEntry extends ConfigEntry {
private int min; private int min;
private int max; private int max;

View File

@ -9,6 +9,11 @@ import rip.athena.client.Athena;
import rip.athena.client.config.ConfigEntry; import rip.athena.client.config.ConfigEntry;
import rip.athena.client.modules.Module; import rip.athena.client.modules.Module;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/6/2023
*/
public class ListEntry extends ConfigEntry { public class ListEntry extends ConfigEntry {
private Module module; private Module module;
private String[] values; private String[] values;

View File

@ -6,6 +6,11 @@ import org.json.JSONObject;
import rip.athena.client.config.ConfigEntry; import rip.athena.client.config.ConfigEntry;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/6/2023
*/
public class StringEntry extends ConfigEntry { public class StringEntry extends ConfigEntry {
public StringEntry(Field field, String key, String description, boolean visible) { public StringEntry(Field field, String key, String description, boolean visible) {
super(field, key, description, visible); super(field, key, description, visible);

View File

@ -0,0 +1,7 @@
package rip.athena.client.events.types.client;
import rip.athena.client.events.Event;
public class ConfigChangeEvent extends Event {
}

View File

@ -2,6 +2,7 @@ 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.config.save.Config;
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.clickgui.pages.ModsPage;
import rip.athena.client.gui.framework.Menu; import rip.athena.client.gui.framework.Menu;
@ -37,8 +38,6 @@ public class IngameMenu extends MinecraftMenuImpl implements DrawImpl {
public static int MENU_HEADER_TEXT_COLOR = new Color(255, 255, 255, MENU_ALPHA).getRGB(); public static int MENU_HEADER_TEXT_COLOR = new Color(255, 255, 255, MENU_ALPHA).getRGB();
public static int MENU_LINE_COLOR = new Color(25, 25, 28, IngameMenu.MENU_ALPHA).getRGB(); public static int MENU_LINE_COLOR = new Color(25, 25, 28, IngameMenu.MENU_ALPHA).getRGB();
protected static final ResourceLocation LOGO = AssetUtils.getResource("/gui/logo-bg-new.png");
public static PageManager pageManager; public static PageManager pageManager;
public static Category category = Category.MODS; public static Category category = Category.MODS;
@ -54,7 +53,7 @@ public class IngameMenu extends MinecraftMenuImpl implements DrawImpl {
@Override @Override
public void initGui() { public void initGui() {
if(initd) { if(initd) {
menu.getComponents().clear(); menu.getComponents().clear();
initd = false; initd = false;
@ -120,15 +119,14 @@ public class IngameMenu extends MinecraftMenuImpl implements DrawImpl {
savedWidth = mc.displayWidth; savedWidth = mc.displayWidth;
savedHeight = mc.displayHeight; savedHeight = mc.displayHeight;
ScaledResolution sr = new ScaledResolution(mc); ScaledResolution sr = new ScaledResolution(mc);
menu.setX(sr.getScaledWidth() / 2 - menu.getWidth() / 2); menu.setX(sr.getScaledWidth() / 2);
menu.setY(sr.getScaledHeight() / 2 - menu.getHeight() / 2); menu.setY(sr.getScaledHeight() / 2);
} }
GlStateManager.pushMatrix(); GlStateManager.pushMatrix();
float value = guiScale / new ScaledResolution(mc).getScaleFactor(); float value = guiScale / new ScaledResolution(mc).getScaleFactor();
GlStateManager.scale(value, value, value); GlStateManager.scale(value, value, value);
DrawUtils.drawRoundedRect(menu.getX(), menu.getY(), menu.getX() + menu.getWidth(), menu.getY() + 58, 4, MENU_TOP_BG_COLOR); DrawUtils.drawRoundedRect(menu.getX(), menu.getY(), menu.getX() + menu.getWidth(), menu.getY() + 58, 4, MENU_TOP_BG_COLOR);
drawShadowDown(menu.getX(), menu.getY() + 58, menu.getWidth()); drawShadowDown(menu.getX(), menu.getY() + 58, menu.getWidth());
@ -198,11 +196,11 @@ public class IngameMenu extends MinecraftMenuImpl implements DrawImpl {
super.onGuiClosed(); super.onGuiClosed();
new Thread(() -> { new Thread(() -> {
/*Config config = Athena.INSTANCE.configManager.getLoadedConfig(); Config config = Athena.INSTANCE.getConfigManager().getLoadedConfig();
if(config != null) { if(config != null) {
config.save(); config.save();
}*/ }
}).start(); }).start();
} }
} }

View File

@ -2,6 +2,7 @@ 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.utils.render.DrawUtils;
import java.awt.*; import java.awt.*;
@ -78,10 +79,13 @@ public class CosmeticBindButton extends CosmeticGenericButton {
int textColor = getColor(DrawType.TEXT, lastState); int textColor = getColor(DrawType.TEXT, lastState);
if(filledBackground) { if(filledBackground) {
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x, y, width, height, backgroundColor); //rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x, y, width, height, backgroundColor);
} }
drawHorizontalLine(x, y, width + 1, 1, lineColor); DrawUtils.drawRoundedRect(x, y, x + width, y + height, 4.0f, new Color(50, 50, 50, 255).getRGB());
DrawUtils.drawRoundedRect(x + 1, y + 1, x + width - 1, y + height - 1, 4.0f, new Color(35, 35, 35, 255).getRGB());
/*drawHorizontalLine(x, y, width + 1, 1, lineColor);
drawVerticalLine(x, y + 1, height - 1, 1, lineColor); drawVerticalLine(x, y + 1, height - 1, 1, lineColor);
drawHorizontalLine(x, y + height, width + 1, 1, lineColor); drawHorizontalLine(x, y + height, width + 1, 1, lineColor);
drawVerticalLine(x + width, y + 1, height - 1, 1, lineColor); drawVerticalLine(x + width, y + 1, height - 1, 1, lineColor);
@ -89,7 +93,7 @@ public class CosmeticBindButton extends CosmeticGenericButton {
drawShadowUp(x, y, width + 1); drawShadowUp(x, y, width + 1);
drawShadowLeft(x, y, height + 1); drawShadowLeft(x, y, height + 1);
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);*/
String text = this.text; String text = this.text;

View File

@ -1,8 +1,10 @@
package rip.athena.client.gui.clickgui.components.cosmetics; package rip.athena.client.gui.clickgui.components.cosmetics;
import net.minecraft.client.renderer.GlStateManager;
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.clickgui.components.macros.MacroButton; import rip.athena.client.gui.clickgui.components.macros.MacroButton;
import rip.athena.client.utils.render.DrawUtils;
import java.awt.*; import java.awt.*;
@ -23,20 +25,20 @@ public class CosmeticGenericButton extends MacroButton {
@Override @Override
public void onInitColors() { public void onInitColors() {
setColor(DrawType.BACKGROUND, ButtonState.NORMAL, new Color(35, 35, 35, 255)); setColor(DrawType.BACKGROUND, ButtonState.NORMAL, new Color(35, 35, 35, 255));
setColor(DrawType.BACKGROUND, ButtonState.ACTIVE, new Color(44, 44, 48, 255)); setColor(DrawType.BACKGROUND, ButtonState.ACTIVE, new Color(30, 30, 30, 255));
setColor(DrawType.BACKGROUND, ButtonState.HOVER, new Color(28, 28, 31, 255)); setColor(DrawType.BACKGROUND, ButtonState.HOVER, new Color(40, 40, 40, 255));
setColor(DrawType.BACKGROUND, ButtonState.HOVERACTIVE, new Color(54, 54, 59, 255)); setColor(DrawType.BACKGROUND, ButtonState.HOVERACTIVE, new Color(25, 25, 25, 255));
setColor(DrawType.BACKGROUND, ButtonState.DISABLED, new Color(100, 100, 100, 255)); setColor(DrawType.BACKGROUND, ButtonState.DISABLED, new Color(100, 100, 100, 255));
setColor(DrawType.LINE, ButtonState.NORMAL, new Color(46, 46, 48, 255)); setColor(DrawType.LINE, ButtonState.NORMAL, new Color(35, 35, 35, 255));
setColor(DrawType.LINE, ButtonState.ACTIVE, new Color(63, 63, 66, 255)); setColor(DrawType.LINE, ButtonState.ACTIVE, new Color(30, 30, 30, 255));
setColor(DrawType.LINE, ButtonState.HOVER, new Color(58, 58, 61, 255)); setColor(DrawType.LINE, ButtonState.HOVER, new Color(40, 40, 40, 255));
setColor(DrawType.LINE, ButtonState.HOVERACTIVE, new Color(76, 76, 79, 255)); setColor(DrawType.LINE, ButtonState.HOVERACTIVE, new Color(25, 25, 25, 255));
setColor(DrawType.LINE, ButtonState.DISABLED, new Color(100, 100, 100, 255)); setColor(DrawType.LINE, ButtonState.DISABLED, new Color(100, 100, 100, 255));
setColor(DrawType.TEXT, ButtonState.NORMAL, new Color(255, 255, 255, 255)); setColor(DrawType.TEXT, ButtonState.NORMAL, new Color(150, 150, 150, 255));
setColor(DrawType.TEXT, ButtonState.ACTIVE, new Color(255, 255, 255, 255)); setColor(DrawType.TEXT, ButtonState.ACTIVE, new Color(225, 225, 225, 255));
setColor(DrawType.TEXT, ButtonState.HOVER, new Color(255, 255, 255, 255)); setColor(DrawType.TEXT, ButtonState.HOVER, new Color(175, 175, 175, 255));
setColor(DrawType.TEXT, ButtonState.HOVERACTIVE, new Color(255, 255, 255, 255)); setColor(DrawType.TEXT, ButtonState.HOVERACTIVE, new Color(255, 255, 255, 255));
setColor(DrawType.TEXT, ButtonState.DISABLED, new Color(255, 255, 255, 255)); setColor(DrawType.TEXT, ButtonState.DISABLED, new Color(255, 255, 255, 255));
} }
@ -51,12 +53,16 @@ public class CosmeticGenericButton extends MacroButton {
int backgroundColor = getColor(DrawType.BACKGROUND, lastState); int backgroundColor = getColor(DrawType.BACKGROUND, lastState);
int lineColor = getColor(DrawType.LINE, lastState); int lineColor = getColor(DrawType.LINE, lastState);
int textColor = getColor(DrawType.TEXT, lastState); int textColor = getColor(DrawType.TEXT, lastState);
if(filledBackground) { if(filledBackground) {
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x, y, width, height, backgroundColor); //rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x, y, width, height, backgroundColor);
} }
drawHorizontalLine(x, y, width + 1, 1, lineColor); GlStateManager.color(1,1,1);
DrawUtils.drawRoundedRect(x, y, x + width, y + height, 4.0f, new Color(50, 50, 50, 255).getRGB());
DrawUtils.drawRoundedRect(x + 1, y + 1, x + width - 1, y + height - 1, 4.0f, lineColor);
/*drawHorizontalLine(x, y, width + 1, 1, lineColor);
drawVerticalLine(x, y + 1, height - 1, 1, lineColor); drawVerticalLine(x, y + 1, height - 1, 1, lineColor);
drawHorizontalLine(x, y + height, width + 1, 1, lineColor); drawHorizontalLine(x, y + height, width + 1, 1, lineColor);
drawVerticalLine(x + width, y + 1, height - 1, 1, lineColor); drawVerticalLine(x + width, y + 1, height - 1, 1, lineColor);
@ -64,7 +70,7 @@ public class CosmeticGenericButton extends MacroButton {
drawShadowUp(x, y, width + 1); drawShadowUp(x, y, width + 1);
drawShadowLeft(x, y, height + 1); drawShadowLeft(x, y, height + 1);
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);*/
drawText(text, x + (width / 2 - getStringWidth(text) / 2), y + (height / 2 - getStringHeight(text) / 2), textColor); drawText(text, x + (width / 2 - getStringWidth(text) / 2), y + (height / 2 - getStringHeight(text) / 2), textColor);

View File

@ -5,6 +5,7 @@ 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.modules.impl.other.Settings; import rip.athena.client.modules.impl.other.Settings;
import rip.athena.client.utils.render.DrawUtils;
import java.awt.*; import java.awt.*;
@ -54,8 +55,11 @@ public class CosmeticRainbowButton extends CosmeticGenericButton {
if(filledBackground) { if(filledBackground) {
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x, y, width, height, backgroundColor); rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x, y, width, height, backgroundColor);
} }
drawHorizontalLine(x, y, width + 1, 1, lineColor); DrawUtils.drawRoundedRect(x, y, x + width, y + height, 4.0f, new Color(50, 50, 50, 255).getRGB());
DrawUtils.drawRoundedRect(x + 1, y + 1, x + width - 1, y + height - 1, 4.0f, new Color(35, 35, 35, 255).getRGB());
/*drawHorizontalLine(x, y, width + 1, 1, lineColor);
drawVerticalLine(x, y + 1, height - 1, 1, lineColor); drawVerticalLine(x, y + 1, height - 1, 1, lineColor);
drawHorizontalLine(x, y + height, width + 1, 1, lineColor); drawHorizontalLine(x, y + height, width + 1, 1, lineColor);
drawVerticalLine(x + width, y + 1, height - 1, 1, lineColor); drawVerticalLine(x + width, y + 1, height - 1, 1, lineColor);
@ -63,7 +67,7 @@ public class CosmeticRainbowButton extends CosmeticGenericButton {
drawShadowUp(x, y, width + 1); drawShadowUp(x, y, width + 1);
drawShadowLeft(x, y, height + 1); drawShadowLeft(x, y, height + 1);
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);*/
if(Settings.customGuiFont) { if(Settings.customGuiFont) {
FontManager.baloo17.drawString(text, x + (width / 2 - getStringWidth(text) / 2), y + (height / 2 - getStringHeight(text) / 2), -1); FontManager.baloo17.drawString(text, x + (width / 2 - getStringWidth(text) / 2), y + (height / 2 - getStringHeight(text) / 2), -1);

View File

@ -11,6 +11,7 @@ import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.entity.RenderManager;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import rip.athena.client.utils.render.DrawUtils;
import java.awt.*; import java.awt.*;
@ -41,9 +42,12 @@ public class CosmeticUserPreview extends MenuComponent {
int lineColor = getColor(DrawType.LINE, ButtonState.NORMAL); int lineColor = getColor(DrawType.LINE, ButtonState.NORMAL);
int backgroundColor = getColor(DrawType.BACKGROUND, ButtonState.NORMAL); int backgroundColor = getColor(DrawType.BACKGROUND, ButtonState.NORMAL);
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x, y, width, height, backgroundColor); //rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x, y, width, height, backgroundColor);
drawHorizontalLine(x, y, width + 1, 1, lineColor); DrawUtils.drawRoundedRect(x, y, x + width, y + height, 4.0f, new Color(50, 50, 50, 255).getRGB());
DrawUtils.drawRoundedRect(x + 1, y + 1, x + width - 1, y + height - 1, 4.0f, new Color(35, 35, 35, 255).getRGB());
/*drawHorizontalLine(x, y, width + 1, 1, lineColor);
drawVerticalLine(x, y + 1, height - 1, 1, lineColor); drawVerticalLine(x, y + 1, height - 1, 1, lineColor);
drawHorizontalLine(x, y + height, width + 1, 1, lineColor); drawHorizontalLine(x, y + height, width + 1, 1, lineColor);
drawVerticalLine(x + width, y + 1, height - 1, 1, lineColor); drawVerticalLine(x + width, y + 1, height - 1, 1, lineColor);
@ -51,7 +55,7 @@ public class CosmeticUserPreview extends MenuComponent {
drawShadowUp(x, y, width + 1); drawShadowUp(x, y, width + 1);
drawShadowLeft(x, y, height + 1); drawShadowLeft(x, y, height + 1);
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);*/
GL11.glPushMatrix(); GL11.glPushMatrix();
GlStateManager.translate(x + width / 2, y + height / 2 + 120, 125); GlStateManager.translate(x + width / 2, y + height / 2 + 120, 125);
@ -84,7 +88,7 @@ public class CosmeticUserPreview extends MenuComponent {
ent.rotationPitch = -((float)Math.atan((double)(0 / 40.0F))) * 20.0F; ent.rotationPitch = -((float)Math.atan((double)(0 / 40.0F))) * 20.0F;
ent.rotationYawHead = ent.rotationYaw; ent.rotationYawHead = ent.rotationYaw;
ent.prevRotationYawHead = ent.rotationYaw; ent.prevRotationYawHead = ent.rotationYaw;
//ent.dontRenderNameTag = true; ent.dontRenderNameTag = true;
GlStateManager.translate(0.0F, 0.0F, 0.0F); GlStateManager.translate(0.0F, 0.0F, 0.0F);
RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager(); RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager();
GlStateManager.disableLighting(); GlStateManager.disableLighting();

View File

@ -21,17 +21,17 @@ public class FPSGenericButton extends CosmeticGenericButton {
@Override @Override
public void onInitColors() { public void onInitColors() {
setColor(DrawType.BACKGROUND, ButtonState.NORMAL, new Color(35, 35, 35, 255)); setColor(DrawType.BACKGROUND, ButtonState.NORMAL, new Color(35, 35, 35, 255));
setColor(DrawType.BACKGROUND, ButtonState.ACTIVE, new Color(35, 35, 35, 255)); setColor(DrawType.BACKGROUND, ButtonState.ACTIVE, new Color(30, 30, 30, 255));
setColor(DrawType.BACKGROUND, ButtonState.HOVER, new Color(35, 35, 35, 255)); setColor(DrawType.BACKGROUND, ButtonState.HOVER, new Color(40, 40, 40, 255));
setColor(DrawType.BACKGROUND, ButtonState.HOVERACTIVE, new Color(35, 35, 35, 255)); setColor(DrawType.BACKGROUND, ButtonState.HOVERACTIVE, new Color(25, 25, 25, 255));
setColor(DrawType.BACKGROUND, ButtonState.DISABLED, new Color(100, 100, 100, 255)); setColor(DrawType.BACKGROUND, ButtonState.DISABLED, new Color(100, 100, 100, 255));
setColor(DrawType.LINE, ButtonState.NORMAL, new Color(30, 29, 32, 255)); setColor(DrawType.LINE, ButtonState.NORMAL, new Color(35, 35, 35, 255));
setColor(DrawType.LINE, ButtonState.ACTIVE, new Color(30, 29, 32, 255)); setColor(DrawType.LINE, ButtonState.ACTIVE, new Color(30, 30, 30, 255));
setColor(DrawType.LINE, ButtonState.HOVER, new Color(30, 29, 32, 255)); setColor(DrawType.LINE, ButtonState.HOVER, new Color(40, 40, 40, 255));
setColor(DrawType.LINE, ButtonState.HOVERACTIVE, new Color(30, 29, 32, 255)); setColor(DrawType.LINE, ButtonState.HOVERACTIVE, new Color(25, 25, 25, 255));
setColor(DrawType.LINE, ButtonState.DISABLED, new Color(100, 100, 100, 255)); setColor(DrawType.LINE, ButtonState.DISABLED, new Color(100, 100, 100, 255));
setColor(DrawType.TEXT, ButtonState.NORMAL, new Color(150, 150, 150, 255)); setColor(DrawType.TEXT, ButtonState.NORMAL, new Color(150, 150, 150, 255));
setColor(DrawType.TEXT, ButtonState.ACTIVE, new Color(225, 225, 225, 255)); setColor(DrawType.TEXT, ButtonState.ACTIVE, new Color(225, 225, 225, 255));
setColor(DrawType.TEXT, ButtonState.HOVER, new Color(175, 175, 175, 255)); setColor(DrawType.TEXT, ButtonState.HOVER, new Color(175, 175, 175, 255));

View File

@ -4,6 +4,9 @@ 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.clickgui.components.macros.FlipButton; import rip.athena.client.gui.clickgui.components.macros.FlipButton;
import rip.athena.client.gui.clickgui.pages.fps.BlacklistModule; import rip.athena.client.gui.clickgui.pages.fps.BlacklistModule;
import rip.athena.client.utils.render.DrawUtils;
import java.awt.*;
/** /**
* @author Athena Development * @author Athena Development
@ -31,11 +34,14 @@ public class FlipButtonFPS extends FlipButton {
int backgroundColor = getColor(DrawType.BACKGROUND, lastState); int backgroundColor = getColor(DrawType.BACKGROUND, lastState);
int lineColor = getColor(DrawType.LINE, lastState); int lineColor = getColor(DrawType.LINE, lastState);
int textColor = getColor(DrawType.TEXT, lastState); int textColor = getColor(DrawType.TEXT, lastState);
drawHorizontalLine(x, y, width + 1, 1, linePopupColor); DrawUtils.drawRoundedRect(x - 1, y - 1, x + width + 1, y + height + 1, 4.0f, new Color(50, 50, 50, 255).getRGB());
DrawUtils.drawRoundedRect(x, y, x + width, y + height, 4.0f, new Color(35, 35, 35, 255).getRGB());
/*drawHorizontalLine(x, y, width + 1, 1, linePopupColor);
drawVerticalLine(x, y + 1, height - 1, 1, linePopupColor); drawVerticalLine(x, y + 1, height - 1, 1, linePopupColor);
drawHorizontalLine(x, y + height, width + 1, 1, linePopupColor); drawHorizontalLine(x, y + height, width + 1, 1, linePopupColor);
drawVerticalLine(x + width, y + 1, height - 1, 1, linePopupColor); drawVerticalLine(x + width, y + 1, height - 1, 1, linePopupColor);*/
int color = active ? NORMAL_ON : NORMAL_OFF; int color = active ? NORMAL_ON : NORMAL_OFF;
@ -44,9 +50,11 @@ public class FlipButtonFPS extends FlipButton {
} }
if(active) { if(active) {
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x + 1, y + 1, width / 2, height - 1, color); DrawUtils.drawRoundedRect(x, y, x + width / 2, y + height, 4.0f, color);
//rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x + 1, y + 1, width / 2, height - 1, color);
} else { } else {
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x + width - width / 2, y + 1, width / 2, height - 1, color); DrawUtils.drawRoundedRect(x + width - width / 2, y, x + width, y + height, 4.0f, color);
//rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x + width - width / 2, y + 1, width / 2, height - 1, color);
} }
mouseDown = false; mouseDown = false;

View File

@ -4,6 +4,9 @@ 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.clickgui.components.waypoints.WaypointTextBarrier; import rip.athena.client.gui.clickgui.components.waypoints.WaypointTextBarrier;
import rip.athena.client.utils.render.DrawUtils;
import java.awt.*;
/** /**
* @author Athena Development * @author Athena Development
@ -27,12 +30,15 @@ public class FlipButtonParent extends WaypointTextBarrier {
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);
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x, y, width, height, backgroundColor); DrawUtils.drawRoundedRect(x, y, x + width, y + height, 4.0f, new Color(50, 50, 50, 255).getRGB());
DrawUtils.drawRoundedRect(x + 1, y + 1, x + width - 1, y + height - 1, 4.0f, new Color(35, 35, 35, 255).getRGB());
/*rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x, y, width, height, backgroundColor);
drawHorizontalLine(x, y, width + 1, 1, lineColor); drawHorizontalLine(x, y, width + 1, 1, lineColor);
drawVerticalLine(x, y + 1, height - 1, 1, lineColor); drawVerticalLine(x, y + 1, height - 1, 1, lineColor);
drawHorizontalLine(x, y + height, width + 1, 1, lineColor); drawHorizontalLine(x, y + height, width + 1, 1, lineColor);
drawVerticalLine(x + width, y + 1, height - 1, 1, lineColor); drawVerticalLine(x + width, y + 1, height - 1, 1, lineColor);*/
drawText(text, x + 10, y + height / 2 - getStringHeight(text) / 2, textColor); drawText(text, x + 10, y + height / 2 - getStringHeight(text) / 2, textColor);
} }

View File

@ -5,6 +5,7 @@ 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.clickgui.IngameMenu; import rip.athena.client.gui.clickgui.IngameMenu;
import rip.athena.client.utils.render.DrawUtils;
import java.awt.*; import java.awt.*;
@ -36,9 +37,12 @@ public class MainWindowBackgroundPS extends MenuComponent {
int lineColor = getColor(DrawType.LINE, ButtonState.NORMAL); int lineColor = getColor(DrawType.LINE, ButtonState.NORMAL);
int backgroundColor = getColor(DrawType.BACKGROUND, ButtonState.NORMAL); int backgroundColor = getColor(DrawType.BACKGROUND, ButtonState.NORMAL);
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x, y, width, height, backgroundColor); //rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x, y, width, height, backgroundColor);
drawHorizontalLine(x, y, width + 1, 1, lineColor); DrawUtils.drawRoundedRect(x, y, x + width, y + height, 4.0f, new Color(50, 50, 50, 255).getRGB());
DrawUtils.drawRoundedRect(x + 1, y + 1, x + width - 1, y + height - 1, 4.0f, new Color(35, 35, 35, 255).getRGB());
/*drawHorizontalLine(x, y, width + 1, 1, lineColor);
drawVerticalLine(x, y + 1, height - 1, 1, lineColor); drawVerticalLine(x, y + 1, height - 1, 1, lineColor);
drawHorizontalLine(x, y + height, width + 1, 1, lineColor); drawHorizontalLine(x, y + height, width + 1, 1, lineColor);
drawVerticalLine(x + width, y + 1, height - 1, 1, lineColor); drawVerticalLine(x + width, y + 1, height - 1, 1, lineColor);
@ -46,6 +50,6 @@ public class MainWindowBackgroundPS extends MenuComponent {
drawShadowUp(x, y, width + 1); drawShadowUp(x, y, width + 1);
drawShadowLeft(x, y, height + 1); drawShadowLeft(x, y, height + 1);
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);*/
} }
} }

View File

@ -1,9 +1,11 @@
package rip.athena.client.gui.clickgui.components.groups; package rip.athena.client.gui.clickgui.components.groups;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
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.gui.clickgui.components.profiles.ProfilesBase; import rip.athena.client.gui.clickgui.components.profiles.ProfilesBase;
import rip.athena.client.modules.impl.other.Settings;
import java.awt.*; import java.awt.*;
@ -77,17 +79,29 @@ public class GroupBase extends ProfilesBase {
@Override @Override
public void drawText(String string, int x, int y, int color) { public void drawText(String string, int x, int y, int color) {
Minecraft.getMinecraft().fontRendererObj.drawString(string, x, y, color); if(Settings.customGuiFont) {
FontManager.baloo17.drawString(string, x, y, color);
} else {
Minecraft.getMinecraft().fontRendererObj.drawString(string, 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,11 +1,13 @@
package rip.athena.client.gui.clickgui.components.groups; package rip.athena.client.gui.clickgui.components.groups;
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.clickgui.IngameMenu; import rip.athena.client.gui.clickgui.IngameMenu;
import rip.athena.client.modules.impl.other.Settings;
import java.awt.*; import java.awt.*;
@ -62,16 +64,28 @@ public class GroupListEntry extends MenuComponent {
@Override @Override
public void drawText(String string, int x, int y, int color) { public void drawText(String string, int x, int y, int color) {
Minecraft.getMinecraft().fontRendererObj.drawString(string, x, y, color); if(Settings.customGuiFont) {
FontManager.baloo17.drawString(string, x, y, color);
} else {
Minecraft.getMinecraft().fontRendererObj.drawString(string, 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,11 +1,13 @@
package rip.athena.client.gui.clickgui.components.groups; package rip.athena.client.gui.clickgui.components.groups;
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.clickgui.IngameMenu; import rip.athena.client.gui.clickgui.IngameMenu;
import rip.athena.client.modules.impl.other.Settings;
import java.awt.*; import java.awt.*;
@ -75,16 +77,28 @@ public class GroupListMiniEntry extends MenuComponent {
@Override @Override
public void drawText(String string, int x, int y, int color) { public void drawText(String string, int x, int y, int color) {
Minecraft.getMinecraft().fontRendererObj.drawString(string, x, y, color); if(Settings.customGuiFont) {
FontManager.baloo17.drawString(string, x, y, color);
} else {
Minecraft.getMinecraft().fontRendererObj.drawString(string, 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,10 +1,12 @@
package rip.athena.client.gui.clickgui.components.groups; package rip.athena.client.gui.clickgui.components.groups;
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.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.clickgui.IngameMenu; import rip.athena.client.gui.clickgui.IngameMenu;
import rip.athena.client.modules.impl.other.Settings;
import java.awt.*; import java.awt.*;
@ -60,16 +62,28 @@ public class GroupUserListHeader extends MenuComponent {
@Override @Override
public void drawText(String string, int x, int y, int color) { public void drawText(String string, int x, int y, int color) {
Minecraft.getMinecraft().fontRendererObj.drawString(string, x, y, color); if(Settings.customGuiFont) {
FontManager.baloo17.drawString(string, x, y, color);
} else {
Minecraft.getMinecraft().fontRendererObj.drawString(string, 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,10 +1,12 @@
package rip.athena.client.gui.clickgui.components.groups; package rip.athena.client.gui.clickgui.components.groups;
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.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.clickgui.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 net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
@ -64,17 +66,29 @@ public class GroupUserListUser extends MenuComponent {
@Override @Override
public void drawText(String string, int x, int y, int color) { public void drawText(String string, int x, int y, int color) {
Minecraft.getMinecraft().fontRendererObj.drawString(string, x, y, color); if(Settings.customGuiFont) {
FontManager.baloo17.drawString(string, x, y, color);
} else {
Minecraft.getMinecraft().fontRendererObj.drawString(string, 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

@ -7,6 +7,7 @@ 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.clickgui.IngameMenu; import rip.athena.client.gui.clickgui.IngameMenu;
import rip.athena.client.modules.impl.other.Settings; import rip.athena.client.modules.impl.other.Settings;
import rip.athena.client.utils.render.DrawUtils;
import java.awt.*; import java.awt.*;
@ -63,23 +64,26 @@ public class FlipButton extends MenuButton {
int lineColor = getColor(DrawType.LINE, lastState); int lineColor = getColor(DrawType.LINE, lastState);
int textColor = getColor(DrawType.TEXT, lastState); int textColor = getColor(DrawType.TEXT, lastState);
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x, y, width, height, backgroundColor); //rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x, y, width, height, backgroundColor);
drawHorizontalLine(x, y, width + 1, 1, lineColor); //drawHorizontalLine(x, y, width + 1, 1, lineColor);
drawVerticalLine(x, y + 1, height - 1, 1, linePopupColor); //drawVerticalLine(x, y + 1, height - 1, 1, linePopupColor);
drawHorizontalLine(x, y + height, width + 1, 1, lineColor); //drawHorizontalLine(x, y + height, width + 1, 1, lineColor);
drawVerticalLine(x + width, y + 1, height - 1, 1, linePopupColor); //drawVerticalLine(x + width, y + 1, height - 1, 1, linePopupColor);
x += 10; x += 10;
width -= 20; width -= 20;
y += 5; y += 5;
height -= 10; height -= 10;
drawHorizontalLine(x, y, width + 1, 1, linePopupColor); DrawUtils.drawRoundedRect(x - 1, y - 1, x + width + 1, y + height + 1, 4.0f, new Color(50, 50, 50, 255).getRGB());
DrawUtils.drawRoundedRect(x, y, x + width, y + height, 4.0f, new Color(35, 35, 35, 255).getRGB());
/*drawHorizontalLine(x, y, width + 1, 1, linePopupColor);
drawVerticalLine(x, y + 1, height - 1, 1, linePopupColor); drawVerticalLine(x, y + 1, height - 1, 1, linePopupColor);
drawHorizontalLine(x, y + height, width + 1, 1, linePopupColor); drawHorizontalLine(x, y + height, width + 1, 1, linePopupColor);
drawVerticalLine(x + width, y + 1, height - 1, 1, linePopupColor); drawVerticalLine(x + width, y + 1, height - 1, 1, linePopupColor);*/
int color = active ? NORMAL_ON : NORMAL_OFF; int color = active ? NORMAL_ON : NORMAL_OFF;
@ -93,9 +97,12 @@ public class FlipButton extends MenuButton {
height -= 1; height -= 1;
if(active) { if(active) {
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x, y, width / 2, height, color); DrawUtils.drawRoundedRect(x, y, x + width / 2, y + height, 4.0f, color);
//rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x, y, width / 2, height, color);
} else { } else {
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x + width - width / 2, y, width / 2, height, color); DrawUtils.drawRoundedRect(x + width - width / 2, y, x + width, y + height, 4.0f, color);
//rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x + width - width / 2, y, width / 2, height, color);
} }
mouseDown = false; mouseDown = false;

View File

@ -8,6 +8,7 @@ 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.clickgui.IngameMenu; import rip.athena.client.gui.clickgui.IngameMenu;
import rip.athena.client.modules.impl.other.Settings; import rip.athena.client.modules.impl.other.Settings;
import rip.athena.client.utils.render.DrawUtils;
import java.awt.*; import java.awt.*;
@ -63,9 +64,11 @@ public class MacroBase extends MenuComponent {
int textColor = getColor(DrawType.TEXT, ButtonState.NORMAL); int textColor = getColor(DrawType.TEXT, ButtonState.NORMAL);
int backgroundColor = getColor(DrawType.BACKGROUND, ButtonState.NORMAL); int backgroundColor = getColor(DrawType.BACKGROUND, ButtonState.NORMAL);
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x, y, width, height, backgroundColor); //rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x, y, width, height, backgroundColor);
drawHorizontalLine(x, y, width + 1, 1, lineColor); DrawUtils.drawRoundedRect(x, y, x + width, y + height, 4.0f, backgroundColor);
/*drawHorizontalLine(x, y, width + 1, 1, lineColor);
drawVerticalLine(x, y + 1, height - 1, 1, lineColor); drawVerticalLine(x, y + 1, height - 1, 1, lineColor);
drawHorizontalLine(x, y + height, width + 1, 1, lineColor); drawHorizontalLine(x, y + height, width + 1, 1, lineColor);
drawVerticalLine(x + width, y + 1, height - 1, 1, lineColor); drawVerticalLine(x + width, y + 1, height - 1, 1, lineColor);
@ -73,13 +76,13 @@ public class MacroBase extends MenuComponent {
drawShadowUp(x, y, width + 1); drawShadowUp(x, y, width + 1);
drawShadowLeft(x, y, height + 1); drawShadowLeft(x, y, height + 1);
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);*/
drawHorizontalLine(x, y, textWidth + 1, 1, linePopupColor); //drawHorizontalLine(x, y, textWidth + 1, 1, linePopupColor);
drawVerticalLine(x, y + 1, height - 1, 1, linePopupColor); //drawVerticalLine(x, y + 1, height - 1, 1, linePopupColor);
drawHorizontalLine(x, y + height, textWidth + 1, 1, linePopupColor); //drawHorizontalLine(x, y + height, textWidth + 1, 1, linePopupColor);
drawVerticalLine(x + textWidth, y + 1, height - 1, 1, linePopupColor); drawVerticalLine(x + textWidth, y + 1, height - 1, 1, linePopupColor);
drawText(text, x + spacing, y + height / 2 - getStringHeight(text) / 2, textColor); drawText(text, x + spacing, y + height / 2 - getStringHeight(text) / 2, textColor);
} }

View File

@ -6,6 +6,7 @@ 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 rip.athena.client.modules.impl.other.Settings;
import rip.athena.client.utils.render.DrawUtils;
import java.awt.*; import java.awt.*;
@ -27,13 +28,13 @@ public class MacroButton extends MenuButton {
@Override @Override
public void onInitColors() { public void onInitColors() {
if(approve) { if(approve) {
setColor(DrawType.LINE, ButtonState.NORMAL, new Color(33, 74, 19, 255)); setColor(DrawType.LINE, ButtonState.NORMAL, new Color(0, 200, 0, 255));
setColor(DrawType.LINE, ButtonState.ACTIVE, new Color(50, 112, 29, 255)); setColor(DrawType.LINE, ButtonState.ACTIVE, new Color(50, 112, 29, 255));
setColor(DrawType.LINE, ButtonState.HOVER, new Color(47, 105, 27, 255)); setColor(DrawType.LINE, ButtonState.HOVER, new Color(47, 105, 27, 255));
setColor(DrawType.LINE, ButtonState.HOVERACTIVE, new Color(60, 133, 34, 255)); setColor(DrawType.LINE, ButtonState.HOVERACTIVE, new Color(60, 133, 34, 255));
setColor(DrawType.LINE, ButtonState.DISABLED, new Color(100, 100, 100, 255)); setColor(DrawType.LINE, ButtonState.DISABLED, new Color(100, 100, 100, 255));
} else { } else {
setColor(DrawType.LINE, ButtonState.NORMAL, new Color(75, 12, 14, 255)); setColor(DrawType.LINE, ButtonState.NORMAL, new Color(200, 0, 0, 255));
setColor(DrawType.LINE, ButtonState.ACTIVE, new Color(99, 15, 18, 255)); setColor(DrawType.LINE, ButtonState.ACTIVE, new Color(99, 15, 18, 255));
setColor(DrawType.LINE, ButtonState.HOVER, new Color(92, 16, 18, 255)); setColor(DrawType.LINE, ButtonState.HOVER, new Color(92, 16, 18, 255));
setColor(DrawType.LINE, ButtonState.HOVERACTIVE, new Color(110, 19, 21, 255)); setColor(DrawType.LINE, ButtonState.HOVERACTIVE, new Color(110, 19, 21, 255));
@ -56,8 +57,11 @@ public class MacroButton extends MenuButton {
int lineColor = getColor(DrawType.LINE, lastState); int lineColor = getColor(DrawType.LINE, lastState);
int textColor = getColor(DrawType.TEXT, lastState); int textColor = getColor(DrawType.TEXT, lastState);
drawHorizontalLine(x, y, width + 1, 1, lineColor); DrawUtils.drawRoundedRect(x, y, x + width, y + height, 4.0f, lineColor);
DrawUtils.drawRoundedRect(x + 1, y + 1, x + width - 1, y + height - 1, 4.0f, new Color(35, 35, 35, 255).getRGB());
/*drawHorizontalLine(x, y, width + 1, 1, lineColor);
drawVerticalLine(x, y + 1, height - 1, 1, lineColor); drawVerticalLine(x, y + 1, height - 1, 1, lineColor);
drawHorizontalLine(x, y + height, width + 1, 1, lineColor); drawHorizontalLine(x, y + height, width + 1, 1, lineColor);
drawVerticalLine(x + width, y + 1, height - 1, 1, lineColor); drawVerticalLine(x + width, y + 1, height - 1, 1, lineColor);
@ -65,7 +69,7 @@ public class MacroButton extends MenuButton {
drawShadowUp(x, y, width + 1); drawShadowUp(x, y, width + 1);
drawShadowLeft(x, y, height + 1); drawShadowLeft(x, y, height + 1);
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);*/
drawText(text, x + (width / 2 - getStringWidth(text) / 2), y + (height / 2 - getStringHeight(text) / 2), textColor); drawText(text, x + (width / 2 - getStringWidth(text) / 2), y + (height / 2 - getStringHeight(text) / 2), textColor);

View File

@ -53,7 +53,7 @@ public class MacroSlimTextField extends SearchTextfield {
int width = this.width + minOffset * 2; int width = this.width + minOffset * 2;
int height = this.height; int height = this.height;
int mouseX = parent.getMouseX(); int mouseX = parent.getMouseX();
if(tab) { if(tab) {
if(!Keyboard.isKeyDown(Keyboard.KEY_TAB)) { if(!Keyboard.isKeyDown(Keyboard.KEY_TAB)) {
tab = false; tab = false;
@ -64,8 +64,8 @@ public class MacroSlimTextField extends SearchTextfield {
int lineColor = getColor(DrawType.LINE, lastState); int lineColor = getColor(DrawType.LINE, lastState);
int textColor = getColor(DrawType.TEXT, lastState); int textColor = getColor(DrawType.TEXT, lastState);
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x, y + height - 3, width, 3, lineColor); //rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x, y + height - 3, width, 3, lineColor);
String textToDraw = text; String textToDraw = text;
if(isPasswordField()) { if(isPasswordField()) {

View File

@ -47,7 +47,7 @@ public class MacroTextfield extends SearchTextfield {
setColor(DrawType.BACKGROUND, ButtonState.NORMAL, new Color(35, 35, 35, IngameMenu.MENU_ALPHA)); setColor(DrawType.BACKGROUND, ButtonState.NORMAL, new Color(35, 35, 35, IngameMenu.MENU_ALPHA));
setColor(DrawType.BACKGROUND, ButtonState.ACTIVE, new Color(29, 29, 32, IngameMenu.MENU_ALPHA)); setColor(DrawType.BACKGROUND, ButtonState.ACTIVE, new Color(29, 29, 32, IngameMenu.MENU_ALPHA));
setColor(DrawType.BACKGROUND, ButtonState.HOVER, new Color(25, 25, 28, IngameMenu.MENU_ALPHA)); setColor(DrawType.BACKGROUND, ButtonState.HOVER, new Color(40, 40, 40, IngameMenu.MENU_ALPHA));
setColor(DrawType.BACKGROUND, ButtonState.HOVERACTIVE, new Color(36, 36, 40, IngameMenu.MENU_ALPHA)); setColor(DrawType.BACKGROUND, ButtonState.HOVERACTIVE, new Color(36, 36, 40, IngameMenu.MENU_ALPHA));
setColor(DrawType.BACKGROUND, ButtonState.DISABLED, new Color(100, 100, 100, IngameMenu.MENU_ALPHA)); setColor(DrawType.BACKGROUND, ButtonState.DISABLED, new Color(100, 100, 100, IngameMenu.MENU_ALPHA));
} }
@ -74,13 +74,13 @@ public class MacroTextfield extends SearchTextfield {
GlStateManager.color(1, 1, 1); GlStateManager.color(1, 1, 1);
DrawUtils.drawRoundedRect(x - 4, y - 4, x + width + 5, y + height + 5, 0, 83886080); /*DrawUtils.drawRoundedRect(x - 4, y - 4, x + width + 5, y + height + 5, 4, 83886080);
DrawUtils.drawRoundedRect(x - 3, y - 3, x + width + 4, y + height + 4, 0, 369098752); DrawUtils.drawRoundedRect(x - 3, y - 3, x + width + 4, y + height + 4, 4, 369098752);
DrawUtils.drawRoundedRect(x - 2, y - 2, x + width + 3, y + height + 3, 0, 587202560); DrawUtils.drawRoundedRect(x - 2, y - 2, x + width + 3, y + height + 3, 4, 587202560);*/
DrawUtils.drawRoundedRect(x - 1, y - 1, x + width + 2, y + height + 2, 0, lineColor); DrawUtils.drawRoundedRect(x - 1, y - 1, x + width + 2, y + height + 2, 4, lineColor);
DrawUtils.drawRoundedRect(x, y, x + width + 1, y + height + 1, 0, lineColor); //DrawUtils.drawRoundedRect(x, y, x + width + 1, y + height + 1, 4, lineColor);
DrawUtils.drawRoundedRect(x, y, x + width + 1, y + height + 1, 0, backgroundColor); DrawUtils.drawRoundedRect(x, y, x + width + 1, y + height + 1, 4, backgroundColor);
String textToDraw = text; String textToDraw = text;

View File

@ -7,6 +7,7 @@ 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.clickgui.IngameMenu; import rip.athena.client.gui.clickgui.IngameMenu;
import rip.athena.client.modules.impl.other.Settings; import rip.athena.client.modules.impl.other.Settings;
import rip.athena.client.utils.render.DrawUtils;
import java.awt.*; import java.awt.*;
@ -58,12 +59,14 @@ public class SimpleTextButton extends MenuButton {
int textColor = getColor(DrawType.TEXT, lastState); int textColor = getColor(DrawType.TEXT, lastState);
int linePopupColor = getColor(DrawType.LINE, ButtonState.POPUP); int linePopupColor = getColor(DrawType.LINE, ButtonState.POPUP);
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x, y, width, height, backgroundColor); //rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x, y, width, height, backgroundColor);
DrawUtils.drawRoundedRect(x - 1, y - 1, x + width + 1, y + height + 1, 4.0f, lineColor);
drawHorizontalLine(x, y, width + 1, 1, lineColor); DrawUtils.drawRoundedRect(x, y, x + width, y + height, 4.0f, backgroundColor);
/*drawHorizontalLine(x, y, width + 1, 1, lineColor);
drawVerticalLine(x, y + 1, height - 1, 1, leftColorChange ? linePopupColor : lineColor); drawVerticalLine(x, y + 1, height - 1, 1, leftColorChange ? linePopupColor : lineColor);
drawHorizontalLine(x, y + height, width + 1, 1, lineColor); drawHorizontalLine(x, y + height, width + 1, 1, lineColor);
drawVerticalLine(x + width, y + 1, height - 1, 1, lineColor); drawVerticalLine(x + width, y + 1, height - 1, 1, lineColor);*/
drawText(text, x + (width / 2 - getStringWidth(text) / 2) + 2, y + (height / 2 - getStringHeight(text) / 2), textColor); drawText(text, x + (width / 2 - getStringWidth(text) / 2) + 2, y + (height / 2 - getStringHeight(text) / 2), textColor);
@ -73,7 +76,7 @@ public class SimpleTextButton extends MenuButton {
@Override @Override
public void drawText(String string, int x, int y, int color) { public void drawText(String string, int x, int y, int color) {
if(Settings.customGuiFont) { if(Settings.customGuiFont) {
FontManager.baloo17.drawString(string, x, y, color); FontManager.baloo17.drawString(string, x - 3, y, color);
} else { } else {
Minecraft.getMinecraft().fontRendererObj.drawString(string, x, y, color); Minecraft.getMinecraft().fontRendererObj.drawString(string, x, y, color);
} }
@ -82,7 +85,7 @@ public class SimpleTextButton extends MenuButton {
@Override @Override
public int getStringWidth(String string) { public int getStringWidth(String string) {
if(Settings.customGuiFont) { if(Settings.customGuiFont) {
return (int) FontManager.baloo17.getStringWidth(string); return (int) FontManager.baloo17.getStringWidth(string) - 1;
} else { } else {
return Minecraft.getMinecraft().fontRendererObj.getStringWidth(string); return Minecraft.getMinecraft().fontRendererObj.getStringWidth(string);
} }
@ -91,7 +94,7 @@ public class SimpleTextButton extends MenuButton {
@Override @Override
public int getStringHeight(String string) { public int getStringHeight(String string) {
if(Settings.customGuiFont) { if(Settings.customGuiFont) {
return (int) FontManager.baloo17.getHeight(string); return (int) FontManager.baloo17.getHeight(string) + 1;
} else { } else {
return Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT; return Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT;
} }

View File

@ -9,6 +9,7 @@ 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 rip.athena.client.modules.impl.other.Settings;
import rip.athena.client.utils.render.DrawUtils;
import java.awt.*; import java.awt.*;
import java.util.Set; import java.util.Set;
@ -160,10 +161,13 @@ public class MenuModKeybind extends MenuComponent {
GlStateManager.color(1,1,1); GlStateManager.color(1,1,1);
drawHorizontalLine(x, y, width + 1, 1, lineColor); DrawUtils.drawRoundedRect(x - 1, y - 1, x + width + 1, y + height + 1, 4.0f, lineColor);
drawVerticalLine(x, y + 1, height - 1, 1, lineColor); DrawUtils.drawRoundedRect(x, y, x + width, y + height, 4.0f, new Color(35,35,35, 255).getRGB());
drawHorizontalLine(x, y + height, width + 1, 1, lineColor);
drawVerticalLine(x + width, y + 1, height - 1, 1, lineColor); //drawHorizontalLine(x, y, width + 1, 1, lineColor);
//drawVerticalLine(x, y + 1, height - 1, 1, lineColor);
//drawHorizontalLine(x, y + height, width + 1, 1, lineColor);
//drawVerticalLine(x + width, y + 1, height - 1, 1, lineColor);
String text = "CLICK TO BIND"; String text = "CLICK TO BIND";

View File

@ -60,6 +60,7 @@ public class ModCategoryButton extends MenuButton {
GlStateManager.color(1, 1, 1); GlStateManager.color(1, 1, 1);
//rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x, y, width - 10, height, backgroundColor); //rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x, y, width - 10, height, backgroundColor);
DrawUtils.drawRoundedRect(x + 9, y - 1, x + width - 19, y + height + 1, 4, new Color(50,50,50,255).getRGB());
DrawUtils.drawRoundedRect(x + 10, y, x + width - 20, y + height, 4, backgroundColor); DrawUtils.drawRoundedRect(x + 10, y, x + width - 20, y + height, 4, backgroundColor);
if(Settings.customGuiFont) { if(Settings.customGuiFont) {

View File

@ -1,11 +1,15 @@
package rip.athena.client.gui.clickgui.components.profiles; package rip.athena.client.gui.clickgui.components.profiles;
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.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.clickgui.IngameMenu; import rip.athena.client.gui.clickgui.IngameMenu;
import rip.athena.client.modules.impl.other.Settings;
import rip.athena.client.utils.render.DrawUtils;
import java.awt.*; import java.awt.*;
@ -57,33 +61,50 @@ public class ProfilesBase extends MenuComponent {
int textColor = getColor(DrawType.TEXT, ButtonState.NORMAL); int textColor = getColor(DrawType.TEXT, ButtonState.NORMAL);
int backgroundColor = getColor(DrawType.BACKGROUND, ButtonState.NORMAL); int backgroundColor = getColor(DrawType.BACKGROUND, ButtonState.NORMAL);
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x, y, width, height, backgroundColor); GlStateManager.color(1,1,1);
//rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x, y, width, height, backgroundColor);
drawHorizontalLine(x, y, width + 1, 1, lineColor); /*drawHorizontalLine(x, y, width + 1, 1, lineColor);
drawVerticalLine(x, y + 1, height - 1, 1, lineColor); drawVerticalLine(x, y + 1, height - 1, 1, lineColor);
drawHorizontalLine(x, y + height, width + 1, 1, lineColor); drawHorizontalLine(x, y + height, width + 1, 1, lineColor);
drawVerticalLine(x + width, y + 1, height - 1, 1, lineColor); drawVerticalLine(x + width, y + 1, height - 1, 1, lineColor);*/
drawShadowUp(x, y, width + 1); /*drawShadowUp(x, y, width + 1);
drawShadowLeft(x, y, height + 1); drawShadowLeft(x, y, height + 1);
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);*/
DrawUtils.drawRoundedRect(x, y, x + width, y + height, 4.0f, new Color(50,50,50,255).getRGB());
DrawUtils.drawRoundedRect(x + 1, y + 1, x + width - 1, y + height - 1, 4.0f, new Color(35,35,35,255).getRGB());
drawText(text, x + width / 2 - getStringWidth(text) / 2, y + 30, textColor); drawText(text, x + width / 2 - getStringWidth(text) / 2, y + 30, textColor);
} }
@Override @Override
public void drawText(String string, int x, int y, int color) { public void drawText(String string, int x, int y, int color) {
Minecraft.getMinecraft().fontRendererObj.drawString(string, x, y, color); if(Settings.customGuiFont) {
FontManager.baloo17.drawString(string, x, y, color);
} else {
Minecraft.getMinecraft().fontRendererObj.drawString(string, 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

@ -20,10 +20,10 @@ public class ProfilesBlueButton extends MacroButton {
@Override @Override
public void onInitColors() { public void onInitColors() {
setColor(DrawType.LINE, ButtonState.NORMAL, new Color(14, 32, 48, 255)); setColor(DrawType.LINE, ButtonState.NORMAL, new Color(20, 20, 20, 255));
setColor(DrawType.LINE, ButtonState.ACTIVE, new Color(29, 66, 99, 255)); setColor(DrawType.LINE, ButtonState.ACTIVE, new Color(25, 25, 25, 255));
setColor(DrawType.LINE, ButtonState.HOVER, new Color(28, 60, 89, 255)); setColor(DrawType.LINE, ButtonState.HOVER, new Color(30, 30, 30, 255));
setColor(DrawType.LINE, ButtonState.HOVERACTIVE, new Color(34, 79, 120, 255)); setColor(DrawType.LINE, ButtonState.HOVERACTIVE, new Color(25, 25, 25, 255));
setColor(DrawType.LINE, ButtonState.DISABLED, new Color(100, 100, 100, 255)); setColor(DrawType.LINE, ButtonState.DISABLED, new Color(100, 100, 100, 255));
setColor(DrawType.TEXT, ButtonState.NORMAL, new Color(200, 200, 200, 255)); setColor(DrawType.TEXT, ButtonState.NORMAL, new Color(200, 200, 200, 255));

View File

@ -1,12 +1,14 @@
package rip.athena.client.gui.clickgui.components.waypoints; package rip.athena.client.gui.clickgui.components.waypoints;
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.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 rip.athena.client.modules.impl.other.Settings;
import rip.athena.client.utils.render.DrawUtils;
import java.awt.*; import java.awt.*;
@ -43,29 +45,34 @@ public class WaypointTextBarrier extends MenuComponent {
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);
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x, y, width, height, backgroundColor); //rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x, y, width, height, backgroundColor);
drawHorizontalLine(x, y, width + 1, 1, lineColor); GlStateManager.color(1,1,1);
DrawUtils.drawRoundedRect(x, y, x + width, y + height, 4.0f, new Color(50, 50, 50, 255).getRGB());
DrawUtils.drawRoundedRect(x + 1, y + 1, x + width - 1, y + height - 1, 4.0f, new Color(35, 35, 35, 255).getRGB());
/*drawHorizontalLine(x, y, width + 1, 1, lineColor);
drawVerticalLine(x, y + 1, height - 1, 1, lineColor); drawVerticalLine(x, y + 1, height - 1, 1, lineColor);
drawHorizontalLine(x, y + height, width + 1, 1, lineColor); drawHorizontalLine(x, y + height, width + 1, 1, lineColor);
drawVerticalLine(x + width, y + 1, height - 1, 1, lineColor); drawVerticalLine(x + width, y + 1, height - 1, 1, lineColor);*/
drawText(text + "", x + width / 2 - getStringWidth(text) / 2 + 2, y + height / 2 - getStringHeight(text) / 2, textColor); drawText(text + "", x + width / 2 - getStringWidth(text) / 2 + 2, y + height / 2 - getStringHeight(text) / 2, textColor);
} }
@Override @Override
public void drawText(String text, int x, int y, int color) { public void drawText(String string, int x, int y, int color) {
if(Settings.customGuiFont) { if(Settings.customGuiFont) {
FontManager.baloo17.drawString(text, x, y, color); FontManager.baloo17.drawString(string, x - 3, y, color);
} else { } else {
Minecraft.getMinecraft().fontRendererObj.drawString(text, x, y, color); Minecraft.getMinecraft().fontRendererObj.drawString(string, x, y, color);
} }
} }
@Override @Override
public int getStringWidth(String string) { public int getStringWidth(String string) {
if(Settings.customGuiFont) { if(Settings.customGuiFont) {
return (int) FontManager.baloo17.getStringWidth(string); return (int) FontManager.baloo17.getStringWidth(string) - 1;
} else { } else {
return Minecraft.getMinecraft().fontRendererObj.getStringWidth(string); return Minecraft.getMinecraft().fontRendererObj.getStringWidth(string);
} }
@ -74,7 +81,7 @@ public class WaypointTextBarrier extends MenuComponent {
@Override @Override
public int getStringHeight(String string) { public int getStringHeight(String string) {
if(Settings.customGuiFont) { if(Settings.customGuiFont) {
return (int) FontManager.baloo17.getHeight(string); return (int) FontManager.baloo17.getHeight(string) + 1;
} else { } else {
return Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT; return Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT;
} }

View File

@ -1,5 +1,6 @@
package rip.athena.client.gui.clickgui.pages; package rip.athena.client.gui.clickgui.pages;
import net.minecraft.client.renderer.GlStateManager;
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;

View File

@ -107,7 +107,7 @@ public class MacrosPage extends Page {
for(Macro macro : Athena.INSTANCE.getMacroManager().getMacros()) { for(Macro macro : Athena.INSTANCE.getMacroManager().getMacros()) {
scrollPane.addComponent(new MacroBase(macro.getName(), x, y, width, height)); scrollPane.addComponent(new MacroBase(macro.getName(), x, y, width, height));
MacroSlimTextField field = new MacroSlimTextField(TextPattern.NONE, x + 160 + spacing, y, width - 160 - spacing * 4 - 90, height - 5) { MacroSlimTextField field = new MacroSlimTextField(TextPattern.NONE, x + 160 + spacing, y, (width - 280 - spacing * 4 - 90), height - 5) {
@Override @Override
public void onAction() { public void onAction() {
macro.setCommand(getText()); macro.setCommand(getText());
@ -117,8 +117,19 @@ public class MacrosPage extends Page {
field.setText(macro.getCommand()); field.setText(macro.getCommand());
scrollPane.addComponent(field); scrollPane.addComponent(field);
FlipButton flipButton = new FlipButton(width - spacing - 90, y, 90 - 10, height) { int keybindWidth = (width - 189 - spacing * 4 - 90) / 2;
MenuModKeybind keybindElement = new MenuModKeybind(x + 220 + spacing + keybindWidth + spacing, y + 5, keybindWidth - 20, height - 10) {
@Override
public void onAction() {
macro.setKey(getBind());
}
};
keybindElement.setBind(macro.getKey());
scrollPane.addComponent(keybindElement);
FlipButton flipButton = new FlipButton(width - spacing - 80, y, 90 - 10, height) {
@Override @Override
public void onAction() { public void onAction() {
macro.setEnabled(isActive()); macro.setEnabled(isActive());
@ -129,7 +140,7 @@ public class MacrosPage extends Page {
scrollPane.addComponent(flipButton); scrollPane.addComponent(flipButton);
scrollPane.addComponent(new SimpleTextButton("X", width - spacing, y, 30, height, true) { scrollPane.addComponent(new SimpleTextButton("X", width - spacing, y + 5, 20, 20, true) {
@Override @Override
public void onAction() { public void onAction() {
Athena.INSTANCE.getMacroManager().getMacros().remove(macro); Athena.INSTANCE.getMacroManager().getMacros().remove(macro);

View File

@ -59,10 +59,8 @@ public class ModsPage extends Page {
@Override @Override
public void onInit() { public void onInit() {
for (Category category : Category.values()) { for (Category category : Category.values()) {
String icon = category.getIcon(); if (!category.isHidden()) {
//MOD_TABS[category.getIndex()] = AssetUtils.getResource(icon);
if (icon.trim().length() > 0 && !category.isHidden()) {
MOD_TABS[category.getIndex()] = AssetUtils.getResource(icon);
} }
} }
} }
@ -77,11 +75,7 @@ public class ModsPage extends Page {
y += 50; y += 50;
for (Category category : Category.values()) { for (Category category : Category.values()) {
String icon = category.getIcon(); if (!category.isHidden()) {
if (icon.trim().length() > 0 && !category.isHidden()) {
//drawShadowUp(menu.getX() + 15, y, 190);
//drawShadowDown(menu.getX() + 15, y + height, 190);
y += height + 2 + 10; y += height + 2 + 10;
} }
} }
@ -127,13 +121,11 @@ public class ModsPage extends Page {
@Override @Override
public void onLoad() { public void onLoad() {
int y = 59 + 50; int y = 59 + 10;
int height = 32; int height = 32;
for (Category category : Category.values()) { for (Category category : Category.values()) {
String icon = category.getIcon(); if (!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() {

View File

@ -1,6 +1,13 @@
package rip.athena.client.gui.clickgui.pages; package rip.athena.client.gui.clickgui.pages;
import net.minecraft.client.gui.GuiScreen;
import org.apache.commons.lang3.RandomStringUtils;
import org.json.JSONException;
import rip.athena.client.Athena;
import rip.athena.client.config.save.Config;
import rip.athena.client.font.FontManager; import rip.athena.client.font.FontManager;
import rip.athena.client.gui.clickgui.components.macros.SimpleTextButton;
import rip.athena.client.gui.clickgui.components.profiles.ProfilesBase;
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.clickgui.IngameMenu; import rip.athena.client.gui.clickgui.IngameMenu;
@ -12,6 +19,14 @@ import rip.athena.client.gui.clickgui.components.mods.ModScrollPane;
import rip.athena.client.gui.clickgui.components.profiles.ProfilesBlueButton; import rip.athena.client.gui.clickgui.components.profiles.ProfilesBlueButton;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import rip.athena.client.modules.impl.other.Settings; import rip.athena.client.modules.impl.other.Settings;
import rip.athena.client.requests.ContentType;
import rip.athena.client.requests.WebRequest;
import rip.athena.client.requests.WebRequestResult;
import java.awt.*;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.NoSuchElementException;
/** /**
* @author Athena Development * @author Athena Development
@ -26,7 +41,9 @@ public class ProfilesPage extends Page {
private ProfilesBlueButton download; private ProfilesBlueButton download;
private MacroButton delete; private MacroButton delete;
private ModScrollPane scrollPane; private ModScrollPane scrollPane;
private String PROFILES_URL = "http://download.athena.rip:3000/api/v1/profiles/upload";
public ProfilesPage(Minecraft mc, Menu menu, IngameMenu parent) { public ProfilesPage(Minecraft mc, Menu menu, IngameMenu parent) {
super(mc, menu, parent); super(mc, menu, parent);
} }
@ -53,9 +70,9 @@ public class ProfilesPage extends Page {
return; return;
} }
//Athena.INSTANCE.configManager.getConfig(nameNew.getText()).save(); Athena.INSTANCE.getConfigManager().getConfig(nameNew.getText()).save();
nameNew.setText(""); nameNew.setText("");
populateScrollPane(); populateScrollPane();
} }
}; };
@ -69,18 +86,20 @@ public class ProfilesPage extends Page {
return; return;
} }
/*try { try {
WebRequest request = new WebRequest(Athena.PROFILES_URL + "/uploads/" + URLEncoder.encode(nameAdd.getText(), "UTF-8") + "/config.json", "GET", ContentType.FORM, false); WebRequest request = new WebRequest("http://download.athena.rip:3000/api/v1/profiles/" + 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) {
Athena.INSTANCE.configManager.getConfig(nameAdd.getText()).load(result.getData()); Athena.INSTANCE.getLog().error(nameAdd.getText() + result.getData());
//Athena.INSTANCE.getConfigManager().getConfig(nameAdd.getText());
Athena.INSTANCE.getNotificationManager().showNotification("Successfully downloaded config", Color.GREEN);
} else { } else {
Athena.INSTANCE.notificationManager.showNotification("Config failed to download, make sure the profile name is accurate.", Color.RED); Athena.INSTANCE.getNotificationManager().showNotification("Config failed to download, make sure the profile name is accurate.", Color.RED);
} }
} catch (JSONException | NoSuchElementException | IOException e) { } catch (JSONException | NoSuchElementException | IOException e) {
Athena.INSTANCE.log.error("Failed to download config.", e); Athena.INSTANCE.getLog().error("Failed to download config." + e);
}*/ }
nameAdd.setText(""); nameAdd.setText("");
populateScrollPane(); populateScrollPane();
@ -92,7 +111,7 @@ public class ProfilesPage extends Page {
public void onAction() { public void onAction() {
setActive(false); setActive(false);
//Athena.INSTANCE.configManager.deleteAllConfigs(); Athena.INSTANCE.getConfigManager().deleteAllConfigs();
populateScrollPane(); populateScrollPane();
} }
}; };
@ -123,7 +142,7 @@ public class ProfilesPage extends Page {
int exitButtonSize = 18; int exitButtonSize = 18;
/*for(Config config : Athena.INSTANCE.configManager.getConfigs()) { for(Config config : Athena.INSTANCE.getConfigManager().getConfigs()) {
scrollPane.addComponent(new ProfilesBase(config.getName(), x, y, width, height)); scrollPane.addComponent(new ProfilesBase(config.getName(), x, y, width, height));
scrollPane.addComponent(new SimpleTextButton("X", x + innerWidth - exitButtonSize + innerSpacing, y + innerSpacing, exitButtonSize, exitButtonSize, false) { scrollPane.addComponent(new SimpleTextButton("X", x + innerWidth - exitButtonSize + innerSpacing, y + innerSpacing, exitButtonSize, exitButtonSize, false) {
@ -135,60 +154,65 @@ public class ProfilesPage extends Page {
populateScrollPane(); populateScrollPane();
} }
}); });
scrollPane.addComponent(new ProfilesBlueButton("UPLOAD PROFILE", x + innerSpacing, y + height - buttonHeight - innerSpacing * 3 - spacing, innerWidth, buttonHeight) { scrollPane.addComponent(new ProfilesBlueButton("UPLOAD PROFILE", x + innerSpacing, y + height - buttonHeight - innerSpacing * 3 - spacing, innerWidth, buttonHeight) {
@Override @Override
public void onAction() { public void onAction() {
setActive(false); setActive(false);
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(Athena.PROFILES_URL + "/upload.php?id=" + code, "POST", ContentType.MULTIPART_FORM, false); WebRequest request = new WebRequest(PROFILES_URL, "POST", ContentType.MULTIPART_FORM, false);
String boundary = "WebKitFormBoundaryYDPG5KWy5y4yolEf"; String boundary = "WebKitFormBoundaryYDPG5KWy5y4yolEf";
request.setBoundary(boundary); request.setBoundary(boundary);
request.setRawData("------" + boundary + "\r\n" + // Set the appropriate headers for Node.js server
"Content-Disposition: form-data; name=\"fileToUpload\"; filename=\"config.json\"\r\n" + request.setHeader("Content-Type", "multipart/form-data; boundary=----" + boundary);
"Content-Type: application/json\r\n" + request.setHeader("Connection", "keep-alive");
"\r\n" +
config.toString() + request.setRawData("------" + boundary + "\r\n" +
"\r\n" + "Content-Disposition: form-data; name=\"id\"\r\n" +
"------" + boundary + "\r\n" + "\r\n" +
"Content-Disposition: form-data; name=\"submit\"\r\n" + code +
"\r\n" + "\r\n" +
"Upload Image\r\n" + "------" + boundary + "\r\n" +
"Content-Disposition: form-data; name=\"fileToUpload\"; filename=\"config.json\"\r\n" +
"Content-Type: application/json\r\n" +
"\r\n" +
config.toString() +
"\r\n" +
"------" + boundary + "--\r\n"); "------" + boundary + "--\r\n");
WebRequestResult result = request.connect(); WebRequestResult result = request.connect();
if(result.getResponse() == 200) { if(result.getResponse() == 200) {
Athena.INSTANCE.notificationManager.showNotification("Config uploaded, config code: " + code + ", copied to clipboard.", Color.RED); Athena.INSTANCE.getNotificationManager().showNotification("Uploaded | Code: [" + code + "], copied to clipboard.", Color.GREEN);
} else { } else {
Athena.INSTANCE.notificationManager.showNotification("Config failed to upload.", Color.RED); Athena.INSTANCE.getNotificationManager().showNotification("Config failed to upload.", Color.RED);
} }
GuiScreen.setClipboardString(code); GuiScreen.setClipboardString(code);
} catch (JSONException | NoSuchElementException | IOException e) { } catch (JSONException | NoSuchElementException | IOException e) {
Athena.INSTANCE.log.error("Failed to upload config.", e); Athena.INSTANCE.getNotificationManager().showNotification("Config failed to upload.", Color.RED);
} }
} }
}); });
scrollPane.addComponent(new MacroButton(config.isEnabled() ? "ENABLED" : "DISABLED", x + innerSpacing, y + height - innerSpacing * 2 - spacing, innerWidth, buttonHeight, config.isEnabled()) { scrollPane.addComponent(new MacroButton(config.isEnabled() ? "ENABLED" : "DISABLED", x + innerSpacing, y + height - innerSpacing * 2 - spacing, innerWidth, buttonHeight, config.isEnabled()) {
@Override @Override
public void onAction() { public void onAction() {
setActive(false); setActive(false);
Config cfg = Athena.INSTANCE.configManager.getLoadedConfig(); Config cfg = Athena.INSTANCE.getConfigManager().getLoadedConfig();
if(cfg != null) { if(cfg != null) {
cfg.save(); cfg.save();
} }
config.load(); config.load();
populateScrollPane(); populateScrollPane();
} }
@ -200,7 +224,7 @@ public class ProfilesPage extends Page {
x = defaultX; x = defaultX;
y += height + spacing; y += height + spacing;
} }
}*/ }
} }

View File

@ -285,8 +285,8 @@ public class SettingsPage extends Page {
int height = 32; int height = 32;
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(menu.getX(), menu.getY() + 58, width, menu.getHeight() - 58, MacrosPage.MENU_SIDE_BG_COLOR); rip.athena.client.gui.framework.draw.DrawImpl.drawRect(menu.getX(), menu.getY() + 58, width, menu.getHeight() - 58, MacrosPage.MENU_SIDE_BG_COLOR);
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(menu.getX(), menu.getY() + 58, width, height + 1, ModCategoryButton.MAIN_COLOR); rip.athena.client.gui.framework.draw.DrawImpl.drawRect(menu.getX(), menu.getY() + 58, width, height + 1, ModCategoryButton.MAIN_COLOR);
drawShadowDown(menu.getX(), y + height, width); drawShadowDown(menu.getX(), y + height, width);
drawShadowDown(menu.getX(), y - 1, width); drawShadowDown(menu.getX(), y - 1, width);

View File

@ -51,7 +51,7 @@ public class WaypointsPage extends Page {
name = new MacroTextfield(TextPattern.NONE, x, y + 85, compWidth, 22, "...") ; name = new MacroTextfield(TextPattern.NONE, x, y + 85, compWidth, 22, "...") ;
description = new MacroTextfield(TextPattern.NONE, x, y + 155, compWidth, 22, "..."); description = new MacroTextfield(TextPattern.NONE, x, y + 155, compWidth, 22, "...");
xBarrier = new WaypointTextBarrier("X", x, y + 195 - 1, 30, 24); xBarrier = new WaypointTextBarrier("X", x, y + 195 - 1, 25, 24);
this.x = new MacroTextfield(TextPattern.NUMBERS_ONLY, x + 30, y + 195, compWidth - 30, 22, "...") { this.x = new MacroTextfield(TextPattern.NUMBERS_ONLY, x + 30, y + 195, compWidth - 30, 22, "...") {
@Override @Override
public void onAction() { public void onAction() {
@ -59,7 +59,7 @@ public class WaypointsPage extends Page {
} }
}; };
yBarrier = new WaypointTextBarrier("Y", x, y + 225 - 1, 30, 24); yBarrier = new WaypointTextBarrier("Y", x, y + 225 - 1, 25, 24);
this.y = new MacroTextfield(TextPattern.NUMBERS_ONLY, x + 30, y + 225, compWidth - 30, 22, "...") { this.y = new MacroTextfield(TextPattern.NUMBERS_ONLY, x + 30, y + 225, compWidth - 30, 22, "...") {
@Override @Override
public void onAction() { public void onAction() {
@ -67,7 +67,7 @@ public class WaypointsPage extends Page {
} }
}; };
zBarrier = new WaypointTextBarrier("Z", x, y + 255 - 1, 30, 24); zBarrier = new WaypointTextBarrier("Z", x, y + 255 - 1, 25, 24);
this.z = new MacroTextfield(TextPattern.NUMBERS_ONLY, x + 30, y + 255, compWidth - 30, 22, "...") { this.z = new MacroTextfield(TextPattern.NUMBERS_ONLY, x + 30, y + 255, compWidth - 30, 22, "...") {
@Override @Override
public void onAction() { public void onAction() {

View File

@ -8,6 +8,7 @@ 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 org.lwjgl.input.Keyboard; import org.lwjgl.input.Keyboard;
import rip.athena.client.utils.render.DrawUtils;
import java.awt.*; import java.awt.*;
import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.DataFlavor;
@ -76,12 +77,12 @@ public class MenuTextField extends MenuComponent {
String text = (String) Toolkit.getDefaultToolkit().getSystemClipboard().getData(DataFlavor.stringFlavor); String text = (String) Toolkit.getDefaultToolkit().getSystemClipboard().getData(DataFlavor.stringFlavor);
if(!setText(text)) { if(!setText(text)) {
//Athena.INSTANCE.notificationManager.showNotification("Clipboard doesnt match the desired data.", Color.RED); Athena.INSTANCE.getNotificationManager().showNotification("Clipboard doesnt match the desired data.", Color.RED);
} else { } else {
index = text.length(); index = text.length();
} }
} catch (HeadlessException | UnsupportedFlavorException | IOException e) { } catch (HeadlessException | UnsupportedFlavorException | IOException e) {
//Athena.INSTANCE.notificationManager.showNotification("Invalid clipboard data.", Color.RED); Athena.INSTANCE.getNotificationManager().showNotification("Invalid clipboard data.", Color.RED);
e.printStackTrace(); e.printStackTrace();
}; };
} }
@ -267,12 +268,15 @@ public class MenuTextField extends MenuComponent {
GlStateManager.color(1, 1,1); GlStateManager.color(1, 1,1);
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x + 1, y + 1, width - 1, height - 1, backgroundColor); //rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x + 1, y + 1, width - 1, height - 1, backgroundColor);
drawHorizontalLine(x, y, width + 1, 1, lineColor); DrawUtils.drawRoundedRect(x - 1, y - 1, x + width + 1, y + height + 1, 4.0f, lineColor);
DrawUtils.drawRoundedRect(x, y, x + width, y + height, 4.0f, new Color(35,35,35, 255).getRGB());
/*drawHorizontalLine(x, y, width + 1, 1, lineColor);
drawVerticalLine(x, y + 1, height - 1, 1, lineColor); drawVerticalLine(x, y + 1, height - 1, 1, lineColor);
drawHorizontalLine(x, y + height, width + 1, 1, lineColor); drawHorizontalLine(x, y + height, width + 1, 1, lineColor);
drawVerticalLine(x + width, y + 1, height - 1, 1, lineColor); drawVerticalLine(x + width, y + 1, height - 1, 1, lineColor);*/
String textToDraw = text; String textToDraw = text;

View File

@ -6,6 +6,7 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import org.lwjgl.input.Mouse; import org.lwjgl.input.Mouse;
import rip.athena.client.Athena; import rip.athena.client.Athena;
import rip.athena.client.config.save.Config;
import rip.athena.client.font.FontManager; import rip.athena.client.font.FontManager;
import rip.athena.client.gui.framework.MinecraftMenuImpl; import rip.athena.client.gui.framework.MinecraftMenuImpl;
import rip.athena.client.gui.framework.draw.DrawImpl; import rip.athena.client.gui.framework.draw.DrawImpl;
@ -359,12 +360,12 @@ public class HUDEditor extends MinecraftMenuImpl implements DrawImpl {
public void onGuiClosed() { public void onGuiClosed() {
super.onGuiClosed(); super.onGuiClosed();
/*new Thread(() -> { new Thread(() -> {
Config config = Athena.INSTANCE.configManager.getLoadedConfig(); Config config = Athena.INSTANCE.getConfigManager().getLoadedConfig();
if(config != null) { if(config != null) {
config.save(); config.save();
} }
}).start();*/ }).start();
} }
} }

View File

@ -0,0 +1,24 @@
package rip.athena.client.gui.notifications;
import java.util.List;
public class NotiRemovalThread implements Runnable {
private List<Notification> notifications;
public NotiRemovalThread(List<Notification> notifications) {
this.notifications = notifications;
}
@Override
public void run() {
while(true) {
notifications.removeIf(noti -> noti.isDead());
try {
Thread.sleep(500);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}

View File

@ -0,0 +1,123 @@
package rip.athena.client.gui.notifications;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.GlStateManager;
import org.lwjgl.opengl.GL11;
import rip.athena.client.font.FontManager;
import rip.athena.client.utils.render.DrawUtils;
import java.awt.*;
public class Notification {
private static Color BACKGROUND_COLOR = new Color(35, 35, 35, 255);
private static Color TEXT_COLOR = new Color(255, 255, 255, 255);
private static Color LINE_COLOR = new Color(255, 255, 255, 255);
private static int FADEOUT_TIME = 750;
private static long MAX_TIME = 10 * 1000L;
private String text;
private Color color;
private long start;
public Notification(String text, Color color) {
this.text = text;
this.color = color;
start = System.currentTimeMillis();
}
public String getText() {
return text;
}
public Color getColor() {
return color;
}
public long getStart() {
return start;
}
public boolean isDead() {
return System.currentTimeMillis() - start > MAX_TIME;
}
public int draw(int y) {
if(isDead()) {
return y;
}
int x = new ScaledResolution(Minecraft.getMinecraft()).getScaledWidth();
int stringWidth = (int) FontManager.baloo17.getStringWidth(text) + 10;
int width = 30;
int height = 20;
float textReady = getDeltaByTime(1900, 600);
float fadeOut = getDeltaByTime((int)MAX_TIME - FADEOUT_TIME, FADEOUT_TIME);
if(fadeOut > 0) {
x = x + Math.round((stringWidth + width) * fadeOut);
}
GlStateManager.color(1,1,1);
float delta = getDeltaByTime(0, 500);
drawRect(Math.round(x - (width * delta)), y, x, y - height, BACKGROUND_COLOR);
if(delta == 1) {
delta = getDeltaByTime(500, 1000);
float oldDelta = delta;
if(delta == 1) {
delta = getDeltaByTime(1500, 400);
drawRect(x - width + 2, y - 2, x - width, y - 2 - Math.round((height - 4) * delta), LINE_COLOR);
if(delta == 1) {
delta = textReady;
drawRect(x - width - Math.round(stringWidth * delta), y - height, x - width, y, BACKGROUND_COLOR);
}
}
float textOutDelta = delta = getDeltaByTime(2500, 1500);
if(textReady == 1) {
FontManager.baloo17.drawString(text, x - width - Math.round(stringWidth * delta) + 5, y - 14, TEXT_COLOR.getRGB());
GL11.glColor4f(BACKGROUND_COLOR.getRed() / 255F, BACKGROUND_COLOR.getGreen() / 255F, BACKGROUND_COLOR.getBlue() / 255F, BACKGROUND_COLOR.getAlpha() / 255F);
drawRect(x - width, y, x, y - height, BACKGROUND_COLOR);
drawRect(x - width + 2, y - 2, x - width, y - 2 - height + 4, LINE_COLOR);
}
DrawUtils.drawImage(NotificationManager.LOGO, x - 24, y - 20, 20, 20);
drawRect(x - width, y - height, x, y - Math.round(20 * oldDelta), BACKGROUND_COLOR);
if(textOutDelta == 1) {
float timeLeft = getDeltaByTime(4000, (int)MAX_TIME - 4000 - FADEOUT_TIME);
drawRect(x - width - stringWidth, y, x - Math.round((width + stringWidth) * (1 - timeLeft)), y - 1, color);
}
}
return y - height;
}
//Legacy support
private void drawRect(int x, int y, int x2, int y2, Color color) {
Gui.drawRectangle(x, y, x2, y2, color.getRGB());
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
}
private float getDeltaByTime(int start, int end) {
float delta = (float)((System.currentTimeMillis() - this.start) - start) / end;
if(delta > 1) {
delta = 1;
} else if(delta < 0) {
delta = 0;
}
return delta;
}
}

View File

@ -0,0 +1,55 @@
package rip.athena.client.gui.notifications;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.util.ResourceLocation;
import rip.athena.client.Athena;
import rip.athena.client.events.SubscribeEvent;
import rip.athena.client.events.types.render.RenderEvent;
import rip.athena.client.events.types.render.RenderType;
import java.awt.*;
import java.util.ArrayList;
import java.util.List;
public class NotificationManager {
public static final ResourceLocation LOGO = new ResourceLocation("Athena/logo/Athena.png");
private List<Notification> notifications;
private Thread removalThread;
public NotificationManager() {
notifications = new ArrayList<>();
removalThread = new Thread(new NotiRemovalThread(notifications));
removalThread.start();
Athena.INSTANCE.getEventBus().register(this);
}
@SubscribeEvent
public void drawOverlay(RenderEvent event) {
if(event.getRenderType() != RenderType.INGAME_OVERLAY) {
return;
}
int y = new ScaledResolution(Minecraft.getMinecraft()).getScaledHeight();
for(Notification noti : notifications) {
y = noti.draw(y);
}
}
public void showNotification(String text, Color color) {
boolean contains = false;
for(Notification noti : notifications) {
if(noti.getText().equalsIgnoreCase(text) && !noti.isDead()) {
contains = true;
break;
}
}
if(!contains) {
notifications.add(new Notification(text, color));
}
}
}

View File

@ -18,26 +18,25 @@ package rip.athena.client.modules;
*/ */
public enum Category { public enum Category {
ALL_MODS(0, "ALL MODS", "/gui/maximize.png", false), ALL_MODS(0, "ALL MODS",false),
MODS(1, "MODS", "/gui/user.png", false), MODS(1, "MODS",false),
RENDER(2, "RENDER", "/gui/laptop.png", false), RENDER(2, "RENDER",false),
FACTIONS(3, "FACTIONS", "/gui/badge.png", false), MOVEMENT(3, "MOVEMENT",false),
OTHER(4, "OTHER", "/gui/other.png", false), FACTIONS(4, "FACTIONS",false),
HIDDEN(5, "", "", true), OTHER(5, "OTHER",false),
HIDDEN(6, "", true),
FPS_SETTINGS(6, "", "", true), FPS_SETTINGS(7, "",true),
GROUPS(7, "", "", true); GROUPS(8, "",true);
private int index; private int index;
private String text; private String text;
private String icon;
private boolean hidden; private boolean hidden;
Category(int index, String text, String icon, boolean hidden) { Category(int index, String text, boolean hidden) {
this.index = index; this.index = index;
this.text = text; this.text = text;
this.icon = icon;
this.hidden = hidden; this.hidden = hidden;
} }
@ -49,10 +48,6 @@ public enum Category {
return text; return text;
} }
public String getIcon() {
return icon;
}
public boolean isHidden() { public boolean isHidden() {
return hidden; return hidden;
} }

View File

@ -32,6 +32,9 @@ public class CPS extends Module {
@ConfigValue.Boolean(name = "Background") @ConfigValue.Boolean(name = "Background")
private boolean backGround = true; private boolean backGround = true;
@ConfigValue.List(name = "Display Mode", values = {"Modern", "Old"}, description = "Chose display of background")
private String backgroundMode = "Modern";
@ConfigValue.Color(name = "Background Color") @ConfigValue.Color(name = "Background Color")
private Color background = new Color(0, 0, 0, 150); private Color background = new Color(0, 0, 0, 150);
@ -76,7 +79,13 @@ public class CPS extends Module {
int height = hud.getHeight(); int height = hud.getHeight();
if(backGround) { if(backGround) {
DrawUtils.drawGradientRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, background.getRGB(), background.getRGB()); if(backgroundMode.equalsIgnoreCase("Modern")) {
DrawUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 4.0f, new Color(50, 50, 50, 255).getRGB());
DrawUtils.drawRoundedRect(hud.getX() + 1, hud.getY() + 1, hud.getX() + width - 1, hud.getY() + height - 1, 4.0f, new Color(35, 35, 35, 255).getRGB());
} else {
DrawUtils.drawGradientRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, background.getRGB(), background.getRGB());
}
} }
float posY = hud.getY() + 2; float posY = hud.getY() + 2;

View File

@ -23,7 +23,10 @@ public class Clock extends Module {
@ConfigValue.List(name = "Clock Format", values = {"yyyy/MM/dd HH:mm:ss","MM/dd/yyyy", "dd/MM/yyyy", "dd/MM/yyyy hh:mm a" , "MM/dd/yyyy hh:mm a" ,"E, MMM dd yyyy","hh:mm a", "hh:mm:ss a", "yyyy-MM-dd"}) @ConfigValue.List(name = "Clock Format", values = {"yyyy/MM/dd HH:mm:ss","MM/dd/yyyy", "dd/MM/yyyy", "dd/MM/yyyy hh:mm a" , "MM/dd/yyyy hh:mm a" ,"E, MMM dd yyyy","hh:mm a", "hh:mm:ss a", "yyyy-MM-dd"})
private String format = "yyyy/MM/dd HH:mm:ss"; private String format = "yyyy/MM/dd HH:mm:ss";
@ConfigValue.List(name = "Display Mode", values = {"Modern", "Old"}, description = "Chose display of background")
private String backgroundMode = "Modern";
@ConfigValue.Boolean(name = "Background") @ConfigValue.Boolean(name = "Background")
private boolean backGround = true; private boolean backGround = true;
@ -77,9 +80,15 @@ public class Clock extends Module {
int width = hud.getWidth(); int width = hud.getWidth();
int height = hud.getHeight(); int height = hud.getHeight();
if(backGround) { if(backGround) {
DrawUtils.drawGradientRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, background.getRGB(), background.getRGB()); if(backgroundMode.equalsIgnoreCase("Modern")) {
DrawUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 4.0f, new Color(50, 50, 50, 255).getRGB());
DrawUtils.drawRoundedRect(hud.getX() + 1, hud.getY() + 1, hud.getX() + width - 1, hud.getY() + height - 1, 4.0f, new Color(35, 35, 35, 255).getRGB());
} else {
DrawUtils.drawGradientRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, background.getRGB(), background.getRGB());
}
} }
float posY = hud.getY() + 2; float posY = hud.getY() + 2;

View File

@ -63,6 +63,9 @@ public class Coordinates extends Module {
@ConfigValue.List(name = "Display Mode", values = {"Horizontal", "Vertical"}, description = "How the hud should be displayed") @ConfigValue.List(name = "Display Mode", values = {"Horizontal", "Vertical"}, description = "How the hud should be displayed")
private String displayMode = "Vertical"; private String displayMode = "Vertical";
@ConfigValue.List(name = "Display Mode", values = {"Modern", "Old"}, description = "Chose display of background")
private String backgroundMode = "Modern";
@ConfigValue.Color(name = "Background Color") @ConfigValue.Color(name = "Background Color")
private Color backgroundColor = new Color(0, 0, 0, 150); private Color backgroundColor = new Color(0, 0, 0, 150);
@ -192,9 +195,14 @@ public class Coordinates extends Module {
int width = getStringWidth(med) + 12; int width = getStringWidth(med) + 12;
int height = 21; int height = 21;
if (this.shadedCoords) { if(this.shadedCoords) {
DrawUtils.drawGradientRect(posX, posY, posX + width, posY + height, backgroundColor.getRGB(), if(backgroundMode.equalsIgnoreCase("Modern")) {
backgroundColor.getRGB()); DrawUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 4.0f, new Color(50, 50, 50, 255).getRGB());
DrawUtils.drawRoundedRect(hud.getX() + 1, hud.getY() + 1, hud.getX() + width - 1, hud.getY() + height - 1, 4.0f, new Color(35, 35, 35, 255).getRGB());
} else {
DrawUtils.drawGradientRect(posX, posY, posX + width, posY + height, backgroundColor.getRGB(), backgroundColor.getRGB());
}
} }
drawString(med, (float) (posX - 2 + (width / 2 - (getStringWidth(med) / 2))), (float) posY + 5, vColor); drawString(med, (float) (posX - 2 + (width / 2 - (getStringWidth(med) / 2))), (float) posY + 5, vColor);
@ -251,11 +259,17 @@ public class Coordinates extends Module {
} }
width += stringWidth; width += stringWidth;
if (this.shadedCoords) {
DrawUtils.drawGradientRect(posX, posY, posX + width, posY + height, backgroundColor.getRGB(), if(this.shadedCoords) {
backgroundColor.getRGB()); if(backgroundMode.equalsIgnoreCase("Modern")) {
DrawUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 4.0f, new Color(50, 50, 50, 255).getRGB());
DrawUtils.drawRoundedRect(hud.getX() + 1, hud.getY() + 1, hud.getX() + width - 1, hud.getY() + height - 1, 4.0f, new Color(35, 35, 35, 255).getRGB());
} else {
DrawUtils.drawGradientRect(posX, posY, posX + width, posY + height, backgroundColor.getRGB(), backgroundColor.getRGB());
}
} }
drawString("X: ", posX + 3, posY + 3 + shift, color); drawString("X: ", posX + 3, posY + 3 + shift, color);
drawString(myPosX + "", posX + 16, posY + 3 + shift, vColor); drawString(myPosX + "", posX + 16, posY + 3 + shift, vColor);
drawString(getDirectionX(myAngle), posX + width - 8 - getStringWidth(getDirectionX(myAngle)), drawString(getDirectionX(myAngle), posX + width - 8 - getStringWidth(getDirectionX(myAngle)),

View File

@ -26,6 +26,9 @@ public class CustomText extends Module {
@ConfigValue.Boolean(name = "Custom Font") @ConfigValue.Boolean(name = "Custom Font")
private boolean customFont = false; private boolean customFont = false;
@ConfigValue.List(name = "Display Mode", values = {"Modern", "Old"}, description = "Chose display of background")
private String backgroundMode = "Modern";
@ConfigValue.Boolean(name = "Background") @ConfigValue.Boolean(name = "Background")
private boolean backGround = true; private boolean backGround = true;
@ -67,9 +70,14 @@ public class CustomText extends Module {
int height = hud.getHeight(); int height = hud.getHeight();
if(backGround) { if(backGround) {
DrawUtils.drawGradientRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, background.getRGB(), background.getRGB()); if(backgroundMode.equalsIgnoreCase("Modern")) {
} DrawUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 4.0f, new Color(50, 50, 50, 255).getRGB());
DrawUtils.drawRoundedRect(hud.getX() + 1, hud.getY() + 1, hud.getX() + width - 1, hud.getY() + height - 1, 4.0f, new Color(35, 35, 35, 255).getRGB());
} else {
DrawUtils.drawGradientRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, background.getRGB(), background.getRGB());
}
}
float posY = hud.getY() + 2; float posY = hud.getY() + 2;
float posX = hud.getX() + 9; float posX = hud.getX() + 9;

View File

@ -16,6 +16,10 @@ import java.awt.*;
* @date 6/2/2023 * @date 6/2/2023
*/ */
public class EntityHUD extends Module { public class EntityHUD extends Module {
@ConfigValue.List(name = "Display Mode", values = {"Modern", "Old"}, description = "Chose display of background")
private String backgroundMode = "Modern";
@ConfigValue.Boolean(name = "Background") @ConfigValue.Boolean(name = "Background")
private boolean backGround = true; private boolean backGround = true;
@ -64,11 +68,17 @@ public class EntityHUD extends Module {
String string = "(" + mc.renderGlobal.countEntitiesRendered + "/" + mc.renderGlobal.countEntitiesTotal + ")"; String string = "(" + mc.renderGlobal.countEntitiesRendered + "/" + mc.renderGlobal.countEntitiesTotal + ")";
int width = hud.getWidth(); int width = hud.getWidth();
int height = hud.getHeight(); int height = hud.getHeight();
if(backGround) { if(backGround) {
DrawUtils.drawGradientRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, background.getRGB(), background.getRGB()); if(backgroundMode.equalsIgnoreCase("Modern")) {
DrawUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 4.0f, new Color(50, 50, 50, 255).getRGB());
DrawUtils.drawRoundedRect(hud.getX() + 1, hud.getY() + 1, hud.getX() + width - 1, hud.getY() + height - 1, 4.0f, new Color(35, 35, 35, 255).getRGB());
} else {
DrawUtils.drawGradientRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, background.getRGB(), background.getRGB());
}
} }
float posY = hud.getY() + 2; float posY = hud.getY() + 2;
float posX = hud.getX() + 9; float posX = hud.getX() + 9;

View File

@ -23,15 +23,18 @@ import java.awt.*;
*/ */
public class FPSMod extends Module { public class FPSMod extends Module {
@ConfigValue.List(name = "Display Mode", values = {"Modern", "Old"}, description = "Chose display of background")
private String backgroundMode = "Modern";
@ConfigValue.Boolean(name = "Background") @ConfigValue.Boolean(name = "Background")
private boolean backGround = true; private boolean backGround = true;
@ConfigValue.Color(name = "Color")
private Color color = Color.WHITE;
@ConfigValue.Color(name = "Background Color") @ConfigValue.Color(name = "Background Color")
private Color background = new Color(0, 0, 0, 150); private Color background = new Color(0, 0, 0, 150);
@ConfigValue.Color(name = "Color")
private Color color = Color.WHITE;
@ConfigValue.Boolean(name = "Custom Font") @ConfigValue.Boolean(name = "Custom Font")
private boolean customFont = false; private boolean customFont = false;
@ -73,7 +76,13 @@ public class FPSMod extends Module {
int height = hud.getHeight(); int height = hud.getHeight();
if(backGround) { if(backGround) {
DrawUtils.drawGradientRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, background.getRGB(), background.getRGB()); if(backgroundMode.equalsIgnoreCase("Modern")) {
DrawUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 4.0f, new Color(50, 50, 50, 255).getRGB());
DrawUtils.drawRoundedRect(hud.getX() + 1, hud.getY() + 1, hud.getX() + width - 1, hud.getY() + height - 1, 4.0f, new Color(35, 35, 35, 255).getRGB());
} else {
DrawUtils.drawGradientRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, background.getRGB(), background.getRGB());
}
} }
float posY = hud.getY() + 2; float posY = hud.getY() + 2;

View File

@ -19,6 +19,7 @@ import java.awt.*;
* @date 6/2/2023 * @date 6/2/2023
*/ */
public class Keystrokes extends Module { public class Keystrokes extends Module {
@ConfigValue.Boolean(name = "Show CPS") @ConfigValue.Boolean(name = "Show CPS")
private boolean keystrokescps = true; private boolean keystrokescps = true;
@ -87,8 +88,8 @@ public class Keystrokes extends Module {
shiftXFont += 2; shiftXFont += 2;
} }
if (mc.gameSettings.keyBindForward.isKeyDown()) { if (mc.gameSettings.keyBindForward.isKeyDown()) {
DrawUtils.drawGradientRect(posX + shiftX, posY + shiftY, posX + 25 + shiftX, posY + 25 + shiftY, DrawUtils.drawGradientRect(posX + shiftX, posY + shiftY, posX + 25 + shiftX, posY + 25 + shiftY, getBackGroundColor(true), getBackGroundColor(true));
getBackGroundColor(true), getBackGroundColor(true));
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glScalef(1.00F, 1.0F, 1.0F); GL11.glScalef(1.00F, 1.0F, 1.0F);
drawString("W", (posX + shiftX + 7) / 1.005F, (posY + shiftY + 7) / 1.005F, color2); drawString("W", (posX + shiftX + 7) / 1.005F, (posY + shiftY + 7) / 1.005F, color2);

View File

@ -18,7 +18,10 @@ import java.awt.*;
public class MemoryUsage extends Module { public class MemoryUsage extends Module {
@ConfigValue.Boolean(name = "Percentage", description = "Show memory usage in percentage.") @ConfigValue.Boolean(name = "Percentage", description = "Show memory usage in percentage.")
private boolean percentage = false; private boolean percentage = false;
@ConfigValue.List(name = "Display Mode", values = {"Modern", "Old"}, description = "Chose display of background")
private String backgroundMode = "Modern";
@ConfigValue.Boolean(name = "Background") @ConfigValue.Boolean(name = "Background")
private boolean backGround = true; private boolean backGround = true;
@ -82,9 +85,15 @@ public class MemoryUsage extends Module {
int width = hud.getWidth(); int width = hud.getWidth();
int height = hud.getHeight(); int height = hud.getHeight();
if(backGround) { if(backGround) {
DrawUtils.drawGradientRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, background.getRGB(), background.getRGB()); if(backgroundMode.equalsIgnoreCase("Modern")) {
DrawUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 4.0f, new Color(50, 50, 50, 255).getRGB());
DrawUtils.drawRoundedRect(hud.getX() + 1, hud.getY() + 1, hud.getX() + width - 1, hud.getY() + height - 1, 4.0f, new Color(35, 35, 35, 255).getRGB());
} else {
DrawUtils.drawGradientRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, background.getRGB(), background.getRGB());
}
} }
float posY = hud.getY() + 2; float posY = hud.getY() + 2;

View File

@ -25,6 +25,9 @@ public class PotCounter extends Module {
@ConfigValue.Color(name = "Color") @ConfigValue.Color(name = "Color")
private Color color = Color.WHITE; private Color color = Color.WHITE;
@ConfigValue.List(name = "Display Mode", values = {"Modern", "Old"}, description = "Chose display of background")
private String backgroundMode = "Modern";
@ConfigValue.Boolean(name = "Background") @ConfigValue.Boolean(name = "Background")
private boolean background = true; private boolean background = true;
@ -91,7 +94,13 @@ public class PotCounter extends Module {
int height = hud.getHeight(); int height = hud.getHeight();
if(background) { if(background) {
DrawUtils.drawGradientRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, backgroundColor.getRGB(), backgroundColor.getRGB()); if(backgroundMode.equalsIgnoreCase("Modern")) {
DrawUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 4.0f, new Color(50, 50, 50, 255).getRGB());
DrawUtils.drawRoundedRect(hud.getX() + 1, hud.getY() + 1, hud.getX() + width - 1, hud.getY() + height - 1, 4.0f, new Color(35, 35, 35, 255).getRGB());
} else {
DrawUtils.drawGradientRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, backgroundColor.getRGB(), backgroundColor.getRGB());
}
} }
float posY = hud.getY() + 2; float posY = hud.getY() + 2;

View File

@ -20,6 +20,10 @@ import java.util.concurrent.CopyOnWriteArrayList;
* @date 6/2/2023 * @date 6/2/2023
*/ */
public class TPS extends Module { public class TPS extends Module {
@ConfigValue.List(name = "Display Mode", values = {"Modern", "Old"}, description = "Chose display of background")
public static String backgroundMode = "Modern";
@ConfigValue.Boolean(name = "Preset Color") @ConfigValue.Boolean(name = "Preset Color")
private boolean presetColor = true; private boolean presetColor = true;

View File

@ -0,0 +1,16 @@
package rip.athena.client.requests;
public enum ContentType {
NONE(""), JSON("application/json"), FORM("application/x-www-form-urlencoded"), MULTIPART_FORM("multipart/form-data");
private String header;
ContentType(String header) {
this.header = header;
}
@Override
public String toString() {
return header;
}
}

View File

@ -0,0 +1,241 @@
package rip.athena.client.requests;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.file.Files;
import java.nio.file.StandardCopyOption;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;
public class WebRequest {
private URL url;
private String requestMethod;
private ContentType contentType;
private Map<String, Object> arguments;
private Map<String, String> headers;
private boolean useCookies;
private StringBuilder cookieData;
private String rawData;
private String boundary;
public WebRequest(String url, String requestMethod, ContentType contentType, boolean useCookies) throws MalformedURLException {
this.url = new URL(url);
this.requestMethod = requestMethod;
this.contentType = contentType;
this.arguments = new HashMap<>();
this.headers = new HashMap<>();
this.useCookies = useCookies;
this.cookieData = new StringBuilder();
this.rawData = "";
this.boundary = "";
}
public void setURL(String url) throws MalformedURLException {
this.url = new URL(url);
}
public URL getURL() {
return url;
}
public void clearHeaders() {
headers.clear();
}
public void clearArguments() {
arguments.clear();
}
public void setHeader(String key, String value){
headers.put(key, value);
}
public void setArguement(String key, Object value){
arguments.put(key, value);
}
public WebRequestResult connect() throws IOException, JSONException, NoSuchElementException {
return connect(null);
}
public WebRequestResult connect(File file) throws IOException, JSONException, NoSuchElementException {
String data = "";
if(contentType == ContentType.JSON) {
JSONObject jsonObject = new JSONObject();
for(String key : arguments.keySet()) {
Object object = arguments.get(key);
jsonObject.put(key, object);
}
data = jsonObject.toString();
} else if(contentType == ContentType.FORM) {
StringBuilder builder = new StringBuilder();
for(String key : arguments.keySet()) {
Object object = arguments.get(key);
if(!builder.toString().isEmpty()) {
builder.append("&");
}
builder.append(URLEncoder.encode(key.toString(), "UTF-8") + "=" + URLEncoder.encode(object.toString(), "UTF-8"));
}
data = builder.toString();
}
if(!rawData.isEmpty()) {
data = rawData;
}
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setDoOutput(true);
conn.setReadTimeout(15000);
conn.setConnectTimeout(15000);
conn.setRequestMethod(requestMethod);
conn.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36");
for(String header : headers.keySet()) {
conn.setRequestProperty(header, headers.get(header));
}
if(cookieData.toString().length() > 0) {
conn.setRequestProperty("Cookie", cookieData.toString());
}
if(!requestMethod.equalsIgnoreCase("GET")) {
conn.setRequestProperty("Content-Type", contentType.toString() + (boundary.isEmpty() ? "" : "; boundary=----" + boundary));
conn.setRequestProperty("Content-Length", String.valueOf(data.length()));
OutputStream os = conn.getOutputStream();
os.write(data.getBytes());
}
conn.connect();
if(file != null && conn.getInputStream() != null) {
try(ByteArrayOutputStream baos = new ByteArrayOutputStream()) {
byte[] buffer = new byte[8192];
int read;
while((read = conn.getInputStream().read(buffer)) > 0) {
baos.write(buffer, 0, read);
}
try(ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray())) {
Files.copy(bais, file.toPath(), StandardCopyOption.REPLACE_EXISTING);
}
}
}
BufferedReader in = null;
try {
in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
} catch(IOException e) {
if(conn.getErrorStream() != null) {
in = new BufferedReader(new InputStreamReader(conn.getErrorStream()));
}
}
if(useCookies) {
List<String> cookies = conn.getHeaderFields().get("Set-Cookie");
if(cookies != null) {
for(String cookie : conn.getHeaderFields().get("Set-Cookie")) {
String cookieData = cookie.substring(0, cookie.indexOf(";"));
appendCookie(cookieData);
}
}
}
String newData = "";
if(in != null) {
StringBuilder output = new StringBuilder();;
String input = "";
while((input = in.readLine()) != null) {
if(!output.toString().isEmpty()) {
output.append(System.getProperty("line.separator"));
}
output.append(input);
}
newData = output.toString();
} else {
//throw new IOException("Failed to get input stream.");
}
return new WebRequestResult(this, newData, conn.getHeaderFields(), conn.getResponseCode());
}
public String getRequestMethod() {
return requestMethod;
}
public ContentType getContentType() {
return contentType;
}
public void setRequestMethod(String requestMethod) {
this.requestMethod = requestMethod;
}
public void setContentType(ContentType contentType) {
this.contentType = contentType;
}
private void appendCookie(String cookie) {
if(!cookieData.toString().isEmpty()) {
StringBuilder newCookie = new StringBuilder();
for(String data : cookieData.toString().split("; ")) {
String key = data.split("=")[0];
if(key.equalsIgnoreCase(cookie.split("=")[0])) {
continue;
}
if(!newCookie.toString().isEmpty()) {
newCookie.append("; ");
}
newCookie.append(data);
}
cookieData = newCookie;
cookieData.append("; ");
}
cookieData.append(cookie);
}
public String getCookies() {
return cookieData.toString();
}
public void setRawData(String string) {
this.rawData = string;
}
public void setBoundary(String boundary) {
this.boundary = boundary;
}
}

View File

@ -0,0 +1,34 @@
package rip.athena.client.requests;
import java.util.List;
import java.util.Map;
public class WebRequestResult {
private WebRequest request;
private Map<String, List<String>> headers;
private String data;
private int response;
public WebRequestResult(WebRequest request, String data, Map<String, List<String>> map, int response) {
this.request = request;
this.data = data;
this.headers = map;
this.response = response;
}
public WebRequest getRequest() {
return request;
}
public String getData() {
return data;
}
public Map<String, List<String>> getHeaders() {
return headers;
}
public int getResponse() {
return response;
}
}

View File

@ -0,0 +1,167 @@
package rip.athena.client.utils.file;
import java.io.*;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Stream;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/6/2023
*/
public class FileHandler {
private final String separator = System.getProperty("line.separator");
private File file;
private boolean fresh = false;
public FileHandler(File file) {
this.file = file;
}
public void init() throws IOException {
if (file.getParent() != null) {
File folder = new File(file.getParent());
if(!folder.exists()) {
folder.mkdirs();
}
}
if(!file.exists()){
file.createNewFile();
fresh = true;
}
}
public void writeToFile(String content, boolean append) throws IOException {
try (Writer writer = new BufferedWriter(new FileWriter(file, append))) {
writer.write(content);
}
}
public void writeToFile(byte[] content) throws IOException {
try (OutputStream writer = new FileOutputStream(file)) {
writer.write(content);
}
}
public byte[] getContentInBytes() throws IOException {
byte[] bytes = new byte[(int)file.length()];
try (FileInputStream reader = new FileInputStream(file)) {
reader.read(bytes);
}
return bytes;
}
public String getContent(boolean ignoreComments) throws IOException {
StringBuilder builder = new StringBuilder();
try (Stream<String> stream = Files.lines(file.toPath())) {
stream.forEach(line -> {
if(line.startsWith("//") && ignoreComments)
return;
builder.append((line.isEmpty() ? "" : separator) + line);
});
}
return builder.toString();
}
public String[] getContentInLines(boolean ignoreComments) throws IOException {
List<String> lines = new ArrayList<>();
try (Stream<String> stream = Files.lines(file.toPath())) {
stream.forEach(line -> {
if(line.startsWith("//") && ignoreComments)
return;
lines.add(line);
});
}
return lines.toArray(new String[lines.size()]);
}
public String[] getLinesByPrefix(String prefix, boolean ignoreComments) throws IOException {
List<String> lines = new ArrayList<>(Arrays.asList(getContentInLines(ignoreComments)));
for(int i = 0; i < lines.size(); i++) {
String line = lines.get(i);
if (!line.startsWith(prefix)) {
lines.remove(i);
}
}
return lines.toArray(new String[lines.size()]);
}
public String[] getLinesByNeedle(String needle, boolean ignoreComments) throws IOException {
List<String> lines = new ArrayList<>(Arrays.asList(getContentInLines(ignoreComments)));
for (int i = 0; i < lines.size(); i++) {
String line = lines.get(i);
if (!line.contains(needle)) {
lines.remove(i);
}
}
return lines.toArray(new String[lines.size()]);
}
public void removeLinesByPrefix(String prefix, boolean ignoreComments) throws IOException {
List<String> lines = new ArrayList<>(Arrays.asList(getContentInLines(ignoreComments)));
StringBuilder output = new StringBuilder();
for (int i = 0; i < lines.size(); i++) {
String line = lines.get(i);
if (!line.startsWith(prefix)) {
output.append(String.valueOf((output.length() == 0) ? "" : separator) + line);
}
}
writeToFile(output.toString(), false);
}
public void removeLinesByNeedle(String needle, boolean ignoreComments) throws IOException {
List<String> lines = new ArrayList<>(Arrays.asList(getContentInLines(ignoreComments)));
StringBuilder output = new StringBuilder();
for(int i = 0; i < lines.size(); i++) {
String line = lines.get(i);
if (!line.contains(needle)) {
output.append(String.valueOf((output.length() == 0) ? "" : separator) + line);
}
}
writeToFile(output.toString(), false);
}
public File getFile() {
return file;
}
public void setFile(File file) {
this.file = file;
}
public boolean isFresh() {
return fresh;
}
public void setFresh(boolean fresh) {
this.fresh = fresh;
}
}

View File

@ -10,6 +10,7 @@ import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.BlockPos; import net.minecraft.util.BlockPos;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import rip.athena.client.font.FontManager; import rip.athena.client.font.FontManager;
import rip.athena.client.modules.impl.render.TPS;
import java.awt.*; import java.awt.*;
@ -23,7 +24,13 @@ public class HUDUtil {
} }
if(bG) { if(bG) {
DrawUtils.displayFilledRectangle(x, y, x+width, y+height, bColor); if(TPS.backgroundMode.equalsIgnoreCase("Modern")) {
DrawUtils.drawRoundedRect(x, y, x + width, y + height, 4.0f, new Color(50, 50, 50, 255).getRGB());
DrawUtils.drawRoundedRect(x + 1, y + 1, x + width - 1, y + height - 1, 4.0f, new Color(35, 35, 35, 255).getRGB());
} else {
DrawUtils.displayFilledRectangle(x, y, x+width, y+height, bColor);
}
} }
int stringWidth = getStringWidth(message); int stringWidth = getStringWidth(message);

View File

@ -1,6 +0,0 @@
Enabled::true
Bind::47
Emote1::star_power
Emote2::
Emote3::
Emote4::

View File

@ -1,10 +0,0 @@
{
"emotes": [
"default",
"dab",
"confused",
"pure_salt",
"wave",
"star_power"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 919 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 836 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 905 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 750 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 423 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1009 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 625 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

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