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.ServerAPI;
import im.expensive.utils.render.ColorUtils;
import im.expensive.utils.render.DisplayUtils;
import im.expensive.utils.render.font.Fonts;
import im.expensive.utils.text.GradientUtil;
import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;
import lombok.experimental.FieldDefaults;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.ITextComponent;
@FieldDefaults(level = AccessLevel.PRIVATE)
@RequiredArgsConstructor
public class WatermarkRenderer implements ElementRenderer {
final ResourceLocation logo = new ResourceLocation("expensive/images/hud/delta.png");
@Override
public void render(EventDisplay eventDisplay) {
MatrixStack ms = eventDisplay.getMatrixStack();
float fontSize = 8;
float fpswi = Fonts.sfui.getWidth(mc.getDebugFPS()+" FPS" , fontSize);
float textWidth = Fonts.sfui.getWidth("W Us1rok g"+mc.getDebugFPS()+" FPS Q" + ServerAPI.calculatePing() + " ms", fontSize);
String bps = (int) mc.player.getPosX() + " x " + (int) mc.player.getPosY() + " y " + (int) mc.player.getPosZ() + " z";
float cowi = Fonts.sfui.getWidth("F " + bps , fontSize);
DisplayUtils.drawRoundedRect(3, 3, 18, 17, 4, ColorUtils.rgb(30,30,30));
DisplayUtils.drawRoundedRect(23, 3, textWidth + 8, 17, 4, ColorUtils.rgb(30,30,30));
DisplayUtils.drawRoundedRect(3, 22, cowi, 17, 4, ColorUtils.rgb(30,30,30));
Fonts.icons2.drawText(ms, "W", 27, 7, ColorUtils.rgb(255,255,255), 10);
Fonts.icos.drawText(ms, "g", 74, 6.5f, ColorUtils.rgb(255,255,255), 12);
Fonts.icons2.drawText(ms, "Q", 96+ fpswi , 7, ColorUtils.rgb(255,255,255), 10);
Fonts.icons2.drawText(ms, "F", 6, 26.5f, ColorUtils.rgb(255,255,255), 10);
Fonts.inter_semibold.drawText(ms, bps, 20, 26, ColorUtils.rgb(255,255,255), 10);
Fonts.inter_semibold.drawText(ms, ServerAPI.calculatePing() + " ms", 110+ fpswi , 6, ColorUtils.rgb(255,255,255), 10);
Fonts.inter_semibold.drawText(ms, "Us1rok", 39, 7, ColorUtils.rgb(255,255,255), 9);
Fonts.inter_semibold.drawText(ms, mc.getDebugFPS()+" FPS", 90, 7, ColorUtils.rgb(255,255,255), 9);
DisplayUtils.drawImage(logo,0.5f,0.1f,23,23,ColorUtils.rgb(255,255,255));
}
}