Localized GUI Strings

This commit is contained in:
CrushedPixel
2015-04-26 14:32:33 +02:00
parent 79be2bd0d5
commit 60a9541c16
13 changed files with 178 additions and 88 deletions

View File

@@ -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;
}