//by destenyclient with <3
// sasal?
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.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.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 = 2;
float fontSize = 8f;
float iconSize = 8;
float localHeight = fontSize + padding * 3;
final ResourceLocation logo = new ResourceLocation("expensive/images/Mainmenu_logo.png");
Style style = Expensive.getInstance().getStyleManager().getCurrentStyle();
int fps = mc.getDebugFPS();
float textWidth = Fonts.sfui.getWidth(" / " + mc.session.getUsername() + mc.debugFPS + " fps ", fontSize);
float textWidth2 = Fonts.sfui.getWidth(" / " + mc.session.getUsername() + mc.debugFPS + " fps ", fontSize);
drawStyledRect(posX, posY, textWidth+padding, localHeight + 4, 3);
ITextComponent name = GradientUtil.gradient("Relake");
Fonts.sfbold.drawCenteredText(ms, name, posX + 20, posY+6, 7);
Fonts.sfui.drawText(ms, " " + " " + mc.debugFPS + " fps" + " uid: 0", posX + 28 +padding+1, posY + 3 + padding + 1, ColorUtils.rgb(255,255,255), 7);
Fonts.sfui.drawText(ms, " / " + mc.debugFPS + " fps" + " / " , posX - 4.9F +padding+1, posY + 3 + padding + 1, ColorUtils.rgba(255,255,255, 110), 7);
//DisplayUtils.drawImage(logo, 4, 4, 12, 13, ColorUtils.rgb(255,255,255));
}
private void drawStyledRect(float x,
float y,
float width,
float height,
float radius) {
DisplayUtils.drawShadow(x + 1, y + 1, width - 2, height - 2, 30, ColorUtils.getColor(0));
DisplayUtils.drawGradientRound(x + 1, y + 1, width - 2, height - 2, radius - 1, ColorUtils.getColor(0));
DisplayUtils.drawRoundedRect(x - 2, y - 2, width + 4, height + 4, radius - 1, ColorUtils.getColor(0));
DisplayUtils.drawRoundedRect(x - 1, y - 1, width + 2, height + 2, radius - 1, ColorUtils.rgba(0, 0, 0, 160));
}
}