Formatted GuiShareToLAN.java
This commit is contained in:
parent
9cde5ceabb
commit
df30a98a5d
1 changed files with 87 additions and 74 deletions
|
@ -4,14 +4,16 @@ import net.lax1dude.eaglercraft.IntegratedServer;
|
||||||
|
|
||||||
public class GuiShareToLan extends GuiScreen {
|
public class GuiShareToLan extends GuiScreen {
|
||||||
/**
|
/**
|
||||||
* A reference to the screen object that created this. Used for navigating between screens.
|
* A reference to the screen object that created this. Used for navigating
|
||||||
|
* between screens.
|
||||||
*/
|
*/
|
||||||
private final GuiScreen parentScreen;
|
private final GuiScreen parentScreen;
|
||||||
private GuiButton buttonAllowCommandsToggle;
|
private GuiButton buttonAllowCommandsToggle;
|
||||||
private GuiButton buttonGameMode;
|
private GuiButton buttonGameMode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The currently selected game mode. One of 'survival', 'creative', or 'adventure'
|
* The currently selected game mode. One of 'survival', 'creative', or
|
||||||
|
* 'adventure'
|
||||||
*/
|
*/
|
||||||
private String gameMode = "survival";
|
private String gameMode = "survival";
|
||||||
|
|
||||||
|
@ -27,26 +29,35 @@ public class GuiShareToLan extends GuiScreen {
|
||||||
*/
|
*/
|
||||||
public void initGui() {
|
public void initGui() {
|
||||||
this.buttonList.clear();
|
this.buttonList.clear();
|
||||||
this.buttonList.add(new GuiButton(101, this.width / 2 - 155, this.height - 28, 150, 20, StatCollector.translateToLocal("lanServer.start")));
|
this.buttonList.add(new GuiButton(101, this.width / 2 - 155, this.height - 28, 150, 20,
|
||||||
this.buttonList.add(new GuiButton(102, this.width / 2 + 5, this.height - 28, 150, 20, StatCollector.translateToLocal("gui.cancel")));
|
StatCollector.translateToLocal("lanServer.start")));
|
||||||
this.buttonList.add(this.buttonGameMode = new GuiButton(104, this.width / 2 - 155, 100, 150, 20, StatCollector.translateToLocal("selectWorld.gameMode")));
|
this.buttonList.add(new GuiButton(102, this.width / 2 + 5, this.height - 28, 150, 20,
|
||||||
this.buttonList.add(this.buttonAllowCommandsToggle = new GuiButton(103, this.width / 2 + 5, 100, 150, 20, StatCollector.translateToLocal("selectWorld.allowCommands")));
|
StatCollector.translateToLocal("gui.cancel")));
|
||||||
|
this.buttonList.add(this.buttonGameMode = new GuiButton(104, this.width / 2 - 155, 100, 150, 20,
|
||||||
|
StatCollector.translateToLocal("selectWorld.gameMode")));
|
||||||
|
this.buttonList.add(this.buttonAllowCommandsToggle = new GuiButton(103, this.width / 2 + 5, 100, 150, 20,
|
||||||
|
StatCollector.translateToLocal("selectWorld.allowCommands")));
|
||||||
this.func_74088_g();
|
this.func_74088_g();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void func_74088_g() {
|
private void func_74088_g() {
|
||||||
this.buttonGameMode.displayString = StatCollector.translateToLocal("selectWorld.gameMode") + " " + StatCollector.translateToLocal("selectWorld.gameMode." + this.gameMode);
|
this.buttonGameMode.displayString = StatCollector.translateToLocal("selectWorld.gameMode") + " "
|
||||||
this.buttonAllowCommandsToggle.displayString = StatCollector.translateToLocal("selectWorld.allowCommands") + " ";
|
+ StatCollector.translateToLocal("selectWorld.gameMode." + this.gameMode);
|
||||||
|
this.buttonAllowCommandsToggle.displayString = StatCollector.translateToLocal("selectWorld.allowCommands")
|
||||||
|
+ " ";
|
||||||
|
|
||||||
if (this.allowCommands) {
|
if (this.allowCommands) {
|
||||||
this.buttonAllowCommandsToggle.displayString = this.buttonAllowCommandsToggle.displayString + StatCollector.translateToLocal("options.on");
|
this.buttonAllowCommandsToggle.displayString = this.buttonAllowCommandsToggle.displayString
|
||||||
|
+ StatCollector.translateToLocal("options.on");
|
||||||
} else {
|
} else {
|
||||||
this.buttonAllowCommandsToggle.displayString = this.buttonAllowCommandsToggle.displayString + StatCollector.translateToLocal("options.off");
|
this.buttonAllowCommandsToggle.displayString = this.buttonAllowCommandsToggle.displayString
|
||||||
|
+ StatCollector.translateToLocal("options.off");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e).
|
* Fired when a control is clicked. This is the equivalent of
|
||||||
|
* ActionListener.actionPerformed(ActionEvent e).
|
||||||
*/
|
*/
|
||||||
protected void actionPerformed(GuiButton par1GuiButton) {
|
protected void actionPerformed(GuiButton par1GuiButton) {
|
||||||
if (par1GuiButton.id == 102) {
|
if (par1GuiButton.id == 102) {
|
||||||
|
@ -84,8 +95,10 @@ public class GuiShareToLan extends GuiScreen {
|
||||||
*/
|
*/
|
||||||
public void drawScreen(int par1, int par2, float par3) {
|
public void drawScreen(int par1, int par2, float par3) {
|
||||||
this.drawDefaultBackground();
|
this.drawDefaultBackground();
|
||||||
this.drawCenteredString(this.fontRenderer, StatCollector.translateToLocal("lanServer.title"), this.width / 2, 50, 16777215);
|
this.drawCenteredString(this.fontRenderer, StatCollector.translateToLocal("lanServer.title"), this.width / 2,
|
||||||
this.drawCenteredString(this.fontRenderer, StatCollector.translateToLocal("lanServer.otherPlayers"), this.width / 2, 82, 16777215);
|
50, 16777215);
|
||||||
|
this.drawCenteredString(this.fontRenderer, StatCollector.translateToLocal("lanServer.otherPlayers"),
|
||||||
|
this.width / 2, 82, 16777215);
|
||||||
super.drawScreen(par1, par2, par3);
|
super.drawScreen(par1, par2, par3);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue