From 60a9541c16ce3575e9ec06a8dce4a3a673ea6912 Mon Sep 17 00:00:00 2001 From: CrushedPixel Date: Sun, 26 Apr 2015 14:32:33 +0200 Subject: [PATCH] Localized GUI Strings --- .gitignore | 12 +++- .../replaymod/events/GuiEventHandler.java | 4 +- .../replaymod/gui/GuiCancelRender.java | 4 +- .../replaymod/gui/GuiReplaySaving.java | 5 +- .../replaymod/gui/GuiReplaySettings.java | 50 ++++++------- .../replaymod/gui/GuiSpectateSelection.java | 16 ++--- .../replaymod/gui/GuiVideoQualitySlider.java | 14 ++-- .../gui/replaystudio/GuiConnectPart.java | 23 +++--- ...ReplayStudio.java => GuiReplayEditor.java} | 23 +++--- .../gui/replaystudio/GuiTrimPart.java | 9 +-- .../gui/replayviewer/GuiRenameReplay.java | 9 ++- .../gui/replayviewer/GuiReplayViewer.java | 26 +++---- .../assets/replaymod/lang/en_US.lang | 71 +++++++++++++++++++ 13 files changed, 178 insertions(+), 88 deletions(-) rename src/main/java/eu/crushedpixel/replaymod/gui/replaystudio/{GuiReplayStudio.java => GuiReplayEditor.java} (88%) diff --git a/.gitignore b/.gitignore index b59bde01..698554de 100755 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,16 @@ /* /*/ -!src/main/** +!src/ +!src/*/ +!src/*/* +!src/*/*/* +!src/*/*/*/* +!src/*/*/*/*/* +!src/*/*/*/*/*/* +!src/*/*/*/*/*/*/* +!src/*/*/*/*/*/*/*/* !.gitignore -!gradlew* +!gradlew !build.gradle !/gradle/ !/LICENSE.txt diff --git a/src/main/java/eu/crushedpixel/replaymod/events/GuiEventHandler.java b/src/main/java/eu/crushedpixel/replaymod/events/GuiEventHandler.java index 7d1021fd..ff8f0ee7 100755 --- a/src/main/java/eu/crushedpixel/replaymod/events/GuiEventHandler.java +++ b/src/main/java/eu/crushedpixel/replaymod/events/GuiEventHandler.java @@ -8,7 +8,7 @@ import eu.crushedpixel.replaymod.gui.GuiReplaySettings; import eu.crushedpixel.replaymod.gui.online.GuiLoginPrompt; import eu.crushedpixel.replaymod.gui.online.GuiReplayCenter; import eu.crushedpixel.replaymod.gui.online.GuiUploadFile; -import eu.crushedpixel.replaymod.gui.replaystudio.GuiReplayStudio; +import eu.crushedpixel.replaymod.gui.replaystudio.GuiReplayEditor; import eu.crushedpixel.replaymod.gui.replayviewer.GuiReplayViewer; import eu.crushedpixel.replaymod.online.authentication.AuthenticationHandler; import eu.crushedpixel.replaymod.registry.LightingHandler; @@ -176,7 +176,7 @@ public class GuiEventHandler { mc.displayGuiScreen(new GuiLoginPrompt(event.gui, new GuiReplayCenter())); } } else if(event.button.id == GuiConstants.REPLAY_EDITOR_BUTTON_ID) { - mc.displayGuiScreen(new GuiReplayStudio()); + mc.displayGuiScreen(new GuiReplayEditor()); } } else if(event.gui instanceof GuiOptions && event.button.id == GuiConstants.REPLAY_OPTIONS_BUTTON_ID) { mc.displayGuiScreen(new GuiReplaySettings(event.gui)); diff --git a/src/main/java/eu/crushedpixel/replaymod/gui/GuiCancelRender.java b/src/main/java/eu/crushedpixel/replaymod/gui/GuiCancelRender.java index ad9ae6c7..74c66ec7 100644 --- a/src/main/java/eu/crushedpixel/replaymod/gui/GuiCancelRender.java +++ b/src/main/java/eu/crushedpixel/replaymod/gui/GuiCancelRender.java @@ -4,6 +4,7 @@ import eu.crushedpixel.replaymod.replay.ReplayProcess; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiYesNo; import net.minecraft.client.gui.GuiYesNoCallback; +import net.minecraft.client.resources.I18n; public class GuiCancelRender extends GuiYesNo { @@ -21,7 +22,8 @@ public class GuiCancelRender extends GuiYesNo { }; public GuiCancelRender() { - super(callback, "Cancel Rendering", "Are you sure that you want to cancel the current rendering process?", 0); + super(callback, I18n.format("replaymod.gui.cancelrender.title"), + I18n.format("replaymod.gui.cancelrender.message"), 0); } } diff --git a/src/main/java/eu/crushedpixel/replaymod/gui/GuiReplaySaving.java b/src/main/java/eu/crushedpixel/replaymod/gui/GuiReplaySaving.java index 2eb79f47..83873fea 100755 --- a/src/main/java/eu/crushedpixel/replaymod/gui/GuiReplaySaving.java +++ b/src/main/java/eu/crushedpixel/replaymod/gui/GuiReplaySaving.java @@ -2,6 +2,7 @@ package eu.crushedpixel.replaymod.gui; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; public class GuiReplaySaving extends GuiScreen { @@ -16,8 +17,8 @@ public class GuiReplaySaving extends GuiScreen { @Override public void drawScreen(int mouseX, int mouseY, float partialTicks) { this.drawDefaultBackground(); - this.drawCenteredString(this.fontRendererObj, "Saving Replay File...", this.width / 2, 20, 16777215); - this.drawCenteredString(this.fontRendererObj, "Please wait while your recent Replay is being saved.", this.width / 2, 40, 16777215); + this.drawCenteredString(this.fontRendererObj, I18n.format("replaymod.gui.replaysaving.title"), this.width / 2, 20, 16777215); + this.drawCenteredString(this.fontRendererObj, I18n.format("replaymod.gui.replaysaving.message"), this.width / 2, 40, 16777215); super.drawScreen(mouseX, mouseY, partialTicks); if(!replaySaving) { Minecraft.getMinecraft().displayGuiScreen(waiting); diff --git a/src/main/java/eu/crushedpixel/replaymod/gui/GuiReplaySettings.java b/src/main/java/eu/crushedpixel/replaymod/gui/GuiReplaySettings.java index 9dbb59c0..86c57185 100755 --- a/src/main/java/eu/crushedpixel/replaymod/gui/GuiReplaySettings.java +++ b/src/main/java/eu/crushedpixel/replaymod/gui/GuiReplaySettings.java @@ -26,7 +26,7 @@ public class GuiReplaySettings extends GuiScreen { private static final int RESOURCEPACK_ID = 9010; private static final int WAITFORCHUNKS_ID = 9011; private static final int INDICATOR_ID = 9012; - protected String screenTitle = "Replay Mod Settings"; + protected String screenTitle = I18n.format("replaymod.gui.settings.title"); private GuiScreen parentGuiScreen; private GuiButton recordServerButton, recordSPButton, sendChatButton, linearButton, lightingButton, resourcePackButton, waitForChunksButton, showIndicatorButton; @@ -36,9 +36,9 @@ public class GuiReplaySettings extends GuiScreen { } public void initGui() { - this.screenTitle = I18n.format("Replay Mod Settings", new Object[0]); + this.screenTitle = I18n.format("replaymod.gui.settings.title"); this.buttonList.clear(); - this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height - 27, I18n.format("gui.done", new Object[0]))); + this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height - 27, I18n.format("gui.done"))); ReplaySettings settings = ReplayMod.replaySettings; @@ -49,17 +49,19 @@ public class GuiReplaySettings extends GuiScreen { if(o == RecordingOptions.notifications) { this.buttonList.add(sendChatButton = new GuiButton(SEND_CHAT, this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), 150, 20, - "Enable Notifications: " + onOff(settings.isShowNotifications()))); + I18n.format("replaymod.gui.settings.notifications")+": " + onOff(settings.isShowNotifications()))); } else if(o == RecordingOptions.recordServer) { this.buttonList.add(recordServerButton = new GuiButton(RECORDSERVER_ID, - this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), 150, 20, "Record Server: " + this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), 150, 20, + I18n.format("replaymod.gui.settings.recordserver")+": " + onOff(settings.isEnableRecordingServer()))); } else if(o == RecordingOptions.recordSingleplayer) { this.buttonList.add(recordSPButton = new GuiButton(RECORDSP_ID, this.width / 2 - 155 + i % 2 * 160, - this.height / 6 + 24 * (i >> 1), 150, 20, "Record Singleplayer: " + onOff(settings.isEnableRecordingSingleplayer()))); + this.height / 6 + 24 * (i >> 1), 150, 20, I18n.format("replaymod.gui.settings.recordsingleplayer")+": " + + onOff(settings.isEnableRecordingSingleplayer()))); } else if(o == RecordingOptions.indicator) { this.buttonList.add(showIndicatorButton = new GuiButton(INDICATOR_ID, this.width / 2 - 155 + i % 2 * 160, - this.height / 6 + 24 * (i >> 1), 150, 20, "Show Recording Indicator: " + onOff(settings.showRecordingIndicator()))); + this.height / 6 + 24 * (i >> 1), 150, 20, I18n.format("replaymod.gui.settings.indicator")+": "+ onOff(settings.showRecordingIndicator()))); } ++i; @@ -74,13 +76,13 @@ public class GuiReplaySettings extends GuiScreen { for(ReplayOptions o : ReplayOptions.values()) { if(o == ReplayOptions.lighting) { this.buttonList.add(lightingButton = new GuiButton(ENABLE_LIGHTING, this.width / 2 - 155 + i % 2 * 160, - this.height / 6 + 24 * (i >> 1), 150, 20, "Enable Lighting: " + onOff(settings.isLightingEnabled()))); + this.height / 6 + 24 * (i >> 1), 150, 20, I18n.format("replaymod.gui.settings.lighting")+": " + onOff(settings.isLightingEnabled()))); } else if(o == ReplayOptions.linear) { this.buttonList.add(linearButton = new GuiButton(FORCE_LINEAR, this.width / 2 - 155 + i % 2 * 160, - this.height / 6 + 24 * (i >> 1), 150, 20, "Camera Path: " + linearOnOff(settings.isLinearMovement()))); + this.height / 6 + 24 * (i >> 1), 150, 20, I18n.format("replaymod.gui.settings.interpolation")+": " + linearOnOff(settings.isLinearMovement()))); } else if(o == ReplayOptions.useResources) { this.buttonList.add(resourcePackButton = new GuiButton(RESOURCEPACK_ID, this.width / 2 - 155 + i % 2 * 160, - this.height / 6 + 24 * (i >> 1), 150, 20, "Server Resource Packs: " + onOff(settings.getUseResourcePacks()))); + this.height / 6 + 24 * (i >> 1), 150, 20, I18n.format("replaymod.gui.settings.resources")+": " + onOff(settings.getUseResourcePacks()))); } ++i; @@ -100,7 +102,7 @@ public class GuiReplaySettings extends GuiScreen { this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), (float) settings.getVideoQuality(), "Video Quality")); } else if(o == RenderOptions.waitForChunks) { this.buttonList.add(resourcePackButton = new GuiButton(WAITFORCHUNKS_ID, this.width / 2 - 155 + i % 2 * 160, - this.height / 6 + 24 * (i >> 1), 150, 20, "Force Render Chunks: " + onOff(settings.getWaitForChunks()))); + this.height / 6 + 24 * (i >> 1), 150, 20, I18n.format("replaymod.gui.settings.forcechunks")+": " + onOff(settings.getWaitForChunks()))); } ++i; @@ -109,20 +111,20 @@ public class GuiReplaySettings extends GuiScreen { } private String onOff(boolean on) { - return on ? "ON" : "OFF"; + return on ? I18n.format("options.on") : I18n.format("options.off"); } private String linearOnOff(boolean on) { - return on ? "Linear" : "Cubic"; + return on ? I18n.format("replaymod.gui.settings.interpolation.linear") : I18n.format("replaymod.gui.settings.interpolation.cubic"); } @Override public void drawScreen(int mouseX, int mouseY, float partialTicks) { this.drawDefaultBackground(); - this.drawCenteredString(this.fontRendererObj, "Replay Mod Settings", this.width / 2, 20, 16777215); + this.drawCenteredString(this.fontRendererObj, screenTitle, this.width / 2, 20, 16777215); if(FMLClientHandler.instance().getClient().thePlayer != null) { - this.drawCenteredString(this.fontRendererObj, "WARNING: Recording settings are going to be", this.width / 2, 180, Color.RED.getRGB()); - this.drawCenteredString(this.fontRendererObj, "applied the next time you join a world.", this.width / 2, 190, Color.RED.getRGB()); + this.drawCenteredString(this.fontRendererObj, I18n.format("replaymod.gui.settings.warning.linea"), this.width / 2, 180, Color.RED.getRGB()); + this.drawCenteredString(this.fontRendererObj, I18n.format("replaymod.gui.settings.warning.lineb"), this.width / 2, 190, Color.RED.getRGB()); } super.drawScreen(mouseX, mouseY, partialTicks); } @@ -137,49 +139,49 @@ public class GuiReplaySettings extends GuiScreen { case RECORDSERVER_ID: boolean enabled = ReplayMod.replaySettings.isEnableRecordingServer(); enabled = !enabled; - recordServerButton.displayString = "Record Server: " + onOff(enabled); + recordServerButton.displayString = I18n.format("replaymod.gui.settings.recordserver")+": " + onOff(enabled); ReplayMod.replaySettings.setEnableRecordingServer(enabled); break; case RECORDSP_ID: enabled = ReplayMod.replaySettings.isEnableRecordingSingleplayer(); enabled = !enabled; - recordSPButton.displayString = "Record Singleplayer: " + onOff(enabled); + recordSPButton.displayString = I18n.format("replaymod.gui.settings.singleplayer")+": " + onOff(enabled); ReplayMod.replaySettings.setEnableRecordingSingleplayer(enabled); break; case SEND_CHAT: enabled = ReplayMod.replaySettings.isShowNotifications(); enabled = !enabled; - sendChatButton.displayString = "Enable Notifications: " + onOff(enabled); + sendChatButton.displayString = I18n.format("replaymod.gui.settings.notifications")+": " + onOff(enabled); ReplayMod.replaySettings.setShowNotifications(enabled); break; case FORCE_LINEAR: enabled = ReplayMod.replaySettings.isLinearMovement(); enabled = !enabled; - linearButton.displayString = "Camera Path: " + linearOnOff(enabled); + linearButton.displayString = I18n.format("replaymod.gui.settings.interpolation")+": " + linearOnOff(enabled); ReplayMod.replaySettings.setLinearMovement(enabled); break; case ENABLE_LIGHTING: enabled = ReplayMod.replaySettings.isLightingEnabled(); enabled = !enabled; - lightingButton.displayString = "Enable Lighting: " + onOff(enabled); + lightingButton.displayString = I18n.format("replaymod.gui.settings.lighting")+": " + onOff(enabled); ReplayMod.replaySettings.setLightingEnabled(enabled); break; case RESOURCEPACK_ID: enabled = ReplayMod.replaySettings.getUseResourcePacks(); enabled = !enabled; - resourcePackButton.displayString = "Server Resource Packs: " + onOff(enabled); + resourcePackButton.displayString = I18n.format("replaymod.gui.settings.resources")+": " + onOff(enabled); ReplayMod.replaySettings.setUseResourcePacks(enabled); break; case WAITFORCHUNKS_ID: enabled = ReplayMod.replaySettings.getWaitForChunks(); enabled = !enabled; - resourcePackButton.displayString = "Force Render Chunks: " + onOff(enabled); + resourcePackButton.displayString = I18n.format("replaymod.gui.settings.forcechunks")+": " + onOff(enabled); ReplayMod.replaySettings.setWaitForChunks(enabled); break; case INDICATOR_ID: enabled = ReplayMod.replaySettings.showRecordingIndicator(); enabled = !enabled; - showIndicatorButton.displayString = "Show Recording Indicator: " + onOff(enabled); + showIndicatorButton.displayString = I18n.format("replaymod.gui.settings.indicator")+": " + onOff(enabled); ReplayMod.replaySettings.setEnableIndicator(enabled); break; } diff --git a/src/main/java/eu/crushedpixel/replaymod/gui/GuiSpectateSelection.java b/src/main/java/eu/crushedpixel/replaymod/gui/GuiSpectateSelection.java index 7c73eaf6..5bb4beb2 100755 --- a/src/main/java/eu/crushedpixel/replaymod/gui/GuiSpectateSelection.java +++ b/src/main/java/eu/crushedpixel/replaymod/gui/GuiSpectateSelection.java @@ -7,6 +7,7 @@ import net.minecraft.client.entity.AbstractClientPlayer; import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EnumPlayerModelParts; import net.minecraft.potion.Potion; @@ -26,7 +27,6 @@ public class GuiSpectateSelection extends GuiScreen { private int playerCount; private int upperPlayer = 0; - private int upperBound = 30; private int lowerBound; private double prevSpeed; @@ -34,6 +34,8 @@ public class GuiSpectateSelection extends GuiScreen { private int lastY = 0; private int fitting = 0; + private final String screenTitle = I18n.format("replaymod.gui.spectate.title"); + public GuiSpectateSelection(List players) { this.prevSpeed = ReplayMod.replaySender.getReplaySpeed(); @@ -77,7 +79,6 @@ public class GuiSpectateSelection extends GuiScreen { } } int k2 = (int) (this.width * 0.4); - int l2 = 30; if(mouseX >= k2 && mouseX <= (this.width * 0.6) && mouseY >= 30 && mouseY <= lowerBound) { int off = mouseY - 30; @@ -134,7 +135,7 @@ public class GuiSpectateSelection extends GuiScreen { @Override public void drawScreen(int mouseX, int mouseY, float partialTicks) { - this.drawCenteredString(fontRendererObj, "Spectate Player", this.width / 2, 5, Color.WHITE.getRGB()); + this.drawCenteredString(fontRendererObj, screenTitle, this.width / 2, 5, Color.WHITE.getRGB()); int k2 = (int) (this.width * 0.4); int l2 = 30; @@ -155,7 +156,7 @@ public class GuiSpectateSelection extends GuiScreen { mc.getTextureManager().bindTexture(p.second()); - this.drawScaledCustomSizeModalRect(k2, l2, 8.0F, 8.0F, 8, 8, 16, 16, 64.0F, 64.0F); + drawScaledCustomSizeModalRect(k2, l2, 8.0F, 8.0F, 8, 8, 16, 16, 64.0F, 64.0F); if(p.first().func_175148_a(EnumPlayerModelParts.HAT)) Gui.drawScaledCustomSizeModalRect(k2, l2, 40.0F, 8.0F, 8, 8, 16, 16, 64.0F, 64.0F); @@ -184,12 +185,9 @@ public class GuiSpectateSelection extends GuiScreen { float posPerc = ((float) upperPlayer) / playerCount; int barY = (int) (posPerc * (height - 32 - 32)); - this.drawRect(k2 - 18, 30 - 2, k2 - 10, this.height - 30 - 2, Color.BLACK.getRGB()); - this.drawRect(k2 - 16, 32 - 2 + barY, k2 - 12, 32 - 1 + barY + barHeight, Color.LIGHT_GRAY.getRGB()); - } else { - + drawRect(k2 - 18, 30 - 2, k2 - 10, this.height - 30 - 2, Color.BLACK.getRGB()); + drawRect(k2 - 16, 32 - 2 + barY, k2 - 12, 32 - 1 + barY + barHeight, Color.LIGHT_GRAY.getRGB()); } - super.drawScreen(mouseX, mouseY, partialTicks); } diff --git a/src/main/java/eu/crushedpixel/replaymod/gui/GuiVideoQualitySlider.java b/src/main/java/eu/crushedpixel/replaymod/gui/GuiVideoQualitySlider.java index 57912a97..49c079cd 100755 --- a/src/main/java/eu/crushedpixel/replaymod/gui/GuiVideoQualitySlider.java +++ b/src/main/java/eu/crushedpixel/replaymod/gui/GuiVideoQualitySlider.java @@ -4,6 +4,7 @@ import eu.crushedpixel.replaymod.ReplayMod; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.resources.I18n; import net.minecraft.util.MathHelper; public class GuiVideoQualitySlider extends GuiButton { @@ -18,15 +19,20 @@ public class GuiVideoQualitySlider extends GuiButton { this.displayKey = displayKey; } + private final String DRAFT = I18n.format("replaymod.gui.settings.videoquality.draft"); + private final String NORMAL = I18n.format("replaymod.gui.settings.videoquality.normal"); + private final String GOOD= I18n.format("replaymod.gui.settings.videoquality.good"); + private final String BEST = I18n.format("replaymod.gui.settings.videoquality.best"); + private String translate(float value) { if(value <= 0.3) { - return "Draft"; + return DRAFT; } else if(value <= 0.5) { - return "Normal"; + return NORMAL; } else if(value <= 0.7) { - return "Good"; + return GOOD; } - return "Best"; + return BEST; } protected int getHoverState(boolean mouseOver) { diff --git a/src/main/java/eu/crushedpixel/replaymod/gui/replaystudio/GuiConnectPart.java b/src/main/java/eu/crushedpixel/replaymod/gui/replaystudio/GuiConnectPart.java index 5bcbc857..18f38aa7 100755 --- a/src/main/java/eu/crushedpixel/replaymod/gui/replaystudio/GuiConnectPart.java +++ b/src/main/java/eu/crushedpixel/replaymod/gui/replaystudio/GuiConnectPart.java @@ -8,6 +8,7 @@ import eu.crushedpixel.replaymod.gui.elements.listeners.SelectionListener; import eu.crushedpixel.replaymod.utils.ReplayFileIO; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.resources.I18n; import org.apache.commons.io.FilenameUtils; import java.awt.*; @@ -18,8 +19,8 @@ import java.util.List; public class GuiConnectPart extends GuiStudioPart { - private static final String DESCRIPTION = "Connects multiple Replays in the same order as the list."; - private static final String TITLE = "Connect Replays"; + private final String DESCRIPTION = I18n.format("replaymod.gui.editor.connect.description"); + private final String TITLE = I18n.format("replaymod.gui.editor.connect.title"); private boolean initialized = false; @@ -60,7 +61,7 @@ public class GuiConnectPart extends GuiStudioPart { if(!initialized) { concatList = new GuiEntryList(1, fontRendererObj, 30, yPos, 150, 0); filesToConcat = new ArrayList(); - String selectedName = FilenameUtils.getBaseName(GuiReplayStudio.instance.getSelectedFile().getAbsolutePath()); + String selectedName = FilenameUtils.getBaseName(GuiReplayEditor.instance.getSelectedFile().getAbsolutePath()); filesToConcat.add(selectedName); concatList.setElements(filesToConcat); @@ -88,7 +89,7 @@ public class GuiConnectPart extends GuiStudioPart { @Override public void onSelectionChanged(int selectionIndex) { try { - filesToConcat.set(concatList.getSelectionIndex(), (String) replayDropdown.getElement(selectionIndex)); + filesToConcat.set(concatList.getSelectionIndex(), replayDropdown.getElement(selectionIndex)); concatList.setElements(filesToConcat); } catch(Exception e) { } //Sorry, too lazy to properly avoid this Exception here @@ -120,26 +121,26 @@ public class GuiConnectPart extends GuiStudioPart { downButton = new GuiArrowButton(GuiConstants.REPLAY_EDITOR_DOWN_BUTTON, 219, yPos + 40, "", false); buttonList.add(downButton); - int w = GuiReplayStudio.instance.width - 243 - 20 - 4; + int w = GuiReplayEditor.instance.width - 243 - 20 - 4; - removeButton = new GuiButton(GuiConstants.REPLAY_EDITOR_REMOVE_BUTTON, 249, yPos + 40, "Remove"); + removeButton = new GuiButton(GuiConstants.REPLAY_EDITOR_REMOVE_BUTTON, 249, yPos + 40, I18n.format("replaymod.gui.remove")); buttonList.add(removeButton); - addButton = new GuiButton(GuiConstants.REPLAY_EDITOR_ADD_BUTTON, 0, yPos + 40, "Add"); + addButton = new GuiButton(GuiConstants.REPLAY_EDITOR_ADD_BUTTON, 0, yPos + 40, I18n.format("replaymod.gui.add")); buttonList.add(addButton); concatList.setSelectionIndex(0); } - int w = GuiReplayStudio.instance.width - 249 - 20 - 4; + int w = GuiReplayEditor.instance.width - 249 - 20 - 4; addButton.xPosition = 249 + 6 + (w / 2); addButton.width = w / 2 + 2; removeButton.width = w / 2 + 2; - replayDropdown.width = GuiReplayStudio.instance.width - 250 - 18; + replayDropdown.width = GuiReplayEditor.instance.width - 250 - 18; - int h = GuiReplayStudio.instance.height - yPos - 20; + int h = GuiReplayEditor.instance.height - yPos - 20; int rows = (int) (h / (float) GuiEntryList.elementHeight); concatList.setVisibleElements(rows); @@ -159,7 +160,7 @@ public class GuiConnectPart extends GuiStudioPart { concatList.drawTextBox(); replayDropdown.drawTextBox(); - drawString(fontRendererObj, "Replay:", 200, yPos + 5 + 7, Color.WHITE.getRGB()); + drawString(fontRendererObj, I18n.format("replaymod.gui.replay")+":", 200, yPos + 5 + 7, Color.WHITE.getRGB()); } @Override diff --git a/src/main/java/eu/crushedpixel/replaymod/gui/replaystudio/GuiReplayStudio.java b/src/main/java/eu/crushedpixel/replaymod/gui/replaystudio/GuiReplayEditor.java similarity index 88% rename from src/main/java/eu/crushedpixel/replaymod/gui/replaystudio/GuiReplayStudio.java rename to src/main/java/eu/crushedpixel/replaymod/gui/replaystudio/GuiReplayEditor.java index e6d508c1..5da7045c 100755 --- a/src/main/java/eu/crushedpixel/replaymod/gui/replaystudio/GuiReplayStudio.java +++ b/src/main/java/eu/crushedpixel/replaymod/gui/replaystudio/GuiReplayEditor.java @@ -6,6 +6,7 @@ import eu.crushedpixel.replaymod.utils.ReplayFileIO; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiMainMenu; import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.resources.I18n; import org.apache.commons.io.FilenameUtils; import java.awt.*; @@ -14,10 +15,10 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; -public class GuiReplayStudio extends GuiScreen { +public class GuiReplayEditor extends GuiScreen { private static final int tabYPos = 110; - public static GuiReplayStudio instance = null; + public static GuiReplayEditor instance = null; private StudioTab currentTab = StudioTab.TRIM; private GuiDropdown replayDropdown; private GuiButton saveModeButton, saveButton; @@ -25,7 +26,7 @@ public class GuiReplayStudio extends GuiScreen { private boolean initialized = false; private List replayFiles = new ArrayList(); - public GuiReplayStudio() { + public GuiReplayEditor() { instance = this; } @@ -50,9 +51,9 @@ public class GuiReplayStudio extends GuiScreen { public void initGui() { List tabButtons = new ArrayList(); - tabButtons.add(new GuiButton(GuiConstants.REPLAY_EDITOR_TRIM_TAB, 0, 0, "Trim Replay")); - tabButtons.add(new GuiButton(GuiConstants.REPLAY_EDITOR_CONNECT_TAB, 0, 0, "Connect Replays")); - tabButtons.add(new GuiButton(GuiConstants.REPLAY_EDITOR_MODIFY_TAB, 0, 0, "Modify Replay")); + tabButtons.add(new GuiButton(GuiConstants.REPLAY_EDITOR_TRIM_TAB, 0, 0, I18n.format("replaymod.gui.editor.trim.title"))); + tabButtons.add(new GuiButton(GuiConstants.REPLAY_EDITOR_CONNECT_TAB, 0, 0, I18n.format("replaymod.gui.editor.connect.title"))); + tabButtons.add(new GuiButton(GuiConstants.REPLAY_EDITOR_MODIFY_TAB, 0, 0, I18n.format("replaymod.gui.editor.modify.title"))); int w = this.width - 30; int w2 = w / tabButtons.size(); @@ -86,11 +87,11 @@ public class GuiReplayStudio extends GuiScreen { buttonList.add(saveModeButton); - GuiButton backButton = new GuiButton(GuiConstants.REPLAY_EDITOR_BACK_BUTTON, width - 70 - 18, height - 20 - 5, "Back"); + GuiButton backButton = new GuiButton(GuiConstants.REPLAY_EDITOR_BACK_BUTTON, width - 70 - 18, height - 20 - 5, I18n.format("replaymod.gui.back")); backButton.width = 70; buttonList.add(backButton); - saveButton = new GuiButton(GuiConstants.REPLAY_EDITOR_SAVE_BUTTON, width - 70 - 18, height - (2 * 20) - 5 - 3, "Save"); + saveButton = new GuiButton(GuiConstants.REPLAY_EDITOR_SAVE_BUTTON, width - 70 - 18, height - (2 * 20) - 5 - 3, I18n.format("replaymod.gui.save")); saveButton.width = 70; buttonList.add(saveButton); @@ -102,7 +103,7 @@ public class GuiReplayStudio extends GuiScreen { } private String getSaveModeLabel() { - return overrideSave ? "Replace Source File" : "Save to new File"; + return overrideSave ? I18n.format("replaymod.gui.editor.savemode.override") : I18n.format("replaymod.gui.editor.savemode.newfile"); } ; @@ -182,8 +183,8 @@ public class GuiReplayStudio extends GuiScreen { i++; } - drawCenteredString(fontRendererObj, "Replay Studio", this.width / 2, 10, 16777215); - drawString(fontRendererObj, "Replay File:", 30, 67, Color.WHITE.getRGB()); + drawCenteredString(fontRendererObj, I18n.format("replaymod.gui.replayeditor"), this.width / 2, 10, 16777215); + drawString(fontRendererObj, I18n.format("replaymod.gui.editor.replayfile"), 30, 67, Color.WHITE.getRGB()); replayDropdown.drawTextBox(); } diff --git a/src/main/java/eu/crushedpixel/replaymod/gui/replaystudio/GuiTrimPart.java b/src/main/java/eu/crushedpixel/replaymod/gui/replaystudio/GuiTrimPart.java index 67b84f83..81ee4b1f 100755 --- a/src/main/java/eu/crushedpixel/replaymod/gui/replaystudio/GuiTrimPart.java +++ b/src/main/java/eu/crushedpixel/replaymod/gui/replaystudio/GuiTrimPart.java @@ -3,6 +3,7 @@ package eu.crushedpixel.replaymod.gui.replaystudio; import eu.crushedpixel.replaymod.gui.elements.GuiNumberInput; import eu.crushedpixel.replaymod.studio.StudioImplementation; import net.minecraft.client.Minecraft; +import net.minecraft.client.resources.I18n; import org.lwjgl.input.Keyboard; import java.awt.*; @@ -12,8 +13,8 @@ import java.util.List; public class GuiTrimPart extends GuiStudioPart { - private static final String DESCRIPTION = "Removes the beginning and end of a Replay File and only keeps the Replay between the given timestamps."; - private static final String TITLE = "Trim Replay"; + private static final String DESCRIPTION = I18n.format("replaymod.gui.editor.trim.description"); + private final String TITLE = I18n.format("replaymod.gui.editor.trim.title"); private Minecraft mc = Minecraft.getMinecraft(); private boolean initialized = false; @@ -103,8 +104,8 @@ public class GuiTrimPart extends GuiStudioPart { @Override public void drawScreen(int mouseX, int mouseY, float partialTicks) { - drawString(mc.fontRendererObj, "Start:", 30, yPos + 7, Color.WHITE.getRGB()); - drawString(mc.fontRendererObj, "End:", 30, yPos + 7 + 30, Color.WHITE.getRGB()); + drawString(mc.fontRendererObj, I18n.format("replaymod.gui.start")+":", 30, yPos + 7, Color.WHITE.getRGB()); + drawString(mc.fontRendererObj, I18n.format("replaymod.gui.end")+":", 30, yPos + 7 + 30, Color.WHITE.getRGB()); drawString(mc.fontRendererObj, "m", 105, yPos + 7, Color.WHITE.getRGB()); drawString(mc.fontRendererObj, "m", 105, yPos + 7 + 30, Color.WHITE.getRGB()); drawString(mc.fontRendererObj, "s", 150, yPos + 7, Color.WHITE.getRGB()); diff --git a/src/main/java/eu/crushedpixel/replaymod/gui/replayviewer/GuiRenameReplay.java b/src/main/java/eu/crushedpixel/replaymod/gui/replayviewer/GuiRenameReplay.java index 684c5f27..3458b573 100755 --- a/src/main/java/eu/crushedpixel/replaymod/gui/replayviewer/GuiRenameReplay.java +++ b/src/main/java/eu/crushedpixel/replaymod/gui/replayviewer/GuiRenameReplay.java @@ -13,7 +13,6 @@ import java.io.File; import java.io.IOException; public class GuiRenameReplay extends GuiScreen { - private static final String __OBFID = "CL_00000709"; private GuiScreen field_146585_a; private GuiTextField field_146583_f; private File file; @@ -30,8 +29,8 @@ public class GuiRenameReplay extends GuiScreen { public void initGui() { Keyboard.enableRepeatEvents(true); this.buttonList.clear(); - this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, I18n.format("Rename", new Object[0]))); - this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.format("Cancel", new Object[0]))); + this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, I18n.format("replaymod.gui.rename"))); + this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.format("replaymod.gui.cancel"))); String s = FilenameUtils.getBaseName(file.getAbsolutePath()); this.field_146583_f = new GuiTextField(2, this.fontRendererObj, this.width / 2 - 100, 60, 200, 20); this.field_146583_f.setFocused(true); @@ -78,8 +77,8 @@ public class GuiRenameReplay extends GuiScreen { public void drawScreen(int mouseX, int mouseY, float partialTicks) { this.drawDefaultBackground(); - this.drawCenteredString(this.fontRendererObj, I18n.format("Rename World", new Object[0]), this.width / 2, 20, 16777215); - this.drawString(this.fontRendererObj, I18n.format("Replay Name", new Object[0]), this.width / 2 - 100, 47, 10526880); + this.drawCenteredString(this.fontRendererObj, I18n.format("replaymod.gui.viewer.rename.title"), this.width / 2, 20, 16777215); + this.drawString(this.fontRendererObj, I18n.format("replaymod.gui.viewer.rename.name"), this.width / 2 - 100, 47, 10526880); this.field_146583_f.drawTextBox(); super.drawScreen(mouseX, mouseY, partialTicks); } diff --git a/src/main/java/eu/crushedpixel/replaymod/gui/replayviewer/GuiReplayViewer.java b/src/main/java/eu/crushedpixel/replaymod/gui/replayviewer/GuiReplayViewer.java index f4971f44..a1414339 100755 --- a/src/main/java/eu/crushedpixel/replaymod/gui/replayviewer/GuiReplayViewer.java +++ b/src/main/java/eu/crushedpixel/replaymod/gui/replayviewer/GuiReplayViewer.java @@ -55,10 +55,10 @@ public class GuiReplayViewer extends GuiScreen implements GuiYesNoCallback { private boolean delete_file = false; public static GuiYesNo getYesNoGui(GuiYesNoCallback p_152129_0_, String file, int p_152129_2_) { - String s1 = I18n.format("Are you sure you want to delete this replay?", new Object[0]); - String s2 = "\'" + file + "\' " + I18n.format("will be lost forever! (A long time!)", new Object[0]); - String s3 = I18n.format("Delete", new Object[0]); - String s4 = I18n.format("Cancel", new Object[0]); + String s1 = I18n.format("replaymod.gui.viewer.delete.linea"); + String s2 = "\'" + file + "\' " + I18n.format("replaymod.gui.viewer.delete.lineb"); + String s3 = I18n.format("replaymod.gui.delete"); + String s4 = I18n.format("replaymod.gui.cancel"); GuiYesNo guiyesno = new GuiYesNo(p_152129_0_, s1, s2, s3, s4, p_152129_2_); return guiyesno; } @@ -132,13 +132,13 @@ public class GuiReplayViewer extends GuiScreen implements GuiYesNoCallback { } private void createButtons() { - this.buttonList.add(loadButton = new GuiButton(LOAD_BUTTON_ID, this.width / 2 - 154, this.height - 52, 73, 20, I18n.format("Load", new Object[0]))); - this.buttonList.add(uploadButton = new GuiButton(UPLOAD_BUTTON_ID, this.width / 2 - 154 + 78, this.height - 52, 73, 20, I18n.format("Upload", new Object[0]))); - this.buttonList.add(folderButton = new GuiButton(FOLDER_BUTTON_ID, this.width / 2 + 4, this.height - 52, 150, 20, I18n.format("Open Replay Folder...", new Object[0]))); - this.buttonList.add(renameButton = new GuiButton(RENAME_BUTTON_ID, this.width / 2 - 154, this.height - 28, 72, 20, I18n.format("Rename", new Object[0]))); - this.buttonList.add(deleteButton = new GuiButton(DELETE_BUTTON_ID, this.width / 2 - 76, this.height - 28, 72, 20, I18n.format("Delete", new Object[0]))); - this.buttonList.add(settingsButton = new GuiButton(SETTINGS_BUTTON_ID, this.width / 2 + 4, this.height - 28, 72, 20, I18n.format("Settings", new Object[0]))); - this.buttonList.add(cancelButton = new GuiButton(CANCEL_BUTTON_ID, this.width / 2 + 4 + 78, this.height - 28, 72, 20, I18n.format("Cancel", new Object[0]))); + this.buttonList.add(loadButton = new GuiButton(LOAD_BUTTON_ID, this.width / 2 - 154, this.height - 52, 73, 20, I18n.format("replaymod.gui.load"))); + this.buttonList.add(uploadButton = new GuiButton(UPLOAD_BUTTON_ID, this.width / 2 - 154 + 78, this.height - 52, 73, 20, I18n.format("replaymod.gui.upload"))); + this.buttonList.add(folderButton = new GuiButton(FOLDER_BUTTON_ID, this.width / 2 + 4, this.height - 52, 150, 20, I18n.format("replaymod.gui.viewer.replayfolder"))); + this.buttonList.add(renameButton = new GuiButton(RENAME_BUTTON_ID, this.width / 2 - 154, this.height - 28, 72, 20, I18n.format("replaymod.gui.rename"))); + this.buttonList.add(deleteButton = new GuiButton(DELETE_BUTTON_ID, this.width / 2 - 76, this.height - 28, 72, 20, I18n.format("replaymod.gui.delete"))); + this.buttonList.add(settingsButton = new GuiButton(SETTINGS_BUTTON_ID, this.width / 2 + 4, this.height - 28, 72, 20, I18n.format("replaymod.gui.settings"))); + this.buttonList.add(cancelButton = new GuiButton(CANCEL_BUTTON_ID, this.width / 2 + 4 + 78, this.height - 28, 72, 20, I18n.format("replaymod.gui.cancel"))); setButtonsEnabled(false); } @@ -165,7 +165,7 @@ public class GuiReplayViewer extends GuiScreen implements GuiYesNoCallback { this.hoveringText = null; this.drawDefaultBackground(); this.replayGuiList.drawScreen(mouseX, mouseY, partialTicks); - this.drawCenteredString(this.fontRendererObj, "Replay Viewer", this.width / 2, 20, 16777215); + this.drawCenteredString(this.fontRendererObj, I18n.format("replaymod.gui.replayviewer"), this.width / 2, 20, 16777215); super.drawScreen(mouseX, mouseY, partialTicks); } @@ -256,7 +256,7 @@ public class GuiReplayViewer extends GuiScreen implements GuiYesNoCallback { } public void loadReplay(int id) { - mc.displayGuiScreen((GuiScreen) null); + mc.displayGuiScreen(null); try { ReplayHandler.startReplay(replayFileList.get(id).first().first()); diff --git a/src/main/resources/assets/replaymod/lang/en_US.lang b/src/main/resources/assets/replaymod/lang/en_US.lang index d7656d67..4e64e29b 100644 --- a/src/main/resources/assets/replaymod/lang/en_US.lang +++ b/src/main/resources/assets/replaymod/lang/en_US.lang @@ -20,6 +20,7 @@ replaymod.category.build=Build replaymod.category.misc=Miscellaneous #Common GUI-related strings +replaymod.gui.replay=Replay replaymod.gui.login=Login replaymod.gui.logout=Logout replaymod.gui.cancel=Cancel @@ -27,11 +28,24 @@ replaymod.gui.username=Username replaymod.gui.password=Password replaymod.gui.back=Back replaymod.gui.duration=Duration +replaymod.gui.load=Load +replaymod.gui.save=Save +replaymod.gui.upload=Upload +replaymod.gui.rename=Rename +replaymod.gui.remove=Remove +replaymod.gui.add=Add +replaymod.gui.start=Start +replaymod.gui.end=End +replaymod.gui.delete=Delete replaymod.gui.mainmenu=Main Menu +replaymod.gui.settings=Settings + +#Only change these if it's neccessary replaymod.gui.replayviewer=Replay Viewer replaymod.gui.replaycenter=Replay Center replaymod.gui.replaysettings=Replay Settings +replaymod.gui.replayeditor=Replay Editor #Login GUI replaymod.gui.login.title=Login to ReplayMod.com @@ -39,6 +53,16 @@ replaymod.gui.login.logging=Logging in... replaymod.gui.login.incorrect=Incorrect username or password replaymod.gui.login.connectionerror=Could not connect to ReplayMod.com +#Replay Viewer GUI +replaymod.gui.viewer.rename.title=Rename Replay +replaymod.gui.viewer.rename.name=Replay Name +replaymod.gui.viewer.replayfolder=Open Replay Folder... + +replaymod.gui.viewer.delete.linea=Are you sure you want to delete this replay? + +#The Replay file name is inserted before the following string, e.g. "Some Replay will be lost forever!..." +replaymod.gui.viewer.delete.lineb=will be lost forever! (a long time!) + #Replay Center GUI replaymod.gui.center.logoutcallback=Do you really want to log out? replaymod.gui.center.newest=Newest Replays @@ -54,3 +78,50 @@ replaymod.gui.upload.tagshint=Tags separated by comma replaymod.gui.upload.uploading=Uploading... replaymod.gui.upload.success=File has been successfully uploaded +#Replay Editor +replaymod.gui.editor.replayfile=Replay File + +replaymod.gui.editor.savemode.override=Replace Source File +replaymod.gui.editor.savemode.newfile=Save to new File + +replaymod.gui.editor.trim.title=Trim Replay +replaymod.gui.editor.connect.title=Connect Replays +replaymod.gui.editor.modify.title=Modify Replay + +replaymod.gui.editor.trim.description=Removes the beginning and end of a Replay File, only keeping the Replay between the given timestamps +replaymod.gui.editor.connect.description=Connects multiple Replays in the specified order +replaymod.gui.editor.modify.description + +#Spectate Player GUI +replaymod.gui.spectate.title=Spectate Player + +#Cancel Replay GUI +replaymod.gui.cancelrender.title=Cancel Rendering +replaymod.gui.cancelrender.message=Are you sure that you want to cancel the current rendering process? + +#Saving Replay GUI +replaymod.gui.replaysaving.title=Saving Replay File... +replaymod.gui.replaysaving.message=Please wait while your recent Replay is being saved. + +#Replay Mod Settings GUI +replaymod.gui.settings.title=Replay Mod Settings + +replaymod.gui.settings.interpolation.linear=Linear +replaymod.gui.settings.interpolation.cubic=Cubic + +replaymod.gui.settings.notifications=Enable Notifications +replaymod.gui.settings.recordserver=Record Server +replaymod.gui.settings.recordsingleplayer=Record Singleplayer +replaymod.gui.settings.indicator=Recording Indicator +replaymod.gui.settings.lighting=Ambient Lighting +replaymod.gui.settings.forcechunks=Force Render Chunks +replaymod.gui.settings.resources=Server Resource Packs +replaymod.gui.settings.interpolation=Path Interpolation + +replaymod.gui.settings.videoquality.draft=Draft +replaymod.gui.settings.videoquality.normal=Normal +replaymod.gui.settings.videoquality.good=Good +replaymod.gui.settings.videoquality.best=Best + +replaymod.gui.settings.warning.linea=WARNING: Recording settings will be +replaymod.gui.settings.warning.lineb=applied the next time you join a world. \ No newline at end of file