Upload files to "src/openonyx/features/hud"
This commit is contained in:
1 parent
1fca6fb78b
commit
c00c1adefc
5 files changed
+816
No files matched your search
@@ -0,0 +1,662 @@
|
|||||||
|
package openonyx.features.hud;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Comparator;
|
||||||
|
import java.util.IdentityHashMap;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.gui.GuiChat;
|
||||||
|
import openonyx.core.OnyxClient;
|
||||||
|
import openonyx.features.Module;
|
||||||
|
import openonyx.features.ModuleCategory;
|
||||||
|
import openonyx.features.hud.group_m.ArrayListAnimation;
|
||||||
|
import openonyx.features.hud.group_m.ArrayListColorMode;
|
||||||
|
import openonyx.features.hud.group_m.ArrayListEntry;
|
||||||
|
import openonyx.features.hud.group_m.ArrayListSorting;
|
||||||
|
import openonyx.features.hud.group_m.ArrayListStyle;
|
||||||
|
import openonyx.history.Setting;
|
||||||
|
import openonyx.history.internal.BooleanSetting;
|
||||||
|
import openonyx.history.internal.ColorSetting;
|
||||||
|
import openonyx.history.internal.EnumSetting;
|
||||||
|
import openonyx.history.internal.MultiSelectSetting;
|
||||||
|
import openonyx.history.internal.NumberSetting;
|
||||||
|
import openonyx.render.Render2D;
|
||||||
|
import openonyx.render.RenderSupport_120;
|
||||||
|
import openonyx.render.group_d.Animation;
|
||||||
|
import openonyx.render.group_d.ColorAnimation;
|
||||||
|
import openonyx.render.group_d.Easings;
|
||||||
|
import openonyx.render.group_v.IconPaths;
|
||||||
|
import openonyx.render.group_v.RenderSupport_184;
|
||||||
|
import openonyx.render.group_v.RoundedShapes;
|
||||||
|
import openonyx.render.group_v.RoundedShapesData2;
|
||||||
|
import openonyx.theme.Fonts;
|
||||||
|
import openonyx.theme.Palette;
|
||||||
|
import openonyx.theme.ThemeManager;
|
||||||
|
import openonyx.theme.internal.ColorUtils;
|
||||||
|
import openonyx.ui.UiSupport_545;
|
||||||
|
import org.lwjgl.input.Mouse;
|
||||||
|
|
||||||
|
public final class ArrayListModule extends Module {
|
||||||
|
public NumberSetting animationSpeed;
|
||||||
|
public NumberSetting scale;
|
||||||
|
public EnumSetting<ArrayListSorting> sort;
|
||||||
|
private static final float X = 100.0F;
|
||||||
|
public BooleanSetting textShadow;
|
||||||
|
private static final float z = 1.0F;
|
||||||
|
private final Animation animation2;
|
||||||
|
public ColorSetting color;
|
||||||
|
private final Animation animation3;
|
||||||
|
public MultiSelectSetting<ModuleCategory> categories;
|
||||||
|
private boolean N;
|
||||||
|
private final Animation animation4;
|
||||||
|
private float x;
|
||||||
|
public ColorSetting firstColor;
|
||||||
|
private boolean y;
|
||||||
|
public NumberSetting positionX;
|
||||||
|
public NumberSetting rowSpacing;
|
||||||
|
public BooleanSetting background;
|
||||||
|
public NumberSetting colorSpread;
|
||||||
|
private long P;
|
||||||
|
private final RenderSupport_184 renderSupport_184;
|
||||||
|
private final UiSupport_545 uiSupport_545;
|
||||||
|
private float p;
|
||||||
|
private float t;
|
||||||
|
public BooleanSetting suffix;
|
||||||
|
private boolean E;
|
||||||
|
public EnumSetting<ArrayListAnimation> animation;
|
||||||
|
public BooleanSetting blur;
|
||||||
|
private float A;
|
||||||
|
public NumberSetting positionY;
|
||||||
|
public BooleanSetting outline;
|
||||||
|
private static final float C = 2.0F;
|
||||||
|
private boolean J;
|
||||||
|
private RoundedShapesData2 roundedShapesData2;
|
||||||
|
private final List<Module> modules;
|
||||||
|
public BooleanSetting lowercase;
|
||||||
|
private float k;
|
||||||
|
private float g;
|
||||||
|
private static final float M = 3.0F;
|
||||||
|
private final Map<Module, ArrayListEntry> arrayListEntryMap;
|
||||||
|
private static final float j = 14.0F;
|
||||||
|
public EnumSetting<ArrayListStyle> style = new EnumSetting<>("Style", ArrayListStyle.ACCENT_BAR).describe("How each row is painted");
|
||||||
|
private static final float h = 140.0F;
|
||||||
|
private static final float l = 4.0F;
|
||||||
|
public NumberSetting colorSpeed;
|
||||||
|
public ColorSetting secondColor;
|
||||||
|
private static final float i = 14.0F;
|
||||||
|
private static final String f = "arraylist";
|
||||||
|
private static final float H = 0.0F;
|
||||||
|
public EnumSetting<ArrayListColorMode> colors;
|
||||||
|
|
||||||
|
// $VF: Unable to simplify switch on enum
|
||||||
|
// Please report this to the Vineflower issue tracker, at https://github.com/Vineflower/vineflower/issues with a copy of the class file (if you have the rights to distribute it!)
|
||||||
|
private float D() {
|
||||||
|
switch ((ArrayListStyle)this.style.getValue()) {
|
||||||
|
case ACCENT_BAR:
|
||||||
|
while (false) {
|
||||||
|
}
|
||||||
|
|
||||||
|
return 4.0F;
|
||||||
|
case PILLS:
|
||||||
|
return 5.0F;
|
||||||
|
case TEXT:
|
||||||
|
return 0.0F;
|
||||||
|
default:
|
||||||
|
throw new MatchException(null, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onEnable() {
|
||||||
|
this.y = false;
|
||||||
|
this.P = 0L;
|
||||||
|
}
|
||||||
|
|
||||||
|
private float L(Render2D render2D, Module module, ArrayListEntry arrayListEntry) {
|
||||||
|
float fx = Math.min(render2D.getTextWidth(Fonts.FONT_STYLE9, this.L(module)), 140.0F);
|
||||||
|
return arrayListEntry.I == null ? fx : fx + 3.0F + render2D.getTextWidth(Fonts.FONT_STYLE8, arrayListEntry.I);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean L(double d, double e) {
|
||||||
|
return d >= this.p && d < this.p + this.A && e >= this.x && e < this.x + this.g;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void L(Render2D render2D, float f, float g) {
|
||||||
|
ArrayListModule arrayListModule1 = this;
|
||||||
|
float hx = arrayListModule1.d();
|
||||||
|
boolean bl = arrayListModule1.isEnabled() && mc.currentScreen instanceof GuiChat;
|
||||||
|
boolean bl1 = arrayListModule1.L(render2D, bl, hx);
|
||||||
|
float m;
|
||||||
|
ArrayListModule arrayListModule2;
|
||||||
|
if (bl1) {
|
||||||
|
m = 1.0F;
|
||||||
|
arrayListModule2 = arrayListModule1;
|
||||||
|
} else {
|
||||||
|
m = 0.0F;
|
||||||
|
arrayListModule2 = arrayListModule1;
|
||||||
|
}
|
||||||
|
|
||||||
|
arrayListModule1.animation2.animateTo(m, arrayListModule2.L(bl1 ? 300.0F : 200.0F), bl1 ? Easings.EASING7 : Easings.EASING);
|
||||||
|
arrayListModule1.animation2.update(hx);
|
||||||
|
if (arrayListModule1.arrayListEntryMap.isEmpty() && arrayListModule1.animation2.isFinished() && arrayListModule1.animation2.getValue() <= 0.0F) {
|
||||||
|
arrayListModule1.h();
|
||||||
|
arrayListModule1.A = 0.0F;
|
||||||
|
arrayListModule1.g = 0.0F;
|
||||||
|
arrayListModule1.E = arrayListModule1.e();
|
||||||
|
} else {
|
||||||
|
Palette palette = ThemeManager.getPalette();
|
||||||
|
float ix = arrayListModule1.scale.getFloat();
|
||||||
|
arrayListModule1.A = arrayListModule1.animation4.getValue() * ix;
|
||||||
|
arrayListModule1.g = arrayListModule1.animation3.getValue() * ix;
|
||||||
|
float jx = fx - arrayListModule1.A - 0.0F;
|
||||||
|
float lx = gx - arrayListModule1.g - 0.0F;
|
||||||
|
arrayListModule1.p = 0.0F + L(arrayListModule1.positionX, jx);
|
||||||
|
arrayListModule1.x = 0.0F + L(arrayListModule1.positionY, lx);
|
||||||
|
IconPaths.L("arraylist", arrayListModule1.p, arrayListModule1.x, arrayListModule1.A, arrayListModule1.g);
|
||||||
|
boolean bl2 = arrayListModule1.L(bl, jx, lx, fx, gx);
|
||||||
|
if (bl && bl2 && !arrayListModule1.N) {
|
||||||
|
float[] kx;
|
||||||
|
if ((kx = arrayListModule1.renderSupport_184.L(true))[0] != 0.0F || kx[1] != 0.0F) {
|
||||||
|
L(arrayListModule1.positionX, L(arrayListModule1.positionX, jx) + kx[0], jx);
|
||||||
|
L(arrayListModule1.positionY, L(arrayListModule1.positionY, lx) + kx[1], lx);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
arrayListModule1.renderSupport_184.L(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
arrayListModule1.p = 0.0F + L(arrayListModule1.positionX, jx);
|
||||||
|
arrayListModule1.x = 0.0F + L(arrayListModule1.positionY, lx);
|
||||||
|
arrayListModule1.p = Math.round(arrayListModule1.p);
|
||||||
|
arrayListModule1.x = Math.round(arrayListModule1.x);
|
||||||
|
arrayListModule1.J = arrayListModule1.positionX.getValue() > 50.0;
|
||||||
|
boolean bl3;
|
||||||
|
ArrayListModule arrayListModule3;
|
||||||
|
if (bl && bl2) {
|
||||||
|
bl3 = true;
|
||||||
|
arrayListModule3 = arrayListModule1;
|
||||||
|
} else {
|
||||||
|
bl3 = false;
|
||||||
|
arrayListModule3 = arrayListModule1;
|
||||||
|
}
|
||||||
|
|
||||||
|
arrayListModule1.uiSupport_545.L(hx, bl3, arrayListModule3.N);
|
||||||
|
if (arrayListModule1.N) {
|
||||||
|
RoundedShapes.L(render2D, fx, gx, arrayListModule1.roundedShapesData2);
|
||||||
|
}
|
||||||
|
|
||||||
|
render2D.pushAlpha(arrayListModule1.animation2.getValue());
|
||||||
|
render2D.pushMatrix();
|
||||||
|
render2D.translate(arrayListModule1.p, arrayListModule1.x);
|
||||||
|
render2D.scaleAround(ix, 0.0F, 0.0F);
|
||||||
|
arrayListModule1.L(render2D, palette);
|
||||||
|
render2D.popMatrix();
|
||||||
|
render2D.popAlpha();
|
||||||
|
arrayListModule1.h();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean e() {
|
||||||
|
return Mouse.isButtonDown(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String d(Module module) {
|
||||||
|
Module module1 = module;
|
||||||
|
String string;
|
||||||
|
if ((string = module1.getSuffix()) != null && !string.isEmpty()) {
|
||||||
|
return string;
|
||||||
|
}
|
||||||
|
|
||||||
|
Iterator iterator = module1.getVisibleSettings().iterator();
|
||||||
|
|
||||||
|
while (iterator.hasNext()) {
|
||||||
|
Setting setting;
|
||||||
|
if ((setting = (Setting)iterator.next()) instanceof EnumSetting) {
|
||||||
|
return EnumSetting.displayName((Enum<?>)((EnumSetting)setting).getValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayListModule() {
|
||||||
|
super("Array List", "Lists every enabled module", ModuleCategory.HUD);
|
||||||
|
this.animation = new EnumSetting<>("Animation", ArrayListAnimation.SLIDE_FADE).describe("How rows enter and leave");
|
||||||
|
this.sort = new EnumSetting<>("Sort", ArrayListSorting.WIDTH_DESC).describe("Row ordering");
|
||||||
|
this.colors = new EnumSetting<>("Colors", ArrayListColorMode.ACCENT).describe("Where each row's colour comes from");
|
||||||
|
this.color = new ColorSetting("Color", -8691201).visibleWhen(this.colors, arrayListColorMode -> arrayListColorMode == ArrayListColorMode.STATIC);
|
||||||
|
this.firstColor = new ColorSetting("First Color", -8691201)
|
||||||
|
.visibleWhen(this.colors, ArrayListColorMode::d)
|
||||||
|
.describe("Gradient: the top row. Fade: one end of the pulse");
|
||||||
|
this.secondColor = new ColorSetting("Second Color", -12598785)
|
||||||
|
.visibleWhen(this.colors, ArrayListColorMode::d)
|
||||||
|
.describe("Gradient: the bottom row. Fade: the other end of the pulse");
|
||||||
|
this.colorSpeed = new NumberSetting("Color Speed", 1.0, 0.1, 5.0, 0.1).withSuffix("x").visibleWhen(this.colors, ArrayListColorMode::L);
|
||||||
|
this.colorSpread = new NumberSetting("Color Spread", 12.0, 0.0, 60.0, 1.0)
|
||||||
|
.visibleWhen(this.colors, ArrayListColorMode::L)
|
||||||
|
.describe("How far the colour shifts between neighbouring rows");
|
||||||
|
this.suffix = new BooleanSetting("Suffix", true).describe("Show the module's mode next to its name");
|
||||||
|
this.lowercase = new BooleanSetting("Lowercase", false).describe("Write every row in lower case");
|
||||||
|
ModuleCategory[] moduleCategorys = new ModuleCategory[4];
|
||||||
|
boolean bl = true;
|
||||||
|
moduleCategorys[0] = ModuleCategory.COMBAT;
|
||||||
|
moduleCategorys[1] = ModuleCategory.MOVEMENT;
|
||||||
|
moduleCategorys[2] = ModuleCategory.PLAYER;
|
||||||
|
moduleCategorys[3] = ModuleCategory.RENDER;
|
||||||
|
this.categories = new MultiSelectSetting<>("Categories", ModuleCategory.class, moduleCategorys).describe("Which categories the list shows");
|
||||||
|
this.background = new BooleanSetting("Background", true).visibleWhen(() -> !this.style.is(ArrayListStyle.TEXT));
|
||||||
|
this.blur = new BooleanSetting("Blur", false)
|
||||||
|
.visibleWhen(() -> !this.style.is(ArrayListStyle.TEXT) && this.background.isEnabled())
|
||||||
|
.describe("Frost each row over what is behind it (needs ClickGui's frosted glass)");
|
||||||
|
this.textShadow = new BooleanSetting("Text Shadow", true).visibleWhen(() -> this.style.is(ArrayListStyle.TEXT));
|
||||||
|
this.outline = new BooleanSetting("Outline", false).visibleWhen(() -> this.style.is(ArrayListStyle.PILLS));
|
||||||
|
this.scale = new NumberSetting("Scale", 1.0, 0.5, 2.0, 0.05).withSuffix("x").describe("Array list size");
|
||||||
|
this.rowSpacing = new NumberSetting("Row Spacing", 0.0, 0.0, 6.0, 0.5);
|
||||||
|
this.animationSpeed = new NumberSetting("Animation Speed", 1.0, 0.25, 3.0, 0.05).withSuffix("x");
|
||||||
|
this.positionX = new NumberSetting("Position X", 100.0, 0.0, 100.0, 0.01).visibleWhen(() -> false);
|
||||||
|
this.positionY = new NumberSetting("Position Y", 0.0, 0.0, 100.0, 0.01).visibleWhen(() -> false);
|
||||||
|
this.arrayListEntryMap = new IdentityHashMap<>();
|
||||||
|
this.modules = new ArrayList<>();
|
||||||
|
this.animation2 = new Animation(0.0F);
|
||||||
|
this.animation4 = new Animation(0.0F);
|
||||||
|
this.animation3 = new Animation(0.0F);
|
||||||
|
this.uiSupport_545 = new UiSupport_545();
|
||||||
|
this.renderSupport_184 = new RenderSupport_184();
|
||||||
|
this.J = true;
|
||||||
|
this.roundedShapesData2 = RoundedShapes.ROUNDED_SHAPES_DATA2;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int L(int i, int j, Module module, Palette palette) {
|
||||||
|
switch ((ArrayListColorMode)this.colors.getValue()) {
|
||||||
|
case ACCENT:
|
||||||
|
while (false) {
|
||||||
|
}
|
||||||
|
|
||||||
|
return palette.primary();
|
||||||
|
case STATIC:
|
||||||
|
return this.color.getValue();
|
||||||
|
case FADE:
|
||||||
|
double d = L() * this.colorSpeed.getFloat() + Math.toRadians(ix * this.colorSpread.getFloat());
|
||||||
|
return ColorAnimation.L(this.firstColor.getValue(), this.secondColor.getValue(), (float)(Math.sin(d) + 1.0) / 2.0F);
|
||||||
|
case GRADIENT:
|
||||||
|
return ColorAnimation.L(this.firstColor.getValue(), this.secondColor.getValue(), jx <= 1 ? 0.0F : (float)ix / (jx - 1));
|
||||||
|
case RAINBOW:
|
||||||
|
float fx;
|
||||||
|
return ColorUtils.hsvToArgb(
|
||||||
|
(fx = (float)(L() * 60.0 * this.colorSpeed.getFloat() + ix * this.colorSpread.getFloat()) % 360.0F) < 0.0F ? fx + 360.0F : fx, 0.75F, 1.0F, 255
|
||||||
|
);
|
||||||
|
case CATEGORY:
|
||||||
|
return ColorUtils.hsvToArgb(module.getModuleCategory().ordinal() * 67.0F % 360.0F, 0.7F, 1.0F, 255);
|
||||||
|
default:
|
||||||
|
throw new MatchException(null, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean L(Render2D render2D, boolean bl1, float f) {
|
||||||
|
ArrayListModule arrayListModule1 = this;
|
||||||
|
arrayListModule1.modules.clear();
|
||||||
|
Iterator iterator = OnyxClient.moduleManager.getModules().iterator();
|
||||||
|
|
||||||
|
label111:
|
||||||
|
while (true) {
|
||||||
|
Iterator iterator1 = iterator;
|
||||||
|
|
||||||
|
while (iterator1.hasNext()) {
|
||||||
|
Module module;
|
||||||
|
if ((module = (Module)iterator.next()) == arrayListModule1) {
|
||||||
|
continue label111;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (module == OnyxClient.moduleManager.clickGUI) {
|
||||||
|
iterator1 = iterator;
|
||||||
|
} else {
|
||||||
|
boolean bl = arrayListModule1.isEnabled() && module.isEnabled() && arrayListModule1.categories.contains(module.getModuleCategory());
|
||||||
|
ArrayListEntry arrayListEntry = arrayListModule1.arrayListEntryMap.get(module);
|
||||||
|
if (bl && arrayListEntry == null) {
|
||||||
|
arrayListEntry = new ArrayListEntry(0.0F);
|
||||||
|
arrayListModule1.arrayListEntryMap.put(module, arrayListEntry);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (arrayListEntry != null) {
|
||||||
|
if (bl) {
|
||||||
|
arrayListEntry.I = arrayListModule1.suffix.isEnabled() ? d(module) : null;
|
||||||
|
if (arrayListEntry.I != null && arrayListModule1.lowercase.isEnabled()) {
|
||||||
|
arrayListEntry.I = arrayListEntry.I.toLowerCase(Locale.ROOT);
|
||||||
|
}
|
||||||
|
|
||||||
|
arrayListEntry.H = arrayListModule1.L(render2D, module, arrayListEntry);
|
||||||
|
arrayListModule1.modules.add(module);
|
||||||
|
}
|
||||||
|
|
||||||
|
float o;
|
||||||
|
ArrayListModule arrayListModule2;
|
||||||
|
if (bl) {
|
||||||
|
o = 1.0F;
|
||||||
|
arrayListModule2 = arrayListModule1;
|
||||||
|
} else {
|
||||||
|
o = 0.0F;
|
||||||
|
arrayListModule2 = arrayListModule1;
|
||||||
|
}
|
||||||
|
|
||||||
|
arrayListEntry.animation.animateTo(o, arrayListModule2.L(bl ? 250.0F : 200.0F), bl ? Easings.EASING7 : Easings.EASING);
|
||||||
|
arrayListEntry.animation.update(fx);
|
||||||
|
arrayListEntry.animation2.update(fx);
|
||||||
|
if (!bl && arrayListEntry.animation.isFinished() && arrayListEntry.animation.getValue() <= 0.0F) {
|
||||||
|
arrayListModule1.arrayListEntryMap.remove(module);
|
||||||
|
}
|
||||||
|
continue label111;
|
||||||
|
}
|
||||||
|
|
||||||
|
iterator1 = iterator;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
arrayListModule1.modules.sort(arrayListModule1.L());
|
||||||
|
float hx = 14.0F + arrayListModule1.rowSpacing.getFloat();
|
||||||
|
float kx = arrayListModule1.D();
|
||||||
|
float lx = 0.0F;
|
||||||
|
|
||||||
|
for (int m = ix = 0; m < arrayListModule1.modules.size(); m = ix) {
|
||||||
|
ArrayListEntry arrayListEntry1;
|
||||||
|
ArrayListEntry arrayListEntry2 = arrayListEntry1 = arrayListModule1.arrayListEntryMap.get(arrayListModule1.modules.get(ix));
|
||||||
|
arrayListEntry2.f = ix;
|
||||||
|
float n;
|
||||||
|
if (arrayListEntry2.d) {
|
||||||
|
arrayListEntry1.animation2.animateTo(ix * hx, arrayListModule1.L(100.0F), Easings.EASING2);
|
||||||
|
n = lx;
|
||||||
|
} else {
|
||||||
|
arrayListEntry1.animation2.set(ix * hx);
|
||||||
|
arrayListEntry1.d = true;
|
||||||
|
n = lx;
|
||||||
|
}
|
||||||
|
|
||||||
|
ix++;
|
||||||
|
lx = Math.max(n, arrayListEntry1.H);
|
||||||
|
}
|
||||||
|
|
||||||
|
int jx;
|
||||||
|
float gx = (jx = arrayListModule1.modules.size()) == 0 ? 0.0F : lx + kx * 2.0F + arrayListModule1.L();
|
||||||
|
kx = jx == 0 ? 0.0F : jx * hx - arrayListModule1.rowSpacing.getFloat();
|
||||||
|
if (jx > 0) {
|
||||||
|
arrayListModule1.animation4.animateTo(gx, arrayListModule1.L(300.0F), Easings.EASING2);
|
||||||
|
arrayListModule1.animation3.animateTo(kx, arrayListModule1.L(300.0F), Easings.EASING2);
|
||||||
|
}
|
||||||
|
|
||||||
|
arrayListModule1.animation4.update(fx);
|
||||||
|
arrayListModule1.animation3.update(fx);
|
||||||
|
if (jx > 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void L(Render2D render2D, Palette palette) {
|
||||||
|
ArrayListStyle arrayListStyle = this.style.getValue();
|
||||||
|
boolean bl = this.background.isEnabled() && arrayListStyle != ArrayListStyle.TEXT && this.blur.isEnabled();
|
||||||
|
RenderSupport_120.L(bl);
|
||||||
|
float fx = this.animation4.getValue();
|
||||||
|
float gx = this.animation3.getValue();
|
||||||
|
float hx = this.D();
|
||||||
|
int ix = this.modules.size();
|
||||||
|
Iterator iterator = this.arrayListEntryMap.entrySet().iterator();
|
||||||
|
|
||||||
|
label58:
|
||||||
|
while (true) {
|
||||||
|
for (Iterator iterator1 = iterator; iterator1.hasNext(); iterator1 = iterator) {
|
||||||
|
Entry entry;
|
||||||
|
Module module = (Module)(entry = (Entry)iterator.next()).getKey();
|
||||||
|
float jx;
|
||||||
|
ArrayListEntry arrayListEntry;
|
||||||
|
if (!((jx = (arrayListEntry = (ArrayListEntry)entry.getValue()).animation.getValue()) <= 0.001F)) {
|
||||||
|
int kx = this.L(arrayListEntry.f, ix, module, palette);
|
||||||
|
float lx = arrayListEntry.H + hx * 2.0F + this.L();
|
||||||
|
float m = this.J ? fx - lx : 0.0F;
|
||||||
|
float n = arrayListEntry.animation2.getValue();
|
||||||
|
ArrayListAnimation arrayListAnimation;
|
||||||
|
if ((arrayListAnimation = this.animation.getValue()).d()) {
|
||||||
|
render2D.pushAlpha(jx);
|
||||||
|
}
|
||||||
|
|
||||||
|
render2D.pushMatrix();
|
||||||
|
if (arrayListAnimation.L()) {
|
||||||
|
float o = (1.0F - jx) * 14.0F;
|
||||||
|
render2D.translate(this.J ? o : -o, 0.0F);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (arrayListAnimation.D()) {
|
||||||
|
render2D.translate(m + (this.J ? lx : 0.0F), n + 7.0F);
|
||||||
|
render2D.scaleAround(0.9F + 0.1F * jx, 0.0F, 0.0F);
|
||||||
|
render2D.translate(-(m + (this.J ? lx : 0.0F)), -(n + 7.0F));
|
||||||
|
}
|
||||||
|
|
||||||
|
this.L(render2D, palette, arrayListStyle, module, arrayListEntry, m, n, lx, hx, kx, bl);
|
||||||
|
render2D.popMatrix();
|
||||||
|
if (arrayListAnimation.d()) {
|
||||||
|
render2D.popAlpha();
|
||||||
|
}
|
||||||
|
continue label58;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.uiSupport_545.L(render2D, 0.0F, 0.0F, fx, gx, 0.0F, palette.onSurface());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static double L() {
|
||||||
|
return System.nanoTime() / 1.0E9;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String L(Module module) {
|
||||||
|
return this.lowercase.isEnabled() ? module.getName().toLowerCase(Locale.ROOT) : module.getName();
|
||||||
|
}
|
||||||
|
|
||||||
|
private float d() {
|
||||||
|
ArrayListModule arrayListModule1 = this;
|
||||||
|
long lx = System.nanoTime();
|
||||||
|
float fx = arrayListModule1.P == 0L ? 16.0F : Math.min((float)(lx - arrayListModule1.P) / 1000000.0F, 100.0F);
|
||||||
|
arrayListModule1.P = lx;
|
||||||
|
return fx;
|
||||||
|
}
|
||||||
|
|
||||||
|
private float L(float f) {
|
||||||
|
return fx / this.animationSpeed.getFloat();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static float L(NumberSetting numberSetting, float f) {
|
||||||
|
return fx <= 0.0F ? 0.0F : (float)(fx * numberSetting.getValue() / 100.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void L(NumberSetting numberSetting, float f, float g) {
|
||||||
|
if (!(gx <= 0.0F)) {
|
||||||
|
numberSetting.setValue(Math.clamp(fx / gx, 0.0F, 1.0F) * 100.0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean l() {
|
||||||
|
return mc.thePlayer != null && mc.theWorld != null && (this.isEnabled() || this.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void L(
|
||||||
|
Render2D render2D,
|
||||||
|
Palette palette,
|
||||||
|
ArrayListStyle arrayListStyle,
|
||||||
|
Module module,
|
||||||
|
ArrayListEntry arrayListEntry,
|
||||||
|
float f,
|
||||||
|
float g,
|
||||||
|
float h,
|
||||||
|
float i,
|
||||||
|
int j,
|
||||||
|
boolean bl
|
||||||
|
) {
|
||||||
|
float kx = this.L();
|
||||||
|
float lx = fx + hx - ix - (this.J ? kx : 0.0F);
|
||||||
|
ix = fx + ix + (this.J ? 0.0F : kx);
|
||||||
|
float m = gx + 7.0F;
|
||||||
|
int n = arrayListStyle == ArrayListStyle.ACCENT_BAR ? palette.onSurface() : jx;
|
||||||
|
int o = ThemeManager.withAlpha(arrayListStyle == ArrayListStyle.TEXT ? jx : palette.onSurface(), 0.6F);
|
||||||
|
Render2D render2D1;
|
||||||
|
switch (arrayListStyle) {
|
||||||
|
case ACCENT_BAR:
|
||||||
|
while (false) {
|
||||||
|
}
|
||||||
|
|
||||||
|
label79: {
|
||||||
|
if (this.background.isEnabled()) {
|
||||||
|
int px = ThemeManager.withAlpha(palette.surface(), 0.55F);
|
||||||
|
if (this.rowSpacing.getFloat() > 0.0F) {
|
||||||
|
RenderSupport_120.L(render2D, fx, gx, hx, 14.0F, 0.0F, px, bl);
|
||||||
|
render2D1 = render2D;
|
||||||
|
break label79;
|
||||||
|
}
|
||||||
|
|
||||||
|
render2D.pushScissor(fx, gx, hx, 14.0F);
|
||||||
|
RenderSupport_120.L(render2D, fx, gx - 4.0F, hx, 22.0F, 0.0F, px, bl);
|
||||||
|
render2D.popScissor();
|
||||||
|
}
|
||||||
|
|
||||||
|
render2D1 = render2D;
|
||||||
|
}
|
||||||
|
|
||||||
|
float s = fx;
|
||||||
|
float tx;
|
||||||
|
if (this.J) {
|
||||||
|
s = fx + hx - kx;
|
||||||
|
tx = gx;
|
||||||
|
} else {
|
||||||
|
tx = gx;
|
||||||
|
}
|
||||||
|
|
||||||
|
render2D1.rect(s, tx, kx, 14.0F, jx);
|
||||||
|
render2D1 = render2D;
|
||||||
|
break;
|
||||||
|
case PILLS:
|
||||||
|
if (this.background.isEnabled()) {
|
||||||
|
RenderSupport_120.L(render2D, fx, gx, hx, 14.0F, 8.0F, ThemeManager.withAlpha(palette.surface(), 0.72F), bl);
|
||||||
|
render2D.roundedRect(fx, gx, hx, 14.0F, 8.0F, ThemeManager.withAlpha(jx, 0.22F));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.outline.isEnabled()) {
|
||||||
|
render2D1 = render2D;
|
||||||
|
render2D.roundedOutline(fx, gx, hx, 14.0F, 8.0F, 1.0F, ThemeManager.withAlpha(jx, 0.5F));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case TEXT:
|
||||||
|
default:
|
||||||
|
render2D1 = render2D;
|
||||||
|
}
|
||||||
|
|
||||||
|
String string1;
|
||||||
|
label72: {
|
||||||
|
string1 = render2D1.trimToWidth(Fonts.FONT_STYLE9, this.L(module), 140.0F);
|
||||||
|
string = arrayListEntry.I;
|
||||||
|
r = arrayListEntry.I == null ? 0.0F : render2D.getTextWidth(Fonts.FONT_STYLE8, string) + 3.0F;
|
||||||
|
if (arrayListStyle == ArrayListStyle.TEXT && this.textShadow.isEnabled()) {
|
||||||
|
int q = ThemeManager.withAlpha(palette.shadow(), 0.075F);
|
||||||
|
if (this.J) {
|
||||||
|
render2D.drawTextRightVCentered(Fonts.FONT_STYLE9, string1, lx - r + 1.0F, m + 1.0F, q);
|
||||||
|
if (string != null) {
|
||||||
|
arrayListModule1 = this;
|
||||||
|
render2D.drawTextRightVCentered(Fonts.FONT_STYLE8, string, lx + 1.0F, m + 1.0F, q);
|
||||||
|
break label72;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
render2D.drawTextVCentered(Fonts.FONT_STYLE9, string1, ix + 1.0F, m + 1.0F, q);
|
||||||
|
if (string != null) {
|
||||||
|
render2D.drawTextVCentered(Fonts.FONT_STYLE8, string, ix + render2D.getTextWidth(Fonts.FONT_STYLE9, string1) + 3.0F + 1.0F, m + 1.0F, q);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
arrayListModule1 = this;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (arrayListModule1.J) {
|
||||||
|
render2D.drawTextRightVCentered(Fonts.FONT_STYLE9, string1, lx - r, m, n);
|
||||||
|
if (string != null) {
|
||||||
|
render2D.drawTextRightVCentered(Fonts.FONT_STYLE8, string, lx, m, o);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
render2D.drawTextVCentered(Fonts.FONT_STYLE9, string1, ix, m, n);
|
||||||
|
if (string != null) {
|
||||||
|
render2D.drawTextVCentered(Fonts.FONT_STYLE8, string, ix + render2D.getTextWidth(Fonts.FONT_STYLE9, string1) + 3.0F, m, o);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDisable() {
|
||||||
|
this.y = true;
|
||||||
|
this.N = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Comparator<Module> L() {
|
||||||
|
switch ((ArrayListSorting)this.sort.getValue()) {
|
||||||
|
case WIDTH_DESC:
|
||||||
|
while (false) {
|
||||||
|
}
|
||||||
|
|
||||||
|
return Comparator.<Module>comparingDouble(module -> -this.arrayListEntryMap.get(module).H).thenComparing(Module::getName);
|
||||||
|
case WIDTH_ASC:
|
||||||
|
return Comparator.<Module>comparingDouble(module -> this.arrayListEntryMap.get(module).H).thenComparing(Module::getName);
|
||||||
|
case ALPHABETICAL:
|
||||||
|
return Comparator.comparing(Module::getName);
|
||||||
|
default:
|
||||||
|
throw new MatchException(null, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private float L() {
|
||||||
|
return this.style.is(ArrayListStyle.ACCENT_BAR) ? 2.0F : 0.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void h() {
|
||||||
|
if (!this.isEnabled() && this.arrayListEntryMap.isEmpty() && this.animation2.isFinished() && !(this.animation2.getValue() > 0.0F)) {
|
||||||
|
this.y = false;
|
||||||
|
this.P = 0L;
|
||||||
|
this.A = 0.0F;
|
||||||
|
this.g = 0.0F;
|
||||||
|
IconPaths.L("arraylist");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean L(boolean bl, float f, float g, float h, float i) {
|
||||||
|
ArrayListModule arrayListModule1 = this;
|
||||||
|
float jx = Minecraft.getScaledMouseX() * hx / mc.displayWidth;
|
||||||
|
float kx = ix - Minecraft.getScaledMouseY() * ix / mc.displayHeight - 1.0F;
|
||||||
|
boolean bl1 = arrayListModule1.e();
|
||||||
|
boolean bl2 = arrayListModule1.L(jx, kx);
|
||||||
|
ArrayListModule arrayListModule2;
|
||||||
|
if (bl && bl1) {
|
||||||
|
if (!arrayListModule1.E && bl2) {
|
||||||
|
arrayListModule1.N = true;
|
||||||
|
arrayListModule1.t = jx - arrayListModule1.p;
|
||||||
|
arrayListModule1.k = kx - arrayListModule1.x;
|
||||||
|
}
|
||||||
|
|
||||||
|
arrayListModule2 = arrayListModule1;
|
||||||
|
} else {
|
||||||
|
arrayListModule2 = arrayListModule1;
|
||||||
|
arrayListModule1.N = false;
|
||||||
|
arrayListModule1.roundedShapesData2 = RoundedShapes.ROUNDED_SHAPES_DATA2;
|
||||||
|
}
|
||||||
|
|
||||||
|
arrayListModule2.E = bl1;
|
||||||
|
if (arrayListModule1.N) {
|
||||||
|
arrayListModule1.roundedShapesData2 = RoundedShapes.L(
|
||||||
|
jx - arrayListModule1.t, kx - arrayListModule1.k, arrayListModule1.A, arrayListModule1.g, hx, ix, 0.0F, IconPaths.L("arraylist")
|
||||||
|
);
|
||||||
|
L(arrayListModule1.positionX, arrayListModule1.roundedShapesData2.x() - 0.0F, fx);
|
||||||
|
L(arrayListModule1.positionY, arrayListModule1.roundedShapesData2.y() - 0.0F, gx);
|
||||||
|
}
|
||||||
|
|
||||||
|
return bl2;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
package openonyx.features.hud;
|
||||||
|
|
||||||
|
import openonyx.features.hud.group_m.ArrayListColorMode;
|
||||||
|
import openonyx.features.hud.group_m.ArrayListSorting;
|
||||||
|
import openonyx.features.hud.group_m.ArrayListStyle;
|
||||||
|
|
||||||
|
// $VF: synthetic class
|
||||||
|
class ArrayListModulePart {
|
||||||
|
static {
|
||||||
|
int[] i = new int[ArrayListSorting.values().length];
|
||||||
|
boolean bl = true;
|
||||||
|
e = i;
|
||||||
|
|
||||||
|
try {
|
||||||
|
e[ArrayListSorting.WIDTH_DESC.ordinal()] = 1;
|
||||||
|
} catch (NoSuchFieldError noSuchFieldError11) {
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
e[ArrayListSorting.WIDTH_ASC.ordinal()] = 2;
|
||||||
|
} catch (NoSuchFieldError noSuchFieldError10) {
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
e[ArrayListSorting.ALPHABETICAL.ordinal()] = 3;
|
||||||
|
} catch (NoSuchFieldError noSuchFieldError9) {
|
||||||
|
}
|
||||||
|
|
||||||
|
i = new int[ArrayListColorMode.values().length];
|
||||||
|
bl = true;
|
||||||
|
f = i;
|
||||||
|
|
||||||
|
try {
|
||||||
|
f[ArrayListColorMode.ACCENT.ordinal()] = 1;
|
||||||
|
} catch (NoSuchFieldError noSuchFieldError8) {
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
f[ArrayListColorMode.STATIC.ordinal()] = 2;
|
||||||
|
} catch (NoSuchFieldError noSuchFieldError7) {
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
f[ArrayListColorMode.FADE.ordinal()] = 3;
|
||||||
|
} catch (NoSuchFieldError noSuchFieldError6) {
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
f[ArrayListColorMode.GRADIENT.ordinal()] = 4;
|
||||||
|
} catch (NoSuchFieldError noSuchFieldError5) {
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
f[ArrayListColorMode.RAINBOW.ordinal()] = 5;
|
||||||
|
} catch (NoSuchFieldError noSuchFieldError4) {
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
f[ArrayListColorMode.CATEGORY.ordinal()] = 6;
|
||||||
|
} catch (NoSuchFieldError noSuchFieldError3) {
|
||||||
|
}
|
||||||
|
|
||||||
|
i = new int[ArrayListStyle.values().length];
|
||||||
|
bl = true;
|
||||||
|
H = i;
|
||||||
|
|
||||||
|
try {
|
||||||
|
H[ArrayListStyle.ACCENT_BAR.ordinal()] = 1;
|
||||||
|
} catch (NoSuchFieldError noSuchFieldError2) {
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
H[ArrayListStyle.PILLS.ordinal()] = 2;
|
||||||
|
} catch (NoSuchFieldError noSuchFieldError1) {
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
H[ArrayListStyle.TEXT.ordinal()] = 3;
|
||||||
|
} catch (NoSuchFieldError noSuchFieldError) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package openonyx.features.hud;
|
||||||
|
|
||||||
|
import openonyx.features.Module;
|
||||||
|
import openonyx.features.ModuleCategory;
|
||||||
|
import openonyx.render.group_w.CustomGuiRenderer;
|
||||||
|
import openonyx.render.group_w.GuiBlurBackground;
|
||||||
|
import openonyx.render.group_w.RenderSupport_202;
|
||||||
|
|
||||||
|
public final class CustomGui extends Module {
|
||||||
|
public final CustomGuiPart8 customGuiPart8;
|
||||||
|
public final CustomGuiPart3 customGuiPart3;
|
||||||
|
public final CustomGuiPart9 customGuiPart9;
|
||||||
|
public final CustomGuiPart2 customGuiPart2;
|
||||||
|
public final CustomGuiPart7 customGuiPart7;
|
||||||
|
public final CustomGuiPart4 customGuiPart4;
|
||||||
|
public final CustomGuiPart6 customGuiPart6;
|
||||||
|
public final CustomGuiPart customGuiPart;
|
||||||
|
public final CustomGuiPart5 customGuiPart5 = new CustomGuiPart5();
|
||||||
|
|
||||||
|
public CustomGui() {
|
||||||
|
super("CustomGui", "Reskins Minecraft's own HUD and screens", ModuleCategory.HUD);
|
||||||
|
this.customGuiPart9 = new CustomGuiPart9();
|
||||||
|
this.customGuiPart8 = new CustomGuiPart8();
|
||||||
|
this.customGuiPart2 = new CustomGuiPart2();
|
||||||
|
this.customGuiPart6 = new CustomGuiPart6();
|
||||||
|
this.customGuiPart4 = new CustomGuiPart4();
|
||||||
|
this.customGuiPart = new CustomGuiPart();
|
||||||
|
this.customGuiPart3 = new CustomGuiPart3();
|
||||||
|
this.customGuiPart7 = new CustomGuiPart7();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDisable() {
|
||||||
|
RenderSupport_202.L();
|
||||||
|
GuiBlurBackground.D();
|
||||||
|
CustomGuiRenderer.L();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package openonyx.features.hud;
|
||||||
|
|
||||||
|
import openonyx.history.SettingGroup;
|
||||||
|
import openonyx.history.internal.BooleanSetting;
|
||||||
|
import openonyx.history.internal.EnumSetting;
|
||||||
|
|
||||||
|
public final class CustomGuiPart extends SettingGroup {
|
||||||
|
public final BooleanSetting damageTrail;
|
||||||
|
public final BooleanSetting animate;
|
||||||
|
public final EnumSetting<FeatureSupport_342Mode> mode = new EnumSetting<>("Mode", FeatureSupport_342Mode.ICONS)
|
||||||
|
.describe("Redrawn icons, or continuous progress bars");
|
||||||
|
|
||||||
|
private CustomGuiPart() {
|
||||||
|
super("Status bars", true);
|
||||||
|
this.animate = new BooleanSetting("Animate", true).describe("Pop on gain, shake on damage, pulse when low");
|
||||||
|
this.damageTrail = new BooleanSetting("Damage trail", true).describe("A lighter ghost that catches up to the value after a hit");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package openonyx.features.hud;
|
||||||
|
|
||||||
|
import openonyx.history.SettingGroup;
|
||||||
|
import openonyx.history.internal.NumberSetting;
|
||||||
|
|
||||||
|
public final class CustomGuiPart2 extends SettingGroup {
|
||||||
|
public final NumberSetting positionY;
|
||||||
|
public final NumberSetting positionX = new NumberSetting("Position X", 50.0, 0.0, 100.0, 0.01).visibleWhen(() -> false);
|
||||||
|
public final NumberSetting scale;
|
||||||
|
|
||||||
|
private CustomGuiPart2() {
|
||||||
|
super("Title", true);
|
||||||
|
this.positionY = new NumberSetting("Position Y", 38.0, 0.0, 100.0, 0.01).visibleWhen(() -> false);
|
||||||
|
this.scale = new NumberSetting("Scale", 1.0, 0.5, 2.0, 0.05).visibleWhen(() -> false);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in new issue
Block a user