Skip to content

Commit

Permalink
Fixed cameras rendering overlays
Browse files Browse the repository at this point in the history
  • Loading branch information
Rigamortis committed Dec 16, 2019
1 parent 133a14e commit 768ba3a
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import me.rigamortis.seppuku.Seppuku;
import me.rigamortis.seppuku.api.camera.Camera;
import me.rigamortis.seppuku.api.event.minecraft.EventUpdateFramebufferSize;
import me.rigamortis.seppuku.api.event.render.EventRender2D;
import me.rigamortis.seppuku.api.event.render.EventRenderOverlay;
import net.minecraft.client.Minecraft;
import team.stiff.pomelo.impl.annotated.handler.annotation.Listener;

Expand Down Expand Up @@ -32,6 +32,17 @@ public void update() {
}
}

@Listener
public void renderOverlay(EventRenderOverlay event) {
if (Minecraft.getMinecraft().inGameHasFocus && Minecraft.getMinecraft().currentScreen == null) {
for (Camera cam : this.cameraList) {
if (cam != null && cam.isRecording()) {
event.setCanceled(true);
}
}
}
}

@Listener
public void fboResize(EventUpdateFramebufferSize event) {
for (Camera cam : this.cameraList) {
Expand Down

0 comments on commit 768ba3a

Please sign in to comment.