package dev.crucifixbeta.mod.gui;

import dev.crucifixbeta.mod.gui.clickgui.ClickGuiScreen;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.text.Text;

@Environment(EnvType.CLIENT)
public class HUDGuiScreen extends Screen {
   private static HUDGuiScreen INSTANCE;

   public HUDGuiScreen() {
      super(Text.literal("HUD"));
      INSTANCE = this;
   }

   public static HUDGuiScreen getInstance() {
      if (INSTANCE == null) {
         INSTANCE = new HUDGuiScreen();
      }

      return INSTANCE;
   }

   @Override
   protected void init() {
      MinecraftClient.getInstance().setScreen(ClickGuiScreen.getInstance());
   }

   @Override
   public void render(DrawContext context, int mouseX, int mouseY, float delta) {
      String var5 = "Opening HUD page...";
      context.drawText(this.textRenderer, var5, this.width / 2 - this.textRenderer.getWidth(var5) / 2, this.height / 2, -1, false);
   }
}
