package im.expensive.ui.display.impl;
import com.mojang.blaze3d.matrix.MatrixStack;
import im.expensive.Expensive;
import im.expensive.events.EventDisplay;
import im.expensive.ui.display.ElementRenderer;
import im.expensive.ui.styles.Style;
import im.expensive.utils.client.PingUtil;
import im.expensive.utils.math.Vector4i;
import im.expensive.utils.render.DisplayUtils;
import im.expensive.utils.render.font.Fonts;
import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;
import lombok.experimental.FieldDefaults;
import static imgui.ImColor.rgba;
@FieldDefaults(level = AccessLevel.PRIVATE)
@RequiredArgsConstructor
public class WatermarkRenderer implements ElementRenderer {
private float posX;
private float posY;
@Override
public void render(EventDisplay eventDisplay) {
MatrixStack ms = eventDisplay.getMatrixStack();
//x,y
float positionX = 5;
float positionY = 3;
// pingutil move
int ping = PingUtil.calculatePing();
//sizes
float width = 240;
float height = 15;
float font_size = 8.5F;
float width_icon = 16;
float height_icon = 16;
//style move
Style style = Expensive.getInstance().getStyleManager().getCurrentStyle();
//background
DisplayUtils.drawRoundedRect(positionX, positionY, width, height, 1, rgba(21, 21, 21, 160));
//line
DisplayUtils.drawRoundedRect(posX + 6.0F, posY + height / 5.0F + height / 5.0F - 4.0F, (width - 1.0F), 3.0F, new net.minecraft.util.math.vector.Vector4f(6.0F, 6.0F, 2.0F, 2.0F), new Vector4i(style.getFirstColor().getRGB(), style.getFirstColor().getRGB(), style.getSecondColor().getRGB(), style.getSecondColor().getRGB()));
//shdow line
DisplayUtils.drawRoundedRect(posX + 6.0F, posY + height / 5.0F + height / 5.0F - 4.0F, (width - 1.0F), 3.0F, new net.minecraft.util.math.vector.Vector4f(6.0F, 6.0F, 2.0F, 2.0F), new Vector4i(style.getFirstColor().getRGB(), style.getFirstColor().getRGB(), style.getSecondColor().getRGB(), style.getSecondColor().getRGB()));
//name
String name = "Celestial ";
Fonts.montserrat.drawCenteredText(ms, name, positionX + 26, positionY + 3, rgba(255, 255, 255, 255), font_size);
//build
String build = "| build 8.2.1 ";
Fonts.montserrat.drawCenteredText(ms, build, positionX + 79, positionY + 3, rgba(255, 255, 255, 255), font_size);
//UID
String uid = "| UID - null ";
Fonts.montserrat.drawCenteredText(ms, uid, positionX + 135, positionY + 3, rgba(255, 255, 255, 255), font_size);
//fps
String fps = "| FPS: " + mc.debugFPS;
Fonts.montserrat.drawCenteredText(ms, fps, positionX + 183, positionY + 3, rgba(255, 255, 255, 255), font_size);
//ping
String ring = "| " + ping + "ms";
Fonts.montserrat.drawCenteredText(ms, ring, positionX + 222, positionY + 3, rgba(255, 255, 255, 255), font_size);
// gradient line
}}