Update GuiDisconnected.java

This commit is contained in:
LAX1DUDE 2022-03-30 17:13:19 -07:00
parent ed2c09a052
commit 280137bd97

View File

@ -3,6 +3,9 @@ package net.minecraft.src;
import java.util.Iterator;
import java.util.List;
import net.lax1dude.eaglercraft.ConfigConstants;
import net.lax1dude.eaglercraft.EaglerAdapter;
public class GuiDisconnected extends GuiScreen {
/** The error message. */
private String errorMessage;
@ -16,7 +19,7 @@ public class GuiDisconnected extends GuiScreen {
public GuiDisconnected(GuiScreen par1GuiScreen, String par2Str, String par3Str, Object... par4ArrayOfObj) {
StringTranslate var5 = StringTranslate.getInstance();
this.field_98095_n = par1GuiScreen;
this.errorMessage = var5.translateKey(par2Str);
this.errorMessage = par2Str.equals("disconnect.requiresAuth") ? par2Str : var5.translateKey(par2Str);
this.errorDetail = par3Str;
this.field_74247_c = par4ArrayOfObj;
}
@ -34,14 +37,16 @@ public class GuiDisconnected extends GuiScreen {
public void initGui() {
StringTranslate var1 = StringTranslate.getInstance();
this.buttonList.clear();
this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120 + 12, var1.translateKey("gui.toMenu")));
this.buttonList.add(new GuiButton(0, this.width / 2 - 100, !"disconnect.requiresAuth".equals(this.errorMessage) ? this.height / 4 + 120 + 12 : this.height - this.height / 5 - 40, var1.translateKey("gui.toMenu")));
if(!"disconnect.requiresAuth".equals(this.errorMessage)) {
if (this.field_74247_c != null) {
this.field_74245_d = this.fontRenderer.listFormattedStringToWidth(var1.translateKeyFormat(this.errorDetail, this.field_74247_c), this.width - 50);
} else {
this.field_74245_d = this.fontRenderer.listFormattedStringToWidth(var1.translateKey(this.errorDetail), this.width - 50);
}
}
}
/**
* Fired when a control is clicked. This is the equivalent of
@ -58,15 +63,34 @@ public class GuiDisconnected extends GuiScreen {
*/
public void drawScreen(int par1, int par2, float par3) {
this.drawDefaultBackground();
this.drawCenteredString(this.fontRenderer, this.errorMessage, this.width / 2, this.height / 2 - 50, 11184810);
int var4 = this.height / 2 - 30;
if("disconnect.requiresAuth".equals(this.errorMessage)) {//22w12a
EaglerAdapter.glPushMatrix();
EaglerAdapter.glScalef(1.5f, 1.5f, 1.5f);
this.drawCenteredString(this.fontRenderer, "Authentication Required", this.width / 3, this.height / 4 - 30, 0xDD5555);
EaglerAdapter.glPopMatrix();
this.drawCenteredString(this.fontRenderer, "This server requires a paid Minecraft account to join", this.width / 2, this.height / 2 - 55, 0xDDDD44);
this.drawCenteredString(this.fontRenderer, "You are running Eaglercraft " + EnumChatFormatting.GRAY + ConfigConstants.version + EnumChatFormatting.RESET + " which does not", this.width / 2, this.height / 2 - 35, 0x44BB44);
this.drawCenteredString(this.fontRenderer, "support Xbox Live sign-in, so this server is inaccessable", this.width / 2, this.height / 2 - 23, 0x44BB44);
EaglerAdapter.glPushMatrix();
EaglerAdapter.glScalef(1.0f, 1.0f, 1.0f);
this.drawCenteredString(this.fontRenderer, "Please contact the owner of this site to update, or", this.width / 2, this.height / 2 - 3, 0x666666);
this.drawCenteredString(this.fontRenderer, "if you want to continue playing Eaglercraft without a", this.width / 2, this.height / 2 + 5, 0x666666);
this.drawCenteredString(this.fontRenderer, "real Minecraft account then please choose to play on", this.width / 2, this.height / 2 + 14, 0x666666);
this.drawCenteredString(this.fontRenderer, "an older server that does still you to play for free", this.width / 2, this.height / 2 + 23, 0x666666);
EaglerAdapter.glPopMatrix();
}else {
this.drawCenteredString(this.fontRenderer, this.errorMessage, this.width / 2, this.height / 2 - 50, 11184810);
if (this.field_74245_d != null) {
for (Iterator var5 = this.field_74245_d.iterator(); var5.hasNext(); var4 += this.fontRenderer.FONT_HEIGHT) {
String var6 = (String) var5.next();
this.drawCenteredString(this.fontRenderer, var6, this.width / 2, var4, 16777215);
}
}
}
super.drawScreen(par1, par2, par3);
}