package im.Lighting.ui.display.impl;
import com.mojang.blaze3d.matrix.MatrixStack;
import im.Lighting.Lighting;
import im.Lighting.events.EventDisplay;
import im.Lighting.ui.display.ElementRenderer;
import im.Lighting.ui.styles.Style;
import im.Lighting.utils.client.PingUtil;
import im.Lighting.utils.render.ColorUtils;
import im.Lighting.utils.render.DisplayUtils;
import im.Lighting.utils.render.font.Fonts;
import im.Lighting.utils.text.GradientUtil;
import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;
import lombok.experimental.FieldDefaults;
import net.minecraft.client.Minecraft;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.Color;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.client.multiplayer.ServerData;
@FieldDefaults(level = AccessLevel.PRIVATE)
@RequiredArgsConstructor
public class WatermarkRenderer implements ElementRenderer {
final Minecraft mc = Minecraft.getInstance();
@Override
public void render(EventDisplay eventDisplay) {
MatrixStack ms = eventDisplay.getMatrixStack();
float posX = 3;
float posY = 3;
float padding = 3;
float fontSize = 8f;
float iconSize = 8;
float localHeight = fontSize + padding * 3;
Style style = Lighting.getInstance().getStyleManager().getCurrentStyle();
int fps = mc.getDebugFPS();
float textWidth = Fonts.sfui.getWidth(" DeadWin - " + mc.session.getUsername() + mc.debugFPS + "FPS ", fontSize);
DisplayUtils.drawShadow(posX, posY, textWidth+padding, localHeight + 4, 25, ColorUtils.rgba(15,19,98,167));
drawStyledRect(posX, posY, textWidth+padding, localHeight + 3, 2);
Fonts.sfui.drawText(ms, " " + " DeadWin - " + mc.session.getUsername() + " " + mc.debugFPS + " FPS", posX+padding+1, posY + padding + 1, ColorUtils.rgb(480,315,205), fontSize);
}
private void drawStyledRect(float x,
float y,
float width,
float height,
float radius) {
DisplayUtils.drawRoundedRect(x, y, width+10, height, radius, ColorUtils.rgba(15, 15, 15, 199));
}
}