Rearranged Input Fields and according Label Strings in Register and Login GUI (looks a lot better now)
This commit is contained in:
@@ -132,10 +132,12 @@ public class GuiLoginPrompt extends GuiScreen {
|
|||||||
this.drawDefaultBackground();
|
this.drawDefaultBackground();
|
||||||
drawCenteredString(fontRendererObj, I18n.format("replaymod.gui.login.title"), this.width / 2, 10, Color.WHITE.getRGB());
|
drawCenteredString(fontRendererObj, I18n.format("replaymod.gui.login.title"), this.width / 2, 10, Color.WHITE.getRGB());
|
||||||
|
|
||||||
drawString(fontRendererObj, usernameLabel, this.width / 2 - (45+10+strwidth2), 37, Color.WHITE.getRGB());
|
drawString(fontRendererObj, usernameLabel, username.xPosition-10-fontRendererObj.getStringWidth(usernameLabel),
|
||||||
|
37, Color.WHITE.getRGB());
|
||||||
username.drawTextBox();
|
username.drawTextBox();
|
||||||
|
|
||||||
drawString(fontRendererObj, passwordLabel, this.width / 2 - (45+10+strwidth2), 67, Color.WHITE.getRGB());
|
drawString(fontRendererObj, passwordLabel, password.xPosition-10-fontRendererObj.getStringWidth(passwordLabel),
|
||||||
|
67, Color.WHITE.getRGB());
|
||||||
password.drawTextBox();
|
password.drawTextBox();
|
||||||
|
|
||||||
switch(textState) {
|
switch(textState) {
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ public class GuiRegister extends GuiScreen {
|
|||||||
private boolean initialized = false;
|
private boolean initialized = false;
|
||||||
|
|
||||||
private int strwidth = 0;
|
private int strwidth = 0;
|
||||||
|
private int totalwidth = 0;
|
||||||
|
|
||||||
private String[] labels = new String[]{I18n.format("replaymod.gui.username"), I18n.format("replaymod.gui.mail"), I18n.format("replaymod.gui.password"),
|
private String[] labels = new String[]{I18n.format("replaymod.gui.username"), I18n.format("replaymod.gui.mail"), I18n.format("replaymod.gui.password"),
|
||||||
I18n.format("replaymod.gui.register.confirmpw")};
|
I18n.format("replaymod.gui.register.confirmpw")};
|
||||||
@@ -56,9 +57,6 @@ public class GuiRegister extends GuiScreen {
|
|||||||
cancelButton.width = 150;
|
cancelButton.width = 150;
|
||||||
} else {
|
} else {
|
||||||
usernameInput.xPosition = mailInput.xPosition = passwordInput.xPosition = passwordConfirmation.xPosition = this.width / 2 - 45;
|
usernameInput.xPosition = mailInput.xPosition = passwordInput.xPosition = passwordConfirmation.xPosition = this.width / 2 - 45;
|
||||||
|
|
||||||
registerButton.xPosition = this.width / 2 - 150 - 2;
|
|
||||||
cancelButton.xPosition = this.width / 2 + 2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inputFields = new ArrayList<GuiTextField>();
|
inputFields = new ArrayList<GuiTextField>();
|
||||||
@@ -67,18 +65,24 @@ public class GuiRegister extends GuiScreen {
|
|||||||
inputFields.add(passwordInput);
|
inputFields.add(passwordInput);
|
||||||
inputFields.add(passwordConfirmation);
|
inputFields.add(passwordConfirmation);
|
||||||
|
|
||||||
buttonList.add(registerButton);
|
|
||||||
buttonList.add(cancelButton);
|
|
||||||
|
|
||||||
strwidth = Math.max(Math.max(fontRendererObj.getStringWidth(labels[0]), fontRendererObj.getStringWidth(labels[1])),
|
strwidth = Math.max(Math.max(fontRendererObj.getStringWidth(labels[0]), fontRendererObj.getStringWidth(labels[1])),
|
||||||
Math.max(fontRendererObj.getStringWidth(labels[2]), fontRendererObj.getStringWidth(labels[3])));
|
Math.max(fontRendererObj.getStringWidth(labels[2]), fontRendererObj.getStringWidth(labels[3])));
|
||||||
|
|
||||||
|
totalwidth = 145+10+strwidth;
|
||||||
|
|
||||||
|
for(GuiTextField f : inputFields)
|
||||||
|
f.xPosition = (width/2) - (totalwidth/2) + strwidth+5;
|
||||||
|
|
||||||
|
buttonList.add(registerButton);
|
||||||
|
buttonList.add(cancelButton);
|
||||||
|
|
||||||
initialized = true;
|
initialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
|
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
|
||||||
this.drawDefaultBackground();
|
this.drawDefaultBackground();
|
||||||
|
drawCenteredString(fontRendererObj, I18n.format("replaymod.gui.register.title"), this.width / 2, 10, Color.WHITE.getRGB());
|
||||||
|
|
||||||
for(GuiTextField f : inputFields) {
|
for(GuiTextField f : inputFields) {
|
||||||
f.drawTextBox();
|
f.drawTextBox();
|
||||||
@@ -86,7 +90,8 @@ public class GuiRegister extends GuiScreen {
|
|||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for(String label : labels) {
|
for(String label : labels) {
|
||||||
drawString(fontRendererObj, label, this.width / 2 - (45 + 10 + strwidth), 37+(i*30), Color.WHITE.getRGB());
|
drawString(fontRendererObj, label, inputFields.get(i).xPosition-10-fontRendererObj.getStringWidth(label),
|
||||||
|
37+(i*30), Color.WHITE.getRGB());
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ replaymod.gui.register.confirmpw=Confirm Password
|
|||||||
replaymod.gui.register.error.nomatch=Passwords don't match
|
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.shortusername=Username has to be at least 5 characters long
|
||||||
replaymod.gui.register.error.shortpw=Password has to be at least 5 characters long
|
replaymod.gui.register.error.shortpw=Password has to be at least 5 characters long
|
||||||
replaymod.gui.register.error.invalidmail=Invalid eMail Address
|
replaymod.gui.register.error.invalidmail=Invalid e-Mail Address
|
||||||
|
|
||||||
|
|
||||||
#Replay Viewer GUI
|
#Replay Viewer GUI
|
||||||
|
|||||||
Reference in New Issue
Block a user