From eb281b9df42a1fa66b03d7705b710375eed82ca8 Mon Sep 17 00:00:00 2001 From: CrushedPixel Date: Sun, 2 Aug 2015 13:56:34 +0200 Subject: [PATCH] Added Disclaimer to GuiRegister telling users that registering means they agree with ReplayMod.com's Terms of Services --- .../replaymod/gui/online/GuiRegister.java | 11 +++++++++++ src/main/resources/assets/replaymod/lang/en_US.lang | 2 ++ 2 files changed, 13 insertions(+) diff --git a/src/main/java/eu/crushedpixel/replaymod/gui/online/GuiRegister.java b/src/main/java/eu/crushedpixel/replaymod/gui/online/GuiRegister.java index 203364c8..ead96fff 100644 --- a/src/main/java/eu/crushedpixel/replaymod/gui/online/GuiRegister.java +++ b/src/main/java/eu/crushedpixel/replaymod/gui/online/GuiRegister.java @@ -11,6 +11,8 @@ import eu.crushedpixel.replaymod.api.ApiException; import eu.crushedpixel.replaymod.online.authentication.AuthenticationHandler; import eu.crushedpixel.replaymod.utils.EmailAddressUtils; import eu.crushedpixel.replaymod.utils.RegexUtils; +import net.minecraft.client.resources.I18n; +import org.lwjgl.util.Dimension; import org.lwjgl.util.ReadableColor; public class GuiRegister extends AbstractGuiScreen { @@ -19,6 +21,7 @@ public class GuiRegister extends AbstractGuiScreen { private final GuiPasswordField passwordInput, passwordConfirmation; private final GuiButton registerButton = new GuiButton(this).setI18nLabel("replaymod.gui.register").setSize(150, 20).setDisabled(); private final GuiButton cancelButton = new GuiButton(this).setI18nLabel("replaymod.gui.cancel").setSize(150, 20); + private final GuiLabel disclaimerLabel = new GuiLabel(this).setI18nText(I18n.format("replaymod.gui.register.disclaimer")); private final GuiLabel statusLabel = new GuiLabel(this).setColor(ReadableColor.RED); { @@ -50,6 +53,14 @@ public class GuiRegister extends AbstractGuiScreen { pos(registerButton, width / 2 - 152, 170); pos(cancelButton, width / 2 + 2, 170); pos(statusLabel, width / 2 - statusLabel.getMinSize().getWidth() / 2, 152); + + int lineCount = getMinecraft().fontRendererObj + .listFormattedStringToWidth(disclaimerLabel.getText(), width - 10).size(); + Dimension dim = new Dimension(width - 10, getMinecraft().fontRendererObj.FONT_HEIGHT*lineCount); + disclaimerLabel.setMinSize(dim); + disclaimerLabel.setMaxSize(dim); + pos(disclaimerLabel, width / 2 - disclaimerLabel.getMinSize().getWidth() / 2, + height - disclaimerLabel.getMinSize().getHeight() - 5); } }); diff --git a/src/main/resources/assets/replaymod/lang/en_US.lang b/src/main/resources/assets/replaymod/lang/en_US.lang index 29942af4..9ca45798 100644 --- a/src/main/resources/assets/replaymod/lang/en_US.lang +++ b/src/main/resources/assets/replaymod/lang/en_US.lang @@ -127,6 +127,8 @@ replaymod.gui.login.connectionerror=Could not connect to ReplayMod.com replaymod.gui.register.title=Register on ReplayMod.com replaymod.gui.register.confirmpw=Confirm Password +replaymod.gui.register.disclaimer=By registering an account, you agree to the Replay Mod's Terms of Service: https://replaymod.com/legal/terms + replaymod.gui.register.error.nomatch=Passwords don't match replaymod.gui.register.error.shortusername=Username has to be at least 5 characters long replaymod.gui.register.error.invalidname=Username may only contain letters and numbers