package im.expensive.ui.display.impl;
import com.mojang.blaze3d.matrix.MatrixStack;
import im.expensive.events.EventDisplay;
import im.expensive.ui.display.ElementRenderer;
import im.expensive.utils.drag.Dragging;
import im.expensive.utils.render.ColorUtils;
import im.expensive.utils.render.DisplayUtils;
import im.expensive.utils.render.font.Fonts;
import lombok.RequiredArgsConstructor;
import net.minecraft.client.gui.screen.ChatScreen;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.Color;
@RequiredArgsConstructor
public class CelestialRender implements ElementRenderer {
final Dragging dragging;
final ResourceLocation celestiallogo = new ResourceLocation("expensive/images/hud/atom.png");
final ResourceLocation grab = new ResourceLocation("expensive/images/hud/grab.png");
@Override
public void render(EventDisplay eventDisplay) {
MatrixStack stack = eventDisplay.getMatrixStack();
float posx = dragging.getX();
float posy = dragging.getY();
float width = 90;
float height = 30;
DisplayUtils.drawShadow(posx, posy, width, height - 5, 10, ColorUtils.getColor(70), ColorUtils.rgba(0,0,0,255));
DisplayUtils.drawRoundedRect(posx, posy, width, height - 5, 5, ColorUtils.getColor(90));
DisplayUtils.drawShadowCircle(posx + 10, posy + 12.5f, 20, ColorUtils.rgba(21,21,21,255));
DisplayUtils.drawCircle(posx + 10, posy + 12.5f, 30, ColorUtils.getColor(10));
Fonts.sfbold.drawText(stack, "Celestial", posx + 26f, posy + 2.5f, ColorUtils.rgba(21,21,21,255), 9.5f);
Fonts.sfbold.drawText(stack, "Celestial", posx + 25.5f, posy + 2, ColorUtils.rgba(255,255,255,255), 9.5f);
Fonts.sfbold.drawText(stack, "UID: ", posx + 26f, posy + 13.5f, ColorUtils.rgba(21,21,21,255), 9.5f);
Fonts.sfbold.drawText(stack, "UID: ", posx + 25.5f, posy + 13, ColorUtils.rgba(255,255,255,255), 9.5f);
Fonts.sfbold.drawText(stack, "7777", posx + 50f, posy + 14.5f, ColorUtils.rgba(21,21,21,255), 8.5f);
Fonts.sfbold.drawText(stack, "7777", posx + 49.5f, posy + 14, ColorUtils.rgba(155,155,155,255), 8.5f);
DisplayUtils.drawImage(celestiallogo, posx - 1, posy + 1, 22,22, ColorUtils.getColor(190));
dragging.setWidth(width + 10);
dragging.setHeight(height + 10);
if (mc.currentScreen instanceof ChatScreen){
DisplayUtils.drawImage(grab, posx, posy, 25,25, -1);
}
}
}