Only render overlay gui once

Fix incorrect texture location of recording-marker
This commit is contained in:
johni0702
2015-05-26 21:43:43 +02:00
parent 7eb24e19bc
commit 395c3b0acd
2 changed files with 7 additions and 2 deletions

View File

@@ -9,6 +9,9 @@ import net.minecraft.client.resources.I18n;
import net.minecraftforge.client.event.RenderGameOverlayEvent; import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import static eu.crushedpixel.replaymod.gui.overlay.GuiReplayOverlay.TEXTURE_SIZE;
import static eu.crushedpixel.replaymod.gui.overlay.GuiReplayOverlay.replay_gui;
/** /**
* Renders overlay during recording. * Renders overlay during recording.
*/ */
@@ -25,13 +28,14 @@ public class GuiRecordingOverlay {
*/ */
@SubscribeEvent @SubscribeEvent
public void renderRecordingIndicator(RenderGameOverlayEvent.Post event) { public void renderRecordingIndicator(RenderGameOverlayEvent.Post event) {
if (event.type != RenderGameOverlayEvent.ElementType.ALL) return;
if(ReplayMod.replaySettings.showRecordingIndicator()) { if(ReplayMod.replaySettings.showRecordingIndicator()) {
FontRenderer fontRenderer = mc.fontRendererObj; FontRenderer fontRenderer = mc.fontRendererObj;
fontRenderer.drawString(I18n.format("replaymod.gui.recording").toUpperCase(), 30, 18 - (fontRenderer.FONT_HEIGHT / 2), 0xffffffff); fontRenderer.drawString(I18n.format("replaymod.gui.recording").toUpperCase(), 30, 18 - (fontRenderer.FONT_HEIGHT / 2), 0xffffffff);
mc.renderEngine.bindTexture(GuiReplayOverlay.replay_gui); mc.renderEngine.bindTexture(replay_gui);
GlStateManager.resetColor(); GlStateManager.resetColor();
GlStateManager.enableAlpha(); GlStateManager.enableAlpha();
Gui.drawModalRectWithCustomSizedTexture(10, 10, 40, 21, 16, 16, 64, 64); Gui.drawModalRectWithCustomSizedTexture(10, 10, 58, 20, 16, 16, TEXTURE_SIZE, TEXTURE_SIZE);
} }
} }
} }

View File

@@ -310,6 +310,7 @@ public class GuiReplayOverlay extends Gui {
@SubscribeEvent @SubscribeEvent
public void onRenderGui(RenderGameOverlayEvent.Post event) throws IllegalArgumentException, IllegalAccessException { public void onRenderGui(RenderGameOverlayEvent.Post event) throws IllegalArgumentException, IllegalAccessException {
if (event.type != RenderGameOverlayEvent.ElementType.ALL) return;
if (!isVisible()) return; if (!isVisible()) return;
FMLClientHandler fml = FMLClientHandler.instance(); FMLClientHandler fml = FMLClientHandler.instance();