package asm.mixins;

import dev.crucifixbeta.mod.gui.menu.EpsilonMenuStyle;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.screen.DownloadingTerrainScreen;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Environment(EnvType.CLIENT)
@Mixin({DownloadingTerrainScreen.class})
public class MixinDownloadingTerrainScreen {
   @Inject(
      method = {"renderBackground"},
      at = {@At("HEAD")},
      cancellable = true
   )
   private void crucifix$renderVideoBackground(DrawContext context, int mouseX, int mouseY, float delta, CallbackInfo ci) {
      EpsilonMenuStyle.renderVideoBackground(context, mouseX, mouseY);
      ci.cancel();
   }
}
