Skip to content
This repository has been archived by the owner on Jun 15, 2024. It is now read-only.

Commit

Permalink
patch v1 (full ab fixed)
Browse files Browse the repository at this point in the history
  • Loading branch information
spartanoah committed May 5, 2024
1 parent c72befa commit f325ebd
Show file tree
Hide file tree
Showing 3,600 changed files with 34,393 additions and 386 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
Binary file added Acrimony/.DS_Store
Binary file not shown.
7 changes: 7 additions & 0 deletions Acrimony/Acrimony.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import Acrimony.filesystem.FileSystem;
import Acrimony.font.FontManager;
import Acrimony.handler.client.BalanceHandler;
import Acrimony.handler.client.BlurHandler;
import Acrimony.handler.client.CameraHandler;
import Acrimony.handler.client.KeybindHandler;
import Acrimony.handler.client.SlotSpoofHandler;
Expand Down Expand Up @@ -44,6 +45,7 @@ public class Acrimony
private SlotSpoofHandler slotSpoofHandler;
private FileSystem fileSystem;
private FontManager fontManager;
public BlurHandler blurHandler;
private boolean destructed;

public void start() throws IOException {
Expand All @@ -60,6 +62,7 @@ public void start() throws IOException {
this.cameraHandler = new CameraHandler();
this.fileSystem = new FileSystem();
this.fontManager = new FontManager();
this.blurHandler = new BlurHandler(true);
this.fileSystem.loadDefaultConfig();
this.fileSystem.loadKeybinds();
this.moduleManager.modules.forEach(m -> m.onClientStarted());
Expand Down Expand Up @@ -144,6 +147,10 @@ public FontManager getFontManager() {
return this.fontManager;
}

public BlurHandler getBlurHandler() {
return this.blurHandler;
}

public boolean isDestructed() {
return this.destructed;
}
Expand Down
5 changes: 3 additions & 2 deletions Acrimony/command/CommandManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
import Acrimony.command.impl.Toggle;
import Acrimony.event.Listener;
import Acrimony.event.impl.ChatSendEvent;
import Acrimony.util.misc.LogUtil;
import Acrimony.ui.notification.Notification;
import Acrimony.ui.notification.NotificationType;
import java.util.ArrayList;

public class CommandManager {
Expand Down Expand Up @@ -41,7 +42,7 @@ public void onChatSend(ChatSendEvent event) {
String[] commandParts = commandWithoutDot.split(" ");
((Command)command).onCommand(commandParts);
} else {
LogUtil.addChatMessage("Command not found.");
Acrimony.instance.getNotificationHandler().postNotification(new Notification(NotificationType.ERROR, "Command", "Command not found.", 3000L));
}
}
}
Expand Down
7 changes: 4 additions & 3 deletions Acrimony/command/impl/Bind.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
import Acrimony.Acrimony;
import Acrimony.command.Command;
import Acrimony.module.Module;
import Acrimony.util.misc.LogUtil;
import Acrimony.ui.notification.Notification;
import Acrimony.ui.notification.NotificationType;
import org.lwjgl.input.Keyboard;

public class Bind
Expand All @@ -22,10 +23,10 @@ public void onCommand(String[] args) {
if (module != null) {
String keyName = args[2].toUpperCase();
((Module)module).setKey(Keyboard.getKeyIndex(keyName));
LogUtil.addChatMessage("Bound " + ((Module)module).getName() + " to " + keyName);
Acrimony.instance.getNotificationHandler().postNotification(new Notification(NotificationType.WARNING, "KeyBind Manager", "Bound module : " + ((Module)module).getName() + " to " + keyName, 3000L));
}
} else {
LogUtil.addChatMessage("Usage : .bind module keybind");
Acrimony.instance.getNotificationHandler().postNotification(new Notification(NotificationType.WARNING, "KeyBind Manager", "Usage : .bind module keybind", 3000L));
}
}
}
Expand Down
9 changes: 5 additions & 4 deletions Acrimony/command/impl/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

import Acrimony.Acrimony;
import Acrimony.command.Command;
import Acrimony.util.misc.LogUtil;
import Acrimony.ui.notification.Notification;
import Acrimony.ui.notification.NotificationType;

public class Config
extends Command {
Expand All @@ -22,15 +23,15 @@ public void onCommand(String[] args) {
case "load": {
boolean success = Acrimony.instance.getFileSystem().loadConfig(configName, false);
if (success) {
LogUtil.addChatMessage("Loaded config " + configName);
Acrimony.instance.getNotificationHandler().postNotification(new Notification(NotificationType.WARNING, "Config announcement", "Loaded config " + configName + " in game.", 3000L));
break;
}
LogUtil.addChatMessage("Config not found.");
Acrimony.instance.getNotificationHandler().postNotification(new Notification(NotificationType.WARNING, "Config announcement", "Config not found in FileSystem, Please make sure you type the correct config name in Chat.", 3000L));
break;
}
case "save": {
Acrimony.instance.getFileSystem().saveConfig(configName);
LogUtil.addChatMessage("Saved config " + configName);
Acrimony.instance.getNotificationHandler().postNotification(new Notification(NotificationType.WARNING, "Config announcement", "Saved config as " + configName + " in game.", 3000L));
}
}
}
Expand Down
7 changes: 4 additions & 3 deletions Acrimony/command/impl/Toggle.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
import Acrimony.Acrimony;
import Acrimony.command.Command;
import Acrimony.module.Module;
import Acrimony.util.misc.LogUtil;
import Acrimony.ui.notification.Notification;
import Acrimony.ui.notification.NotificationType;

public class Toggle
extends Command {
Expand All @@ -20,10 +21,10 @@ public void onCommand(String[] args) {
Object module = Acrimony.instance.getModuleManager().getModuleByNameNoSpace(args[1]);
if (module != null) {
((Module)module).toggle();
LogUtil.addChatMessage((((Module)module).isEnabled() ? "Enabled " : "Disabled ") + ((Module)module).getName());
Acrimony.instance.getNotificationHandler().postNotification(new Notification(NotificationType.WARNING, "Toggle Module", (((Module)module).isEnabled() ? "Enabled " : "Disabled ") + ((Module)module).getName(), 3000L));
}
} else {
LogUtil.addChatMessage("Usage : .t/toggle modulename");
Acrimony.instance.getNotificationHandler().postNotification(new Notification(NotificationType.WARNING, "Toggle Module", "Usage : .t/toggle modulename", 3000L));
}
}
}
Expand Down
11 changes: 11 additions & 0 deletions Acrimony/filesystem/FileSystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import Acrimony.module.Module;
import Acrimony.setting.AbstractSetting;
import Acrimony.setting.impl.BooleanSetting;
import Acrimony.setting.impl.ColorSetting;
import Acrimony.setting.impl.DoubleSetting;
import Acrimony.setting.impl.IntegerSetting;
import Acrimony.setting.impl.ModeSetting;
Expand Down Expand Up @@ -57,6 +58,11 @@ public void saveConfig(String configName) {
toWrite.add("Setting:" + m.getName() + ":" + modeSetting.getName() + ":" + modeSetting.getMode());
continue;
}
if (s instanceof ColorSetting) {
ColorSetting colorSetting = (ColorSetting)s;
toWrite.add("Setting:" + m.getName() + ":" + colorSetting.getName() + ":" + colorSetting.getMode());
continue;
}
if (s instanceof DoubleSetting) {
DoubleSetting doubleSetting = (DoubleSetting)s;
toWrite.add("Setting:" + m.getName() + ":" + doubleSetting.getName() + ":" + doubleSetting.getValue());
Expand Down Expand Up @@ -116,6 +122,11 @@ public boolean loadConfig(String configName, boolean defaultConfig) {
modeSetting.setMode(infos[3]);
break;
}
if (setting instanceof ColorSetting) {
ColorSetting colorSetting = (ColorSetting)setting;
colorSetting.setMode(infos[3]);
break;
}
if (setting instanceof DoubleSetting) {
DoubleSetting doubleSetting = (DoubleSetting)setting;
doubleSetting.setValue(Double.parseDouble(infos[3]));
Expand Down
42 changes: 42 additions & 0 deletions Acrimony/font/FontManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,27 @@ public class FontManager {
private AcrimonyFont sfprobold;
private AcrimonyFont sfprobold22;
private AcrimonyFont icon;
private AcrimonyFont jellolight;
private AcrimonyFont jellomedium;
private AcrimonyFont jellosemibold;
private AcrimonyFont jellosemiboldTitle;
private AcrimonyFont jelloregularTitle;
private AcrimonyFont jelloregularSubTitle;
private AcrimonyFont jelloregular;

public FontManager() {
this.sfpro23 = new AcrimonyFont(this.getFontFromTTF("sfpro", 23.0f, 0), true, true);
this.sfproTitle = new AcrimonyFont(this.getFontFromTTF("sfpro", 30.0f, 0), true, true);
this.sfprobold = new AcrimonyFont(this.getFontFromTTF("sfprobold", 20.0f, 0), true, true);
this.sfprobold22 = new AcrimonyFont(this.getFontFromTTF("sfprobold", 22.0f, 0), true, true);
this.icon = new AcrimonyFont(this.getFontFromTTF("icon", 36.0f, 0), true, true);
this.jellolight = new AcrimonyFont(this.getFontFromTTF("Urbanist-Light", 20.0f, 0), true, true);
this.jellomedium = new AcrimonyFont(this.getFontFromTTF("Urbanist-Medium", 20.0f, 0), true, true);
this.jelloregular = new AcrimonyFont(this.getFontFromTTF("Urbanist-Regular", 20.0f, 0), true, true);
this.jelloregularSubTitle = new AcrimonyFont(this.getFontFromTTF("Urbanist-Regular", 26.0f, 0), true, true);
this.jelloregularTitle = new AcrimonyFont(this.getFontFromTTF("Urbanist-Regular", 52.0f, 0), true, true);
this.jellosemibold = new AcrimonyFont(this.getFontFromTTF("Urbanist-SemiBold", 20.0f, 0), true, true);
this.jellosemiboldTitle = new AcrimonyFont(this.getFontFromTTF("Urbanist-SemiBold", 50.0f, 0), true, true);
}

public Font getFontFromTTF(String fontName, float fontSize, int fontType) {
Expand Down Expand Up @@ -69,5 +83,33 @@ public AcrimonyFont getSfprobold22() {
public AcrimonyFont getIcon() {
return this.icon;
}

public AcrimonyFont getJellolight() {
return this.jellolight;
}

public AcrimonyFont getJellomedium() {
return this.jellomedium;
}

public AcrimonyFont getJellosemibold() {
return this.jellosemibold;
}

public AcrimonyFont getJellosemiboldTitle() {
return this.jellosemiboldTitle;
}

public AcrimonyFont getJelloregularTitle() {
return this.jelloregularTitle;
}

public AcrimonyFont getJelloregularSubTitle() {
return this.jelloregularSubTitle;
}

public AcrimonyFont getJelloregular() {
return this.jelloregular;
}
}

151 changes: 151 additions & 0 deletions Acrimony/handler/client/BlurFilters/GaussianFilter.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
/*
* Decompiled with CFR 0.153-SNAPSHOT (d6f6758-dirty).
*/
package Acrimony.handler.client.BlurFilters;

import Acrimony.handler.client.BlurFilters.PixelUtils;
import java.awt.image.BufferedImage;
import java.awt.image.ColorModel;
import java.awt.image.Kernel;

public class GaussianFilter {
protected float radius;
protected Kernel kernel;
protected boolean alpha = true;
protected boolean premultiplyAlpha = true;
public static int CLAMP_EDGES = 1;
public static int WRAP_EDGES = 2;

public GaussianFilter() {
this(2.0f);
}

public GaussianFilter(float radius) {
this.setRadius(radius);
}

public void setRadius(float radius) {
this.radius = radius;
this.kernel = GaussianFilter.makeKernel(radius);
}

public float getRadius() {
return this.radius;
}

public BufferedImage filter(BufferedImage src, BufferedImage dst) {
int width = src.getWidth();
int height = src.getHeight();
if (dst == null) {
dst = this.createCompatibleDestImage(src, null);
}
int[] inPixels = new int[width * height];
int[] outPixels = new int[width * height];
src.getRGB(0, 0, width, height, inPixels, 0, width);
if (this.radius > 0.0f) {
GaussianFilter.convolveAndTranspose(this.kernel, inPixels, outPixels, width, height, this.alpha, this.alpha && this.premultiplyAlpha, false, CLAMP_EDGES);
GaussianFilter.convolveAndTranspose(this.kernel, outPixels, inPixels, height, width, this.alpha, false, this.alpha && this.premultiplyAlpha, CLAMP_EDGES);
}
dst.setRGB(0, 0, width, height, inPixels, 0, width);
return dst;
}

public static void convolveAndTranspose(Kernel kernel, int[] inPixels, int[] outPixels, int width, int height, boolean alpha, boolean premultiply, boolean unpremultiply, int edgeAction) {
float[] matrix = kernel.getKernelData(null);
int cols = kernel.getWidth();
int cols2 = cols / 2;
for (int y = 0; y < height; ++y) {
int index = y;
int ioffset = y * width;
for (int x = 0; x < width; ++x) {
float r = 0.0f;
float g = 0.0f;
float b = 0.0f;
float a = 0.0f;
int moffset = cols2;
for (int col = -cols2; col <= cols2; ++col) {
float f = matrix[moffset + col];
if (f == 0.0f) continue;
int ix = x + col;
if (ix < 0) {
if (edgeAction == CLAMP_EDGES) {
ix = 0;
} else if (edgeAction == WRAP_EDGES) {
ix = (x + width) % width;
}
} else if (ix >= width) {
if (edgeAction == CLAMP_EDGES) {
ix = width - 1;
} else if (edgeAction == WRAP_EDGES) {
ix = (x + width) % width;
}
}
int rgb = inPixels[ioffset + ix];
int pa = rgb >> 24 & 0xFF;
int pr = rgb >> 16 & 0xFF;
int pg = rgb >> 8 & 0xFF;
int pb = rgb & 0xFF;
if (premultiply) {
float a255 = (float)pa * 0.003921569f;
pr = (int)((float)pr * a255);
pg = (int)((float)pg * a255);
pb = (int)((float)pb * a255);
}
a += f * (float)pa;
r += f * (float)pr;
g += f * (float)pg;
b += f * (float)pb;
}
if (unpremultiply && a != 0.0f && a != 255.0f) {
float f = 255.0f / a;
r *= f;
g *= f;
b *= f;
}
int ia = alpha ? PixelUtils.clamp((int)((double)a + 0.5)) : 255;
int ir = PixelUtils.clamp((int)((double)r + 0.5));
int ig = PixelUtils.clamp((int)((double)g + 0.5));
int ib = PixelUtils.clamp((int)((double)b + 0.5));
outPixels[index] = ia << 24 | ir << 16 | ig << 8 | ib;
index += height;
}
}
}

public static Kernel makeKernel(float radius) {
int r = (int)Math.ceil(radius);
int rows = r * 2 + 1;
float[] matrix = new float[rows];
float sigma = radius / 3.0f;
float sigma22 = 2.0f * sigma * sigma;
float sigmaPi2 = (float)Math.PI * 2 * sigma;
float sqrtSigmaPi2 = (float)Math.sqrt(sigmaPi2);
float radius2 = radius * radius;
float total = 0.0f;
int index = 0;
for (int row = -r; row <= r; ++row) {
float distance = row * row;
matrix[index] = distance > radius2 ? 0.0f : (float)Math.exp(-distance / sigma22) / sqrtSigmaPi2;
total += matrix[index];
++index;
}
int i = 0;
while (i < rows) {
int n = i++;
matrix[n] = matrix[n] / total;
}
return new Kernel(rows, 1, matrix);
}

public BufferedImage createCompatibleDestImage(BufferedImage src, ColorModel dstCM) {
if (dstCM == null) {
dstCM = src.getColorModel();
}
return new BufferedImage(dstCM, dstCM.createCompatibleWritableRaster(src.getWidth(), src.getHeight()), dstCM.isAlphaPremultiplied(), null);
}

public String toString() {
return "Blur/Gaussian Blur...";
}
}

0 comments on commit f325ebd

Please sign in to comment.