package com.leisuretimedock.blasttravelreborn.client.screen.overlay;

import com.leisuretimedock.blasttravelreborn.content.entity.CannonEntity;
import com.leisuretimedock.blasttravelreborn.util.BTRUtil;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.util.Mth;
import net.minecraftforge.client.gui.overlay.ForgeGui;
import net.minecraftforge.client.gui.overlay.IGuiOverlay;

public class CannonOverlay implements IGuiOverlay {
    private float cannonOverlayScale = 0.5f;
    private final Minecraft mc;
    public CannonOverlay() {
        this.mc = Minecraft.getInstance();
    }
    @Override
    public void render(ForgeGui gui, GuiGraphics guiGraphics, float partialTick, int screenWidth, int screenHeight) {
        if(mc.player != null && mc.player.getVehicle() instanceof CannonEntity){
            cannonOverlayScale = Mth.lerp(0.5f * partialTick, cannonOverlayScale, 1.125f);
            if(mc.options.getCameraType().isFirstPerson()){
                BTRUtil.renderCannonHubOverlay(guiGraphics, cannonOverlayScale);
            }
        }
    }
}
