Upload files to "src/openonyx/features/hud"
This commit is contained in:
1 parent
26bef251bc
commit
694c0e984c
5 files changed
+910
No files matched your search
@@ -0,0 +1,6 @@
|
|||||||
|
package openonyx.features.hud;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public record TargetHUDData2(float width, float height, List<TargetHUDData> parts, float shield) {
|
||||||
|
}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
package openonyx.features.hud;
|
||||||
|
|
||||||
|
import openonyx.features.hud.internal.TargetHudElement;
|
||||||
|
import openonyx.features.hud.internal.TargetHudElementMode;
|
||||||
|
|
||||||
|
// $VF: synthetic class
|
||||||
|
class TargetHUDPart {
|
||||||
|
static {
|
||||||
|
int[] i = new int[TargetHudElement.values().length];
|
||||||
|
boolean bl = true;
|
||||||
|
e = i;
|
||||||
|
|
||||||
|
try {
|
||||||
|
e[TargetHudElement.AVATAR.ordinal()] = 1;
|
||||||
|
} catch (NoSuchFieldError noSuchFieldError7) {
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
e[TargetHudElement.NAME.ordinal()] = 2;
|
||||||
|
} catch (NoSuchFieldError noSuchFieldError6) {
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
e[TargetHudElement.HEALTH.ordinal()] = 3;
|
||||||
|
} catch (NoSuchFieldError noSuchFieldError5) {
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
e[TargetHudElement.HEALTH_BAR.ordinal()] = 4;
|
||||||
|
} catch (NoSuchFieldError noSuchFieldError4) {
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
e[TargetHudElement.DISTANCE.ordinal()] = 5;
|
||||||
|
} catch (NoSuchFieldError noSuchFieldError3) {
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
e[TargetHudElement.STATUS.ordinal()] = 6;
|
||||||
|
} catch (NoSuchFieldError noSuchFieldError2) {
|
||||||
|
}
|
||||||
|
|
||||||
|
i = new int[TargetHudElementMode.values().length];
|
||||||
|
bl = true;
|
||||||
|
H = i;
|
||||||
|
|
||||||
|
try {
|
||||||
|
H[TargetHudElementMode.AVATAR.ordinal()] = 1;
|
||||||
|
} catch (NoSuchFieldError noSuchFieldError1) {
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
H[TargetHudElementMode.BAR.ordinal()] = 2;
|
||||||
|
} catch (NoSuchFieldError noSuchFieldError) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,835 @@
|
|||||||
|
package openonyx.features.hud;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.IdentityHashMap;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.Set;
|
||||||
|
import meteordevelopment.orbit.EventHandler;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.gui.GuiChat;
|
||||||
|
import net.minecraft.util.BlockPos;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import openonyx.configuration.internal.PacketDirection;
|
||||||
|
import openonyx.configuration.internal.PacketEvent;
|
||||||
|
import openonyx.core.OnyxClient;
|
||||||
|
import openonyx.features.Module;
|
||||||
|
import openonyx.features.ModuleCategory;
|
||||||
|
import openonyx.features.combat.BedBreaker;
|
||||||
|
import openonyx.features.player.Scaffold;
|
||||||
|
import openonyx.history.internal.BooleanSetting;
|
||||||
|
import openonyx.history.internal.MultiEnumSetting;
|
||||||
|
import openonyx.history.internal.NumberSetting;
|
||||||
|
import openonyx.music.NowPlayingService;
|
||||||
|
import openonyx.music.TrackInfo;
|
||||||
|
import openonyx.render.Render2D;
|
||||||
|
import openonyx.render.RenderSupport_120;
|
||||||
|
import openonyx.render.TextureFilter;
|
||||||
|
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.AlphaLevels;
|
||||||
|
import openonyx.theme.Fonts;
|
||||||
|
import openonyx.theme.Palette;
|
||||||
|
import openonyx.theme.ThemeManager;
|
||||||
|
import openonyx.ui.UiSupport_545;
|
||||||
|
import org.lwjgl.input.Mouse;
|
||||||
|
|
||||||
|
public final class Watermark extends Module {
|
||||||
|
public BooleanSetting nowPlaying;
|
||||||
|
private static final float sa = 9.0F;
|
||||||
|
private static final float na = 6.0F;
|
||||||
|
private static final float Za = 2.0F;
|
||||||
|
private static final int Xa = 256;
|
||||||
|
private RoundedShapesData2 roundedShapesData2;
|
||||||
|
public NumberSetting hold;
|
||||||
|
public NumberSetting statsX;
|
||||||
|
private float wa;
|
||||||
|
private static final float Oa = 2.5F;
|
||||||
|
private static final float oa = 3.5F;
|
||||||
|
private static final float ta = 2.0F;
|
||||||
|
private final Animation animation;
|
||||||
|
private static final float ra = 8.0F;
|
||||||
|
private static final float za = 7.0F;
|
||||||
|
private static final float Pa = 1.0F;
|
||||||
|
private static final float Na = 6.0F;
|
||||||
|
private final NowPlayingService nowPlayingService;
|
||||||
|
private float ka;
|
||||||
|
private final StatsIsland statsIsland;
|
||||||
|
private static final float Aa = 3.0F;
|
||||||
|
private static final float Ca = 6.0F;
|
||||||
|
private static final float Ba = 0.94F;
|
||||||
|
private final ColorAnimation colorAnimation;
|
||||||
|
private static final float Ea = 5.0F;
|
||||||
|
private final Animation animation2;
|
||||||
|
private float Ma;
|
||||||
|
private final Animation animation3;
|
||||||
|
private boolean Ia;
|
||||||
|
private static final int Fa = 3;
|
||||||
|
private static final String Ja = "watermark";
|
||||||
|
private float ja;
|
||||||
|
private static final float ma = 11.0F;
|
||||||
|
private static final float da = 0.5F;
|
||||||
|
public NumberSetting lowBlocks;
|
||||||
|
private WatermarkData3 watermarkData3;
|
||||||
|
private final UiSupport_545 uiSupport_545;
|
||||||
|
public NumberSetting positionY;
|
||||||
|
private WatermarkData2 watermarkData2;
|
||||||
|
private static final float Da = 16.695652F;
|
||||||
|
private final Animation animation4;
|
||||||
|
private static final float Ga = 12.0F;
|
||||||
|
private long ga;
|
||||||
|
private final Animation animation5;
|
||||||
|
private boolean Q;
|
||||||
|
private static final float T = 22.0F;
|
||||||
|
private WatermarkData4 watermarkData4;
|
||||||
|
private static final float o = 12.0F;
|
||||||
|
private static final int U = 184;
|
||||||
|
private String X;
|
||||||
|
private String w;
|
||||||
|
private static final float z = 8.0F;
|
||||||
|
private static final float v = 22.0F;
|
||||||
|
public NumberSetting scale = new NumberSetting("Scale", 1.0, 0.5, 2.0, 0.05).withSuffix("x").describe("Island size");
|
||||||
|
public BooleanSetting scaffoldBlocks;
|
||||||
|
private float O;
|
||||||
|
private static final float N = 10.0F;
|
||||||
|
private static final float q = 6.0F;
|
||||||
|
private static final ResourceLocation x = new ResourceLocation("onyx", "textures/gui/logo.png");
|
||||||
|
private static final float u = 12.0F;
|
||||||
|
private static final float y = 6.0F;
|
||||||
|
private static final float n = 90.0F;
|
||||||
|
private static final int Y = 3;
|
||||||
|
public BooleanSetting moduleToggles = new BooleanSetting("Module toggles", true).describe("Announce modules turning on and off");
|
||||||
|
private float W;
|
||||||
|
private static final float P = 3.0F;
|
||||||
|
private float V;
|
||||||
|
private float R;
|
||||||
|
private final ColorAnimation colorAnimation2;
|
||||||
|
private static final float t = 10.0F;
|
||||||
|
private static final float b = 5.0F;
|
||||||
|
private float E;
|
||||||
|
private static final float F = 30.0F;
|
||||||
|
private static final float G = 5.0F;
|
||||||
|
public MultiEnumSetting<StatsMode> stats;
|
||||||
|
public NumberSetting positionX;
|
||||||
|
private boolean B;
|
||||||
|
private boolean C;
|
||||||
|
private float J;
|
||||||
|
private static final float D = 0.007F;
|
||||||
|
private final RenderSupport_184 renderSupport_184;
|
||||||
|
private static final WatermarkData WATERMARK_DATA = L(WatermarkMode.TOGGLE, "Drag to move", "", true);
|
||||||
|
private final Animation animation6;
|
||||||
|
private static final float g = 100.0F;
|
||||||
|
private String M;
|
||||||
|
private int L;
|
||||||
|
private WatermarkData watermarkData;
|
||||||
|
private static final float m = 2.0F;
|
||||||
|
private static final float h = 54.0F;
|
||||||
|
private static final WatermarkData WATERMARK_DATA2 = L(WatermarkMode.IDLE, "onyx", "", true);
|
||||||
|
private static final float I = 4.5F;
|
||||||
|
private final Animation animation7;
|
||||||
|
private final ColorAnimation colorAnimation3;
|
||||||
|
private WatermarkData watermarkData5;
|
||||||
|
public NumberSetting statsY;
|
||||||
|
private final Set<Module> modules;
|
||||||
|
|
||||||
|
private void L(Render2D render2D, Palette palette, float f, float g, float h) {
|
||||||
|
f += 2.0F;
|
||||||
|
float j;
|
||||||
|
float k = j = gx - 7.0F - 2.0F;
|
||||||
|
render2D.drawTextVCentered(Fonts.FONT_STYLE8, this.watermarkData5.badge(), f, 11.0F, palette.onSurfaceVariant());
|
||||||
|
render2D.pushAlpha(this.animation.getValue());
|
||||||
|
render2D.pushMatrix();
|
||||||
|
render2D.translate(0.0F, (1.0F - this.animation.getValue()) * 5.0F * this.Ma);
|
||||||
|
render2D.drawTextRightVCentered(Fonts.FONT_STYLE9, this.watermarkData5.text(), j, 11.0F, this.colorAnimation.L());
|
||||||
|
render2D.popMatrix();
|
||||||
|
render2D.popAlpha();
|
||||||
|
gx = k - f;
|
||||||
|
hx = hx - 8.0F - 3.0F;
|
||||||
|
float i = gx * this.animation5.getValue();
|
||||||
|
render2D.roundedRect(f, hx, gx, 3.0F, Float.MAX_VALUE, palette.surfaceContainerHighest());
|
||||||
|
if (i > 0.5F) {
|
||||||
|
render2D.roundedRect(f, hx, i, 3.0F, Float.MAX_VALUE, this.colorAnimation3.L());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void i(Render2D render2D, Palette palette, float f, float g) {
|
||||||
|
float hx = gx - 6.0F;
|
||||||
|
float i;
|
||||||
|
float j = i = f * this.watermarkData5.progress();
|
||||||
|
render2D.pushScissor(0.0F, hx, f, 6.0F);
|
||||||
|
render2D.roundedOutline(0.0F, 0.0F, f, gx, Float.MAX_VALUE, 2.5F, palette.surfaceContainerHighest());
|
||||||
|
render2D.popScissor();
|
||||||
|
if (!(j <= 0.5F)) {
|
||||||
|
render2D.pushScissor(0.0F, hx, i, 6.0F);
|
||||||
|
render2D.roundedOutline(0.0F, 0.0F, f, gx, Float.MAX_VALUE, 2.5F, palette.primary());
|
||||||
|
render2D.popScissor();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public StatsIsland getStatsIsland() {
|
||||||
|
return this.statsIsland;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void L(Render2D render2D, float f, WatermarkData watermarkData) {
|
||||||
|
this.animation6.animateTo(Math.max(22.0F, this.L(render2D, watermarkDatax)), 200.0F, Easings.EASING2);
|
||||||
|
this.animation7.animateTo(watermarkDatax.kind() == WatermarkMode.GAUGE ? 30.0F : 22.0F, 200.0F, Easings.EASING2);
|
||||||
|
this.animation6.update(f);
|
||||||
|
this.animation7.update(f);
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean H() {
|
||||||
|
return this.animation4.getTarget() <= 0.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void L(Palette palette, float f) {
|
||||||
|
Watermark watermark1 = this;
|
||||||
|
watermark1.colorAnimation2.L(palette.outlineVariant(), 400.0F, Easings.EASING2);
|
||||||
|
watermark1.colorAnimation2.L(f);
|
||||||
|
boolean bl = watermark1.watermarkData4 != null && watermark1.watermarkData4.alert();
|
||||||
|
watermark1.colorAnimation.L(bl ? palette.error() : palette.onSurface(), 250.0F, Easings.EASING2);
|
||||||
|
watermark1.colorAnimation.L(f);
|
||||||
|
watermark1.colorAnimation3.L(bl ? palette.error() : palette.primary(), 250.0F, Easings.EASING2);
|
||||||
|
watermark1.colorAnimation3.L(f);
|
||||||
|
}
|
||||||
|
|
||||||
|
public TrackInfo L() {
|
||||||
|
return this.watermarkData2 == null ? null : this.nowPlayingService.L();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void L(Render2D render2D, Palette palette, int i, float f) {
|
||||||
|
Watermark watermark1 = this;
|
||||||
|
float gx = f / 2.0F;
|
||||||
|
float k = Math.min(16.695652F, f - 9.0F);
|
||||||
|
float hx = 7.0F + (16.695652F - k) / 2.0F;
|
||||||
|
float j = gx - k / 2.0F;
|
||||||
|
if (watermark1.watermarkData5.art() != null) {
|
||||||
|
render2D.L(watermark1.watermarkData5.art(), hx, j, k, k, 0.0F, 0.0F, 1.0F, 1.0F, 1, 1, -1, TextureFilter.MINIFIED);
|
||||||
|
render2D.i(hx, j, k, k, 3.5F, i);
|
||||||
|
} else {
|
||||||
|
render2D.drawIcon("\ue405", 15.347826F, gx, 12.0F, palette.onSurfaceVariant());
|
||||||
|
}
|
||||||
|
|
||||||
|
float mx = 29.695652F;
|
||||||
|
String string = render2D.trimToWidth(Fonts.FONT_STYLE9, watermark1.M, 90.0F);
|
||||||
|
watermark1.L(render2D, palette, mx, gx, string, f);
|
||||||
|
float l = mx + render2D.getTextWidth(Fonts.FONT_STYLE9, string) + 6.0F;
|
||||||
|
watermark1.d(render2D, palette, l, gx);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void D(float f) {
|
||||||
|
this.animation4.update(f);
|
||||||
|
if (L(this.watermarkData, this.watermarkData5)) {
|
||||||
|
this.watermarkData5 = this.watermarkData;
|
||||||
|
if (this.animation4.getTarget() < 1.0F) {
|
||||||
|
this.animation4.animateTo(1.0F, 200.0F, Easings.EASING4);
|
||||||
|
}
|
||||||
|
} else if (this.animation2.getValue() <= 0.0F) {
|
||||||
|
this.watermarkData5 = this.watermarkData;
|
||||||
|
this.animation4.set(1.0F);
|
||||||
|
} else if (this.animation4.getTarget() > 0.0F) {
|
||||||
|
this.animation4.animateTo(0.0F, 50.0F, Easings.EASING);
|
||||||
|
} else {
|
||||||
|
if (this.animation4.isFinished()) {
|
||||||
|
this.watermarkData5 = this.watermarkData;
|
||||||
|
this.animation4.set(0.0F).animateTo(1.0F, 200.0F, Easings.EASING4);
|
||||||
|
if (this.watermarkData5.kind() == WatermarkMode.TOGGLE && !this.watermarkData5.badge().isEmpty()) {
|
||||||
|
this.d(this.watermarkData5.positive());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void L(boolean bl, float f) {
|
||||||
|
if (bl) {
|
||||||
|
this.watermarkData = WATERMARK_DATA;
|
||||||
|
} else {
|
||||||
|
if (this.watermarkData3 != null) {
|
||||||
|
this.R -= f;
|
||||||
|
if (this.R > 0.0F) {
|
||||||
|
WatermarkMode watermarkMode = WatermarkMode.TOGGLE;
|
||||||
|
String string = this.watermarkData3.name();
|
||||||
|
String string1;
|
||||||
|
Watermark watermark1;
|
||||||
|
if (this.watermarkData3.positive()) {
|
||||||
|
string1 = "ON";
|
||||||
|
watermark1 = this;
|
||||||
|
} else {
|
||||||
|
string1 = "OFF";
|
||||||
|
watermark1 = this;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.watermarkData = L(watermarkMode, string, string1, watermark1.watermarkData3.positive());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.watermarkData3 = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.watermarkData4 != null) {
|
||||||
|
this.watermarkData = L(WatermarkMode.GAUGE, this.watermarkData4.value(), this.watermarkData4.label(), !this.watermarkData4.alert());
|
||||||
|
} else if (this.watermarkData2 != null) {
|
||||||
|
this.watermarkData = new WatermarkData(
|
||||||
|
WatermarkMode.MUSIC,
|
||||||
|
this.watermarkData2.title(),
|
||||||
|
this.watermarkData2.artist(),
|
||||||
|
true,
|
||||||
|
this.watermarkData2.art(),
|
||||||
|
this.watermarkData2.progress(),
|
||||||
|
this.watermarkData2.playing()
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
this.watermarkData = WATERMARK_DATA2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static WatermarkData L(WatermarkMode watermarkMode, String string, String string1, boolean bl) {
|
||||||
|
return new WatermarkData(watermarkMode, string, string1, bl, null, 0.0F, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onEnable() {
|
||||||
|
this.Q = this.Ia = false;
|
||||||
|
this.ga = 0L;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDisable() {
|
||||||
|
this.statsIsland.L();
|
||||||
|
this.Ia = true;
|
||||||
|
this.B = false;
|
||||||
|
this.watermarkData3 = null;
|
||||||
|
this.R = 0.0F;
|
||||||
|
this.watermarkData4 = null;
|
||||||
|
this.X = null;
|
||||||
|
this.V = 0.0F;
|
||||||
|
this.L = 0;
|
||||||
|
this.modules.clear();
|
||||||
|
this.watermarkData5 = WATERMARK_DATA2;
|
||||||
|
this.watermarkData = WATERMARK_DATA2;
|
||||||
|
this.animation4.set(1.0F);
|
||||||
|
this.watermarkData2 = null;
|
||||||
|
this.M = "";
|
||||||
|
this.w = "";
|
||||||
|
this.animation3.set(1.0F);
|
||||||
|
this.nowPlayingService.D();
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
private void onPacket(PacketEvent packetEvent) {
|
||||||
|
if (packetEvent.getPacketDirection() == PacketDirection.INCOMING) {
|
||||||
|
this.statsIsland.L(packetEvent.getPacket());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void F() {
|
||||||
|
Watermark watermark1 = this;
|
||||||
|
boolean bl = watermark1.isEnabled() && watermark1.nowPlaying.isEnabled() && watermark1.nowPlayingService.L();
|
||||||
|
if (!bl) {
|
||||||
|
watermark1.nowPlayingService.D();
|
||||||
|
watermark1.watermarkData2 = null;
|
||||||
|
} else {
|
||||||
|
watermark1.nowPlayingService.d();
|
||||||
|
TrackInfo trackInfo;
|
||||||
|
if ((trackInfo = watermark1.nowPlayingService.L()) != null && trackInfo.title() != null && !trackInfo.title().isEmpty()) {
|
||||||
|
watermark1.watermarkData2 = new WatermarkData2(trackInfo.title(), trackInfo.artist(), trackInfo.art(), trackInfo.L(), trackInfo.playing());
|
||||||
|
} else {
|
||||||
|
watermark1.watermarkData2 = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void L(Render2D render2D, float f, float g) {
|
||||||
|
Watermark watermark1 = this;
|
||||||
|
float mx = watermark1.L();
|
||||||
|
boolean bl = watermark1.isEnabled() && mc.currentScreen instanceof GuiChat;
|
||||||
|
watermark1.O = (watermark1.O + mx) % 100000.0F;
|
||||||
|
watermark1.h();
|
||||||
|
watermark1.L(mx);
|
||||||
|
watermark1.F();
|
||||||
|
watermark1.L(bl, mx);
|
||||||
|
watermark1.D(mx);
|
||||||
|
watermark1.d(mx);
|
||||||
|
Animation animationx = watermark1.animation2;
|
||||||
|
float p;
|
||||||
|
Watermark watermark2;
|
||||||
|
if (watermark1.isEnabled()) {
|
||||||
|
p = 1.0F;
|
||||||
|
watermark2 = watermark1;
|
||||||
|
} else {
|
||||||
|
p = 0.0F;
|
||||||
|
watermark2 = watermark1;
|
||||||
|
}
|
||||||
|
|
||||||
|
float ox;
|
||||||
|
Watermark watermark3;
|
||||||
|
if (watermark2.isEnabled()) {
|
||||||
|
ox = 300.0F;
|
||||||
|
watermark3 = watermark1;
|
||||||
|
} else {
|
||||||
|
ox = 200.0F;
|
||||||
|
watermark3 = watermark1;
|
||||||
|
}
|
||||||
|
|
||||||
|
animationx.animateTo(p, ox, watermark3.isEnabled() ? Easings.EASING7 : Easings.EASING);
|
||||||
|
watermark1.animation2.update(mx);
|
||||||
|
if (!watermark1.isEnabled() && watermark1.animation2.isFinished() && watermark1.animation2.getValue() <= 0.0F) {
|
||||||
|
watermark1.l();
|
||||||
|
watermark1.C = watermark1.k();
|
||||||
|
} else {
|
||||||
|
RenderSupport_120.L();
|
||||||
|
Palette palette = ThemeManager.getPalette();
|
||||||
|
watermark1.L(palette, mx);
|
||||||
|
WatermarkData watermarkDatax = watermark1.H() ? watermark1.watermarkData5 : watermark1.watermarkData;
|
||||||
|
watermark1.L(render2D, mx, watermarkDatax);
|
||||||
|
float nx = watermark1.scale.getFloat() * (0.94F + 0.060000002F * watermark1.animation2.getValue());
|
||||||
|
float hx = 36.695652F + watermark1.animation6.getValue();
|
||||||
|
float i = watermark1.animation7.getValue();
|
||||||
|
watermark1.ja = hx * nx;
|
||||||
|
watermark1.E = i * nx;
|
||||||
|
float j = f - watermark1.ja - 20.0F;
|
||||||
|
float k = gx - watermark1.E - 20.0F;
|
||||||
|
watermark1.W = 10.0F + L(watermark1.positionX, j);
|
||||||
|
watermark1.ka = 10.0F + L(watermark1.positionY, k);
|
||||||
|
IconPaths.L("watermark", watermark1.W, watermark1.ka, watermark1.ja, watermark1.E);
|
||||||
|
boolean bl1 = watermark1.L(bl, j, k, f, gx);
|
||||||
|
if (bl && bl1 && !watermark1.B) {
|
||||||
|
float[] l;
|
||||||
|
if ((l = watermark1.renderSupport_184.L(true))[0] != 0.0F || l[1] != 0.0F) {
|
||||||
|
L(watermark1.positionX, L(watermark1.positionX, j) + l[0], j);
|
||||||
|
L(watermark1.positionY, L(watermark1.positionY, k) + l[1], k);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
watermark1.renderSupport_184.L(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
watermark1.W = 10.0F + L(watermark1.positionX, j);
|
||||||
|
watermark1.ka = 10.0F + L(watermark1.positionY, k);
|
||||||
|
boolean bl2;
|
||||||
|
if (bl && bl1) {
|
||||||
|
bl2 = true;
|
||||||
|
watermark3 = watermark1;
|
||||||
|
} else {
|
||||||
|
bl2 = false;
|
||||||
|
watermark3 = watermark1;
|
||||||
|
}
|
||||||
|
|
||||||
|
watermark1.uiSupport_545.L(mx, bl2, watermark3.B);
|
||||||
|
if (watermark1.B) {
|
||||||
|
RoundedShapes.L(render2D, f, gx, watermark1.roundedShapesData2);
|
||||||
|
}
|
||||||
|
|
||||||
|
render2D.pushAlpha(watermark1.animation2.getValue());
|
||||||
|
render2D.pushMatrix();
|
||||||
|
render2D.translate(watermark1.W, watermark1.ka + (1.0F - watermark1.animation2.getValue()) * 5.0F);
|
||||||
|
render2D.scaleAround(nx, 0.0F, 0.0F);
|
||||||
|
watermark1.D(render2D, palette, hx, i);
|
||||||
|
render2D.popMatrix();
|
||||||
|
render2D.popAlpha();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean k() {
|
||||||
|
return Mouse.isButtonDown(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void L(Render2D render2D, Palette palette, float f, float g, String string, float h) {
|
||||||
|
Watermark watermark1 = this;
|
||||||
|
float i;
|
||||||
|
if ((i = watermark1.animation3.getValue()) >= 0.999F) {
|
||||||
|
render2D.drawTextVCentered(Fonts.FONT_STYLE9, string, f, gx, palette.onSurface());
|
||||||
|
} else {
|
||||||
|
render2D.pushScissor(f, 0.0F, 102.0F, hx);
|
||||||
|
if (!watermark1.w.isEmpty()) {
|
||||||
|
String string1 = render2D.trimToWidth(Fonts.FONT_STYLE9, watermark1.w, 90.0F);
|
||||||
|
render2D.pushAlpha(1.0F - i);
|
||||||
|
render2D.drawTextVCentered(Fonts.FONT_STYLE9, string1, f - 12.0F * i, gx, palette.onSurface());
|
||||||
|
render2D.popAlpha();
|
||||||
|
}
|
||||||
|
|
||||||
|
render2D.pushAlpha(i);
|
||||||
|
render2D.drawTextVCentered(Fonts.FONT_STYLE9, string, f + 12.0F * (1.0F - i), gx, palette.onSurface());
|
||||||
|
render2D.popAlpha();
|
||||||
|
render2D.popScissor();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void d(float f) {
|
||||||
|
if (this.watermarkData5.kind() != WatermarkMode.MUSIC) {
|
||||||
|
this.M = this.watermarkData5.text();
|
||||||
|
this.animation3.set(1.0F);
|
||||||
|
} else {
|
||||||
|
if (!this.watermarkData5.text().equals(this.M)) {
|
||||||
|
this.w = this.M;
|
||||||
|
this.M = this.watermarkData5.text();
|
||||||
|
this.animation3.set(0.0F).animateTo(1.0F, 250.0F, Easings.EASING7);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.animation3.update(f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void D(Render2D render2D, Palette palette, float f, float g) {
|
||||||
|
int i = AlphaLevels.L(3, palette);
|
||||||
|
render2D.shadow(0.0F, 0.0F, f, gx, Float.MAX_VALUE, 3);
|
||||||
|
RenderSupport_120.L(render2D, 0.0F, 0.0F, f, gx, Float.MAX_VALUE, i);
|
||||||
|
boolean bl = this.watermarkData5.kind() == WatermarkMode.MUSIC;
|
||||||
|
if (!bl) {
|
||||||
|
render2D.L(x, 7.0F, (gx - 12.0F) / 2.0F, 16.695652F, 12.0F, 0.0F, 0.0F, 256.0F, 184.0F, 256, 184, palette.primary(), TextureFilter.MINIFIED);
|
||||||
|
}
|
||||||
|
|
||||||
|
render2D.pushAlpha(this.animation4.getValue());
|
||||||
|
render2D.pushMatrix();
|
||||||
|
render2D.translate(0.0F, (1.0F - this.animation4.getValue()) * 6.0F);
|
||||||
|
render2D.pushScissor(0.0F, 0.0F, f, gx);
|
||||||
|
Render2D render2D1;
|
||||||
|
if (bl) {
|
||||||
|
render2D1 = render2D;
|
||||||
|
this.L(render2D, palette, i, gx);
|
||||||
|
} else {
|
||||||
|
float hx = 29.695652F;
|
||||||
|
switch (this.watermarkData5.kind()) {
|
||||||
|
case IDLE:
|
||||||
|
render2D1 = render2D;
|
||||||
|
|
||||||
|
while (false) {
|
||||||
|
}
|
||||||
|
|
||||||
|
render2D.drawTextVCentered(Fonts.FONT_STYLE9, this.watermarkData5.text(), hx, gx / 2.0F, palette.onSurface());
|
||||||
|
break;
|
||||||
|
case MUSIC:
|
||||||
|
this.L(render2D, palette, hx, gx / 2.0F);
|
||||||
|
render2D1 = render2D;
|
||||||
|
break;
|
||||||
|
case GAUGE:
|
||||||
|
this.L(render2D, palette, hx, f, gx);
|
||||||
|
render2D1 = render2D;
|
||||||
|
break;
|
||||||
|
case TOGGLE:
|
||||||
|
default:
|
||||||
|
render2D1 = render2D;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
render2D1.popScissor();
|
||||||
|
render2D.popMatrix();
|
||||||
|
render2D.popAlpha();
|
||||||
|
this.uiSupport_545.L(render2D, 0.0F, 0.0F, f, gx, Float.MAX_VALUE, palette.onSurface());
|
||||||
|
render2D.roundedOutline(0.0F, 0.0F, f, gx, Float.MAX_VALUE, 1.0F, this.colorAnimation2.L());
|
||||||
|
if (bl) {
|
||||||
|
this.i(render2D, palette, f, gx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private float L() {
|
||||||
|
Watermark watermark1 = this;
|
||||||
|
long l = System.nanoTime();
|
||||||
|
float f = watermark1.ga == 0L ? 16.0F : Math.min((float)(l - watermark1.ga) / 1000000.0F, 100.0F);
|
||||||
|
watermark1.ga = l;
|
||||||
|
return f;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void l() {
|
||||||
|
this.Ia = false;
|
||||||
|
this.ga = 0L;
|
||||||
|
this.ja = 0.0F;
|
||||||
|
this.E = 0.0F;
|
||||||
|
IconPaths.L("watermark");
|
||||||
|
}
|
||||||
|
|
||||||
|
private static float L(Render2D render2D, String string) {
|
||||||
|
return 10.0F + render2D.getTextWidth(Fonts.FONT_STYLE8, string);
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean L(boolean bl, float f, float g, float h, float i) {
|
||||||
|
Watermark watermark1 = this;
|
||||||
|
float j = Minecraft.getScaledMouseX() * hx / mc.displayWidth;
|
||||||
|
float k = i - Minecraft.getScaledMouseY() * i / mc.displayHeight - 1.0F;
|
||||||
|
boolean bl1 = watermark1.k();
|
||||||
|
boolean bl2 = watermark1.L(j, k);
|
||||||
|
Watermark watermark2;
|
||||||
|
if (bl && bl1) {
|
||||||
|
if (!watermark1.C && bl2) {
|
||||||
|
watermark1.B = true;
|
||||||
|
watermark1.J = j - watermark1.W;
|
||||||
|
watermark1.wa = k - watermark1.ka;
|
||||||
|
}
|
||||||
|
|
||||||
|
watermark2 = watermark1;
|
||||||
|
} else {
|
||||||
|
watermark2 = watermark1;
|
||||||
|
watermark1.B = false;
|
||||||
|
watermark1.roundedShapesData2 = RoundedShapes.ROUNDED_SHAPES_DATA2;
|
||||||
|
}
|
||||||
|
|
||||||
|
watermark2.C = bl1;
|
||||||
|
if (watermark1.B) {
|
||||||
|
watermark1.roundedShapesData2 = RoundedShapes.L(
|
||||||
|
j - watermark1.J, k - watermark1.wa, watermark1.ja, watermark1.E, hx, i, 10.0F, IconPaths.L("watermark")
|
||||||
|
);
|
||||||
|
L(watermark1.positionX, watermark1.roundedShapesData2.x() - 10.0F, f);
|
||||||
|
L(watermark1.positionY, watermark1.roundedShapesData2.y() - 10.0F, gx);
|
||||||
|
}
|
||||||
|
|
||||||
|
return bl2;
|
||||||
|
}
|
||||||
|
|
||||||
|
private float L(Render2D render2D, WatermarkData watermarkData) {
|
||||||
|
switch (watermarkDatax.kind()) {
|
||||||
|
case IDLE:
|
||||||
|
while (false) {
|
||||||
|
}
|
||||||
|
|
||||||
|
return render2D.getTextWidth(Fonts.FONT_STYLE9, watermarkDatax.text());
|
||||||
|
case MUSIC:
|
||||||
|
float f = Math.min(render2D.getTextWidth(Fonts.FONT_STYLE9, watermarkDatax.text()), 90.0F);
|
||||||
|
if (watermarkDatax.badge().isEmpty()) {
|
||||||
|
return f;
|
||||||
|
}
|
||||||
|
|
||||||
|
return f + 6.0F + L(render2D, watermarkDatax.badge());
|
||||||
|
case GAUGE:
|
||||||
|
return Math.max(
|
||||||
|
54.0F,
|
||||||
|
render2D.getTextWidth(Fonts.FONT_STYLE8, watermarkDatax.badge()) + 8.0F + render2D.getTextWidth(Fonts.FONT_STYLE9, watermarkDatax.text())
|
||||||
|
)
|
||||||
|
+ 4.0F;
|
||||||
|
case TOGGLE:
|
||||||
|
return Math.min(render2D.getTextWidth(Fonts.FONT_STYLE9, watermarkDatax.text()), 90.0F) + 6.0F + 10.0F;
|
||||||
|
default:
|
||||||
|
throw new MatchException(null, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void d(Render2D render2D, Palette palette, float f, float g) {
|
||||||
|
Watermark watermark1 = this;
|
||||||
|
f = f;
|
||||||
|
|
||||||
|
int i;
|
||||||
|
for (int l = i = 0; l < 3; l = i) {
|
||||||
|
float j = i * 2.1F;
|
||||||
|
float hx = watermark1.watermarkData5.playing() ? 0.5F + 0.5F * (float)Math.sin(watermark1.O * 0.007F + j) : 0.1F;
|
||||||
|
float k = 3.0F + 6.0F * hx;
|
||||||
|
render2D.roundedRect(f, gx - k / 2.0F, 2.0F, k, Float.MAX_VALUE, palette.primary());
|
||||||
|
i++;
|
||||||
|
f += 4.0F;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean L(double d, double e) {
|
||||||
|
return d >= this.W && d < this.W + this.ja && e >= this.ka && e < this.ka + this.E;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static float L(NumberSetting numberSetting, float f) {
|
||||||
|
return f <= 0.0F ? 0.0F : (float)(f * numberSetting.getValue() / 100.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean L(WatermarkData watermarkData, WatermarkData watermarkData1) {
|
||||||
|
return watermarkDatax.equals(watermarkData1)
|
||||||
|
|| watermarkDatax.kind() == WatermarkMode.GAUGE && watermarkData1.kind() == WatermarkMode.GAUGE
|
||||||
|
|| watermarkDatax.kind() == WatermarkMode.MUSIC && watermarkData1.kind() == WatermarkMode.MUSIC;
|
||||||
|
}
|
||||||
|
|
||||||
|
private WatermarkData4 d() {
|
||||||
|
BedBreaker bedBreaker = OnyxClient.moduleManager.bedBreaker;
|
||||||
|
if (!OnyxClient.moduleManager.bedBreaker.isEnabled()) {
|
||||||
|
return null;
|
||||||
|
} else {
|
||||||
|
BlockPos blockPos;
|
||||||
|
if ((blockPos = bedBreaker.getBlockPos3()) != null && mc.theWorld != null) {
|
||||||
|
float f;
|
||||||
|
int i = Math.round((f = Math.clamp(mc.playerController.getCurBlockDamage(), 0.0F, 1.0F)) * 100.0F);
|
||||||
|
String string = mc.theWorld.getBlockState(blockPos).getBlock().getLocalizedName();
|
||||||
|
return new WatermarkData4(string, i + "%", f, i, false);
|
||||||
|
} else {
|
||||||
|
return new WatermarkData4("Bed", "Idle", 0.0F, 0.0F, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean h() {
|
||||||
|
return mc.thePlayer != null && mc.theWorld != null && (this.isEnabled() || this.Ia);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void d(boolean bl) {
|
||||||
|
Watermark watermark1 = this;
|
||||||
|
Palette palette = ThemeManager.getPalette();
|
||||||
|
watermark1.colorAnimation2.L(bl ? palette.primary() : palette.error());
|
||||||
|
}
|
||||||
|
|
||||||
|
private WatermarkData4 L() {
|
||||||
|
Watermark watermark1 = this;
|
||||||
|
Scaffold scaffold = OnyxClient.moduleManager.scaffold;
|
||||||
|
if (watermark1.scaffoldBlocks.isEnabled() && scaffold.isEnabled()) {
|
||||||
|
int i;
|
||||||
|
if ((i = scaffold.L()) > watermark1.L) {
|
||||||
|
watermark1.L = i;
|
||||||
|
}
|
||||||
|
|
||||||
|
WatermarkData4 watermarkData4x = new WatermarkData4;
|
||||||
|
String string = String.valueOf(i);
|
||||||
|
float f;
|
||||||
|
int j;
|
||||||
|
if (watermark1.L > 0) {
|
||||||
|
f = Math.clamp((float)i / watermark1.L, 0.0F, 1.0F);
|
||||||
|
j = i;
|
||||||
|
} else {
|
||||||
|
f = 0.0F;
|
||||||
|
j = i;
|
||||||
|
}
|
||||||
|
|
||||||
|
watermarkData4x./* $VF: Unable to resugar constructor */<init>("Blocks", string, f, j, i <= watermark1.lowBlocks.getInt());
|
||||||
|
return watermarkData4x;
|
||||||
|
} else {
|
||||||
|
watermark1.L = 0;
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Watermark() {
|
||||||
|
super("Watermark", "Dynamic island that reacts to what the client is doing", ModuleCategory.HUD);
|
||||||
|
this.hold = new NumberSetting("Hold", 0.5, 0.3, 5.0, 0.1)
|
||||||
|
.withSuffix("s")
|
||||||
|
.describe("How long a notification stays expanded")
|
||||||
|
.visibleWhen(this.moduleToggles);
|
||||||
|
this.scaffoldBlocks = new BooleanSetting("Scaffold blocks", true).describe("Live block counter while Scaffold runs");
|
||||||
|
this.lowBlocks = new NumberSetting("Low blocks", 32.0, 0.0, 128.0, 1.0)
|
||||||
|
.describe("Count below which the number turns red")
|
||||||
|
.visibleWhen(this.scaffoldBlocks);
|
||||||
|
StatsMode[] statsModes = new StatsMode[2];
|
||||||
|
boolean bl = true;
|
||||||
|
statsModes[0] = StatsMode.FPS;
|
||||||
|
statsModes[1] = StatsMode.PING;
|
||||||
|
this.stats = new MultiEnumSetting<>("Stats", StatsMode.class, statsModes)
|
||||||
|
.describe("Live client and connection readouts on their own island — drag them on the island itself (press T) to reorder");
|
||||||
|
this.nowPlaying = new BooleanSetting("Now playing", true).describe("Show whatever's currently playing on the system (Windows/macOS only)");
|
||||||
|
this.positionX = new NumberSetting("Position X", 50.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.statsX = new NumberSetting("Stats X", 0.0, 0.0, 100.0, 0.01).visibleWhen(() -> false);
|
||||||
|
this.statsY = new NumberSetting("Stats Y", 0.0, 0.0, 100.0, 0.01).visibleWhen(() -> false);
|
||||||
|
this.statsIsland = new StatsIsland(this);
|
||||||
|
this.nowPlayingService = new NowPlayingService();
|
||||||
|
this.animation2 = new Animation(0.0F);
|
||||||
|
this.animation6 = new Animation(22.0F);
|
||||||
|
this.animation7 = new Animation(22.0F);
|
||||||
|
this.animation4 = new Animation(1.0F);
|
||||||
|
this.animation = new Animation(1.0F);
|
||||||
|
this.animation5 = new Animation(1.0F);
|
||||||
|
this.animation3 = new Animation(1.0F);
|
||||||
|
this.colorAnimation2 = new ColorAnimation(ThemeManager.getPalette().outlineVariant());
|
||||||
|
this.colorAnimation = new ColorAnimation(ThemeManager.getPalette().onSurface());
|
||||||
|
this.colorAnimation3 = new ColorAnimation(ThemeManager.getPalette().primary());
|
||||||
|
this.uiSupport_545 = new UiSupport_545();
|
||||||
|
this.modules = Collections.newSetFromMap(new IdentityHashMap<>());
|
||||||
|
this.watermarkData5 = WATERMARK_DATA2;
|
||||||
|
this.watermarkData = WATERMARK_DATA2;
|
||||||
|
this.Ma = 1.0F;
|
||||||
|
this.M = "";
|
||||||
|
this.w = "";
|
||||||
|
this.roundedShapesData2 = RoundedShapes.ROUNDED_SHAPES_DATA2;
|
||||||
|
this.renderSupport_184 = new RenderSupport_184();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void h() {
|
||||||
|
Watermark watermark1 = this;
|
||||||
|
if (watermark1.isEnabled()) {
|
||||||
|
Iterator iterator = OnyxClient.moduleManager.getModules().iterator();
|
||||||
|
|
||||||
|
label38:
|
||||||
|
while (true) {
|
||||||
|
Iterator iterator1 = iterator;
|
||||||
|
|
||||||
|
while (iterator1.hasNext()) {
|
||||||
|
Module module;
|
||||||
|
if ((module = (Module)iterator.next()) == watermark1) {
|
||||||
|
continue label38;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (module == OnyxClient.moduleManager.clickGUI) {
|
||||||
|
iterator1 = iterator;
|
||||||
|
} else {
|
||||||
|
boolean bl;
|
||||||
|
if ((bl = module.isEnabled()) == watermark1.modules.contains(module)) {
|
||||||
|
iterator1 = iterator;
|
||||||
|
} else {
|
||||||
|
Watermark watermark2;
|
||||||
|
if (bl) {
|
||||||
|
watermark1.modules.add(module);
|
||||||
|
watermark2 = watermark1;
|
||||||
|
} else {
|
||||||
|
watermark1.modules.remove(module);
|
||||||
|
watermark2 = watermark1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!watermark2.Q) {
|
||||||
|
continue label38;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!watermark1.moduleToggles.isEnabled()) {
|
||||||
|
iterator1 = iterator;
|
||||||
|
} else {
|
||||||
|
watermark1.watermarkData3 = new WatermarkData3(module.getName(), bl);
|
||||||
|
watermark1.R = watermark1.hold.getFloat() * 1000.0F;
|
||||||
|
iterator1 = iterator;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
watermark1.Q = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void L(float f) {
|
||||||
|
Watermark watermark1 = this;
|
||||||
|
watermark1.watermarkData4 = watermark1.L();
|
||||||
|
if (watermark1.watermarkData4 == null) {
|
||||||
|
watermark1.watermarkData4 = watermark1.d();
|
||||||
|
}
|
||||||
|
|
||||||
|
String string = watermark1.watermarkData4 == null ? null : watermark1.watermarkData4.value();
|
||||||
|
if (!Objects.equals(string, watermark1.X) && watermark1.animation.isFinished()) {
|
||||||
|
watermark1.Ma = watermark1.watermarkData4 != null && watermark1.watermarkData4.level() < watermark1.V ? -1.0F : 1.0F;
|
||||||
|
watermark1.animation.set(0.0F).animateTo(1.0F, 100.0F, Easings.EASING7);
|
||||||
|
}
|
||||||
|
|
||||||
|
watermark1.X = string;
|
||||||
|
watermark1.V = watermark1.watermarkData4 == null ? 0.0F : watermark1.watermarkData4.level();
|
||||||
|
watermark1.animation5.animateTo(watermark1.watermarkData4 == null ? 0.0F : watermark1.watermarkData4.fill(), 250.0F, Easings.EASING2);
|
||||||
|
watermark1.animation5.update(f);
|
||||||
|
watermark1.animation.update(f);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void L(NumberSetting numberSetting, float f, float g) {
|
||||||
|
if (!(gx <= 0.0F)) {
|
||||||
|
numberSetting.setValue(Math.clamp(f / gx, 0.0F, 1.0F) * 100.0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void L(Render2D render2D, Palette palette, float f, float g) {
|
||||||
|
Watermark watermark1 = this;
|
||||||
|
String string = render2D.trimToWidth(Fonts.FONT_STYLE9, watermark1.watermarkData5.text(), 90.0F);
|
||||||
|
render2D.drawTextVCentered(Fonts.FONT_STYLE9, string, f, gx, palette.onSurface());
|
||||||
|
if (!watermark1.watermarkData5.badge().isEmpty()) {
|
||||||
|
f = f + render2D.getTextWidth(Fonts.FONT_STYLE9, string) + 6.0F;
|
||||||
|
float hx = L(render2D, watermark1.watermarkData5.badge());
|
||||||
|
render2D.roundedRect(
|
||||||
|
f, gx - 6.0F, hx, 12.0F, Float.MAX_VALUE, watermark1.watermarkData5.positive() ? palette.primaryContainer() : palette.surfaceContainerHighest()
|
||||||
|
);
|
||||||
|
render2D.drawTextCenteredVCentered(
|
||||||
|
Fonts.FONT_STYLE8,
|
||||||
|
watermark1.watermarkData5.badge(),
|
||||||
|
f + hx / 2.0F,
|
||||||
|
gx,
|
||||||
|
watermark1.watermarkData5.positive() ? palette.onPrimaryContainer() : palette.onSurfaceVariant()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
package openonyx.features.hud;
|
||||||
|
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
|
record WatermarkData(WatermarkMode kind, String text, String badge, boolean positive, ResourceLocation art, float progress, boolean playing) {
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
package openonyx.features.hud;
|
||||||
|
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
|
record WatermarkData2(String title, String artist, ResourceLocation art, float progress, boolean playing) {
|
||||||
|
}
|
||||||
Reference in new issue
Block a user