added themes and fixed bugs

This commit is contained in:
The Biggest skiddd 2023-06-08 19:53:22 +02:00
parent ee9bdf506f
commit 65bf6f7a52
382 changed files with 2097 additions and 454 deletions

View File

@ -7,6 +7,7 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.util.ResourceLocation;
import rip.athena.client.font.FontManager;
import rip.athena.client.utils.render.DrawUtils;
import rip.athena.client.utils.render.RoundedUtils;
import java.awt.*;
@ -96,8 +97,8 @@ public class GuiButton extends Gui
this.mouseDragged(mc, mouseX, mouseY);
int j = 14737632;
DrawUtils.drawRoundedRect(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, 4, hovered ? new Color(200,200,200,100).getRGB() : new Color(100,100,100,100).getRGB());
DrawUtils.drawRoundedRect(this.xPosition + 1, this.yPosition + 1, (this.xPosition + this.width) - 1, (this.yPosition + this.height) - 1, 3, new Color(22, 24, 27,100).getRGB());
RoundedUtils.drawRoundedRect(this.xPosition, this.yPosition, this.xPosition + this.width, this.yPosition + this.height, 12, hovered ? new Color(200,200,200,100).getRGB() : new Color(100,100,100,100).getRGB());
RoundedUtils.drawRoundedRect(this.xPosition + 1, this.yPosition + 1, (this.xPosition + this.width) - 1, (this.yPosition + this.height) - 1, 12, new Color(22, 24, 27,100).getRGB());
if (!this.enabled)

View File

@ -17,6 +17,7 @@ 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.theme.ThemeManager;
import rip.athena.client.utils.PrefixedLogger;
import rip.athena.client.utils.input.KeybindManager;
@ -57,6 +58,7 @@ public class Athena {
private NotificationManager notificationManager;
private ConfigManager configManager;
private ModuleManager moduleManager;
private ThemeManager themeManager;
private MacroManager macroManager;
private HUDManager hudManager;
private EventBus eventBus;
@ -74,8 +76,6 @@ public class Athena {
MAIN_DIR.mkdir();
}
if(SocketClient.isClientRunning()) {
JOptionPane.showMessageDialog(null, "Port 1337 already in use.");
System.exit(0);
@ -83,6 +83,7 @@ public class Athena {
this.configManager = new ConfigManager(CONFIGS_DIR);
this.moduleManager = new ModuleManager();
this.themeManager = new ThemeManager();
this.macroManager = new MacroManager();
this.hudManager = new HUDManager();
this.eventBus = new EventBus();

View File

@ -15,6 +15,7 @@ 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.theme.Theme;
import rip.athena.client.utils.StringUtils;
import rip.athena.client.utils.file.FileHandler;
import rip.athena.client.utils.input.BindType;
@ -125,7 +126,7 @@ public class Config {
}
}
}
JSONObject hud = json.getJSONObject("hud");
for(String element : hud.keySet()) {
@ -143,7 +144,16 @@ public class Config {
}
}
}
String themeIdentifier = obj.getString("theme");
for (Theme theme : Theme.values()) {
if (theme.name().equalsIgnoreCase(themeIdentifier)) {
Athena.INSTANCE.getThemeManager().setTheme(theme);
break;
}
}
JSONArray macroList = obj.getJSONArray("macros");
for(int i = 0; i < macroList.length(); i++) {
@ -355,7 +365,7 @@ public class Config {
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);
}
@ -364,7 +374,9 @@ public class Config {
obj.put("hud", hudObj);
config.put(mod.getName(), obj);
}
config.put("theme", Athena.INSTANCE.getThemeManager().getTheme().name());
JSONArray macros = new JSONArray();
for(Macro macro : Athena.INSTANCE.getMacroManager().getMacros()) {
@ -380,7 +392,7 @@ public class Config {
config.put("macros", macros);
JSONObject fps = new JSONObject();
List<String> buffer = new ArrayList<>();
for(Class<?> clazz : SettingsPage.BLOCKS) {

View File

@ -12,7 +12,8 @@ public enum Category {
MACROS("MACROS", "Athena/gui/mods/cps.png"),
WAYPOINTS("WAYPOINTS", "Athena/gui/menu/waypoints.png"),
PROFILES("PROFILES", "Athena/gui/menu/profiles.png"),
COSMETICS("COSMETICS", "Athena/gui/menu/cosmetics.png");
COSMETICS("COSMETICS", "Athena/gui/menu/cosmetics.png"),
THEMES("THEMES", "Athena/gui/menu/themes.png");
private String name;
private String icon;

View File

@ -136,11 +136,14 @@ public class IngameMenu extends MinecraftMenuImpl implements DrawImpl {
drawShadowDown(menu.getX(), menu.getY() + 58, menu.getWidth());
RoundedUtils.drawRoundedOutline(menu.getX(), menu.getY(), menu.getX() + menu.getWidth(), menu.getY() + menu.getHeight(), 54, 5, new Color(50, 50, 50, 255).getRGB());
RoundedUtils.drawRoundedRect(menu.getX(), menu.getY(), menu.getX() + menu.getWidth(), menu.getY() + menu.getHeight(), 54, new Color(30, 30, 30, 255).getRGB());
RoundedUtils.drawRoundedOutline(menu.getX(), menu.getY(), menu.getX() + menu.getWidth(), menu.getY() + menu.getHeight(), 32, 5, new Color(50, 50, 50, 255).getRGB());
RoundedUtils.drawRoundedRect(menu.getX(), menu.getY(), menu.getX() + menu.getWidth(), menu.getY() + menu.getHeight(), 32, new Color(30, 30, 30, 255).getRGB());
rip.athena.client.utils.font.FontManager.getNunitoBold(50).drawString(Athena.INSTANCE.getClientName().toUpperCase(), menu.getX() + 40, menu.getY() + 20, MENU_HEADER_TEXT_COLOR);
//DrawUtils.drawImage(new ResourceLocation("Athena/logo/pride.png"), (int) (menu.getX() + FontManager.font1.getStringWidth(Athena.INSTANCE.getClientName().toUpperCase()) + 70), (int) (menu.getY() - 10 + FontManager.font1.getHeight(Athena.INSTANCE.getClientName().toUpperCase())), 30, 30);
rip.athena.client.utils.font.FontManager.getNunitoBold(50).drawString(Athena.INSTANCE.getClientName().toUpperCase(), menu.getX() + 60, menu.getY() + 20, MENU_HEADER_TEXT_COLOR);
//DrawUtils.drawImage(new ResourceLocation("Athena/logo/Athena.png"), (int) (menu.getX() + FontManager.font1.getStringWidth(Athena.INSTANCE.getClientName().toUpperCase()) + 70), (int) (menu.getY() - 10 + FontManager.font1.getHeight(Athena.INSTANCE.getClientName().toUpperCase())), 30, 30);
drawShadowDown(menu.getX(), menu.getY() + 58, menu.getWidth());
if(category != null) {

View File

@ -34,6 +34,7 @@ public class PageManager {
pages.put(Category.WAYPOINTS, new WaypointsPage(mc, menu, parent));
pages.put(Category.PROFILES, new ProfilesPage(mc, menu, parent));
pages.put(Category.COSMETICS, new CosmeticsPage(mc, menu, parent));
pages.put(Category.THEMES, new ThemesPage(mc, menu, parent));
}
public Map<Category, Page> getPages() {

View File

@ -2,6 +2,7 @@ package rip.athena.client.gui.clickgui.components.mods;
import net.minecraft.client.Minecraft;
import net.minecraft.util.ResourceLocation;
import rip.athena.client.Athena;
import rip.athena.client.font.FontManager;
import rip.athena.client.gui.framework.components.MenuButton;
import rip.athena.client.gui.framework.draw.ButtonState;
@ -58,8 +59,9 @@ public class CategoryButton extends MenuButton {
//RoundedUtils.drawRoundedRect(x + 9, y - 1, x + width - 19, y + height + 1, 12, new Color(50,50,50,255).getRGB());
if(isActive()) {
RoundedUtils.drawRoundedRect(x + 29, y - 1, x + width - 19, y + height + 1, 12, new Color(50, 50, 50, 255).getRGB());
RoundedUtils.drawRoundedRect(x + 30, y, x + width - 20, y + height, 12, new Color(25,25,25,255).getRGB());
RoundedUtils.drawGradientRound(x + 30, y, width - 40, height, 12, Athena.INSTANCE.getThemeManager().getTheme().getFirstColor(), Athena.INSTANCE.getThemeManager().getTheme().getFirstColor(), Athena.INSTANCE.getThemeManager().getTheme().getSecondColor(), Athena.INSTANCE.getThemeManager().getTheme().getSecondColor());
//RoundedUtils.drawRoundedRect(x + 29, y - 1, x + width - 19, y + height + 1, 12, new Color(50, 50, 50, 255).getRGB());
//RoundedUtils.drawRoundedRect(x + 30, y, x + width - 20, y + height, 12, new Color(25,25,25,255).getRGB());
}
if(Settings.customGuiFont) {
rip.athena.client.utils.font.FontManager.getNunitoBold(20).drawString(text, x + 70, y + height / 2 - (getStringHeight(text) / 2) + 2, textColor);

View File

@ -2,6 +2,7 @@ package rip.athena.client.gui.clickgui.components.mods;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import rip.athena.client.Athena;
import rip.athena.client.font.FontManager;
import rip.athena.client.gui.framework.components.MenuSlider;
import rip.athena.client.gui.framework.draw.ButtonState;
@ -100,7 +101,8 @@ public class MenuModSlider extends MenuSlider {
linePos += minOffset;
}
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x + 1, y + 1, linePos, height - 1, backgroundColor);
RoundedUtils.drawGradientRound(x + 1, y + 1, linePos, height - 1, 6,Athena.INSTANCE.getThemeManager().getTheme().getFirstColor(), Athena.INSTANCE.getThemeManager().getTheme().getFirstColor(), Athena.INSTANCE.getThemeManager().getTheme().getSecondColor(), Athena.INSTANCE.getThemeManager().getTheme().getSecondColor());
//rip.athena.client.gui.framework.draw.DrawImpl.drawRect(x + 1, y + 1, linePos, height - 1, backgroundColor);
int cursorPos = linePos;
int cursorWidth = 20;

View File

@ -1,6 +1,7 @@
package rip.athena.client.gui.clickgui.components.mods;
import net.minecraft.client.Minecraft;
import rip.athena.client.Athena;
import rip.athena.client.font.FontManager;
import rip.athena.client.gui.framework.components.MenuButton;
import rip.athena.client.gui.framework.draw.ButtonState;
@ -65,13 +66,14 @@ public class ModCategoryButton extends MenuButton {
GlStateManager.color(1, 1, 1);
if(isActive()) {
RoundedUtils.drawRoundedRect(x + 17, y - 1, x + width - 19, y + height - 4, 12, new Color(50,50,50,255).getRGB());
RoundedUtils.drawRoundedRect(x + 18, y, x + width - 20, y + height - 5, 12, backgroundColor);
RoundedUtils.drawGradientRound(x + 17, y - 1, width - 23, height - 4, 12, Athena.INSTANCE.getThemeManager().getTheme().getFirstColor(), Athena.INSTANCE.getThemeManager().getTheme().getFirstColor(), Athena.INSTANCE.getThemeManager().getTheme().getSecondColor(), Athena.INSTANCE.getThemeManager().getTheme().getSecondColor());
//RoundedUtils.drawRoundedRect(x + 17, y - 1, x + width - 6, y + height - 4, 12, new Color(50,50,50,255).getRGB());
//RoundedUtils.drawRoundedRect(x + 18, y, x + width - 7, y + height - 5, 12, backgroundColor);
//drawHorizontalLine(x + (width / 2 - getStringWidth(text) / 2), y + 29, (int)Minecraft.getMinecraft().fontRendererObj.getStringWidth(text), 2, textColor);
}
if(Settings.customGuiFont) {
rip.athena.client.utils.font.FontManager.getNunitoBold(20).drawString(text, x + (width / 2 - getStringWidth(text) / 2), y + height / 2 - (getStringHeight(text) / 2) - 3, textColor);
rip.athena.client.utils.font.FontManager.getNunitoBold(25).drawString(text, x + (width / 2 - getStringWidth(text) / 2), y + height / 2 - (getStringHeight(text) / 2) - 3, textColor);
} else {
Minecraft.getMinecraft().fontRendererObj.drawString(text, x + (width / 2 - getStringWidth(text) / 2), y + height / 2 - (getStringHeight(text) / 2) - 3, textColor);
}

View File

@ -1,6 +1,7 @@
package rip.athena.client.gui.clickgui.components.mods;
import net.minecraft.client.renderer.GlStateManager;
import rip.athena.client.Athena;
import rip.athena.client.gui.framework.MenuComponent;
import rip.athena.client.gui.framework.MenuPriority;
import rip.athena.client.gui.framework.components.MenuDraggable;
@ -11,6 +12,7 @@ import net.minecraft.client.Minecraft;
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11;
import rip.athena.client.utils.render.DrawUtils;
import rip.athena.client.utils.render.RoundedUtils;
import java.awt.*;
import java.util.Collections;
@ -228,19 +230,27 @@ public class ModScrollPane extends MenuScrollPane {
scrollerHeight -= 3;
GlStateManager.color(1, 1,1);
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(scrollerX - 3, y - 2, scrollerWidth + 6, scrollerHeight + 8, 83886080);
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(scrollerX - 2, y - 1, scrollerWidth + 4, scrollerHeight + 6, 369098752);
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(scrollerX - 1, y, scrollerWidth + 2, scrollerHeight + 4, 587202560);
//rip.athena.client.gui.framework.draw.DrawImpl.drawRect(scrollerX - 3, y - 2, scrollerWidth + 6, scrollerHeight + 8, 83886080);
//rip.athena.client.gui.framework.draw.DrawImpl.drawRect(scrollerX - 2, y - 1, scrollerWidth + 4, scrollerHeight + 6, 369098752);
//rip.athena.client.gui.framework.draw.DrawImpl.drawRect(scrollerX - 1, y, scrollerWidth + 2, scrollerHeight + 4, 587202560);
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(scrollerX, y + 1, scrollerWidth, scrollerHeight + 2, getColor(DrawType.LINE, ButtonState.NORMAL));
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(scrollerX + 1, y + 2, scrollerWidth - 2, scrollerHeight, getColor(DrawType.BACKGROUND, ButtonState.NORMAL));
//rip.athena.client.gui.framework.draw.DrawImpl.drawRect(scrollerX, y + 1, scrollerWidth, scrollerHeight + 2, getColor(DrawType.LINE, ButtonState.NORMAL));
//rip.athena.client.gui.framework.draw.DrawImpl.drawRect(scrollerX + 1, y + 2, scrollerWidth - 2, scrollerHeight, getColor(DrawType.BACKGROUND, ButtonState.NORMAL));
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(scrollerX - 3, newY - 3, scrollerWidth + 6, newSize + 6, 83886080);
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(scrollerX - 2, newY - 2, scrollerWidth + 4, newSize + 4, 369098752);
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(scrollerX - 1, newY - 1, scrollerWidth + 2, newSize + 2, 587202560);
RoundedUtils.drawRoundedRect(scrollerX + 2, y + 2, scrollerX + scrollerWidth - 2, y + scrollerHeight, 6, getColor(DrawType.BACKGROUND, ButtonState.NORMAL));
//RoundedUtils.drawRoundedRect(scrollerX - 3, newY - 3, scrollerWidth + 6, newSize + 6, 12, -1);
RoundedUtils.drawGradientRound(scrollerX, newY - 3, scrollerWidth, newSize, 6,Athena.INSTANCE.getThemeManager().getTheme().getFirstColor(), Athena.INSTANCE.getThemeManager().getTheme().getFirstColor(), Athena.INSTANCE.getThemeManager().getTheme().getSecondColor(), Athena.INSTANCE.getThemeManager().getTheme().getSecondColor());
//RoundedUtils.drawRoundedRect(scrollerX, newY - 3, scrollerX + scrollerWidth, newY + newSize, 6, -1);
//rip.athena.client.gui.framework.draw.DrawImpl.drawRect(scrollerX - 3, newY - 3, scrollerWidth + 6, newSize + 6, 83886080);
//rip.athena.client.gui.framework.draw.DrawImpl.drawRect(scrollerX - 2, newY - 2, scrollerWidth + 4, newSize + 4, 369098752);
//rip.athena.client.gui.framework.draw.DrawImpl.drawRect(scrollerX - 1, newY - 1, scrollerWidth + 2, newSize + 2, 587202560);
//rip.athena.client.gui.framework.draw.DrawImpl.drawRect(scrollerX, newY, scrollerWidth, newSize, getColor(DrawType.LINE, scrollerState));
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(scrollerX + 1, newY + 1, scrollerWidth - 2, newSize - 2, getColor(DrawType.BACKGROUND, scrollerState));
//rip.athena.client.gui.framework.draw.DrawImpl.drawRect(scrollerX + 1, newY + 1, scrollerWidth - 2, newSize - 2, getColor(DrawType.BACKGROUND, scrollerState));
}
}

View File

@ -13,6 +13,7 @@ import rip.athena.client.gui.clickgui.IngameMenu;
import rip.athena.client.modules.impl.other.Settings;
import rip.athena.client.utils.render.DrawUtils;
import org.lwjgl.input.Keyboard;
import rip.athena.client.utils.render.RoundedUtils;
import java.awt.*;
@ -66,8 +67,8 @@ public class SearchTextfield extends MenuTextField {
GlStateManager.color(1, 1,1);
DrawUtils.drawRoundedRect(x - 4, y - 4, x + width + 5, y + height + 5, 10, 83886080);
DrawUtils.drawRoundedRect(x - 2, y - 2, x + width + 3, y + height + 3, 10, 587202560);
RoundedUtils.drawRoundedRect(x - 4, y - 4, x + width + 5, y + height + 5, 24, 83886080);
RoundedUtils.drawRoundedRect(x - 2, y - 2, x + width + 3, y + height + 3, 24, 587202560);
/*DrawUtils.drawRoundedRect(x - 1, y - 1, x + width + 2, y + height + 2, 10, lineColor);
DrawUtils.drawRoundedRect(x, y, x + width + 1, y + height + 1, 10, lineColor);
@ -136,7 +137,7 @@ public class SearchTextfield extends MenuTextField {
if(Settings.customGuiFont) {
textHeight = (int) FontManager.baloo17.getHeight(textToDraw);
drawVerticalLine(x + 10 + (int)rip.athena.client.utils.font.FontManager.getProductSansRegular(30).width(textToDraw.substring(0, toRender)) + 1, y + height / 2 - textHeight / 2, textHeight, 1, textColor);
drawVerticalLine(x + 10 + (int)rip.athena.client.utils.font.FontManager.getNunito(20).width(textToDraw.substring(0, toRender)) + 1, y + height / 2 - textHeight / 2, textHeight, 1, textColor);
} else {
textHeight = Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT;
drawVerticalLine(x + 10 + (int)Minecraft.getMinecraft().fontRendererObj.getStringWidth(textToDraw.substring(0, toRender)) + 1, y + height / 2 - textHeight / 2, textHeight, 1, textColor);
@ -191,7 +192,7 @@ public class SearchTextfield extends MenuTextField {
bestIndex = i;
}
position += (int)rip.athena.client.utils.font.FontManager.getProductSansRegular(30).width(text.charAt(i) + "");
position += (int)rip.athena.client.utils.font.FontManager.getNunito(20).width(text.charAt(i) + "");
}
if(mouseX > position) {
@ -202,6 +203,8 @@ public class SearchTextfield extends MenuTextField {
index = 0;
}
}
DrawUtils.drawImage(new ResourceLocation("Athena/gui/menu/search.png"), x + width - 30, y + 5, 20, 20);
mouseDown = false;
}

View File

@ -0,0 +1,101 @@
package rip.athena.client.gui.clickgui.components.themes;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import rip.athena.client.Athena;
import rip.athena.client.font.FontManager;
import rip.athena.client.gui.clickgui.IngameMenu;
import rip.athena.client.gui.framework.components.MenuButton;
import rip.athena.client.gui.framework.draw.ButtonState;
import rip.athena.client.gui.framework.draw.DrawType;
import rip.athena.client.modules.impl.other.Settings;
import rip.athena.client.theme.Theme;
import rip.athena.client.utils.render.DrawUtils;
import rip.athena.client.utils.render.RoundedUtils;
import java.awt.*;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class SimpleGradientButton extends MenuButton {
protected boolean leftColorChange;
public SimpleGradientButton(Theme theme, int x, int y, int width, int height, boolean leftColorChange) {
super(theme, x, y, width, height);
this.leftColorChange = leftColorChange;
}
@Override
public void onInitColors() {
setColor(DrawType.BACKGROUND, ButtonState.NORMAL, new Color(35, 35, 35, IngameMenu.MENU_ALPHA));
setColor(DrawType.BACKGROUND, ButtonState.ACTIVE, new Color(35, 35, 35, IngameMenu.MENU_ALPHA));
setColor(DrawType.BACKGROUND, ButtonState.HOVER, new Color(35, 35, 35, IngameMenu.MENU_ALPHA));
setColor(DrawType.BACKGROUND, ButtonState.HOVERACTIVE, new Color(35, 35, 35, IngameMenu.MENU_ALPHA));
setColor(DrawType.BACKGROUND, ButtonState.DISABLED, new Color(255, 255, 255, IngameMenu.MENU_ALPHA));
setColor(DrawType.LINE, ButtonState.NORMAL, new Color(52, 52, 53, IngameMenu.MENU_ALPHA));
setColor(DrawType.LINE, ButtonState.ACTIVE, new Color(52, 52, 53, IngameMenu.MENU_ALPHA));
setColor(DrawType.LINE, ButtonState.HOVER, new Color(52, 52, 53, IngameMenu.MENU_ALPHA));
setColor(DrawType.LINE, ButtonState.HOVERACTIVE, new Color(52, 52, 53, IngameMenu.MENU_ALPHA));
setColor(DrawType.LINE, ButtonState.DISABLED, new Color(255, 255, 255, IngameMenu.MENU_ALPHA));
setColor(DrawType.LINE, ButtonState.POPUP, new Color(28, 28, 30, IngameMenu.MENU_ALPHA));
setColor(DrawType.TEXT, ButtonState.NORMAL, new Color(56, 56, 58, IngameMenu.MENU_ALPHA));
setColor(DrawType.TEXT, ButtonState.ACTIVE, new Color(90, 90, 94, IngameMenu.MENU_ALPHA));
setColor(DrawType.TEXT, ButtonState.HOVER, new Color(75, 75, 78, IngameMenu.MENU_ALPHA));
setColor(DrawType.TEXT, ButtonState.HOVERACTIVE, new Color(100, 100, 104, IngameMenu.MENU_ALPHA));
setColor(DrawType.TEXT, ButtonState.DISABLED, new Color(255, 255, 255, IngameMenu.MENU_ALPHA));
}
@Override
public void onRender() {
int x = this.getRenderX();
int y = this.getRenderY();
int mouseX = parent.getMouseX();
int width = this.width;
int backgroundColor = getColor(DrawType.BACKGROUND, lastState);
int lineColor = getColor(DrawType.LINE, lastState);
int textColor = getColor(DrawType.TEXT, lastState);
int linePopupColor = getColor(DrawType.LINE, ButtonState.POPUP);
GlStateManager.color(1,1,1);
//RoundedUtils.drawRoundedRect(x, y, x + width, y + height, 12.0f, new Color(50,50,50,255).getRGB());
RoundedUtils.drawGradientRound(x, y, width, height, 6, theme.getFirstColor(), theme.getFirstColor(), theme.getSecondColor(), theme.getSecondColor());
GlStateManager.color(1,1,1);
mouseDown = false;
}
@Override
public void drawText(String string, int x, int y, int color) {
if(Settings.customGuiFont) {
rip.athena.client.utils.font.FontManager.getProductSansRegular(30).drawString(string, x - 3, y, color);
} else {
Minecraft.getMinecraft().fontRendererObj.drawString(string, x, y, color);
}
}
@Override
public int getStringWidth(String string) {
if(Settings.customGuiFont) {
return (int) rip.athena.client.utils.font.FontManager.getProductSansRegular(30).width(string) - 1;
} else {
return Minecraft.getMinecraft().fontRendererObj.getStringWidth(string);
}
}
@Override
public int getStringHeight(String string) {
if(Settings.customGuiFont) {
return (int) FontManager.baloo17.getHeight(string) + 1;
} else {
return Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT;
}
}
}

View File

@ -0,0 +1,98 @@
package rip.athena.client.gui.clickgui.components.themes;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import rip.athena.client.font.FontManager;
import rip.athena.client.gui.clickgui.IngameMenu;
import rip.athena.client.gui.framework.components.MenuButton;
import rip.athena.client.gui.framework.draw.ButtonState;
import rip.athena.client.gui.framework.draw.DrawType;
import rip.athena.client.modules.impl.other.Settings;
import rip.athena.client.theme.Theme;
import rip.athena.client.utils.render.RoundedUtils;
import java.awt.*;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class TriColorGradientButton extends MenuButton {
protected boolean leftColorChange;
public TriColorGradientButton(Theme theme, int x, int y, int width, int height, boolean leftColorChange) {
super(theme, x, y, width, height);
this.leftColorChange = leftColorChange;
}
@Override
public void onInitColors() {
setColor(DrawType.BACKGROUND, ButtonState.NORMAL, new Color(35, 35, 35, IngameMenu.MENU_ALPHA));
setColor(DrawType.BACKGROUND, ButtonState.ACTIVE, new Color(35, 35, 35, IngameMenu.MENU_ALPHA));
setColor(DrawType.BACKGROUND, ButtonState.HOVER, new Color(35, 35, 35, IngameMenu.MENU_ALPHA));
setColor(DrawType.BACKGROUND, ButtonState.HOVERACTIVE, new Color(35, 35, 35, IngameMenu.MENU_ALPHA));
setColor(DrawType.BACKGROUND, ButtonState.DISABLED, new Color(255, 255, 255, IngameMenu.MENU_ALPHA));
setColor(DrawType.LINE, ButtonState.NORMAL, new Color(52, 52, 53, IngameMenu.MENU_ALPHA));
setColor(DrawType.LINE, ButtonState.ACTIVE, new Color(52, 52, 53, IngameMenu.MENU_ALPHA));
setColor(DrawType.LINE, ButtonState.HOVER, new Color(52, 52, 53, IngameMenu.MENU_ALPHA));
setColor(DrawType.LINE, ButtonState.HOVERACTIVE, new Color(52, 52, 53, IngameMenu.MENU_ALPHA));
setColor(DrawType.LINE, ButtonState.DISABLED, new Color(255, 255, 255, IngameMenu.MENU_ALPHA));
setColor(DrawType.LINE, ButtonState.POPUP, new Color(28, 28, 30, IngameMenu.MENU_ALPHA));
setColor(DrawType.TEXT, ButtonState.NORMAL, new Color(56, 56, 58, IngameMenu.MENU_ALPHA));
setColor(DrawType.TEXT, ButtonState.ACTIVE, new Color(90, 90, 94, IngameMenu.MENU_ALPHA));
setColor(DrawType.TEXT, ButtonState.HOVER, new Color(75, 75, 78, IngameMenu.MENU_ALPHA));
setColor(DrawType.TEXT, ButtonState.HOVERACTIVE, new Color(100, 100, 104, IngameMenu.MENU_ALPHA));
setColor(DrawType.TEXT, ButtonState.DISABLED, new Color(255, 255, 255, IngameMenu.MENU_ALPHA));
}
@Override
public void onRender() {
int x = this.getRenderX();
int y = this.getRenderY();
int mouseX = parent.getMouseX();
int width = this.width;
int backgroundColor = getColor(DrawType.BACKGROUND, lastState);
int lineColor = getColor(DrawType.LINE, lastState);
int textColor = getColor(DrawType.TEXT, lastState);
int linePopupColor = getColor(DrawType.LINE, ButtonState.POPUP);
GlStateManager.color(1,1,1);
//RoundedUtils.drawRoundedRect(x, y, x + width, y + height, 12.0f, new Color(50,50,50,255).getRGB());
RoundedUtils.drawGradientRound(x, y, width, height, 6, theme.getFirstColor(), theme.getSecondColor(), theme.getThirdColor(), theme.getFirstColor());
mouseDown = false;
}
@Override
public void drawText(String string, int x, int y, int color) {
if(Settings.customGuiFont) {
rip.athena.client.utils.font.FontManager.getProductSansRegular(30).drawString(string, x - 3, y, color);
} else {
Minecraft.getMinecraft().fontRendererObj.drawString(string, x, y, color);
}
}
@Override
public int getStringWidth(String string) {
if(Settings.customGuiFont) {
return (int) rip.athena.client.utils.font.FontManager.getProductSansRegular(30).width(string) - 1;
} else {
return Minecraft.getMinecraft().fontRendererObj.getStringWidth(string);
}
}
@Override
public int getStringHeight(String string) {
if(Settings.customGuiFont) {
return (int) FontManager.baloo17.getHeight(string) + 1;
} else {
return Minecraft.getMinecraft().fontRendererObj.FONT_HEIGHT;
}
}
}

View File

@ -129,7 +129,7 @@ public class ModsPage extends Page {
for (Category category : Category.values()) {
if (!category.isHidden()) {
MenuButton comp = new ModCategoryButton(category, x, y, (int) (30 + rip.athena.client.utils.font.FontManager.getNunitoBold(30).width(category.getText())), height) {
MenuButton comp = new ModCategoryButton(category, x - 20, y, (int) (35 + rip.athena.client.utils.font.FontManager.getNunitoBold(30).width(category.getText())), height) {
@Override
public void onAction() {
for (rip.athena.client.gui.framework.MenuComponent component : menu.getComponents()) {
@ -257,6 +257,7 @@ public class ModsPage extends Page {
int sliderWidth = pane.getWidth() - xSpacing * 2;
for (ConfigEntry configEntry : activeModule.getEntries()) {
GlStateManager.color(1,1,1);
final FeatureText label;
String key = configEntry.getKey().toUpperCase();

View File

@ -238,11 +238,10 @@ public class ProfilesPage extends Page {
drawVerticalLine(menu.getX() + 215, y + height - 30, height + 432, 3, new Color(32, 32, 32, 225).getRGB());
if(Settings.customGuiFont) {
FontManager.vision16.drawString("PROFILES", menu.getX() + 235, menu.getY() + 80, IngameMenu.MENU_HEADER_TEXT_COLOR);
rip.athena.client.utils.font.FontManager.getNunitoBold(30).drawString("PROFILES", menu.getX() + 235, menu.getY() + 80, IngameMenu.MENU_HEADER_TEXT_COLOR);
} else {
mc.fontRendererObj.drawString("PROFILES", menu.getX() + 235, menu.getY() + 80, IngameMenu.MENU_HEADER_TEXT_COLOR);
Minecraft.getMinecraft().fontRendererObj.drawString("PROFILES", menu.getX() + 235, menu.getY() + 80, IngameMenu.MENU_HEADER_TEXT_COLOR);
}
//drawHorizontalLine(menu.getX() + 31, menu.getY() + 110, menu.getWidth() - width - 31 * 2, 3, IngameMenu.MENU_LINE_COLOR);
rip.athena.client.gui.framework.draw.DrawImpl.drawRect(menu.getX() + menu.getWidth() - width, menu.getY() + 58, width, menu.getHeight() - 58, MacrosPage.MENU_SIDE_BG_COLOR);

View File

@ -0,0 +1,142 @@
package rip.athena.client.gui.clickgui.pages;
import net.minecraft.client.Minecraft;
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.gui.clickgui.IngameMenu;
import rip.athena.client.gui.clickgui.Page;
import rip.athena.client.gui.clickgui.components.macros.MacroButton;
import rip.athena.client.gui.clickgui.components.macros.MacroTextfield;
import rip.athena.client.gui.clickgui.components.macros.SimpleTextButton;
import rip.athena.client.gui.clickgui.components.mods.ModCategoryButton;
import rip.athena.client.gui.clickgui.components.mods.ModScrollPane;
import rip.athena.client.gui.clickgui.components.profiles.ProfilesBase;
import rip.athena.client.gui.clickgui.components.profiles.ProfilesBlueButton;
import rip.athena.client.gui.clickgui.components.themes.SimpleGradientButton;
import rip.athena.client.gui.clickgui.components.themes.TriColorGradientButton;
import rip.athena.client.gui.framework.Menu;
import rip.athena.client.gui.framework.TextPattern;
import rip.athena.client.gui.framework.draw.DrawImpl;
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 rip.athena.client.theme.Theme;
import rip.athena.client.utils.font.FontManager;
import rip.athena.client.utils.render.DrawUtils;
import rip.athena.client.utils.render.RoundedUtils;
import java.awt.*;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.NoSuchElementException;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/2/2023
*/
public class ThemesPage extends Page {
private ModScrollPane scrollPane;
private Theme activeTheme;
public ThemesPage(Minecraft mc, Menu menu, IngameMenu parent) {
super(mc, menu, parent);
}
@Override
public void onInit() {
int width = 300;
scrollPane = new ModScrollPane(260, 140, menu.getWidth() - width - 10 * 2, menu.getHeight() - 141, false);
populateScrollPane();
}
@Override
public void onRender() {
int y = menu.getY() + 59;
int height = 32;
if(Settings.customGuiFont) {
rip.athena.client.utils.font.FontManager.getNunitoBold(30).drawString("THEMES | " + Athena.INSTANCE.getThemeManager().getTheme().getTheme(), menu.getX() + 235, menu.getY() + 80, IngameMenu.MENU_HEADER_TEXT_COLOR);
} else {
Minecraft.getMinecraft().fontRendererObj.drawString("THEMES", menu.getX() + 235, menu.getY() + 80, IngameMenu.MENU_HEADER_TEXT_COLOR);
}
RoundedUtils.drawGradientRound(menu.getX() + 275, menu.getY() + 110, menu.getX() + 120, 20, 6, Athena.INSTANCE.getThemeManager().getTheme().getFirstColor(), Athena.INSTANCE.getThemeManager().getTheme().getFirstColor(), Athena.INSTANCE.getThemeManager().getTheme().getSecondColor(), Athena.INSTANCE.getThemeManager().getTheme().getSecondColor());
drawVerticalLine(menu.getX() + 215, y + height - 30, height + 432, 3, new Color(32, 32, 32, 225).getRGB());
}
private void populateScrollPane() {
scrollPane.getComponents().clear();
int spacing = 15;
int height = 70;
int y = spacing;
int x = spacing;
int defaultX = spacing;
int width = 190;
int maxWidth = scrollPane.getWidth() - spacing * 2;
for(Theme theme : Theme.values()) {
if (theme.isTriColor()) {
scrollPane.addComponent(new TriColorGradientButton(theme, x, y, width, height, false) {
@Override
public void onAction() {
setActive(false);
Athena.INSTANCE.getThemeManager().setTheme(theme);
populateScrollPane();
}
});
} else {
scrollPane.addComponent(new SimpleGradientButton(theme, x, y, width, height, false) {
@Override
public void onAction() {
setActive(false);
Athena.INSTANCE.getThemeManager().setTheme(theme);
populateScrollPane();
}
});
}
x += spacing + width;
if(x + spacing + width > maxWidth) {
x = defaultX;
y += height + spacing;
}
}
}
@Override
public void onLoad() {
menu.addComponent(scrollPane);
}
@Override
public void onUnload() {
}
@Override
public void onOpen() {
}
@Override
public void onClose() {
}
}

View File

@ -4,6 +4,7 @@ import net.minecraft.client.renderer.GlStateManager;
import rip.athena.client.gui.framework.MenuComponent;
import rip.athena.client.gui.framework.draw.ButtonState;
import rip.athena.client.gui.framework.draw.DrawType;
import rip.athena.client.theme.Theme;
import java.awt.*;
@ -18,6 +19,7 @@ public class MenuButton extends MenuComponent {
protected int minOffset = 2;
protected boolean mouseDown = false;
protected boolean active = false;
protected Theme theme;
protected ButtonState lastState = ButtonState.NORMAL;
public MenuButton(String text, int x, int y){
@ -29,6 +31,11 @@ public class MenuButton extends MenuComponent {
super(x, y, width, height);
this.text = text;
}
public MenuButton(Theme theme, int x, int y, int width, int height) {
super(x, y, width, height);
this.theme = theme;
}
@Override
public void onInitColors() {

View File

@ -319,19 +319,19 @@ public class AthenaMenu extends GuiScreen implements GuiYesNoCallback
public void drawScreen(int mouseX, int mouseY, float partialTicks)
{
DrawUtils.drawImage(new ResourceLocation("Athena/menu/wallpaper.jpg"), 0, 0, width, height);
DrawUtils.drawImage(new ResourceLocation("Athena/menu/test.png"), 0, 0, width, height);
int[] size = InputUtils.getWindowsSize();
int startX = size[0] / 2;
int startY = size[1] / 2;
int x = startX - 75;
int y = this.height / 4 + 18;
int y = this.height / 4 + 28;
int width = 150;
int height = 100;
FontManager.vision30.drawString(Athena.INSTANCE.getClientName().toUpperCase(),
this.width / 2 - 88 + FontManager.vision30.getStringWidth(Athena.INSTANCE.getClientName().toUpperCase()), y, new Color(255, 255, 255).getRGB());
rip.athena.client.utils.font.FontManager.getNunitoBold(30).drawString(Athena.INSTANCE.getClientName().toUpperCase(),
this.width / 2 - 88 + rip.athena.client.utils.font.FontManager.getNunitoBold(30).width(Athena.INSTANCE.getClientName().toUpperCase()), y, new Color(255, 255, 255).getRGB());
GlStateManager.pushMatrix();
DrawUtils.drawImage(new ResourceLocation("Athena/menu/exit.png"),startX + startX - 20, 10, 10, 10);

View File

@ -5,8 +5,10 @@ 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.Athena;
import rip.athena.client.font.FontManager;
import rip.athena.client.utils.render.DrawUtils;
import rip.athena.client.utils.render.RoundedUtils;
import java.awt.*;
@ -92,8 +94,8 @@ public class Notification {
DrawUtils.drawImage(NotificationManager.LOGO, x - 24, y - 20, 20, 20);
drawRect(x - width, y - height, x, y - Math.round(20 * oldDelta), BACKGROUND_COLOR);
drawRect(x, y, 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);

View File

@ -1,6 +1,7 @@
package rip.athena.client.modules.impl.render;
import org.lwjgl.opengl.GL11;
import rip.athena.client.Athena;
import rip.athena.client.config.ConfigValue;
import rip.athena.client.events.SubscribeEvent;
import rip.athena.client.events.types.input.MouseDownEvent;
@ -33,7 +34,7 @@ public class CPS extends Module {
@ConfigValue.Boolean(name = "Background")
private boolean backGround = true;
@ConfigValue.List(name = "Display Mode", values = {"Modern", "Old"}, description = "Chose display of background")
@ConfigValue.List(name = "Display Mode", values = {"Modern", "Fade", "Old"}, description = "Chose display of background")
private String backgroundMode = "Modern";
@ConfigValue.Color(name = "Background Color")
@ -80,10 +81,14 @@ public class CPS extends Module {
int height = hud.getHeight();
if(backGround) {
if(backgroundMode.equalsIgnoreCase("Modern")) {
RoundedUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 12.0f, new Color(50, 50, 50, 255).getRGB());
RoundedUtils.drawRoundedRect(hud.getX() + 1, hud.getY() + 1, hud.getX() + width - 1, hud.getY() + height - 1, 12.0f, new Color(35, 35, 35, 255).getRGB());
if(backgroundMode.equalsIgnoreCase("Modern")) {
if(Athena.INSTANCE.getThemeManager().getTheme().isTriColor()) {
RoundedUtils.drawGradientRound(hud.getX(), hud.getY(), hud.getWidth(), hud.getHeight(), 6, Athena.INSTANCE.getThemeManager().getTheme().getFirstColor(), Athena.INSTANCE.getThemeManager().getTheme().getSecondColor(), Athena.INSTANCE.getThemeManager().getTheme().getThirdColor(), Athena.INSTANCE.getThemeManager().getTheme().getFirstColor());
} else {
RoundedUtils.drawGradientRound(hud.getX(), hud.getY(), hud.getWidth(), hud.getHeight(), 6, Athena.INSTANCE.getThemeManager().getTheme().getFirstColor(), Athena.INSTANCE.getThemeManager().getTheme().getFirstColor(), Athena.INSTANCE.getThemeManager().getTheme().getSecondColor(), Athena.INSTANCE.getThemeManager().getTheme().getSecondColor());
}
} else if (backgroundMode.equalsIgnoreCase("Fade")) {
RoundedUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 8.0f, Athena.INSTANCE.getThemeManager().getTheme().getAccentColor().getRGB());
} else {
DrawUtils.drawGradientRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, background.getRGB(), background.getRGB());
}
@ -97,9 +102,9 @@ public class CPS extends Module {
hud.setHeight((int)FontManager.baloo17.getHeight(string) + 7);
if(isUsingStaticChroma) {
DrawUtils.drawCustomFontChromaString(FontManager.baloo17, string, (int) (posX), (int) posY + 1, true, true);
DrawUtils.drawCustomFontChromaString(rip.athena.client.utils.font.FontManager.getProductSansRegular(25), string, (int) (posX), (int) posY + 1, true, true);
} else if(isUsingWaveChroma) {
DrawUtils.drawCustomFontChromaString(FontManager.baloo17, string, (int) (posX), (int) posY + 1, false, true);
DrawUtils.drawCustomFontChromaString(rip.athena.client.utils.font.FontManager.getProductSansRegular(25), string, (int) (posX), (int) posY + 1, false, true);
} else {
rip.athena.client.utils.font.FontManager.getProductSansRegular(25).drawString(string,(int) (posX) + 1, (int)posY + 2, color.getRGB());
}

View File

@ -1,12 +1,14 @@
package rip.athena.client.modules.impl.render;
import org.lwjgl.opengl.GL11;
import rip.athena.client.Athena;
import rip.athena.client.config.ConfigValue;
import rip.athena.client.font.FontManager;
import rip.athena.client.gui.hud.HUDElement;
import rip.athena.client.modules.Category;
import rip.athena.client.modules.Module;
import rip.athena.client.utils.render.DrawUtils;
import rip.athena.client.utils.render.RoundedUtils;
import java.awt.*;
import java.time.LocalDateTime;
@ -24,7 +26,7 @@ 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"})
private String format = "yyyy/MM/dd HH:mm:ss";
@ConfigValue.List(name = "Display Mode", values = {"Modern", "Old"}, description = "Chose display of background")
@ConfigValue.List(name = "Display Mode", values = {"Modern", "Fade", "Old"}, description = "Chose display of background")
private String backgroundMode = "Modern";
@ConfigValue.Boolean(name = "Background")
@ -83,9 +85,9 @@ public class Clock extends Module {
if(backGround) {
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());
RoundedUtils.drawGradientRound(hud.getX(), hud.getY(), hud.getWidth(), hud.getHeight(), 6, Athena.INSTANCE.getThemeManager().getTheme().getFirstColor(), Athena.INSTANCE.getThemeManager().getTheme().getFirstColor(), Athena.INSTANCE.getThemeManager().getTheme().getSecondColor(), Athena.INSTANCE.getThemeManager().getTheme().getSecondColor());
} else if (backgroundMode.equalsIgnoreCase("Fade")) {
RoundedUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 8.0f, Athena.INSTANCE.getThemeManager().getTheme().getAccentColor().getRGB());
} else {
DrawUtils.drawGradientRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, background.getRGB(), background.getRGB());
}
@ -99,9 +101,9 @@ public class Clock extends Module {
hud.setHeight((int)FontManager.baloo17.getHeight(string) + 7);
if(isUsingStaticChroma) {
DrawUtils.drawCustomFontChromaString(FontManager.baloo17, string, (int) (posX), (int) posY, true, true);
DrawUtils.drawCustomFontChromaString(rip.athena.client.utils.font.FontManager.getProductSansRegular(25), string, (int) (posX), (int) posY, true, true);
} else if(isUsingWaveChroma) {
DrawUtils.drawCustomFontChromaString(FontManager.baloo17, string, (int) (posX), (int) posY, false, true);
DrawUtils.drawCustomFontChromaString(rip.athena.client.utils.font.FontManager.getProductSansRegular(25), string, (int) (posX), (int) posY, false, true);
} else {
rip.athena.client.utils.font.FontManager.getProductSansRegular(30).drawString(string,(int) (posX), (int)posY, color.getRGB());
}

View File

@ -13,6 +13,7 @@ import net.minecraft.client.resources.model.IBakedModel;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
import org.lwjgl.opengl.GL11;
import rip.athena.client.Athena;
import rip.athena.client.config.ConfigValue;
import rip.athena.client.events.SubscribeEvent;
import rip.athena.client.events.types.input.KeyDownEvent;
@ -21,6 +22,7 @@ import rip.athena.client.gui.hud.HUDElement;
import rip.athena.client.modules.Category;
import rip.athena.client.modules.Module;
import rip.athena.client.utils.render.DrawUtils;
import rip.athena.client.utils.render.RoundedUtils;
import java.awt.*;
@ -63,7 +65,7 @@ public class Coordinates extends Module {
@ConfigValue.List(name = "Display Mode", values = {"Horizontal", "Vertical"}, description = "How the hud should be displayed")
private String displayMode = "Vertical";
@ConfigValue.List(name = "Display Mode", values = {"Modern", "Old"}, description = "Chose display of background")
@ConfigValue.List(name = "Display Mode", values = {"Modern", "Fade", "Old"}, description = "Chose display of background")
private String backgroundMode = "Modern";
@ConfigValue.Color(name = "Background Color")
@ -197,11 +199,11 @@ public class Coordinates extends Module {
if(this.shadedCoords) {
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());
RoundedUtils.drawGradientRound(hud.getX(), hud.getY(), hud.getWidth(), hud.getHeight(), 6, Athena.INSTANCE.getThemeManager().getTheme().getFirstColor(), Athena.INSTANCE.getThemeManager().getTheme().getFirstColor(), Athena.INSTANCE.getThemeManager().getTheme().getSecondColor(), Athena.INSTANCE.getThemeManager().getTheme().getSecondColor());
} else if (backgroundMode.equalsIgnoreCase("Fade")) {
RoundedUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 8.0f, Athena.INSTANCE.getThemeManager().getTheme().getAccentColor().getRGB());
} else {
DrawUtils.drawGradientRect(posX, posY, posX + width, posY + height, backgroundColor.getRGB(), backgroundColor.getRGB());
DrawUtils.drawGradientRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, backgroundColor.getRGB(), backgroundColor.getRGB());
}
}
@ -218,7 +220,6 @@ public class Coordinates extends Module {
if (this.displayMode.equalsIgnoreCase("Vertical")) {
GL11.glPushMatrix();
GL11.glEnable(GL11.GL_ALPHA_TEST);
FontRenderer var8 = mc.fontRendererObj;
if (mc.thePlayer.posX > 0) {
myPosX = (int) MathHelper.floor_double(mc.thePlayer.posX);
} else {
@ -262,10 +263,11 @@ public class Coordinates extends Module {
if(this.shadedCoords) {
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());
RoundedUtils.drawGradientRound(hud.getX(), hud.getY(), hud.getWidth(), hud.getHeight(), 6, Athena.INSTANCE.getThemeManager().getTheme().getFirstColor(), Athena.INSTANCE.getThemeManager().getTheme().getFirstColor(), Athena.INSTANCE.getThemeManager().getTheme().getSecondColor(), Athena.INSTANCE.getThemeManager().getTheme().getSecondColor());
} else if (backgroundMode.equalsIgnoreCase("Fade")) {
RoundedUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 8.0f, Athena.INSTANCE.getThemeManager().getTheme().getAccentColor().getRGB());
} else {
DrawUtils.drawGradientRect(posX, posY, posX + width, posY + height, backgroundColor.getRGB(), backgroundColor.getRGB());
DrawUtils.drawGradientRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, backgroundColor.getRGB(), backgroundColor.getRGB());
}
}
@ -315,7 +317,7 @@ public class Coordinates extends Module {
public int getStringWidth(String text) {
if (this.customFont) {
return (int) rip.athena.client.utils.font.FontManager.getProductSansRegular(30).width(text);
return (int) rip.athena.client.utils.font.FontManager.getProductSansRegular(25).width(text);
} else {
return mc.fontRendererObj.getStringWidth(text);
}
@ -401,11 +403,11 @@ public class Coordinates extends Module {
public void drawString(String text, double posX, double posY, Color color) {
if (this.customFont) {
if (color.getBlue() == 5 && color.getRed() == 5 && color.getGreen() == 5) {
DrawUtils.drawCustomFontChromaString(FontManager.baloo17, text, (int) posX, (int) posY - 2, true, true);
DrawUtils.drawCustomFontChromaString(rip.athena.client.utils.font.FontManager.getProductSansRegular(25), text, (int) posX, (int) posY - 2, true, true);
} else if (color.getBlue() == 6 && color.getRed() == 6 && color.getGreen() == 6) {
DrawUtils.drawCustomFontChromaString(FontManager.baloo17, text, (int) posX, (int) posY - 2, false, true);
DrawUtils.drawCustomFontChromaString(rip.athena.client.utils.font.FontManager.getProductSansRegular(25), text, (int) posX, (int) posY - 2, false, true);
} else {
rip.athena.client.utils.font.FontManager.getProductSansRegular(30).drawString(text, (int) posX, (int) posY - 2, color.getRGB());
rip.athena.client.utils.font.FontManager.getProductSansRegular(25).drawString(text, (int) posX, (int) posY - 2, color.getRGB());
}
} else {
if (color.getBlue() == 5 && color.getRed() == 5 && color.getGreen() == 5) {

View File

@ -1,12 +1,14 @@
package rip.athena.client.modules.impl.render;
import org.lwjgl.opengl.GL11;
import rip.athena.client.Athena;
import rip.athena.client.config.ConfigValue;
import rip.athena.client.font.FontManager;
import rip.athena.client.gui.hud.HUDElement;
import rip.athena.client.modules.Category;
import rip.athena.client.modules.Module;
import rip.athena.client.utils.render.DrawUtils;
import rip.athena.client.utils.render.RoundedUtils;
import java.awt.*;
@ -26,7 +28,7 @@ public class CustomText extends Module {
@ConfigValue.Boolean(name = "Custom Font")
private boolean customFont = false;
@ConfigValue.List(name = "Display Mode", values = {"Modern", "Old"}, description = "Chose display of background")
@ConfigValue.List(name = "Display Mode", values = {"Modern", "Fade", "Old"}, description = "Chose display of background")
private String backgroundMode = "Modern";
@ConfigValue.Boolean(name = "Background")
@ -45,7 +47,7 @@ public class CustomText extends Module {
private int width = 56;
private int height = 18;
public CustomText() {
super("Custom Text", Category.RENDER);
super("Custom Text", Category.RENDER, "Athena/gui/mods/customtext.png");
hud = new HUDElement("customtext", width, height) {
@Override
@ -70,14 +72,19 @@ public class CustomText extends Module {
int height = hud.getHeight();
if(backGround) {
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());
if(backgroundMode.equalsIgnoreCase("Modern")) {
if(Athena.INSTANCE.getThemeManager().getTheme().isTriColor()) {
RoundedUtils.drawGradientRound(hud.getX(), hud.getY(), hud.getWidth(), hud.getHeight(), 6, Athena.INSTANCE.getThemeManager().getTheme().getFirstColor(), Athena.INSTANCE.getThemeManager().getTheme().getSecondColor(), Athena.INSTANCE.getThemeManager().getTheme().getThirdColor(), Athena.INSTANCE.getThemeManager().getTheme().getFirstColor());
} else {
RoundedUtils.drawGradientRound(hud.getX(), hud.getY(), hud.getWidth(), hud.getHeight(), 6, Athena.INSTANCE.getThemeManager().getTheme().getFirstColor(), Athena.INSTANCE.getThemeManager().getTheme().getFirstColor(), Athena.INSTANCE.getThemeManager().getTheme().getSecondColor(), Athena.INSTANCE.getThemeManager().getTheme().getSecondColor());
}
} else if (backgroundMode.equalsIgnoreCase("Fade")) {
RoundedUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 8.0f, Athena.INSTANCE.getThemeManager().getTheme().getAccentColor().getRGB());
} else {
DrawUtils.drawGradientRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, background.getRGB(), background.getRGB());
}
}
float posY = hud.getY() + 2;
float posX = hud.getX() + 9;
@ -86,9 +93,9 @@ public class CustomText extends Module {
hud.setHeight((int)FontManager.baloo17.getHeight(customText) + 7);
if(isUsingStaticChroma) {
DrawUtils.drawCustomFontChromaString(FontManager.baloo17, customText, (int) (posX), (int) posY + 1, true, true);
DrawUtils.drawCustomFontChromaString(rip.athena.client.utils.font.FontManager.getProductSansRegular(25), customText, (int) (posX), (int) posY + 1, true, true);
} else if(isUsingWaveChroma) {
DrawUtils.drawCustomFontChromaString(FontManager.baloo17, customText, (int) (posX), (int) posY + 1, false, true);
DrawUtils.drawCustomFontChromaString(rip.athena.client.utils.font.FontManager.getProductSansRegular(25), customText, (int) (posX), (int) posY + 1, false, true);
} else {
rip.athena.client.utils.font.FontManager.getProductSansRegular(30).drawString(customText,(int) (posX), (int)posY + 1, color.getRGB());
}

View File

@ -1,12 +1,14 @@
package rip.athena.client.modules.impl.render;
import org.lwjgl.opengl.GL11;
import rip.athena.client.Athena;
import rip.athena.client.config.ConfigValue;
import rip.athena.client.font.FontManager;
import rip.athena.client.gui.hud.HUDElement;
import rip.athena.client.modules.Category;
import rip.athena.client.modules.Module;
import rip.athena.client.utils.render.DrawUtils;
import rip.athena.client.utils.render.RoundedUtils;
import java.awt.*;
@ -17,7 +19,7 @@ import java.awt.*;
*/
public class EntityHUD extends Module {
@ConfigValue.List(name = "Display Mode", values = {"Modern", "Old"}, description = "Chose display of background")
@ConfigValue.List(name = "Display Mode", values = {"Modern", "Fade", "Old"}, description = "Chose display of background")
private String backgroundMode = "Modern";
@ConfigValue.Boolean(name = "Background")
@ -43,7 +45,7 @@ public class EntityHUD extends Module {
private int height = 18;
public EntityHUD() {
super("Entity HUD", Category.RENDER);
super("Entity HUD", Category.RENDER, "Athena/gui/mods/entityhud.png");
hud = new HUDElement("entityhud", width, height) {
@Override
@ -71,9 +73,9 @@ public class EntityHUD extends Module {
if(backGround) {
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());
RoundedUtils.drawGradientRound(hud.getX(), hud.getY(), hud.getWidth(), hud.getHeight(), 6, Athena.INSTANCE.getThemeManager().getTheme().getFirstColor(), Athena.INSTANCE.getThemeManager().getTheme().getFirstColor(), Athena.INSTANCE.getThemeManager().getTheme().getSecondColor(), Athena.INSTANCE.getThemeManager().getTheme().getSecondColor());
} else if (backgroundMode.equalsIgnoreCase("Fade")) {
RoundedUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 8.0f, Athena.INSTANCE.getThemeManager().getTheme().getAccentColor().getRGB());
} else {
DrawUtils.drawGradientRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, background.getRGB(), background.getRGB());
}
@ -87,9 +89,9 @@ public class EntityHUD extends Module {
hud.setHeight((int)FontManager.baloo17.getHeight(string) + 7);
if(isUsingStaticChroma) {
DrawUtils.drawCustomFontChromaString(FontManager.baloo17, string, (int) (posX), (int) posY, true, true);
DrawUtils.drawCustomFontChromaString(rip.athena.client.utils.font.FontManager.getProductSansRegular(25), string, (int) (posX), (int) posY, true, true);
} else if(isUsingWaveChroma) {
DrawUtils.drawCustomFontChromaString(FontManager.baloo17, string, (int) (posX), (int) posY, false, true);
DrawUtils.drawCustomFontChromaString(rip.athena.client.utils.font.FontManager.getProductSansRegular(25), string, (int) (posX), (int) posY, false, true);
} else {
rip.athena.client.utils.font.FontManager.getProductSansRegular(30).drawString(string,(int) (posX), (int)posY, color.getRGB());
}

View File

@ -1,5 +1,6 @@
package rip.athena.client.modules.impl.render;
import net.minecraft.client.renderer.GlStateManager;
import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11;
import rip.athena.client.Athena;
@ -10,12 +11,16 @@ import rip.athena.client.events.types.render.RenderType;
import rip.athena.client.font.FontManager;
import rip.athena.client.font.FontUtils;
import rip.athena.client.gui.hud.HUDElement;
import rip.athena.client.gui.menu.AthenaMenu;
import rip.athena.client.modules.Category;
import rip.athena.client.modules.Module;
import rip.athena.client.utils.render.DrawUtils;
import rip.athena.client.utils.render.RoundedUtils;
import java.awt.*;
import static org.lwjgl.opengl.GL11.GL_GREATER;
/**
* @author Athena Development
* @project Athena-Client
@ -23,7 +28,7 @@ import java.awt.*;
*/
public class FPSMod extends Module {
@ConfigValue.List(name = "Display Mode", values = {"Modern", "Old"}, description = "Chose display of background")
@ConfigValue.List(name = "Display Mode", values = {"Modern", "Fade", "Old"}, description = "Chose display of background")
private String backgroundMode = "Modern";
@ConfigValue.Boolean(name = "Background")
@ -77,9 +82,13 @@ public class FPSMod extends Module {
if(backGround) {
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());
if(Athena.INSTANCE.getThemeManager().getTheme().isTriColor()) {
RoundedUtils.drawGradientRound(hud.getX(), hud.getY(), hud.getWidth(), hud.getHeight(), 6, Athena.INSTANCE.getThemeManager().getTheme().getFirstColor(), Athena.INSTANCE.getThemeManager().getTheme().getSecondColor(), Athena.INSTANCE.getThemeManager().getTheme().getThirdColor(), Athena.INSTANCE.getThemeManager().getTheme().getFirstColor());
} else {
RoundedUtils.drawGradientRound(hud.getX(), hud.getY(), hud.getWidth(), hud.getHeight(), 6, Athena.INSTANCE.getThemeManager().getTheme().getFirstColor(), Athena.INSTANCE.getThemeManager().getTheme().getFirstColor(), Athena.INSTANCE.getThemeManager().getTheme().getSecondColor(), Athena.INSTANCE.getThemeManager().getTheme().getSecondColor());
}
} else if (backgroundMode.equalsIgnoreCase("Fade")) {
RoundedUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 8.0f, Athena.INSTANCE.getThemeManager().getTheme().getAccentColorWave().getRGB());
} else {
DrawUtils.drawGradientRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, background.getRGB(), background.getRGB());
}
@ -93,11 +102,13 @@ public class FPSMod extends Module {
hud.setHeight((int)FontManager.baloo17.getHeight(string) + 7);
if(isUsingStaticChroma) {
DrawUtils.drawCustomFontChromaString(FontManager.baloo17, string, (int) (posX), (int) posY + 1, true, true);
DrawUtils.drawCustomFontChromaString(rip.athena.client.utils.font.FontManager.getProductSansRegular(25), string, (int) (posX), (int) posY + 1, true, true);
} else if(isUsingWaveChroma) {
DrawUtils.drawCustomFontChromaString(FontManager.baloo17, string, (int) (posX), (int) posY + 1, false, true);
DrawUtils.drawCustomFontChromaString(rip.athena.client.utils.font.FontManager.getProductSansRegular(25), string, (int) (posX), (int) posY + 1, false, true);
} else {
rip.athena.client.utils.font.FontManager.getPoppinsRegular(25).drawString(string,(int) (posX), (int)posY + 3, color.getRGB());
rip.athena.client.utils.font.FontManager.getProductSansRegular(25).drawString(string,(int) (posX) + 1, (int)posY + 2, color.getRGB());
//rip.athena.client.utils.font.FontManager.getPoppinsRegular(25).drawString(string,(int) (posX), (int)posY + 3, color.getRGB());
//rip.athena.client.utils.font.FontManager.getProductSansRegular(30).drawString(string,(int) (posX), (int)posY + 1, color.getRGB());
}
} else {

View File

@ -356,9 +356,9 @@ public class Keystrokes extends Module {
public void drawString(String text, float posX, float posY, Color color) {
if (this.isCustomFont) {
if (isUsingStaticChroma) {
DrawUtils.drawCustomFontChromaString(FontManager.baloo17, text, (int)posX + 1, (int)posY, true, true);
DrawUtils.drawCustomFontChromaString(rip.athena.client.utils.font.FontManager.getProductSansRegular(25), text, (int)posX + 1, (int)posY, true, true);
} else if (isUsingWaveChroma) {
DrawUtils.drawCustomFontChromaString(FontManager.baloo17, text, (int)posX + 1, (int)posY, false, true);
DrawUtils.drawCustomFontChromaString(rip.athena.client.utils.font.FontManager.getProductSansRegular(25), text, (int)posX + 1, (int)posY, false, true);
} else {
rip.athena.client.utils.font.FontManager.getProductSansRegular(30).drawString(text, (int)posX + 1, (int)posY, color.getRGB());
}

View File

@ -1,12 +1,14 @@
package rip.athena.client.modules.impl.render;
import org.lwjgl.opengl.GL11;
import rip.athena.client.Athena;
import rip.athena.client.config.ConfigValue;
import rip.athena.client.font.FontManager;
import rip.athena.client.gui.hud.HUDElement;
import rip.athena.client.modules.Category;
import rip.athena.client.modules.Module;
import rip.athena.client.utils.render.DrawUtils;
import rip.athena.client.utils.render.RoundedUtils;
import java.awt.*;
@ -19,7 +21,7 @@ public class MemoryUsage extends Module {
@ConfigValue.Boolean(name = "Percentage", description = "Show memory usage in percentage.")
private boolean percentage = false;
@ConfigValue.List(name = "Display Mode", values = {"Modern", "Old"}, description = "Chose display of background")
@ConfigValue.List(name = "Display Mode", values = {"Modern", "Fade", "Old"}, description = "Chose display of background")
private String backgroundMode = "Modern";
@ConfigValue.Boolean(name = "Background")
@ -81,16 +83,15 @@ public class MemoryUsage extends Module {
if(this.percentage) {
string = "Memory: " + percentage + "%";
}
int width = hud.getWidth();
int height = hud.getHeight();
if(backGround) {
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());
RoundedUtils.drawGradientRound(hud.getX(), hud.getY(), hud.getWidth(), hud.getHeight(), 6, Athena.INSTANCE.getThemeManager().getTheme().getFirstColor(), Athena.INSTANCE.getThemeManager().getTheme().getFirstColor(), Athena.INSTANCE.getThemeManager().getTheme().getSecondColor(), Athena.INSTANCE.getThemeManager().getTheme().getSecondColor());
} else if (backgroundMode.equalsIgnoreCase("Fade")) {
RoundedUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 8.0f, Athena.INSTANCE.getThemeManager().getTheme().getAccentColor().getRGB());
} else {
DrawUtils.drawGradientRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, background.getRGB(), background.getRGB());
}
@ -104,9 +105,9 @@ public class MemoryUsage extends Module {
hud.setHeight((int)FontManager.baloo17.getHeight(string) + 7);
if(isUsingStaticChroma) {
DrawUtils.drawCustomFontChromaString(FontManager.baloo17, string, (int) (posX), (int) posY, true, true);
DrawUtils.drawCustomFontChromaString(rip.athena.client.utils.font.FontManager.getProductSansRegular(25), string, (int) (posX), (int) posY, true, true);
} else if(isUsingWaveChroma) {
DrawUtils.drawCustomFontChromaString(FontManager.baloo17, string, (int) (posX), (int) posY, false, true);
DrawUtils.drawCustomFontChromaString(rip.athena.client.utils.font.FontManager.getProductSansRegular(25), string, (int) (posX), (int) posY, false, true);
} else {
rip.athena.client.utils.font.FontManager.getProductSansRegular(30).drawString(string,(int) (posX), (int)posY, color.getRGB());
}

View File

@ -6,12 +6,14 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.FoodStats;
import org.lwjgl.opengl.GL11;
import rip.athena.client.Athena;
import rip.athena.client.config.ConfigValue;
import rip.athena.client.font.FontManager;
import rip.athena.client.gui.hud.HUDElement;
import rip.athena.client.modules.Category;
import rip.athena.client.modules.Module;
import rip.athena.client.utils.render.DrawUtils;
import rip.athena.client.utils.render.RoundedUtils;
import java.awt.*;
@ -25,7 +27,7 @@ public class PotCounter extends Module {
@ConfigValue.Color(name = "Color")
private Color color = Color.WHITE;
@ConfigValue.List(name = "Display Mode", values = {"Modern", "Old"}, description = "Chose display of background")
@ConfigValue.List(name = "Display Mode", values = {"Modern", "Fade", "Old"}, description = "Chose display of background")
private String backgroundMode = "Modern";
@ConfigValue.Boolean(name = "Background")
@ -94,10 +96,14 @@ public class PotCounter extends Module {
int height = hud.getHeight();
if(background) {
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());
if(backgroundMode.equalsIgnoreCase("Modern")) {
if(Athena.INSTANCE.getThemeManager().getTheme().isTriColor()) {
RoundedUtils.drawGradientRound(hud.getX(), hud.getY(), hud.getWidth(), hud.getHeight(), 6, Athena.INSTANCE.getThemeManager().getTheme().getFirstColor(), Athena.INSTANCE.getThemeManager().getTheme().getSecondColor(), Athena.INSTANCE.getThemeManager().getTheme().getThirdColor(), Athena.INSTANCE.getThemeManager().getTheme().getFirstColor());
} else {
RoundedUtils.drawGradientRound(hud.getX(), hud.getY(), hud.getWidth(), hud.getHeight(), 6, Athena.INSTANCE.getThemeManager().getTheme().getFirstColor(), Athena.INSTANCE.getThemeManager().getTheme().getFirstColor(), Athena.INSTANCE.getThemeManager().getTheme().getSecondColor(), Athena.INSTANCE.getThemeManager().getTheme().getSecondColor());
}
} else if (backgroundMode.equalsIgnoreCase("Fade")) {
RoundedUtils.drawRoundedRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, 8.0f, Athena.INSTANCE.getThemeManager().getTheme().getAccentColor().getRGB());
} else {
DrawUtils.drawGradientRect(hud.getX(), hud.getY(), hud.getX() + width, hud.getY() + height, backgroundColor.getRGB(), backgroundColor.getRGB());
}
@ -111,9 +117,9 @@ public class PotCounter extends Module {
hud.setHeight((int) (FontManager.baloo17.getHeight(str) + 7));
if(isUsingStaticChroma) {
DrawUtils.drawCustomFontChromaString(FontManager.baloo17, str, (int) posX, (int) posY + 1, true, true);
DrawUtils.drawCustomFontChromaString(rip.athena.client.utils.font.FontManager.getProductSansRegular(25), str, (int) posX, (int) posY + 1, true, true);
} else if (isUsingWaveChroma) {
DrawUtils.drawCustomFontChromaString(FontManager.baloo17, str, (int) posX, (int) posY + 1, false, true);
DrawUtils.drawCustomFontChromaString(rip.athena.client.utils.font.FontManager.getProductSansRegular(25), str, (int) posX, (int) posY + 1, false, true);
} else {
rip.athena.client.utils.font.FontManager.getProductSansRegular(30).drawString(str, (int) posX, (int) posY + 1, color.getRGB());
}

View File

@ -21,7 +21,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
*/
public class TPS extends Module {
@ConfigValue.List(name = "Display Mode", values = {"Modern", "Old"}, description = "Chose display of background")
@ConfigValue.List(name = "Display Mode", values = {"Modern", "Fade", "Old"}, description = "Chose display of background")
public static String backgroundMode = "Modern";
@ConfigValue.Boolean(name = "Preset Color")
@ -148,14 +148,12 @@ public class TPS extends Module {
}
GL11.glColor4f(1F, 1F, 1F, 1F);
GL11.glPopMatrix();
float x = 14;
float lastValue = 0;
int i = 0;
if(mode.equalsIgnoreCase("Graph") ||mode.equalsIgnoreCase("Both")) {
GL11.glPushMatrix();

View File

@ -0,0 +1,211 @@
package rip.athena.client.theme;
import lombok.AllArgsConstructor;
import lombok.Getter;
import net.minecraft.util.EnumChatFormatting;
import rip.athena.client.utils.render.ColorUtil;
import javax.vecmath.Vector2d;
import java.awt.*;
import java.util.ArrayList;
import java.util.Arrays;
import static net.minecraft.util.EnumChatFormatting.*;
import static net.minecraft.util.EnumChatFormatting.DARK_GREEN;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/8/2023
*/
@Getter
public enum Theme implements ColorUtil {
ATHENA("Athena", new Color(7, 64, 170), new Color(4, 83, 97), DARK_PURPLE, false, KeyColors.PURPLE, KeyColors.RED),
AUBERGINE("Aubergine", new Color(170, 7, 107), new Color(97, 4, 95), DARK_PURPLE, false, KeyColors.PURPLE, KeyColors.RED),
AQUA("Aqua", new Color(185, 250, 255), new Color(79, 199, 200), EnumChatFormatting.AQUA, false, KeyColors.AQUA),
BANANA("Banana", new Color(253, 236, 177), new Color(255, 255, 255), YELLOW, false, KeyColors.YELLOW),
BLEND("Blend", new Color(71, 148, 253), new Color(71, 253, 160), EnumChatFormatting.AQUA, false, KeyColors.AQUA, KeyColors.LIME),
BLOSSOM("Blossom", new Color(226, 208, 249), new Color(49, 119, 115), DARK_AQUA, false, KeyColors.PINK, KeyColors.GRAY),
BUBBLEGUM("Bubblegum", new Color(243, 145, 216), new Color(152, 165, 243), LIGHT_PURPLE, false, KeyColors.PINK, KeyColors.PURPLE),
CANDY_CANE("Candy Cane", new Color(255, 255, 255), new Color(255, 0, 0), RED, false, KeyColors.RED),
CHERRY("Cherry", new Color(187, 55, 125), new Color(251, 211, 233), RED, false, KeyColors.RED, KeyColors.PURPLE, KeyColors.PINK),
CHRISTMAS("Christmas", new Color(255, 64, 64), new Color(255, 255, 255), new Color(64, 255, 64), RED, true, KeyColors.RED, KeyColors.LIME),
CORAL("Coral", new Color(244, 168, 150), new Color(52, 133, 151), DARK_AQUA, false, KeyColors.PINK, KeyColors.ORANGE, KeyColors.DARK_BLUE),
DIGITAL_HORIZON("Digital Horizon", new Color(95, 195, 228), new Color(229, 93, 135), EnumChatFormatting.AQUA, false, KeyColors.AQUA, KeyColors.RED, KeyColors.PINK),
EXPRESS("Express", new Color(173, 83, 137), new Color(60, 16, 83), DARK_PURPLE, false, KeyColors.PURPLE, KeyColors.PINK),
LIME_WATER("Lime Water", new Color(18, 255, 247), new Color(179, 255, 171), EnumChatFormatting.AQUA, false, KeyColors.AQUA, KeyColors.LIME),
LUSH("Lush", new Color(168, 224, 99), new Color(86, 171, 47), GREEN, false, KeyColors.LIME, KeyColors.DARK_GREEN),
HALOGEN("Halogen", new Color(255, 65, 108), new Color(255, 75, 43), RED, false, KeyColors.RED, KeyColors.ORANGE),
HYPER("Hyper", new Color(236, 110, 173), new Color(52, 148, 230), LIGHT_PURPLE, false, KeyColors.PINK, KeyColors.DARK_BLUE, KeyColors.AQUA),
MAGIC("Magic", new Color(74, 0, 224), new Color(142, 45, 226), BLUE, false, KeyColors.DARK_BLUE, KeyColors.PURPLE),
MAY("May", new Color(253, 219, 245), new Color(238, 79, 238), LIGHT_PURPLE, false, KeyColors.PINK, KeyColors.PURPLE),
ORANGE_JUICE("Orange Juice", new Color(252, 74, 26), new Color(247, 183, 51), GOLD, false, KeyColors.ORANGE, KeyColors.YELLOW),
PASTEL("Pastel", new Color(243, 155, 178), new Color(207, 196, 243), LIGHT_PURPLE, false, KeyColors.PINK),
PUMPKIN("Pumpkin", new Color(241, 166, 98), new Color(255, 216, 169), new Color(227, 139, 42), GOLD, true, KeyColors.ORANGE),
SATIN("Satin", new Color(215, 60, 67), new Color(140, 23, 39), RED, false, KeyColors.RED),
SNOWY_SKY("Snowy Sky", new Color(1, 171, 179), new Color(234, 234, 234), new Color(18, 232, 232), EnumChatFormatting.AQUA, true, KeyColors.AQUA, KeyColors.GRAY),
STEEL_FADE("Steel Fade", new Color(66, 134, 244), new Color(55, 59, 68), BLUE, false, KeyColors.DARK_BLUE, KeyColors.GRAY),
SUNDAE("Sundae", new Color(206, 74, 126), new Color(122, 44, 77), RED, false, KeyColors.PINK, KeyColors.PURPLE, KeyColors.RED),
SUNKIST("Sunkist", new Color(242, 201, 76), new Color(242, 153, 74), YELLOW,false, KeyColors.YELLOW, KeyColors.ORANGE),
WATER("Water", new Color(12, 232, 199), new Color(12, 163, 232), EnumChatFormatting.AQUA, false, KeyColors.AQUA, KeyColors.DARK_BLUE),
WINTER("Winter", Color.WHITE, Color.WHITE, GRAY, false, KeyColors.GRAY, KeyColors.GRAY),
WOOD("Wood", new Color(79, 109, 81), new Color(170, 139, 87), new Color(240, 235, 206), DARK_GREEN, true, KeyColors.DARK_GREEN);
private final String theme;
private final Color firstColor, secondColor, thirdColor;
private final EnumChatFormatting chatAccentColor;
private final ArrayList<KeyColors> keyColors;
private final boolean triColor;
Theme(String theme, Color firstColor, Color secondColor, EnumChatFormatting chatAccentColor, boolean triColor, KeyColors... keyColors) {
this.theme = theme;
this.firstColor = this.thirdColor = firstColor;
this.secondColor = secondColor;
this.chatAccentColor = chatAccentColor;
this.keyColors = new ArrayList<>(Arrays.asList(keyColors));
this.triColor = triColor;
}
Theme(String theme, Color firstColor, Color secondColor, Color thirdColor, EnumChatFormatting chatAccentColor, boolean triColor, KeyColors... keyColors) {
this.theme = theme;
this.firstColor = firstColor;
this.secondColor = secondColor;
this.thirdColor = thirdColor;
this.chatAccentColor = chatAccentColor;
this.keyColors = new ArrayList<>(Arrays.asList(keyColors));
this.triColor = triColor;
}
public Color getFirstColor() {
return firstColor;
}
public Color getSecondColor() {
return secondColor;
}
public Color getThirdColor() {
return thirdColor;
}
/**
* Calculates the accent color at a specific screen point. Depending on the position on the screen, the
* accent has a slightly different color (blending between the two or three accent colors) to create an
* interesting gradient effect.
*
* @param screenCoordinates The screen coordinates to calculate the accent color for
* @return The determined target color for the provided coordinates, between the two or three accent colors of the theme
* @author Hazsi
* @since 10/11/2022
*/
public Color getAccentColor(Vector2d screenCoordinates) {
// Three color blending
if (this.triColor) {
double blendFactor = this.getBlendFactor(screenCoordinates);
// Blend between first and second color
if (blendFactor <= 0.5) return ColorUtil.mixColors(getSecondColor(), getFirstColor(), blendFactor * 2D);
// Blend between second and third color
else return ColorUtil.mixColors(getThirdColor(), getSecondColor(), (blendFactor - 0.5) * 2D);
}
// Two color blending
return ColorUtil.mixColors(getFirstColor(), getSecondColor(), getBlendFactor(screenCoordinates));
}
public double getWaveFactor(Vector2d screenCoordinates) {
double waveLength = 200.0; // Adjust this value to control the wavelength of the wave
double waveSpeed = 0.01; // Adjust this value to control the speed of the wave
double offsetX = (screenCoordinates.getX() / waveLength) - (System.currentTimeMillis() * waveSpeed);
double waveOffset = Math.sin(offsetX);
return (waveOffset + 1.0) / 2.0; // Normalize the wave offset to the range [0, 1]
}
private Color getColorFromWave(double waveFactor) {
// Interpolate between the first and second color using the wave factor
int red = (int) (getFirstColor().getRed() + waveFactor * (getSecondColor().getRed() - getFirstColor().getRed()));
int green = (int) (getFirstColor().getGreen() + waveFactor * (getSecondColor().getGreen() - getFirstColor().getGreen()));
int blue = (int) (getFirstColor().getBlue() + waveFactor * (getSecondColor().getBlue() - getFirstColor().getBlue()));
return new Color(red, green, blue);
}
public Color getAccentColorWave(Vector2d screenCoordinates) {
double waveIntensity = 0.5; // Adjust this value to control the intensity of the wave
double blendFactor = getBlendFactor(screenCoordinates) * waveIntensity;
// Three color blending
if (this.triColor) {
// Calculate the interpolated color between the first and second colors
Color color1 = ColorUtil.mixColors(getSecondColor(), getFirstColor(), blendFactor);
// Calculate the interpolated color between the second and third colors
Color color2 = ColorUtil.mixColors(getThirdColor(), getSecondColor(), blendFactor);
// Blend between the two interpolated colors based on the blend factor
if (blendFactor <= 0.5) return ColorUtil.mixColors(color2, color1, blendFactor * 2.0);
else return ColorUtil.mixColors(color1, color2, (blendFactor - 0.5) * 2.0);
}
// Two color blending
return ColorUtil.mixColors(getFirstColor(), getSecondColor(), blendFactor);
}
public Color getAccentColorWave() {
return getAccentColorWave(new Vector2d(0.0, 0.0));
}
public Color getAccentColor() {
return getAccentColor(new Vector2d(0.0, 0.0));
}
@Deprecated
public int getRound() {
return 4;
}
public Color getDropShadow() {
return new Color(0, 0, 0, 160);
}
/**
* Determines the blending factor between the themes two accent colors at a specific screen coordinate
*
* @param screenCoordinates The screen coordinate to calculate the blend factor for
* @return The blending factor, in a range of [0, 1] (inclusive) between the two accent colors of the theme
* @author Hazsi
* @since 10/11/2022
*/
public double getBlendFactor(Vector2d screenCoordinates) {
return Math.sin(System.currentTimeMillis() / 600.0D
+ screenCoordinates.getX() * 0.005D
+ screenCoordinates.getY() * 0.06D
) * 0.5D + 0.5D;
}
@Deprecated
public Color getBackgroundShade() {
return new Color(0, 0, 0, 100);
}
@Getter
@AllArgsConstructor
public enum KeyColors {
RED(new Color(255, 50, 50)),
ORANGE(new Color(255, 128, 50)),
YELLOW(new Color(255, 255, 50)),
LIME(new Color(128, 255, 50)),
DARK_GREEN(new Color(50, 128, 50)),
AQUA(new Color(50, 200, 255)),
DARK_BLUE(new Color(50, 100, 200)),
PURPLE(new Color(128, 50, 255)),
PINK(new Color(255, 128, 255)),
GRAY(new Color(100, 100, 110));
private final Color color;
}
}

View File

@ -0,0 +1,18 @@
package rip.athena.client.theme;
import lombok.Getter;
import lombok.Setter;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/8/2023
*/
@Getter
@Setter
public class ThemeManager {
private Theme theme = Theme.ATHENA;
}

View File

@ -0,0 +1,92 @@
package rip.athena.client.utils;
import lombok.experimental.UtilityClass;
import net.minecraft.util.MathHelper;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.concurrent.ThreadLocalRandom;
/**
* @author Patrick, Hazsi
* @since 11/17/2021
*/
@UtilityClass
public class MathUtil {
/**
* Method which returns a double between two input numbers
*
* @param min minimal number
* @param max maximal number
* @return random between both numbers
*/
public double getRandom(double min, double max) {
if (min == max) {
return min;
} else if (min > max) {
final double d = min;
min = max;
max = d;
}
return ThreadLocalRandom.current().nextDouble(min, max);
}
public double round(final double value, final int places) {
final BigDecimal bigDecimal = BigDecimal.valueOf(value);
return bigDecimal.setScale(places, RoundingMode.HALF_UP).doubleValue();
}
public double round(final double value, final int scale, final double inc) {
final double halfOfInc = inc / 2.0;
final double floored = Math.floor(value / inc) * inc;
if (value >= floored + halfOfInc) {
return new BigDecimal(Math.ceil(value / inc) * inc)
.setScale(scale, RoundingMode.HALF_UP)
.doubleValue();
} else {
return new BigDecimal(floored)
.setScale(scale, RoundingMode.HALF_UP)
.doubleValue();
}
}
public double roundWithSteps(final double value, final double steps) {
double a = ((Math.round(value / steps)) * steps);
a *= 1000;
a = (int) a;
a /= 1000;
return a;
}
public double lerp(final double a, final double b, final double c) {
return a + c * (b - a);
}
public float lerp(final float a, final float b, final float c) {
return a + c * (b - a);
}
/**
* Gets the distance to the position. Args: x, y, z
*/
public double getDistance(final double x1, final double y1, final double z1, final double x2, final double y2, final double z2) {
final double d0 = x2 - x1;
final double d1 = y2 - y1;
final double d2 = z2 - z1;
return MathHelper.sqrt_double(d0 * d0 + d1 * d1 + d2 * d2);
}
/**
* Clamps a number, n, to be within a specified range
* @param min The minimum permitted value of the input
* @param max The maximum permitted value of the input
* @param n The input number to clamp
* @return The input, bounded by the specified minimum and maximum values
*/
public double clamp(double min, double max, double n) {
return Math.max(min, Math.min(max, n));
}
}

View File

@ -58,7 +58,22 @@ public class FileHandler {
return bytes;
}
public static String readInputStream(InputStream inputStream) {
StringBuilder stringBuilder = new StringBuilder();
try {
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
String line;
while ((line = bufferedReader.readLine()) != null)
stringBuilder.append(line).append('\n');
} catch (Exception e) {
e.printStackTrace();
}
return stringBuilder.toString();
}
public String getContent(boolean ignoreComments) throws IOException {
StringBuilder builder = new StringBuilder();

View File

@ -0,0 +1,83 @@
package rip.athena.client.utils.render;
import org.lwjgl.opengl.GL11;
import rip.athena.client.utils.MathUtil;
import java.awt.*;
public interface ColorUtil {
/**
* Method which colors using a hex code
*
* @param hex used hex code
*/
static void glColor(final int hex) {
final float a = (hex >> 24 & 0xFF) / 255.0F;
final float r = (hex >> 16 & 0xFF) / 255.0F;
final float g = (hex >> 8 & 0xFF) / 255.0F;
final float b = (hex & 0xFF) / 255.0F;
GL11.glColor4f(r, g, b, a);
}
/**
* Method which colors using a color
*
* @param color used color
*/
static void glColor(final Color color) {
GL11.glColor4f(color.getRed() / 255.0F, color.getGreen() / 255.0F, color.getBlue() / 255.0F, color.getAlpha() / 255.0F);
}
static Color darker(final Color color, final float factor) {
return new Color(Math.max((int) (color.getRed() * factor), 0),
Math.max((int) (color.getGreen() * factor), 0),
Math.max((int) (color.getBlue() * factor), 0),
color.getAlpha());
}
static Color brighter(final Color color, final float factor) {
int red = color.getRed();
int green = color.getGreen();
int blue = color.getBlue();
final int alpha = color.getAlpha();
final int i = (int) (1 / (1 - factor));
if (red == 0 && green == 0 && blue == 0) {
return new Color(i, i, i, alpha);
}
if (red > 0 && red < i) red = i;
if (green > 0 && green < i) green = i;
if (blue > 0 && blue < i) blue = i;
return new Color(Math.min((int) (red / factor), 255),
Math.min((int) (green / factor), 255),
Math.min((int) (blue / factor), 255),
alpha);
}
static Color withRed(final Color color, final int red) {
return new Color(red, color.getGreen(), color.getBlue());
}
static Color withGreen(final Color color, final int green) {
return new Color(color.getRed(), green, color.getBlue());
}
static Color withBlue(final Color color, final int blue) {
return new Color(color.getRed(), color.getGreen(), blue);
}
static Color withAlpha(final Color color, final int alpha) {
return new Color(color.getRed(), color.getGreen(), color.getBlue(), (int) MathUtil.clamp(0, 255, alpha));
}
static Color mixColors(final Color color1, final Color color2, final double percent) {
final double inverse_percent = 1.0 - percent;
final int redPart = (int) (color1.getRed() * percent + color2.getRed() * inverse_percent);
final int greenPart = (int) (color1.getGreen() * percent + color2.getGreen() * inverse_percent);
final int bluePart = (int) (color1.getBlue() * percent + color2.getBlue() * inverse_percent);
return new Color(redPart, greenPart, bluePart);
}
}

View File

@ -12,9 +12,15 @@ import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL13;
import rip.athena.client.font.FontUtils;
import rip.athena.client.utils.font.Font;
import rip.athena.client.utils.font.FontManager;
import rip.athena.client.utils.shader.ShaderUtil;
import java.awt.*;
import static org.lwjgl.opengl.GL11.GL_ONE_MINUS_SRC_ALPHA;
import static org.lwjgl.opengl.GL11.GL_SRC_ALPHA;
/**
* @author Athena Development
* @project Athena-Client
@ -22,6 +28,8 @@ import java.awt.*;
*/
public enum DrawUtils {
BLACK(-16711423),
BLUE(-12028161),
DARKBLUE(-12621684),
@ -47,6 +55,41 @@ public enum DrawUtils {
this.c = co;
}
private static final ShaderUtil gradientMaskShader = new ShaderUtil("gradientMask");
public static void applyGradientHorizontal(float x, float y, float width, float height, float alpha, Color left, Color right, Runnable content) {
applyGradient(x, y, width, height, alpha, left, left, right, right, content);
}
public static void applyGradient(float x, float y, float width, float height, float alpha, Color bottomLeft, Color topLeft, Color bottomRight, Color topRight, Runnable content) {
GlStateManager.color(1, 1, 1, 1);
GlStateManager.enableBlend();
GlStateManager.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
gradientMaskShader.init();
ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft());
gradientMaskShader.setUniformf("location", x * sr.getScaleFactor(), (Minecraft.getMinecraft().displayHeight - (height * sr.getScaleFactor())) - (y * sr.getScaleFactor()));
gradientMaskShader.setUniformf("rectSize", width * sr.getScaleFactor(), height * sr.getScaleFactor());
gradientMaskShader.setUniformf("alpha", alpha);
gradientMaskShader.setUniformi("tex", 0);
// Bottom Left
gradientMaskShader.setUniformf("color1", bottomLeft.getRed() / 255f, bottomLeft.getGreen() / 255f, bottomLeft.getBlue() / 255f);
//Top left
gradientMaskShader.setUniformf("color2", topLeft.getRed() / 255f, topLeft.getGreen() / 255f, topLeft.getBlue() / 255f);
//Bottom Right
gradientMaskShader.setUniformf("color3", bottomRight.getRed() / 255f, bottomRight.getGreen() / 255f, bottomRight.getBlue() / 255f);
//Top Right
gradientMaskShader.setUniformf("color4", topRight.getRed() / 255f, topRight.getGreen() / 255f, topRight.getBlue() / 255f);
//Apply the gradient to whatever is put here
content.run();
gradientMaskShader.unload();
GlStateManager.disableBlend();
}
public static void displayFilledRectangle(int x1, int y1, int x2, int y2, Color color) {
GL11.glPushMatrix();
@ -243,7 +286,7 @@ public enum DrawUtils {
GL11.glPopMatrix();
}
public static void drawCustomFontChromaString(FontUtils font, String string, int x, int y, boolean static_chroma, boolean shadow) {
public static void drawCustomFontChromaString(Font font, String string, int x, int y, boolean static_chroma, boolean shadow) {
Minecraft mc = Minecraft.getMinecraft();
if (static_chroma) {
@ -256,7 +299,7 @@ public enum DrawUtils {
int i = Color.HSBtoRGB(l % (int) 2000.0F / 2000.0F, 0.8F, 0.8F);
String tmp = String.valueOf(textChar);
font.drawString(tmp, xTmp, y, i);
xTmp += font.getStringWidth(tmp);
xTmp += font.width(tmp);
}
}
}

View File

@ -9,6 +9,7 @@ import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.BlockPos;
import org.lwjgl.opengl.GL11;
import rip.athena.client.Athena;
import rip.athena.client.font.FontManager;
import rip.athena.client.modules.impl.render.TPS;
@ -25,9 +26,9 @@ public class HUDUtil {
if(bG) {
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());
RoundedUtils.drawGradientRound(x, y, width, height, 6, Athena.INSTANCE.getThemeManager().getTheme().getFirstColor(), Athena.INSTANCE.getThemeManager().getTheme().getFirstColor(), Athena.INSTANCE.getThemeManager().getTheme().getSecondColor(), Athena.INSTANCE.getThemeManager().getTheme().getSecondColor());
} else if (TPS.backgroundMode.equalsIgnoreCase("Fade")) {
RoundedUtils.drawRoundedRect(x, y, x + width, y + height, 8.0f, Athena.INSTANCE.getThemeManager().getTheme().getAccentColor().getRGB());
} else {
DrawUtils.displayFilledRectangle(x, y, x+width, y+height, bColor);
}

View File

@ -2,15 +2,52 @@ package rip.athena.client.utils.render;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.GlStateManager;
import org.lwjgl.opengl.GL11;
import rip.athena.client.utils.shader.ShaderUtil;
import java.awt.*;
import static org.lwjgl.opengl.GL11.*;
public class RoundedUtils {
final static Minecraft mc = Minecraft.getMinecraft();
final static FontRenderer fr = mc.fontRendererObj;
private static final ShaderUtil roundedGradientShader = new ShaderUtil("roundedRectGradient");
public static void drawGradientRound(float x, float y, float width, float height, float radius, Color bottomLeft, Color topLeft, Color bottomRight, Color topRight) {
GlStateManager.enableAlpha();
GlStateManager.alphaFunc(GL_GREATER, (float) (0 * .01));
GlStateManager.color(1, 1, 1, 1);
GlStateManager.enableBlend();
GlStateManager.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
roundedGradientShader.init();
setupRoundedRectUniforms(x, y, width, height, radius, roundedGradientShader);
//Top left
roundedGradientShader.setUniformf("color1", topLeft.getRed() / 255f, topLeft.getGreen() / 255f, topLeft.getBlue() / 255f, topLeft.getAlpha() / 255f);
// Bottom Left
roundedGradientShader.setUniformf("color2", bottomLeft.getRed() / 255f, bottomLeft.getGreen() / 255f, bottomLeft.getBlue() / 255f, bottomLeft.getAlpha() / 255f);
//Top Right
roundedGradientShader.setUniformf("color3", topRight.getRed() / 255f, topRight.getGreen() / 255f, topRight.getBlue() / 255f, topRight.getAlpha() / 255f);
//Bottom Right
roundedGradientShader.setUniformf("color4", bottomRight.getRed() / 255f, bottomRight.getGreen() / 255f, bottomRight.getBlue() / 255f, bottomRight.getAlpha() / 255f);
ShaderUtil.drawQuads(x - 1, y - 1, width + 2, height + 2);
roundedGradientShader.unload();
GlStateManager.disableBlend();
}
private static void setupRoundedRectUniforms(float x, float y, float width, float height, float radius, ShaderUtil roundedTexturedShader) {
ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft());
roundedTexturedShader.setUniformf("location", x * sr.getScaleFactor(),
(Minecraft.getMinecraft().displayHeight - (height * sr.getScaleFactor())) - (y * sr.getScaleFactor()));
roundedTexturedShader.setUniformf("rectSize", width * sr.getScaleFactor(), height * sr.getScaleFactor());
roundedTexturedShader.setUniformf("radius", radius * sr.getScaleFactor());
}
public static void enableGL2D() {
glDisable(GL_DEPTH_TEST);
glEnable(GL_BLEND);
@ -112,12 +149,12 @@ public class RoundedUtils {
glVertex2d(x1 - radius + Math.sin(i * Math.PI / 180.0D) * radius, y + radius + Math.cos(i * Math.PI / 180.0D) * radius);
glEnd();
glEnable(GL_TEXTURE_2D);
glDisable(GL_BLEND);
//glDisable(GL_BLEND);
glDisable(GL_LINE_SMOOTH);
glDisable(GL_BLEND);
glDisable(GL_LINE_SMOOTH);
glScaled(2.0D, 2.0D, 2.0D);
glEnable(GL_BLEND);
//glEnable(GL_BLEND);
glPopAttrib();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
}

View File

@ -0,0 +1,539 @@
package rip.athena.client.utils.shader;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.util.ResourceLocation;
import rip.athena.client.utils.file.FileHandler;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import static net.minecraft.client.renderer.OpenGlHelper.glGetProgrami;
import static net.minecraft.client.renderer.OpenGlHelper.glGetShaderi;
import static org.lwjgl.opengl.GL11.*;
import static org.lwjgl.opengl.GL20.*;
import static org.lwjgl.opengl.GL20.GL_LINK_STATUS;
/**
* @author Athena Development
* @project Athena-Client
* @date 6/8/2023
*/
public class ShaderUtil {
private final int programID;
public ShaderUtil(String fragmentShaderLoc, String vertexShaderLoc) {
int program = glCreateProgram();
try {
int fragmentShaderID;
switch (fragmentShaderLoc) {
case "kawaseUpGlow":
fragmentShaderID = createShader(new ByteArrayInputStream(kawaseUpGlow.getBytes()), GL_FRAGMENT_SHADER);
break;
case "glow":
fragmentShaderID = createShader(new ByteArrayInputStream(glowShader.getBytes()), GL_FRAGMENT_SHADER);
break;
case "chams":
fragmentShaderID = createShader(new ByteArrayInputStream(chams.getBytes()), GL_FRAGMENT_SHADER);
break;
case "roundRectTexture":
fragmentShaderID = createShader(new ByteArrayInputStream(roundRectTexture.getBytes()), GL_FRAGMENT_SHADER);
break;
case "roundRectOutline":
fragmentShaderID = createShader(new ByteArrayInputStream(roundRectOutline.getBytes()), GL_FRAGMENT_SHADER);
break;
case "kawaseUpBloom":
fragmentShaderID = createShader(new ByteArrayInputStream(kawaseUpBloom.getBytes()), GL_FRAGMENT_SHADER);
break;
case "kawaseDownBloom":
fragmentShaderID = createShader(new ByteArrayInputStream(kawaseDownBloom.getBytes()), GL_FRAGMENT_SHADER);
break;
case "kawaseUp":
fragmentShaderID = createShader(new ByteArrayInputStream(kawaseUp.getBytes()), GL_FRAGMENT_SHADER);
break;
case "kawaseDown":
fragmentShaderID = createShader(new ByteArrayInputStream(kawaseDown.getBytes()), GL_FRAGMENT_SHADER);
break;
case "gradientMask":
fragmentShaderID = createShader(new ByteArrayInputStream(gradientMask.getBytes()), GL_FRAGMENT_SHADER);
break;
case "mask":
fragmentShaderID = createShader(new ByteArrayInputStream(mask.getBytes()), GL_FRAGMENT_SHADER);
break;
case "gradient":
fragmentShaderID = createShader(new ByteArrayInputStream(gradient.getBytes()), GL_FRAGMENT_SHADER);
break;
case "roundedRect":
fragmentShaderID = createShader(new ByteArrayInputStream(roundedRect.getBytes()), GL_FRAGMENT_SHADER);
break;
case "roundedRectGradient":
fragmentShaderID = createShader(new ByteArrayInputStream(roundedRectGradient.getBytes()), GL_FRAGMENT_SHADER);
break;
default:
fragmentShaderID = createShader(Minecraft.getMinecraft().getResourceManager().getResource(new ResourceLocation(fragmentShaderLoc)).getInputStream(), GL_FRAGMENT_SHADER);
break;
}
glAttachShader(program, fragmentShaderID);
int vertexShaderID = createShader(Minecraft.getMinecraft().getResourceManager().getResource(new ResourceLocation(vertexShaderLoc)).getInputStream(), GL_VERTEX_SHADER);
glAttachShader(program, vertexShaderID);
} catch (IOException e) {
e.printStackTrace();
}
glLinkProgram(program);
int status = glGetProgrami(program, GL_LINK_STATUS);
if (status == 0) {
throw new IllegalStateException("Shader failed to link!");
}
this.programID = program;
}
public ShaderUtil(String fragmentShadersrc, boolean notUsed) {
int program = glCreateProgram();
int fragmentShaderID = createShader(new ByteArrayInputStream(fragmentShadersrc.getBytes()), GL_FRAGMENT_SHADER);
int vertexShaderID = 0;
try {
vertexShaderID = createShader(Minecraft.getMinecraft().getResourceManager().getResource(new ResourceLocation("Athena/shaders/vertex.vsh")).getInputStream(), GL_VERTEX_SHADER);
} catch (IOException e) {
throw new RuntimeException(e);
}
glAttachShader(program, fragmentShaderID);
glAttachShader(program, vertexShaderID);
glLinkProgram(program);
int status = glGetProgrami(program, GL_LINK_STATUS);
if (status == 0) {
throw new IllegalStateException("Shader failed to link!");
}
this.programID = program;
}
public ShaderUtil(String fragmentShaderLoc) {
this(fragmentShaderLoc, "Athena/shaders/vertex.vsh");
}
public void init() {
glUseProgram(programID);
}
public void unload() {
glUseProgram(0);
}
public int getUniform(String name) {
return glGetUniformLocation(programID, name);
}
public void setUniformf(String name, float... args) {
int loc = glGetUniformLocation(programID, name);
switch (args.length) {
case 1:
glUniform1f(loc, args[0]);
break;
case 2:
glUniform2f(loc, args[0], args[1]);
break;
case 3:
glUniform3f(loc, args[0], args[1], args[2]);
break;
case 4:
glUniform4f(loc, args[0], args[1], args[2], args[3]);
break;
}
}
public void setUniformi(String name, int... args) {
int loc = glGetUniformLocation(programID, name);
if (args.length > 1) glUniform2i(loc, args[0], args[1]);
else glUniform1i(loc, args[0]);
}
public static void drawQuads(float x, float y, float width, float height) {
glBegin(GL_QUADS);
glTexCoord2f(0, 0);
glVertex2f(x, y);
glTexCoord2f(0, 1);
glVertex2f(x, y + height);
glTexCoord2f(1, 1);
glVertex2f(x + width, y + height);
glTexCoord2f(1, 0);
glVertex2f(x + width, y);
glEnd();
}
public static void drawQuads() {
ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft());
float width = (float) sr.getScaledWidth_double();
float height = (float) sr.getScaledHeight_double();
glBegin(GL_QUADS);
glTexCoord2f(0, 1);
glVertex2f(0, 0);
glTexCoord2f(0, 0);
glVertex2f(0, height);
glTexCoord2f(1, 0);
glVertex2f(width, height);
glTexCoord2f(1, 1);
glVertex2f(width, 0);
glEnd();
}
public static void drawQuads(float width, float height) {
glBegin(GL_QUADS);
glTexCoord2f(0, 1);
glVertex2f(0, 0);
glTexCoord2f(0, 0);
glVertex2f(0, height);
glTexCoord2f(1, 0);
glVertex2f(width, height);
glTexCoord2f(1, 1);
glVertex2f(width, 0);
glEnd();
}
private int createShader(InputStream inputStream, int shaderType) {
int shader = glCreateShader(shaderType);
glShaderSource(shader, FileHandler.readInputStream(inputStream));
glCompileShader(shader);
if (glGetShaderi(shader, GL_COMPILE_STATUS) == 0) {
System.out.println(glGetShaderInfoLog(shader, 4096));
throw new IllegalStateException(String.format("Shader (%s) failed to compile!", shaderType));
}
return shader;
}
private String kawaseUpGlow = "#version 120\n" +
"\n" +
"uniform sampler2D inTexture, textureToCheck;\n" +
"uniform vec2 halfpixel, offset, iResolution;\n" +
"uniform bool check;\n" +
"uniform float lastPass;\n" +
"uniform float exposure;\n" +
"\n" +
"void main() {\n" +
" if(check && texture2D(textureToCheck, gl_TexCoord[0].st).a != 0.0) discard;\n" +
" vec2 uv = vec2(gl_FragCoord.xy / iResolution);\n" +
"\n" +
" vec4 sum = texture2D(inTexture, uv + vec2(-halfpixel.x * 2.0, 0.0) * offset);\n" +
" sum.rgb *= sum.a;\n" +
" vec4 smpl1 = texture2D(inTexture, uv + vec2(-halfpixel.x, halfpixel.y) * offset);\n" +
" smpl1.rgb *= smpl1.a;\n" +
" sum += smpl1 * 2.0;\n" +
" vec4 smp2 = texture2D(inTexture, uv + vec2(0.0, halfpixel.y * 2.0) * offset);\n" +
" smp2.rgb *= smp2.a;\n" +
" sum += smp2;\n" +
" vec4 smp3 = texture2D(inTexture, uv + vec2(halfpixel.x, halfpixel.y) * offset);\n" +
" smp3.rgb *= smp3.a;\n" +
" sum += smp3 * 2.0;\n" +
" vec4 smp4 = texture2D(inTexture, uv + vec2(halfpixel.x * 2.0, 0.0) * offset);\n" +
" smp4.rgb *= smp4.a;\n" +
" sum += smp4;\n" +
" vec4 smp5 = texture2D(inTexture, uv + vec2(halfpixel.x, -halfpixel.y) * offset);\n" +
" smp5.rgb *= smp5.a;\n" +
" sum += smp5 * 2.0;\n" +
" vec4 smp6 = texture2D(inTexture, uv + vec2(0.0, -halfpixel.y * 2.0) * offset);\n" +
" smp6.rgb *= smp6.a;\n" +
" sum += smp6;\n" +
" vec4 smp7 = texture2D(inTexture, uv + vec2(-halfpixel.x, -halfpixel.y) * offset);\n" +
" smp7.rgb *= smp7.a;\n" +
" sum += smp7 * 2.0;\n" +
" vec4 result = sum / 12.0;\n" +
" gl_FragColor = vec4(result.rgb / result.a, mix(result.a, 1.0 - exp(-result.a * exposure), step(0.0, lastPass)));\n" +
"}";
private String glowShader = "#version 120\n" +
"\n" +
"uniform sampler2D textureIn, textureToCheck;\n" +
"uniform vec2 texelSize, direction;\n" +
"uniform vec3 color;\n" +
"uniform bool avoidTexture;\n" +
"uniform float exposure, radius;\n" +
"uniform float weights[256];\n" +
"\n" +
"#define offset direction * texelSize\n" +
"\n" +
"void main() {\n" +
" if (direction.y == 1 && avoidTexture) {\n" +
" if (texture2D(textureToCheck, gl_TexCoord[0].st).a != 0.0) discard;\n" +
" }\n" +
" vec4 innerColor = texture2D(textureIn, gl_TexCoord[0].st);\n" +
" innerColor.rgb *= innerColor.a;\n" +
" innerColor *= weights[0];\n" +
" for (float r = 1.0; r <= radius; r++) {\n" +
" vec4 colorCurrent1 = texture2D(textureIn, gl_TexCoord[0].st + offset * r);\n" +
" vec4 colorCurrent2 = texture2D(textureIn, gl_TexCoord[0].st - offset * r);\n" +
"\n" +
" colorCurrent1.rgb *= colorCurrent1.a;\n" +
" colorCurrent2.rgb *= colorCurrent2.a;\n" +
"\n" +
" innerColor += (colorCurrent1 + colorCurrent2) * weights[int(r)];\n" +
" }\n" +
"\n" +
" gl_FragColor = vec4(innerColor.rgb / innerColor.a, mix(innerColor.a, 1.0 - exp(-innerColor.a * exposure), step(0.0, direction.y)));\n" +
"}\n";
private String chams =
"#version 120\n" +
"\n" +
"uniform sampler2D textureIn;\n" +
"uniform vec4 color;\n" +
"void main() {\n" +
" float alpha = texture2D(textureIn, gl_TexCoord[0].st).a;\n" +
" gl_FragColor = vec4(color.rgb, color.a * mix(0.0, alpha, step(0.0, alpha)));\n" +
"}\n";
private String roundRectTexture = "#version 120\n" +
"\n" +
"uniform vec2 location, rectSize;\n" +
"uniform sampler2D textureIn;\n" +
"uniform float radius, alpha;\n" +
"\n" +
"float roundedBoxSDF(vec2 centerPos, vec2 size, float radius) {\n" +
" return length(max(abs(centerPos) -size, 0.)) - radius;\n" +
"}\n" +
"\n" +
"\n" +
"void main() {\n" +
" float distance = roundedBoxSDF((rectSize * .5) - (gl_TexCoord[0].st * rectSize), (rectSize * .5) - radius - 1., radius);\n" +
" float smoothedAlpha = (1.0-smoothstep(0.0, 2.0, distance)) * alpha;\n" +
" gl_FragColor = vec4(texture2D(textureIn, gl_TexCoord[0].st).rgb, smoothedAlpha);\n" +
"}";
private String roundRectOutline = "#version 120\n" +
"\n" +
"uniform vec2 location, rectSize;\n" +
"uniform vec4 color, outlineColor;\n" +
"uniform float radius, outlineThickness;\n" +
"\n" +
"float roundedSDF(vec2 centerPos, vec2 size, float radius) {\n" +
" return length(max(abs(centerPos) - size + radius, 0.0)) - radius;\n" +
"}\n" +
"\n" +
"void main() {\n" +
" float distance = roundedSDF(gl_FragCoord.xy - location - (rectSize * .5), (rectSize * .5) + (outlineThickness *.5) - 1.0, radius);\n" +
"\n" +
" float blendAmount = smoothstep(0., 2., abs(distance) - (outlineThickness * .5));\n" +
"\n" +
" vec4 insideColor = (distance < 0.) ? color : vec4(outlineColor.rgb, 0.0);\n" +
" gl_FragColor = mix(outlineColor, insideColor, blendAmount);\n" +
"\n" +
"}";
private String kawaseUpBloom = "#version 120\n" +
"\n" +
"uniform sampler2D inTexture, textureToCheck;\n" +
"uniform vec2 halfpixel, offset, iResolution;\n" +
"uniform int check;\n" +
"\n" +
"void main() {\n" +
" // if(check && texture2D(textureToCheck, gl_TexCoord[0].st).a > 0.0) discard;\n" +
" vec2 uv = vec2(gl_FragCoord.xy / iResolution);\n" +
"\n" +
" vec4 sum = texture2D(inTexture, uv + vec2(-halfpixel.x * 2.0, 0.0) * offset);\n" +
" sum.rgb *= sum.a;\n" +
" vec4 smpl1 = texture2D(inTexture, uv + vec2(-halfpixel.x, halfpixel.y) * offset);\n" +
" smpl1.rgb *= smpl1.a;\n" +
" sum += smpl1 * 2.0;\n" +
" vec4 smp2 = texture2D(inTexture, uv + vec2(0.0, halfpixel.y * 2.0) * offset);\n" +
" smp2.rgb *= smp2.a;\n" +
" sum += smp2;\n" +
" vec4 smp3 = texture2D(inTexture, uv + vec2(halfpixel.x, halfpixel.y) * offset);\n" +
" smp3.rgb *= smp3.a;\n" +
" sum += smp3 * 2.0;\n" +
" vec4 smp4 = texture2D(inTexture, uv + vec2(halfpixel.x * 2.0, 0.0) * offset);\n" +
" smp4.rgb *= smp4.a;\n" +
" sum += smp4;\n" +
" vec4 smp5 = texture2D(inTexture, uv + vec2(halfpixel.x, -halfpixel.y) * offset);\n" +
" smp5.rgb *= smp5.a;\n" +
" sum += smp5 * 2.0;\n" +
" vec4 smp6 = texture2D(inTexture, uv + vec2(0.0, -halfpixel.y * 2.0) * offset);\n" +
" smp6.rgb *= smp6.a;\n" +
" sum += smp6;\n" +
" vec4 smp7 = texture2D(inTexture, uv + vec2(-halfpixel.x, -halfpixel.y) * offset);\n" +
" smp7.rgb *= smp7.a;\n" +
" sum += smp7 * 2.0;\n" +
" vec4 result = sum / 12.0;\n" +
" gl_FragColor = vec4(result.rgb / result.a, mix(result.a, result.a * (1.0 - texture2D(textureToCheck, gl_TexCoord[0].st).a),check));\n" +
"}";
private String kawaseDownBloom = "#version 120\n" +
"\n" +
"uniform sampler2D inTexture;\n" +
"uniform vec2 offset, halfpixel, iResolution;\n" +
"\n" +
"void main() {\n" +
" vec2 uv = vec2(gl_FragCoord.xy / iResolution);\n" +
" vec4 sum = texture2D(inTexture, gl_TexCoord[0].st);\n" +
" sum.rgb *= sum.a;\n" +
" sum *= 4.0;\n" +
" vec4 smp1 = texture2D(inTexture, uv - halfpixel.xy * offset);\n" +
" smp1.rgb *= smp1.a;\n" +
" sum += smp1;\n" +
" vec4 smp2 = texture2D(inTexture, uv + halfpixel.xy * offset);\n" +
" smp2.rgb *= smp2.a;\n" +
" sum += smp2;\n" +
" vec4 smp3 = texture2D(inTexture, uv + vec2(halfpixel.x, -halfpixel.y) * offset);\n" +
" smp3.rgb *= smp3.a;\n" +
" sum += smp3;\n" +
" vec4 smp4 = texture2D(inTexture, uv - vec2(halfpixel.x, -halfpixel.y) * offset);\n" +
" smp4.rgb *= smp4.a;\n" +
" sum += smp4;\n" +
" vec4 result = sum / 8.0;\n" +
" gl_FragColor = vec4(result.rgb / result.a, result.a);\n" +
"}";
private String kawaseUp = "#version 120\n" +
"\n" +
"uniform sampler2D inTexture, textureToCheck;\n" +
"uniform vec2 halfpixel, offset, iResolution;\n" +
"uniform int check;\n" +
"\n" +
"void main() {\n" +
" vec2 uv = vec2(gl_FragCoord.xy / iResolution);\n" +
" vec4 sum = texture2D(inTexture, uv + vec2(-halfpixel.x * 2.0, 0.0) * offset);\n" +
" sum += texture2D(inTexture, uv + vec2(-halfpixel.x, halfpixel.y) * offset) * 2.0;\n" +
" sum += texture2D(inTexture, uv + vec2(0.0, halfpixel.y * 2.0) * offset);\n" +
" sum += texture2D(inTexture, uv + vec2(halfpixel.x, halfpixel.y) * offset) * 2.0;\n" +
" sum += texture2D(inTexture, uv + vec2(halfpixel.x * 2.0, 0.0) * offset);\n" +
" sum += texture2D(inTexture, uv + vec2(halfpixel.x, -halfpixel.y) * offset) * 2.0;\n" +
" sum += texture2D(inTexture, uv + vec2(0.0, -halfpixel.y * 2.0) * offset);\n" +
" sum += texture2D(inTexture, uv + vec2(-halfpixel.x, -halfpixel.y) * offset) * 2.0;\n" +
"\n" +
" gl_FragColor = vec4(sum.rgb /12.0, mix(1.0, texture2D(textureToCheck, gl_TexCoord[0].st).a, check));\n" +
"}\n";
private String kawaseDown = "#version 120\n" +
"\n" +
"uniform sampler2D inTexture;\n" +
"uniform vec2 offset, halfpixel, iResolution;\n" +
"\n" +
"void main() {\n" +
" vec2 uv = vec2(gl_FragCoord.xy / iResolution);\n" +
" vec4 sum = texture2D(inTexture, gl_TexCoord[0].st) * 4.0;\n" +
" sum += texture2D(inTexture, uv - halfpixel.xy * offset);\n" +
" sum += texture2D(inTexture, uv + halfpixel.xy * offset);\n" +
" sum += texture2D(inTexture, uv + vec2(halfpixel.x, -halfpixel.y) * offset);\n" +
" sum += texture2D(inTexture, uv - vec2(halfpixel.x, -halfpixel.y) * offset);\n" +
" gl_FragColor = vec4(sum.rgb * .125, 1.0);\n" +
"}\n";
private String gradientMask = "#version 120\n" +
"\n" +
"uniform vec2 location, rectSize;\n" +
"uniform sampler2D tex;\n" +
"uniform vec3 color1, color2, color3, color4;\n" +
"uniform float alpha;\n" +
"\n" +
"#define NOISE .5/255.0\n" +
"\n" +
"vec3 createGradient(vec2 coords, vec3 color1, vec3 color2, vec3 color3, vec3 color4){\n" +
" vec3 color = mix(mix(color1.rgb, color2.rgb, coords.y), mix(color3.rgb, color4.rgb, coords.y), coords.x);\n" +
" //Dithering the color from https://shader-tutorial.dev/advanced/color-banding-dithering/\n" +
" color += mix(NOISE, -NOISE, fract(sin(dot(coords.xy, vec2(12.9898,78.233))) * 43758.5453));\n" +
" return color;\n" +
"}\n" +
"\n" +
"void main() {\n" +
" vec2 coords = (gl_FragCoord.xy - location) / rectSize;\n" +
" float texColorAlpha = texture2D(tex, gl_TexCoord[0].st).a;\n" +
" gl_FragColor = vec4(createGradient(coords, color1, color2, color3, color4), texColorAlpha * alpha);\n" +
"}";
private String mask = "#version 120\n" +
"\n" +
"uniform vec2 location, rectSize;\n" +
"uniform sampler2D u_texture, u_texture2;\n" +
"void main() {\n" +
" vec2 coords = (gl_FragCoord.xy - location) / rectSize;\n" +
" float texColorAlpha = texture2D(u_texture, gl_TexCoord[0].st).a;\n" +
" vec3 tex2Color = texture2D(u_texture2, gl_TexCoord[0].st).rgb;\n" +
" gl_FragColor = vec4(tex2Color, texColorAlpha);\n" +
"}";
private String gradient = "#version 120\n" +
"\n" +
"uniform vec2 location, rectSize;\n" +
"uniform sampler2D tex;\n" +
"uniform vec4 color1, color2, color3, color4;\n" +
"#define NOISE .5/255.0\n" +
"\n" +
"vec4 createGradient(vec2 coords, vec4 color1, vec4 color2, vec4 color3, vec4 color4){\n" +
" vec4 color = mix(mix(color1, color2, coords.y), mix(color3, color4, coords.y), coords.x);\n" +
" //Dithering the color\n" +
" // from https://shader-tutorial.dev/advanced/color-banding-dithering/\n" +
" color += mix(NOISE, -NOISE, fract(sin(dot(coords.xy, vec2(12.9898, 78.233))) * 43758.5453));\n" +
" return color;\n" +
"}\n" +
"\n" +
"void main() {\n" +
" vec2 coords = (gl_FragCoord.xy - location) / rectSize;\n" +
" gl_FragColor = createGradient(coords, color1, color2, color3, color4);\n" +
"}";
private String roundedRectGradient = "#version 120\n" +
"\n" +
"uniform vec2 location, rectSize;\n" +
"uniform vec4 color1, color2, color3, color4;\n" +
"uniform float radius;\n" +
"\n" +
"#define NOISE .5/255.0\n" +
"\n" +
"float roundSDF(vec2 p, vec2 b, float r) {\n" +
" return length(max(abs(p) - b , 0.0)) - r;\n" +
"}\n" +
"\n" +
"vec4 createGradient(vec2 coords, vec4 color1, vec4 color2, vec4 color3, vec4 color4){\n" +
" vec4 color = mix(mix(color1, color2, coords.y), mix(color3, color4, coords.y), coords.x);\n" +
" //Dithering the color\n" +
" // from https://shader-tutorial.dev/advanced/color-banding-dithering/\n" +
" color += mix(NOISE, -NOISE, fract(sin(dot(coords.xy, vec2(12.9898, 78.233))) * 43758.5453));\n" +
" return color;\n" +
"}\n" +
"\n" +
"void main() {\n" +
" vec2 st = gl_TexCoord[0].st;\n" +
" vec2 halfSize = rectSize * .5;\n" +
" \n" +
" // use the bottom leftColor as the alpha\n"+
" float smoothedAlpha = (1.0-smoothstep(0.0, 2., roundSDF(halfSize - (gl_TexCoord[0].st * rectSize), halfSize - radius - 1., radius)));\n" +
" vec4 gradient = createGradient(st, color1, color2, color3, color4);" +
" gl_FragColor = vec4(gradient.rgb, gradient.a * smoothedAlpha);\n" +
"}";
private String roundedRect = "#version 120\n" +
"\n" +
"uniform vec2 location, rectSize;\n" +
"uniform vec4 color;\n" +
"uniform float radius;\n" +
"uniform bool blur;\n" +
"\n" +
"float roundSDF(vec2 p, vec2 b, float r) {\n" +
" return length(max(abs(p) - b, 0.0)) - r;\n" +
"}\n" +
"\n" +
"\n" +
"void main() {\n" +
" vec2 rectHalf = rectSize * .5;\n" +
" // Smooth the result (free antialiasing).\n" +
" float smoothedAlpha = (1.0-smoothstep(0.0, 1.0, roundSDF(rectHalf - (gl_TexCoord[0].st * rectSize), rectHalf - radius - 1., radius))) * color.a;\n" +
" gl_FragColor = vec4(color.rgb, smoothedAlpha);// mix(quadColor, shadowColor, 0.0);\n" +
"\n" +
"}";
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 800 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 594 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 963 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 MiB

View File

@ -0,0 +1,6 @@
#version 120
void main() {
gl_TexCoord[0] = gl_MultiTexCoord0;
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 938 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 831 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 825 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

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.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 811 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 997 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

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: 905 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 665 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 512 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 807 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 599 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

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