Upload files to "src/openonyx/features/hud"
This commit is contained in:
1 parent
2598331c33
commit
26bef251bc
5 files changed
+943
No files matched your search
@@ -0,0 +1,79 @@
|
|||||||
|
package openonyx.features.hud;
|
||||||
|
|
||||||
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
import openonyx.core.MinecraftAccess;
|
||||||
|
|
||||||
|
final class StatsIslandPart implements MinecraftAccess {
|
||||||
|
private long l;
|
||||||
|
private static final int I = 20;
|
||||||
|
private final AtomicInteger atomicInteger;
|
||||||
|
private static final long i = 250000000L;
|
||||||
|
private int f;
|
||||||
|
private final boolean[] H;
|
||||||
|
private int e;
|
||||||
|
|
||||||
|
private void D() {
|
||||||
|
this.atomicInteger.set(0);
|
||||||
|
this.l = 0L;
|
||||||
|
this.f = 0;
|
||||||
|
this.e = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int L() {
|
||||||
|
StatsIslandPart statsIslandPart1 = this;
|
||||||
|
if (statsIslandPart1.e == 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int ix = 0;
|
||||||
|
|
||||||
|
for (int k = j = 0; k < statsIslandPart1.e; k = ++j) {
|
||||||
|
if (!statsIslandPart1.H[j]) {
|
||||||
|
ix++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Math.round(ix * 100.0F / statsIslandPart1.e);
|
||||||
|
}
|
||||||
|
|
||||||
|
private StatsIslandPart() {
|
||||||
|
int ix = 52 & 95;
|
||||||
|
super();
|
||||||
|
this.atomicInteger = new AtomicInteger();
|
||||||
|
boolean[] bl = new boolean[ix];
|
||||||
|
boolean bl1 = true;
|
||||||
|
this.H = bl;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void d() {
|
||||||
|
StatsIslandPart statsIslandPart1 = this;
|
||||||
|
if (mc.getNetHandler() == null) {
|
||||||
|
statsIslandPart1.D();
|
||||||
|
} else {
|
||||||
|
long lx = System.nanoTime();
|
||||||
|
if (statsIslandPart1.l == 0L) {
|
||||||
|
statsIslandPart1.l = lx;
|
||||||
|
} else {
|
||||||
|
long m;
|
||||||
|
if ((m = lx - statsIslandPart1.l) >= 250000000L) {
|
||||||
|
boolean bl = statsIslandPart1.atomicInteger.getAndSet(0) > 0;
|
||||||
|
int j = (int)Math.min(m / 250000000L, 20L);
|
||||||
|
int k = 0;
|
||||||
|
statsIslandPart1.l = lx;
|
||||||
|
|
||||||
|
for (int ix = 0; k < j; k = ix) {
|
||||||
|
statsIslandPart1.H[statsIslandPart1.f] = bl;
|
||||||
|
statsIslandPart1.f = (statsIslandPart1.f + 1) % 20;
|
||||||
|
int n = statsIslandPart1.e + 1;
|
||||||
|
ix++;
|
||||||
|
statsIslandPart1.e = Math.min(n, 20);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void L() {
|
||||||
|
this.atomicInteger.incrementAndGet();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package openonyx.features.hud;
|
||||||
|
|
||||||
|
// $VF: synthetic class
|
||||||
|
class StatsIslandPart2 {
|
||||||
|
static {
|
||||||
|
int[] i = new int[StatsMode.values().length];
|
||||||
|
boolean bl = true;
|
||||||
|
e = i;
|
||||||
|
|
||||||
|
try {
|
||||||
|
e[StatsMode.FPS.ordinal()] = 1;
|
||||||
|
} catch (NoSuchFieldError noSuchFieldError4) {
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
e[StatsMode.USERNAME.ordinal()] = 2;
|
||||||
|
} catch (NoSuchFieldError noSuchFieldError3) {
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
e[StatsMode.PING.ordinal()] = 3;
|
||||||
|
} catch (NoSuchFieldError noSuchFieldError2) {
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
e[StatsMode.PACKET_LOSS.ordinal()] = 4;
|
||||||
|
} catch (NoSuchFieldError noSuchFieldError1) {
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
e[StatsMode.SERVER.ordinal()] = 5;
|
||||||
|
} catch (NoSuchFieldError noSuchFieldError) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package openonyx.features.hud;
|
||||||
|
|
||||||
|
import openonyx.history.DisplayNamed;
|
||||||
|
|
||||||
|
public enum StatsMode implements DisplayNamed {
|
||||||
|
PACKET_LOSS("Packet loss"),
|
||||||
|
FPS("FPS"),
|
||||||
|
SERVER("Server"),
|
||||||
|
PING("Ping"),
|
||||||
|
USERNAME("Username");
|
||||||
|
|
||||||
|
private final String e;
|
||||||
|
|
||||||
|
private static StatsMode[] L() {
|
||||||
|
StatsMode[] statsModes = new StatsMode[5];
|
||||||
|
boolean bl = true;
|
||||||
|
statsModes[0] = FPS;
|
||||||
|
statsModes[1] = USERNAME;
|
||||||
|
statsModes[2] = PING;
|
||||||
|
statsModes[3] = PACKET_LOSS;
|
||||||
|
statsModes[4] = SERVER;
|
||||||
|
return statsModes;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDisplayName() {
|
||||||
|
return this.e;
|
||||||
|
}
|
||||||
|
|
||||||
|
StatsMode(String string1) {
|
||||||
|
this.e = string1;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,785 @@
|
|||||||
|
package openonyx.features.hud;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.entity.AbstractClientPlayer;
|
||||||
|
import net.minecraft.client.gui.GuiChat;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.util.Vec3;
|
||||||
|
import openonyx.core.OnyxClient;
|
||||||
|
import openonyx.events.ChatFormattingUtils;
|
||||||
|
import openonyx.events.GeometryUtils;
|
||||||
|
import openonyx.features.Module;
|
||||||
|
import openonyx.features.ModuleCategory;
|
||||||
|
import openonyx.features.hud.internal.TargetHudElement;
|
||||||
|
import openonyx.features.hud.internal.TargetHudPlaceholders;
|
||||||
|
import openonyx.features.hud.internal.TargetHudPlaceholdersData;
|
||||||
|
import openonyx.features.hud.internal.TargetHudTextSettings;
|
||||||
|
import openonyx.history.internal.ActionSetting;
|
||||||
|
import openonyx.history.internal.EnumSetting;
|
||||||
|
import openonyx.history.internal.NumberSetting;
|
||||||
|
import openonyx.render.Render2D;
|
||||||
|
import openonyx.render.RenderSupport_120;
|
||||||
|
import openonyx.render.WorldToScreen;
|
||||||
|
import openonyx.render.group_d.Animation;
|
||||||
|
import openonyx.render.group_d.ColorAnimation;
|
||||||
|
import openonyx.render.group_d.Easings;
|
||||||
|
import openonyx.render.group_e.FontStyle;
|
||||||
|
import openonyx.render.group_e.TargetHudTextSettingsWeightMode;
|
||||||
|
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.AlphaLevels;
|
||||||
|
import openonyx.theme.Fonts;
|
||||||
|
import openonyx.theme.Palette;
|
||||||
|
import openonyx.theme.ThemeManager;
|
||||||
|
import openonyx.ui.TargetHudEditor;
|
||||||
|
import openonyx.ui.UiSupport_545;
|
||||||
|
import org.lwjgl.input.Mouse;
|
||||||
|
|
||||||
|
public class TargetHUD extends Module {
|
||||||
|
public TargetHudTextSettings targetHudTextSettings;
|
||||||
|
private static final float Ea = 1.0F;
|
||||||
|
private static final float La = 0.94F;
|
||||||
|
private static final float Ma = 3.0F;
|
||||||
|
public ActionSetting editLayout = new ActionSetting("Edit layout", () -> mc.displayGuiScreen(new TargetHudEditor(mc.currentScreen)))
|
||||||
|
.describe("Move, rescale, recolour and retitle the card's elements");
|
||||||
|
private final UiSupport_545 uiSupport_545;
|
||||||
|
private static final float Fa = 400.0F;
|
||||||
|
private float Ja;
|
||||||
|
private static final float ja = 9.0F;
|
||||||
|
private static final float ma = 0.5F;
|
||||||
|
private static final float da = 28.0F;
|
||||||
|
private final Animation animation;
|
||||||
|
private static final float Ka = 6.0F;
|
||||||
|
private float ha;
|
||||||
|
private float Ha;
|
||||||
|
private static final float ia = 8.0F;
|
||||||
|
public TargetHudTextSettings targetHudTextSettings2;
|
||||||
|
private final Animation animation2;
|
||||||
|
private static final float Ga = 8.0F;
|
||||||
|
private static final float ga = 1.0F;
|
||||||
|
private static final float ca = 100.0F;
|
||||||
|
public NumberSetting positionX;
|
||||||
|
private float T;
|
||||||
|
private final ColorAnimation colorAnimation;
|
||||||
|
public NumberSetting linger;
|
||||||
|
private boolean U;
|
||||||
|
public TargetHudTextSettings distanceM;
|
||||||
|
private static final float w = 8.0F;
|
||||||
|
private EntityLivingBase z;
|
||||||
|
private float v;
|
||||||
|
private final Animation animation3;
|
||||||
|
private static final float Z = 1.35F;
|
||||||
|
private static final float O = 0.8F;
|
||||||
|
private float N;
|
||||||
|
private static final float q = 12.0F;
|
||||||
|
private EntityLivingBase x;
|
||||||
|
private float u;
|
||||||
|
private static final float y = 0.55F;
|
||||||
|
private static final float n = 4.0F;
|
||||||
|
private List<TargetHudTextSettings> targetHudTextSettingsList;
|
||||||
|
private static final double r = 0.05;
|
||||||
|
private float W;
|
||||||
|
public EnumSetting<Position> position;
|
||||||
|
private float V;
|
||||||
|
private float R;
|
||||||
|
private final Animation animation4;
|
||||||
|
private long t;
|
||||||
|
private RoundedShapesData2 roundedShapesData2;
|
||||||
|
public NumberSetting opacity;
|
||||||
|
private static final float F = 2.0F;
|
||||||
|
private final RenderSupport_184 renderSupport_184;
|
||||||
|
private final Animation animation5;
|
||||||
|
private static final float K = 80.0F;
|
||||||
|
public TargetHudTextSettings name2;
|
||||||
|
private static final String C = " · ";
|
||||||
|
private static final float J = 0.5F;
|
||||||
|
private static final float D = 11.0F;
|
||||||
|
public TargetHudTextSettings status;
|
||||||
|
private boolean a;
|
||||||
|
private static final float k = 10.0F;
|
||||||
|
public NumberSetting heightOffset;
|
||||||
|
private boolean M;
|
||||||
|
private final Animation animation6;
|
||||||
|
public NumberSetting positionY;
|
||||||
|
private final ColorAnimation colorAnimation2;
|
||||||
|
public NumberSetting scale = new NumberSetting("Scale", 0.85, 0.5, 2.0, 0.05).withSuffix("x").describe("Card size");
|
||||||
|
private float l;
|
||||||
|
private static final float I = 0.3F;
|
||||||
|
public TargetHudTextSettings health;
|
||||||
|
private static final String i = "target-hud";
|
||||||
|
private static final float f = 62.0F;
|
||||||
|
private static final float H = 26.0F;
|
||||||
|
private static final int e = 3;
|
||||||
|
|
||||||
|
private float d() {
|
||||||
|
TargetHUD targetHUD1 = this;
|
||||||
|
long lx = System.nanoTime();
|
||||||
|
float fx = targetHUD1.t == 0L ? 16.0F : Math.min((float)(lx - targetHUD1.t) / 1000000.0F, 100.0F);
|
||||||
|
targetHUD1.t = lx;
|
||||||
|
return fx;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void L(Render2D render2D, Palette palette, TargetHUDData2 targetHUDData2, boolean bl) {
|
||||||
|
float fx = targetHUDData2.width();
|
||||||
|
float g = targetHUDData2.height();
|
||||||
|
int ix = AlphaLevels.L(3, palette);
|
||||||
|
render2D.shadow(0.0F, 0.0F, fx, g, 12.0F, 3);
|
||||||
|
RenderSupport_120.L(render2D, 0.0F, 0.0F, fx, g, 12.0F, ix);
|
||||||
|
render2D.pushAlpha(this.animation3.getValue());
|
||||||
|
|
||||||
|
for (TargetHUDData targetHUDData : targetHUDData2.parts()) {
|
||||||
|
switch (targetHUDData.L().getTargetHudElementMode()) {
|
||||||
|
case AVATAR:
|
||||||
|
while (false) {
|
||||||
|
}
|
||||||
|
|
||||||
|
this.L(render2D, palette, targetHUDData, ix);
|
||||||
|
break;
|
||||||
|
case BAR:
|
||||||
|
this.L(render2D, palette, targetHUDData, targetHUDData2.shield());
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
this.L(render2D, palette, targetHUDData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
render2D.popAlpha();
|
||||||
|
if (bl) {
|
||||||
|
this.uiSupport_545.L(render2D, 0.0F, 0.0F, fx, g, 12.0F, palette.onSurface());
|
||||||
|
}
|
||||||
|
|
||||||
|
render2D.roundedOutline(
|
||||||
|
0.0F, 0.0F, fx, g, 12.0F, 1.0F, ColorAnimation.L(palette.outlineVariant(), palette.primary(), bl ? this.animation4.getValue() : 0.0F)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void L(NumberSetting numberSetting, float f, float g) {
|
||||||
|
if (!(g <= 0.0F)) {
|
||||||
|
numberSetting.setValue(Math.clamp(fx / g, 0.0F, 1.0F) * 100.0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void L(Render2D render2D, Palette palette, TargetHUDData targetHUDData, float f) {
|
||||||
|
float g = targetHUDData.width();
|
||||||
|
float h = targetHUDData.height();
|
||||||
|
if (!(g <= 0.0F)) {
|
||||||
|
int ix = this.L(targetHUDData.settings(), palette);
|
||||||
|
float j;
|
||||||
|
if ((j = targetHUDData.settings().glow.getFloat()) > 0.0F) {
|
||||||
|
render2D.L(targetHUDData.x(), targetHUDData.y(), g * this.animation2.getValue(), h, Float.MAX_VALUE, j, 0.0F, ix);
|
||||||
|
}
|
||||||
|
|
||||||
|
float kx = this.L(render2D, targetHUDData, 0.0F, g, this.animation2.getValue() * g, ix);
|
||||||
|
if (targetHUDData.settings().absorption.isEnabled()) {
|
||||||
|
kx = this.L(render2D, targetHUDData, kx, g, fx * g, palette.tertiary());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (targetHUDData.settings().damageTrail.isEnabled()) {
|
||||||
|
kx = this.L(
|
||||||
|
render2D, targetHUDData, kx, g, (this.animation6.getValue() - this.animation2.getValue()) * g, ThemeManager.withAlpha(palette.error(), 0.55F)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
fx = kx > 0.0F ? kx + 3.0F : 0.0F;
|
||||||
|
if (g - fx > 0.5F) {
|
||||||
|
render2D.roundedRect(targetHUDData.x() + fx, targetHUDData.y(), g - fx, h, Float.MAX_VALUE, palette.surfaceContainerHighest());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private float L(FontStyle fontStyle) {
|
||||||
|
return fontStyle.i() * 1.35F;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TargetHUD() {
|
||||||
|
super("TargetHUD", "Card showing your target's health and distance", ModuleCategory.HUD);
|
||||||
|
this.linger = new NumberSetting("Linger", 1.0, 0.0, 3.0, 0.1).withSuffix("s").describe("How long the card holds a target it has lost");
|
||||||
|
this.targetHudTextSettings2 = new TargetHudTextSettings(TargetHudElement.AVATAR, true, "", () -> ThemeManager.getPalette().surfaceContainerHighest());
|
||||||
|
this.name2 = new TargetHudTextSettings(TargetHudElement.NAME, true, "{name}", () -> ThemeManager.getPalette().onSurface());
|
||||||
|
this.health = new TargetHudTextSettings(TargetHudElement.HEALTH, true, "{health}", () -> ThemeManager.getPalette().primary());
|
||||||
|
this.distanceM = new TargetHudTextSettings(TargetHudElement.DISTANCE, true, "{distance}m", () -> ThemeManager.getPalette().onSurfaceVariant());
|
||||||
|
this.status = new TargetHudTextSettings(TargetHudElement.STATUS, true, "{status}", () -> ThemeManager.getPalette().onSurfaceVariant());
|
||||||
|
this.targetHudTextSettings = new TargetHudTextSettings(TargetHudElement.HEALTH_BAR, true, "", () -> ThemeManager.getPalette().primary());
|
||||||
|
this.position = new EnumSetting<>("Position", Position.SCREEN).describe("Fixed on the screen, or floating above the target in the world");
|
||||||
|
this.heightOffset = new NumberSetting("Height offset", 0.6, -3.0, 3.0, 0.1)
|
||||||
|
.withSuffix("m")
|
||||||
|
.describe("How far above the target's head the card floats")
|
||||||
|
.visibleWhen(this.position, position -> positionx == Position.WORLD);
|
||||||
|
this.opacity = new NumberSetting("Opacity", 100.0, 5.0, 100.0, 1.0)
|
||||||
|
.withSuffix("%")
|
||||||
|
.describe("Overall opacity of the card - the rendered mob avatar is drawn by the game and stays solid");
|
||||||
|
this.positionX = new NumberSetting("Position X", 50.0, 0.0, 100.0, 0.01).visibleWhen(() -> false);
|
||||||
|
this.positionY = new NumberSetting("Position Y", 78.26, 0.0, 100.0, 0.01).visibleWhen(() -> false);
|
||||||
|
this.animation5 = new Animation(0.0F);
|
||||||
|
this.animation3 = new Animation(1.0F);
|
||||||
|
this.animation = new Animation(62.0F);
|
||||||
|
this.animation2 = new Animation(1.0F);
|
||||||
|
this.animation6 = new Animation(1.0F);
|
||||||
|
this.animation4 = new Animation(0.0F);
|
||||||
|
this.colorAnimation = new ColorAnimation(ThemeManager.getPalette().primary());
|
||||||
|
this.colorAnimation2 = new ColorAnimation(ThemeManager.getPalette().onSurfaceVariant());
|
||||||
|
this.uiSupport_545 = new UiSupport_545();
|
||||||
|
this.Ja = 1.0F;
|
||||||
|
this.roundedShapesData2 = RoundedShapes.ROUNDED_SHAPES_DATA2;
|
||||||
|
this.renderSupport_184 = new RenderSupport_184();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<TargetHudTextSettings> D() {
|
||||||
|
if (this.targetHudTextSettingsList == null) {
|
||||||
|
this.targetHudTextSettingsList = List.of(this.targetHudTextSettings2, this.name2, this.health, this.distanceM, this.status, this.targetHudTextSettings);
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.targetHudTextSettingsList;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String L(TargetHudTextSettings targetHudTextSettings, FontStyle fontStyle, TargetHudPlaceholdersData targetHudPlaceholdersData) {
|
||||||
|
String string = TargetHudPlaceholders.L(targetHudTextSettingsx.text.getValue(), targetHudPlaceholdersData, targetHudTextSettingsx.readout.getValue());
|
||||||
|
return TargetHudPlaceholders.L(fontStyle.L(), string);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean l() {
|
||||||
|
return this.isEnabled() && mc.thePlayer != null && mc.theWorld != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean L(boolean bl, float f, float g, float h, float i) {
|
||||||
|
TargetHUD targetHUD1 = this;
|
||||||
|
float j = Minecraft.getScaledMouseX() * h / mc.displayWidth;
|
||||||
|
float kx = ix - Minecraft.getScaledMouseY() * ix / mc.displayHeight - 1.0F;
|
||||||
|
boolean bl1 = targetHUD1.I();
|
||||||
|
boolean bl2 = targetHUD1.L((double)j, (double)kx);
|
||||||
|
TargetHUD targetHUD2;
|
||||||
|
if (bl && bl1) {
|
||||||
|
if (!targetHUD1.U && bl2) {
|
||||||
|
targetHUD1.M = true;
|
||||||
|
targetHUD1.ha = j - targetHUD1.T;
|
||||||
|
targetHUD1.Ha = kx - targetHUD1.l;
|
||||||
|
}
|
||||||
|
|
||||||
|
targetHUD2 = targetHUD1;
|
||||||
|
} else {
|
||||||
|
targetHUD2 = targetHUD1;
|
||||||
|
targetHUD1.M = false;
|
||||||
|
targetHUD1.roundedShapesData2 = RoundedShapes.ROUNDED_SHAPES_DATA2;
|
||||||
|
}
|
||||||
|
|
||||||
|
targetHUD2.U = bl1;
|
||||||
|
if (targetHUD1.M) {
|
||||||
|
targetHUD1.roundedShapesData2 = RoundedShapes.L(
|
||||||
|
j - targetHUD1.ha, kx - targetHUD1.Ha, targetHUD1.u, targetHUD1.W, h, ix, 10.0F, IconPaths.L("target-hud")
|
||||||
|
);
|
||||||
|
L(targetHUD1.positionX, targetHUD1.roundedShapesData2.x() - 10.0F, fx);
|
||||||
|
L(targetHUD1.positionY, targetHUD1.roundedShapesData2.y() - 10.0F, g);
|
||||||
|
}
|
||||||
|
|
||||||
|
return bl2;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void L(boolean bl, float f) {
|
||||||
|
EntityLivingBase entityLivingBase = bl ? mc.thePlayer : this.L();
|
||||||
|
if (entityLivingBase != null) {
|
||||||
|
this.x = entityLivingBase;
|
||||||
|
this.v = 0.0F;
|
||||||
|
} else {
|
||||||
|
if (this.x != null) {
|
||||||
|
this.v += fx;
|
||||||
|
if (this.v >= this.linger.getFloat() * 1000.0F) {
|
||||||
|
this.x = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private int L(TargetHudTextSettings targetHudTextSettings, Palette palette) {
|
||||||
|
if (!targetHudTextSettingsx.colour.d()) {
|
||||||
|
return targetHudTextSettingsx.colour.getValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (targetHudTextSettingsx.getTargetHudElement()) {
|
||||||
|
case AVATAR:
|
||||||
|
while (false) {
|
||||||
|
}
|
||||||
|
|
||||||
|
return palette.surfaceContainerHighest();
|
||||||
|
case NAME:
|
||||||
|
return palette.onSurface();
|
||||||
|
case HEALTH:
|
||||||
|
case HEALTH_BAR:
|
||||||
|
return this.colorAnimation.L();
|
||||||
|
case DISTANCE:
|
||||||
|
return palette.onSurfaceVariant();
|
||||||
|
case STATUS:
|
||||||
|
return this.colorAnimation2.L();
|
||||||
|
default:
|
||||||
|
throw new MatchException(null, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public float L() {
|
||||||
|
return this.scale.getFloat();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void d(float f, float g) {
|
||||||
|
this.T = Math.clamp(this.V - this.u * 0.5F, 10.0F, Math.max(10.0F, fx - this.u - 10.0F));
|
||||||
|
this.l = Math.clamp(this.R - this.W, 10.0F, Math.max(10.0F, g - this.W - 10.0F));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void L(float f, float g) {
|
||||||
|
if (fx < this.Ja) {
|
||||||
|
this.N = 0.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.Ja = fx;
|
||||||
|
this.animation2.animateTo(fx, 250.0F, Easings.EASING2);
|
||||||
|
this.animation2.update(g);
|
||||||
|
TargetHUD targetHUD1;
|
||||||
|
if (fx > this.animation6.getTarget()) {
|
||||||
|
targetHUD1 = this;
|
||||||
|
this.animation6.animateTo(fx, 250.0F, Easings.EASING2);
|
||||||
|
} else {
|
||||||
|
if (fx < this.animation6.getTarget()) {
|
||||||
|
this.N += g;
|
||||||
|
if (this.N >= 400.0F) {
|
||||||
|
this.animation6.animateTo(fx, 500.0F, Easings.EASING);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
targetHUD1 = this;
|
||||||
|
}
|
||||||
|
|
||||||
|
targetHUD1.animation6.update(g);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void L(Render2D render2D, Palette palette, TargetHUDData targetHUDData, int i) {
|
||||||
|
float fx = targetHUDData.x();
|
||||||
|
float g = targetHUDData.y();
|
||||||
|
float h = targetHUDData.width();
|
||||||
|
int j = this.L(targetHUDData.settings(), palette);
|
||||||
|
float kx;
|
||||||
|
if ((kx = targetHUDData.settings().glow.getFloat()) > 0.0F) {
|
||||||
|
render2D.L(fx, g, h, h, 4.0F, kx, 0.0F, j);
|
||||||
|
}
|
||||||
|
|
||||||
|
render2D.roundedRect(fx, g, h, h, 4.0F, j);
|
||||||
|
EntityLivingBase entityLivingBase = this.z;
|
||||||
|
Render2D render2D1;
|
||||||
|
if (this.z instanceof AbstractClientPlayer) {
|
||||||
|
AbstractClientPlayer abstractClientPlayer = (AbstractClientPlayer)entityLivingBase;
|
||||||
|
render2D1 = render2D;
|
||||||
|
render2D.drawPlayerHead(abstractClientPlayer.getLocationSkin(), fx, g, h);
|
||||||
|
} else {
|
||||||
|
int lx = (int)Math.max(1.0F, 0.8F * h / Math.max(0.5F, this.z.height));
|
||||||
|
render2D1 = render2D;
|
||||||
|
render2D.drawEntityFace(this.z, fx + h / 2.0F, g + h, lx);
|
||||||
|
}
|
||||||
|
|
||||||
|
render2D1.i(fx, g, h, h, 4.0F, ix);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static float L(NumberSetting numberSetting, float f) {
|
||||||
|
return fx <= 0.0F ? 0.0F : (float)(fx * numberSetting.getValue() / 100.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
private float L(Render2D render2D, TargetHUDData targetHUDData, float f, float g, float h, int i) {
|
||||||
|
float j = fx > 0.0F ? fx + 3.0F : 0.0F;
|
||||||
|
if ((g = Math.min(h, g - j)) <= 0.5F) {
|
||||||
|
return fx;
|
||||||
|
}
|
||||||
|
|
||||||
|
render2D.roundedRect(targetHUDData.x() + j, targetHUDData.y(), g, targetHUDData.height(), Float.MAX_VALUE, ix);
|
||||||
|
return j + g;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean L(float f, float g, float h) {
|
||||||
|
if (this.z == null || !this.z.isEntityAlive() || this.x == null) {
|
||||||
|
return this.L(fx, g);
|
||||||
|
} else if (!WorldToScreen.L()) {
|
||||||
|
return this.L(fx, g);
|
||||||
|
} else {
|
||||||
|
Vec3 vec3;
|
||||||
|
if ((vec3 = new Vec3(
|
||||||
|
this.z.lastTickPosX + (this.z.posX - this.z.lastTickPosX) * h,
|
||||||
|
this.z.lastTickPosY + (this.z.posY - this.z.lastTickPosY) * h + this.z.height + this.heightOffset.getFloat(),
|
||||||
|
this.z.lastTickPosZ + (this.z.posZ - this.z.lastTickPosZ) * h
|
||||||
|
))
|
||||||
|
.subtract(WorldToScreen.getVec3())
|
||||||
|
.dotProduct(WorldToScreen.getVec32())
|
||||||
|
<= 0.05) {
|
||||||
|
return this.a = false;
|
||||||
|
} else {
|
||||||
|
float[] j;
|
||||||
|
if ((j = WorldToScreen.L(vec3, fx, g)) == null) {
|
||||||
|
return this.a = false;
|
||||||
|
} else {
|
||||||
|
float ix = this.a ? 28.0F : 0.0F;
|
||||||
|
if (!(j[0] < -ix) && !(j[0] > fx + ix) && !(j[1] < -ix) && !(j[1] > g + ix)) {
|
||||||
|
this.V = j[0];
|
||||||
|
this.R = j[1];
|
||||||
|
this.a = true;
|
||||||
|
this.d(fx, g);
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
this.a = false;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void L(Render2D render2D, Palette palette, TargetHUDData targetHUDData) {
|
||||||
|
if (!targetHUDData.text().isEmpty()) {
|
||||||
|
FontStyle fontStyle = targetHUDData.style();
|
||||||
|
int ix = this.L(targetHUDData.settings(), palette);
|
||||||
|
float fx = targetHUDData.settings().glow.getFloat();
|
||||||
|
float g = targetHUDData.y() + targetHUDData.height() / 2.0F;
|
||||||
|
render2D.L(fontStyle, targetHUDData.text(), targetHUDData.x(), render2D.centerTextY(fontStyle, g), ix, fx);
|
||||||
|
render2D.drawTextVCentered(fontStyle, targetHUDData.text(), targetHUDData.x(), g, ix);
|
||||||
|
if (targetHUDData.settings().readout.getValue().L()) {
|
||||||
|
float h = this.L(fontStyle);
|
||||||
|
render2D.drawIcon("\ue87d", targetHUDData.x() + targetHUDData.width() - h / 2.0F, g, h, ix);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDisable() {
|
||||||
|
this.z = null;
|
||||||
|
this.x = null;
|
||||||
|
this.a = false;
|
||||||
|
this.M = false;
|
||||||
|
this.v = 0.0F;
|
||||||
|
this.t = 0L;
|
||||||
|
this.u = 0.0F;
|
||||||
|
this.W = 0.0F;
|
||||||
|
this.animation5.set(0.0F);
|
||||||
|
this.animation3.set(1.0F);
|
||||||
|
IconPaths.L("target-hud");
|
||||||
|
}
|
||||||
|
|
||||||
|
private EntityLivingBase L() {
|
||||||
|
EntityLivingBase entityLivingBase;
|
||||||
|
return (entityLivingBase = OnyxClient.moduleManager.killAura.getTarget()) != null && entityLivingBase.isEntityAlive() ? entityLivingBase : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean L(double d, double e) {
|
||||||
|
return d >= this.T && d < this.T + this.u && ex >= this.l && ex < this.l + this.W;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void L(List<TargetHUDData> list, TargetHudTextSettings targetHudTextSettings, String string, FontStyle fontStyle, float f, float g, float h, float i) {
|
||||||
|
if (targetHudTextSettingsx.h()) {
|
||||||
|
list.add(
|
||||||
|
new TargetHUDData(
|
||||||
|
targetHudTextSettingsx, string, fontStyle, fx + targetHudTextSettingsx.offsetX.getFloat(), g + targetHudTextSettingsx.offsetY.getFloat(), h, ix
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private float L(float f) {
|
||||||
|
TargetHUD targetHUD1 = this;
|
||||||
|
if (mc.thePlayer != null && targetHUD1.z != mc.thePlayer && mc.thePlayer.isEntityAlive() && targetHUD1.z.isEntityAlive() && Float.isFinite(fx)) {
|
||||||
|
float h = Math.max(mc.thePlayer.getMaxHealth(), 1.0F);
|
||||||
|
float ix = Math.clamp(mc.thePlayer.getHealth(), 0.0F, h);
|
||||||
|
float g = Math.max(mc.thePlayer.getAbsorptionAmount(), 0.0F);
|
||||||
|
return ix + g - fx;
|
||||||
|
} else {
|
||||||
|
return 0.0F;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private int L(Palette palette, boolean bl, float f) {
|
||||||
|
if (bl) {
|
||||||
|
return palette.primary();
|
||||||
|
} else {
|
||||||
|
float g;
|
||||||
|
if ((g = this.L(fx)) > 1.0F) {
|
||||||
|
return palette.primary();
|
||||||
|
} else {
|
||||||
|
return g < -1.0F ? palette.error() : palette.onSurfaceVariant();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private float L(TargetHudTextSettings targetHudTextSettings, FontStyle fontStyle) {
|
||||||
|
return targetHudTextSettingsx.readout.getValue().L() ? 2.0F + this.L(fontStyle) : 0.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void L(Render2D render2D, float f, float g, float h) {
|
||||||
|
TargetHUD targetHUD1 = this;
|
||||||
|
float ix = targetHUD1.d();
|
||||||
|
boolean bl = mc.currentScreen instanceof GuiChat;
|
||||||
|
targetHUD1.L(bl, ix);
|
||||||
|
targetHUD1.L(ix);
|
||||||
|
boolean bl2 = targetHUD1.x == null;
|
||||||
|
float o;
|
||||||
|
boolean bl4;
|
||||||
|
if (bl2) {
|
||||||
|
o = 0.0F;
|
||||||
|
bl4 = bl2;
|
||||||
|
} else {
|
||||||
|
o = 1.0F;
|
||||||
|
bl4 = bl2;
|
||||||
|
}
|
||||||
|
|
||||||
|
float nx;
|
||||||
|
boolean bl5;
|
||||||
|
if (bl4) {
|
||||||
|
nx = 200.0F;
|
||||||
|
bl5 = bl2;
|
||||||
|
} else {
|
||||||
|
nx = 300.0F;
|
||||||
|
bl5 = bl2;
|
||||||
|
}
|
||||||
|
|
||||||
|
targetHUD1.animation5.animateTo(o, nx, bl5 ? Easings.EASING : Easings.EASING7);
|
||||||
|
targetHUD1.animation5.update(ix);
|
||||||
|
if (targetHUD1.z == null) {
|
||||||
|
targetHUD1.u = 0.0F;
|
||||||
|
targetHUD1.W = 0.0F;
|
||||||
|
targetHUD1.U = targetHUD1.I();
|
||||||
|
IconPaths.L("target-hud");
|
||||||
|
} else {
|
||||||
|
RenderSupport_120.L();
|
||||||
|
Palette palette = ThemeManager.getPalette();
|
||||||
|
TargetHUDData2 targetHUDData2 = targetHUD1.L(render2D, palette, bl, ix);
|
||||||
|
float j = targetHUD1.scale.getFloat() * (0.94F + 0.060000002F * targetHUD1.animation5.getValue());
|
||||||
|
targetHUD1.u = targetHUDData2.width() * j;
|
||||||
|
targetHUD1.W = targetHUDData2.height() * j;
|
||||||
|
boolean bl1 = targetHUD1.position.is(Position.WORLD) && !bl && targetHUD1.L(fx, g, h);
|
||||||
|
boolean bl3 = false;
|
||||||
|
TargetHUD targetHUD3;
|
||||||
|
if (bl1) {
|
||||||
|
targetHUD3 = targetHUD1;
|
||||||
|
targetHUD1.U = targetHUD1.I();
|
||||||
|
targetHUD1.renderSupport_184.L(false);
|
||||||
|
IconPaths.L("target-hud");
|
||||||
|
} else {
|
||||||
|
float m = fx - targetHUD1.u - 20.0F;
|
||||||
|
float kx = g - targetHUD1.W - 20.0F;
|
||||||
|
targetHUD1.T = 10.0F + L(targetHUD1.positionX, m);
|
||||||
|
targetHUD1.l = 10.0F + L(targetHUD1.positionY, kx);
|
||||||
|
IconPaths.L("target-hud", targetHUD1.T, targetHUD1.l, targetHUD1.u, targetHUD1.W);
|
||||||
|
bl3 = targetHUD1.L(bl, m, kx, fx, g);
|
||||||
|
if (bl && bl3 && !targetHUD1.M) {
|
||||||
|
float[] lx;
|
||||||
|
if ((lx = targetHUD1.renderSupport_184.L(true))[0] != 0.0F || lx[1] != 0.0F) {
|
||||||
|
L(targetHUD1.positionX, L(targetHUD1.positionX, m) + lx[0], m);
|
||||||
|
L(targetHUD1.positionY, L(targetHUD1.positionY, kx) + lx[1], kx);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
targetHUD1.renderSupport_184.L(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
targetHUD3 = targetHUD1;
|
||||||
|
targetHUD1.T = 10.0F + L(targetHUD1.positionX, m);
|
||||||
|
targetHUD1.l = 10.0F + L(targetHUD1.positionY, kx);
|
||||||
|
}
|
||||||
|
|
||||||
|
targetHUD3.animation4.animateTo(bl ? 1.0F : 0.0F, 250.0F, Easings.EASING2);
|
||||||
|
targetHUD1.animation4.update(ix);
|
||||||
|
TargetHUD targetHUD2;
|
||||||
|
if (bl && bl3) {
|
||||||
|
bl4 = true;
|
||||||
|
targetHUD2 = targetHUD1;
|
||||||
|
} else {
|
||||||
|
bl4 = false;
|
||||||
|
targetHUD2 = targetHUD1;
|
||||||
|
}
|
||||||
|
|
||||||
|
targetHUD1.uiSupport_545.L(ix, bl4, targetHUD2.M);
|
||||||
|
if (targetHUD1.M) {
|
||||||
|
RoundedShapes.L(render2D, fx, g, targetHUD1.roundedShapesData2);
|
||||||
|
}
|
||||||
|
|
||||||
|
render2D.pushAlpha(targetHUD1.animation5.getValue());
|
||||||
|
render2D.pushAlpha(targetHUD1.opacity.getFloat() / 100.0F);
|
||||||
|
render2D.pushMatrix();
|
||||||
|
render2D.translate(targetHUD1.T, targetHUD1.l);
|
||||||
|
render2D.scaleAround(j, 0.0F, 0.0F);
|
||||||
|
targetHUD1.L(render2D, palette, targetHUDData2, true);
|
||||||
|
render2D.popMatrix();
|
||||||
|
render2D.popAlpha();
|
||||||
|
render2D.popAlpha();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void L(EntityLivingBase entityLivingBase) {
|
||||||
|
this.z = entityLivingBase;
|
||||||
|
this.a = false;
|
||||||
|
float fx = Math.clamp(entityLivingBase.getHealth() / Math.max(entityLivingBase.getMaxHealth(), 1.0F), 0.0F, 1.0F);
|
||||||
|
this.animation2.set(fx);
|
||||||
|
this.animation6.set(fx);
|
||||||
|
this.Ja = fx;
|
||||||
|
this.N = 0.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void L(Palette palette, boolean bl, float f, float g, float h) {
|
||||||
|
this.colorAnimation.L(fx <= 0.3F ? palette.error() : palette.primary(), 250.0F, Easings.EASING2);
|
||||||
|
this.colorAnimation.L(h);
|
||||||
|
this.colorAnimation2.L(this.L(palette, bl, g), 250.0F, Easings.EASING2);
|
||||||
|
this.colorAnimation2.L(h);
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean I() {
|
||||||
|
return Mouse.isButtonDown(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public TargetHUDData2 L(Render2D render2D, Palette palette, float f) {
|
||||||
|
if (mc.thePlayer == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.z = mc.thePlayer;
|
||||||
|
this.x = mc.thePlayer;
|
||||||
|
this.animation3.set(1.0F);
|
||||||
|
this.animation5.set(1.0F);
|
||||||
|
return this.L(render2D, palette, false, fx);
|
||||||
|
}
|
||||||
|
|
||||||
|
private String L(boolean bl, float f) {
|
||||||
|
if (bl) {
|
||||||
|
return "Drag to move";
|
||||||
|
} else {
|
||||||
|
float g;
|
||||||
|
if ((g = this.L(fx)) > 1.0F) {
|
||||||
|
return "Winning";
|
||||||
|
} else {
|
||||||
|
return g < -1.0F ? "Losing" : "Even";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean L(float f, float g) {
|
||||||
|
if (!this.a) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.d(fx, g);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TargetHUDData2 L(Render2D render2D, Palette palette, boolean bl, float f) {
|
||||||
|
TargetHUD targetHUD1 = this;
|
||||||
|
float xx = Math.max(targetHUD1.z.getMaxHealth(), 1.0F);
|
||||||
|
float ux = Math.clamp(targetHUD1.z.getHealth(), 0.0F, xx);
|
||||||
|
float g = Math.max(targetHUD1.z.getAbsorptionAmount(), 0.0F);
|
||||||
|
float h;
|
||||||
|
targetHUD1.L(h = ux / xx, fx);
|
||||||
|
targetHUD1.L(palette, bl, h, ux + g, fx);
|
||||||
|
boolean bl1 = targetHUD1.targetHudTextSettings.absorption.isEnabled();
|
||||||
|
TargetHudPlaceholdersData targetHudPlaceholdersData = new TargetHudPlaceholdersData(
|
||||||
|
ChatFormattingUtils.L(targetHUD1.z.getName()), ux + (bl1 ? g : 0.0F), xx, (float)Math.sqrt(GeometryUtils.L(targetHUD1.z)), targetHUD1.L(bl, ux + g)
|
||||||
|
);
|
||||||
|
FontStyle fontStyle3 = targetHUD1.L(targetHUD1.name2, Fonts.FONT_STYLE9);
|
||||||
|
FontStyle fontStyle = targetHUD1.L(targetHUD1.health, Fonts.FONT_STYLE9);
|
||||||
|
FontStyle fontStyle1 = targetHUD1.L(targetHUD1.distanceM, Fonts.FONT_STYLE8);
|
||||||
|
FontStyle fontStyle2 = targetHUD1.L(targetHUD1.status, Fonts.FONT_STYLE8);
|
||||||
|
String string = render2D.trimToWidth(
|
||||||
|
fontStyle3, targetHUD1.L(targetHUD1.name2, fontStyle3, targetHudPlaceholdersData), 80.0F * targetHUD1.name2.size.getFloat()
|
||||||
|
);
|
||||||
|
String string1 = targetHUD1.L(targetHUD1.health, fontStyle, targetHudPlaceholdersData);
|
||||||
|
String string3 = bl ? "" : targetHUD1.L(targetHUD1.distanceM, fontStyle1, targetHudPlaceholdersData);
|
||||||
|
String string2 = targetHUD1.L(targetHUD1.status, fontStyle2, targetHudPlaceholdersData);
|
||||||
|
if (targetHUD1.distanceM.h() && targetHUD1.status.h() && !string3.isEmpty()) {
|
||||||
|
string3 = new StringBuilder().insert(0, string3).append(" · ").toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
float ix = targetHUD1.targetHudTextSettings2.h() ? 26.0F * targetHUD1.targetHudTextSettings2.size.getFloat() : 0.0F;
|
||||||
|
float j = 11.0F + (targetHUD1.targetHudTextSettings2.h() ? ix + 9.0F : 0.0F);
|
||||||
|
float kx = targetHUD1.name2.h() ? render2D.getTextWidth(fontStyle3, string) : 0.0F;
|
||||||
|
float lx = targetHUD1.health.h() ? render2D.getTextWidth(fontStyle, string1) + targetHUD1.L(targetHUD1.health, fontStyle) : 0.0F;
|
||||||
|
float m = targetHUD1.distanceM.h() ? render2D.getTextWidth(fontStyle1, string3) : 0.0F;
|
||||||
|
float nx = targetHUD1.status.h() ? render2D.getTextWidth(fontStyle2, string2) : 0.0F;
|
||||||
|
float vx = kx + lx + (targetHUD1.name2.h() && targetHUD1.health.h() ? 8.0F : 0.0F);
|
||||||
|
float o = m + nx;
|
||||||
|
targetHUD1.animation.animateTo(Math.max(62.0F, Math.max(vx, o)), 300.0F, Easings.EASING2);
|
||||||
|
targetHUD1.animation.update(fx);
|
||||||
|
float wx = j + targetHUD1.animation.getValue() + 11.0F;
|
||||||
|
fx = targetHUD1.targetHudTextSettings.thickness.getFloat();
|
||||||
|
float zx;
|
||||||
|
TargetHUD targetHUD2;
|
||||||
|
if (targetHUD1.name2.h()) {
|
||||||
|
zx = fontStyle3.h();
|
||||||
|
targetHUD2 = targetHUD1;
|
||||||
|
} else {
|
||||||
|
zx = 0.0F;
|
||||||
|
targetHUD2 = targetHUD1;
|
||||||
|
}
|
||||||
|
|
||||||
|
o = Math.max(zx, targetHUD2.health.h() ? fontStyle.h() : 0.0F);
|
||||||
|
if (targetHUD1.distanceM.h()) {
|
||||||
|
zx = fontStyle1.h();
|
||||||
|
targetHUD2 = targetHUD1;
|
||||||
|
} else {
|
||||||
|
zx = 0.0F;
|
||||||
|
targetHUD2 = targetHUD1;
|
||||||
|
}
|
||||||
|
|
||||||
|
float p = Math.max(zx, targetHUD2.status.h() ? fontStyle2.h() : 0.0F);
|
||||||
|
float qx = o + p + (o > 0.0F && p > 0.0F ? 4.0F : 0.0F);
|
||||||
|
float rx = Math.max(ix, qx);
|
||||||
|
float s = 8.0F + (rx - ix) / 2.0F;
|
||||||
|
float tx;
|
||||||
|
o = (tx = 8.0F + (rx - qx) / 2.0F) + o / 2.0F;
|
||||||
|
p = tx + qx - p / 2.0F;
|
||||||
|
qx = 8.0F + rx + 6.0F;
|
||||||
|
rx = (targetHUD1.targetHudTextSettings.h() ? qx + fx : 8.0F + rx) + 8.0F;
|
||||||
|
ArrayList arrayList = new ArrayList(6);
|
||||||
|
targetHUD1.L(arrayList, targetHUD1.targetHudTextSettings2, null, null, 11.0F, s, ix, ix);
|
||||||
|
targetHUD1.L(arrayList, targetHUD1.name2, string, fontStyle3, j, o - fontStyle3.h() / 2.0F, kx, fontStyle3.h());
|
||||||
|
targetHUD1.L(arrayList, targetHUD1.health, string1, fontStyle, wx - 11.0F - lx, o - fontStyle.h() / 2.0F, lx, fontStyle.h());
|
||||||
|
targetHUD1.L(arrayList, targetHUD1.distanceM, string3, fontStyle1, j, p - fontStyle1.h() / 2.0F, m, fontStyle1.h());
|
||||||
|
targetHUD1.L(arrayList, targetHUD1.status, string2, fontStyle2, j + m, p - fontStyle2.h() / 2.0F, nx, fontStyle2.h());
|
||||||
|
targetHUD1.L(arrayList, targetHUD1.targetHudTextSettings, null, null, 11.0F, qx, Math.max(0.0F, wx - 22.0F), fx);
|
||||||
|
float yx = rx;
|
||||||
|
|
||||||
|
for (Iterator iterator1 = iterator = arrayList.iterator(); iterator1.hasNext(); iterator1 = iterator) {
|
||||||
|
TargetHUDData targetHUDData = (TargetHUDData)iterator.next();
|
||||||
|
yx = Math.max(yx, targetHUDData.y() + targetHUDData.height() + 8.0F);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new TargetHUDData2(wx, yx, arrayList, g / xx);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void h() {
|
||||||
|
this.x = this.z = null;
|
||||||
|
this.a = false;
|
||||||
|
this.animation5.set(0.0F);
|
||||||
|
}
|
||||||
|
|
||||||
|
private FontStyle L(TargetHudTextSettings targetHudTextSettings, FontStyle fontStyle) {
|
||||||
|
TargetHudTextSettingsWeightMode targetHudTextSettingsWeightMode = targetHudTextSettingsx.weight.getValue();
|
||||||
|
float fx;
|
||||||
|
return (fx = targetHudTextSettingsx.size.getFloat()) == 1.0F && targetHudTextSettingsWeightMode == fontStyle.weight()
|
||||||
|
? fontStyle
|
||||||
|
: new FontStyle(fontStyle.optical(), targetHudTextSettingsWeightMode, fontStyle.size() * fx, fontStyle.lineHeight() * fx);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void L(float f) {
|
||||||
|
this.animation3.update(fx);
|
||||||
|
if (this.x == this.z) {
|
||||||
|
if (this.z != null && this.animation3.getTarget() < 1.0F) {
|
||||||
|
this.animation3.animateTo(1.0F, 150.0F, Easings.EASING7);
|
||||||
|
}
|
||||||
|
} else if (this.x == null) {
|
||||||
|
if (this.animation5.isFinished() && this.animation5.getValue() <= 0.0F) {
|
||||||
|
this.z = null;
|
||||||
|
}
|
||||||
|
} else if (this.z == null || this.animation5.getValue() <= 0.0F) {
|
||||||
|
this.L(this.x);
|
||||||
|
this.animation3.set(1.0F);
|
||||||
|
} else if (this.animation3.getTarget() > 0.0F) {
|
||||||
|
this.animation3.animateTo(0.0F, 100.0F, Easings.EASING);
|
||||||
|
} else {
|
||||||
|
if (this.animation3.isFinished()) {
|
||||||
|
this.L(this.x);
|
||||||
|
this.animation3.set(0.0F).animateTo(1.0F, 150.0F, Easings.EASING7);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package openonyx.features.hud;
|
||||||
|
|
||||||
|
import openonyx.features.hud.internal.TargetHudElement;
|
||||||
|
import openonyx.features.hud.internal.TargetHudTextSettings;
|
||||||
|
import openonyx.render.group_e.FontStyle;
|
||||||
|
|
||||||
|
public record TargetHUDData(TargetHudTextSettings settings, String text, FontStyle style, float x, float y, float width, float height) {
|
||||||
|
public TargetHudElement L() {
|
||||||
|
return this.settings.getTargetHudElement();
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in new issue
Block a user