From 531319a4d1104d7255c9ae9a52ee34a2ee052246 Mon Sep 17 00:00:00 2001 From: CrushedPixel Date: Thu, 16 Jul 2015 17:28:33 +0200 Subject: [PATCH] Added Checkbox to GuiRenderSettings to enable/disable Name Tag rendering --- .../replaymod/gui/GuiConstants.java | 1 + .../replaymod/gui/GuiRenderSettings.java | 18 ++++++++++++------ .../resources/assets/replaymod/lang/en_US.lang | 3 ++- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/main/java/eu/crushedpixel/replaymod/gui/GuiConstants.java b/src/main/java/eu/crushedpixel/replaymod/gui/GuiConstants.java index 270dcae0..308d579b 100755 --- a/src/main/java/eu/crushedpixel/replaymod/gui/GuiConstants.java +++ b/src/main/java/eu/crushedpixel/replaymod/gui/GuiConstants.java @@ -71,6 +71,7 @@ public class GuiConstants { public static final int RENDER_SETTINGS_COLOR_PICKER = 9014; public static final int RENDER_SETTINGS_ENABLE_GREENSCREEN = 9015; public static final int RENDER_SETTINGS_OUTPUT_CHOOSER = 9016; + public static final int RENDER_SETTINGS_RENDER_NAMETAGS = 9017; public static final int REPLAY_SETTINGS_RECORDSERVER_ID = 9004; public static final int REPLAY_SETTINGS_RECORDSP_ID = 9005; diff --git a/src/main/java/eu/crushedpixel/replaymod/gui/GuiRenderSettings.java b/src/main/java/eu/crushedpixel/replaymod/gui/GuiRenderSettings.java index 04269c5d..b97769eb 100644 --- a/src/main/java/eu/crushedpixel/replaymod/gui/GuiRenderSettings.java +++ b/src/main/java/eu/crushedpixel/replaymod/gui/GuiRenderSettings.java @@ -15,6 +15,7 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiErrorScreen; import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.resources.I18n; import net.minecraftforge.fml.client.FMLClientHandler; import net.minecraftforge.fml.client.config.GuiCheckBox; @@ -45,7 +46,7 @@ public class GuiRenderSettings extends GuiScreen { private int virtualY, virtualHeight; - private GuiCheckBox ignoreCamDir, enableGreenscreen; + private GuiCheckBox ignoreCamDir, enableGreenscreen, renderNameTags; private GuiNumberInput xRes, yRes; private GuiToggleButton interpolation, forceChunks; private GuiVideoFramerateSlider framerateSlider; @@ -161,6 +162,7 @@ public class GuiRenderSettings extends GuiScreen { forceChunks.width = interpolation.width = framerateSlider.width = 150; enableGreenscreen = new GuiCheckBox(GuiConstants.RENDER_SETTINGS_ENABLE_GREENSCREEN, 0, 0, I18n.format("replaymod.gui.rendersettings.chromakey"), false); + renderNameTags = new GuiCheckBox(GuiConstants.RENDER_SETTINGS_RENDER_NAMETAGS, 0, 0, I18n.format("replaymod.gui.rendersettings.nametags"), true); colorPicker = new GuiColorPicker(GuiConstants.RENDER_SETTINGS_COLOR_PICKER, 0, 0, I18n.format("replaymod.gui.rendersettings.skycolor")+": ", 0, 0); colorPicker.enabled = enableGreenscreen.isChecked(); @@ -190,6 +192,7 @@ public class GuiRenderSettings extends GuiScreen { advancedButtons.add(forceChunks); advancedButtons.add(enableGreenscreen); advancedButtons.add(colorPicker); + advancedButtons.add(renderNameTags); } virtualHeight = 200; @@ -267,7 +270,7 @@ public class GuiRenderSettings extends GuiScreen { commandInput.width = 55; commandInput.xPosition = (this.width-305)/2; - commandInput.yPosition = ffmpegArguments.yPosition = this.virtualY + 20 + ((i/2)*25); + commandInput.yPosition = ffmpegArguments.yPosition = advancedButtons.get(advancedButtons.size()-1).yPosition + 20; ffmpegArguments.width = 245; ffmpegArguments.xPosition = commandInput.xPosition+commandInput.width+5; @@ -287,10 +290,6 @@ public class GuiRenderSettings extends GuiScreen { toHandle.addAll(permanentButtons); toHandle.addAll(advancedTab ? advancedButtons : defaultButtons); - for(GuiButton b : toHandle) { - b.drawButton(mc, mouseX, mouseY); - } - if(!advancedTab) { this.drawString(fontRendererObj, I18n.format("replaymod.gui.rendersettings.renderer") + ":", (width - w1) / 2, rendererDropdown.yPosition + 6, Color.WHITE.getRGB()); @@ -326,6 +325,11 @@ public class GuiRenderSettings extends GuiScreen { } } + for(GuiButton b : toHandle) { + b.drawButton(mc, mouseX, mouseY); + GlStateManager.enableBlend(); + } + renderButton.drawOverlay(mc, mouseX, mouseY); } @@ -499,6 +503,8 @@ public class GuiRenderSettings extends GuiScreen { options.setSkyColor(colorPicker.getPickedColor()); } + options.setHideNameTags(!renderNameTags.isChecked()); + options.setWidth(getWidthSetting()); options.setHeight(getHeightSetting()); diff --git a/src/main/resources/assets/replaymod/lang/en_US.lang b/src/main/resources/assets/replaymod/lang/en_US.lang index b9bd6648..22a3edbe 100644 --- a/src/main/resources/assets/replaymod/lang/en_US.lang +++ b/src/main/resources/assets/replaymod/lang/en_US.lang @@ -321,11 +321,12 @@ replaymod.gui.rendersettings.framerate=Video Framerate replaymod.gui.rendersettings.quality=Video Quality replaymod.gui.rendersettings.chromakey=Chroma Keying replaymod.gui.rendersettings.skycolor=Sky Color +replaymod.gui.rendersettings.nametags=Render Name Tags replaymod.gui.rendersettings.outputfile=Output File replaymod.gui.rendersettings.command=Command replaymod.gui.rendersettings.arguments=Command Line Arguments -replaymod.gui.rendersettings.ffmpeg.description=By default, the Replay Mod will render videos as .webm files. If you are an advanced user, you can customize the command line parameters used to export the video. For more information, check http://replaymod.com/docs +replaymod.gui.rendersettings.ffmpeg.description=If you are an advanced user, you can customize the command line parameters used to export the video. For more information, check http://replaymod.com/docs replaymod.gui.rendersettings.stablecamera=Ignore Camera Rotation replaymod.gui.rendersettings.exportyoutube=Export for YouTube