hovering, flying npc
This commit is contained in:
parent
5300c9e4fc
commit
103e4d35f5
7 changed files with 111 additions and 28 deletions
|
@ -24,13 +24,18 @@ public class GuiConnect extends Gui implements Textbox.Callback {
|
|||
private Label userLabel;
|
||||
private Label passLabel;
|
||||
private Label accLabel;
|
||||
private String lastAddr = "";
|
||||
private int lastPort = Config.PORT;
|
||||
private String lastUser = "";
|
||||
private String lastPass = "";
|
||||
private String lastAcc = "";
|
||||
|
||||
public void init(int width, int height) {
|
||||
this.addrBox = this.add(new Textbox(0, 20, 410, 24, 128, true, this, ""));
|
||||
this.portBox = this.add(new Textbox(414, 20, 66, 24, 5, true, this, ""));
|
||||
this.userBox = this.add(new Textbox(0, 70, 220, 24, NetHandlerPlayServer.MAX_USER_LENGTH, true, this, NetHandlerPlayServer.VALID_USER, ""));
|
||||
this.passBox = this.add(new Textbox(0, 120, 480, 24, NetHandlerPlayServer.MAX_PASS_LENGTH, true, this, ""));
|
||||
this.accBox = this.add(new Textbox(0, 170, 480, 24, NetHandlerPlayServer.MAX_PASS_LENGTH, true, this, ""));
|
||||
this.addrBox = this.add(new Textbox(0, 20, 400, 24, 128, true, this, this.lastAddr));
|
||||
this.portBox = this.add(new Textbox(404, 20, 76, 24, 5, true, this, "" + this.lastPort));
|
||||
this.userBox = this.add(new Textbox(0, 70, 220, 24, NetHandlerPlayServer.MAX_USER_LENGTH, true, this, NetHandlerPlayServer.VALID_USER, this.lastUser));
|
||||
this.passBox = this.add(new Textbox(0, 120, 480, 24, NetHandlerPlayServer.MAX_PASS_LENGTH, true, this, this.lastPass));
|
||||
this.accBox = this.add(new Textbox(0, 170, 480, 24, NetHandlerPlayServer.MAX_PASS_LENGTH, true, this, this.lastAcc));
|
||||
this.add(new ActButton(0, 220, 480, 24, new ActButton.Callback() {
|
||||
public void use(ActButton elem, ActButton.Mode action) {
|
||||
GuiConnect.this.connect();
|
||||
|
@ -63,7 +68,8 @@ public class GuiConnect extends Gui implements Textbox.Callback {
|
|||
}
|
||||
int port = -1;
|
||||
if(this.portBox.getText().isEmpty()) {
|
||||
port = Config.PORT;
|
||||
this.portLabel.setText(TextColor.RED + "Port");
|
||||
return;
|
||||
}
|
||||
else {
|
||||
try {
|
||||
|
@ -83,6 +89,11 @@ public class GuiConnect extends Gui implements Textbox.Callback {
|
|||
}
|
||||
String pass = this.passBox.getText();
|
||||
String acc = this.accBox.getText();
|
||||
this.lastAddr = addr;
|
||||
this.lastPort = port;
|
||||
this.lastUser = user;
|
||||
this.lastPass = pass;
|
||||
this.lastAcc = acc;
|
||||
this.gm.connect(addr, port, user, pass, acc);
|
||||
}
|
||||
|
||||
|
|
|
@ -210,19 +210,20 @@ public class GuiCreate extends Gui implements ActButton.Callback, Textbox.Callba
|
|||
UniverseRegistry.clear();
|
||||
this.alreadyGenerated = false;
|
||||
this.dimension = Integer.MAX_VALUE;
|
||||
this.createButton = this.add(new ActButton(width / 2 - 155, height - 28, 150, 20, (ActButton.Callback)this, "Neue Welt erstellen"));
|
||||
this.add(new ActButton(width / 2 + 5, height - 28, 150, 20, (Gui)GuiWorlds.INSTANCE, "Abbrechen"));
|
||||
this.dimButton = this.add(new ActButton(width / 2 - 155, 220, 310, 20, (ActButton.Callback)this, ""));
|
||||
this.worldNameField = this.add(new Textbox(width / 2 - 100, 60, 200, 20, 256, true, this, GuiWorlds.VALID_FILE, ""));
|
||||
this.createButton = this.add(new ActButton(0, 340, 160, 24, (ActButton.Callback)this, "Welt erstellen"));
|
||||
this.add(new ActButton(164, 340, 160, 24, (Gui)GuiWorlds.INSTANCE, "Abbrechen"));
|
||||
this.dimButton = this.add(new ActButton(0, 220, 324, 24, (ActButton.Callback)this, ""));
|
||||
this.worldNameField = this.add(new Textbox(20, 40, 284, 24, 256, true, this, GuiWorlds.VALID_FILE, ""));
|
||||
this.worldNameField.setSelected();
|
||||
this.worldSeedField = this.add(new Textbox(width / 2 - 100, 136, 200, 20, 256, true, this, ""));
|
||||
this.worldUserField = this.add(new Textbox(width / 2 - 100, 98, 200, 20, NetHandlerPlayServer.MAX_USER_LENGTH, true, this, NetHandlerPlayServer.VALID_USER, ""));
|
||||
this.worldSeedField = this.add(new Textbox(20, 140, 284, 24, 256, true, this, ""));
|
||||
this.worldUserField = this.add(new Textbox(20, 90, 284, 24, NetHandlerPlayServer.MAX_USER_LENGTH, true, this, NetHandlerPlayServer.VALID_USER, ""));
|
||||
this.createButton.enabled = false;
|
||||
this.actionLabel = this.add(new Label(width / 2 - 100, 49, 200, 20, this.getFolderDesc(), true));
|
||||
this.userLabel = this.add(new Label(width / 2 - 100, 87, 200, 20, this.getUserDesc(), true));
|
||||
this.seed = this.add(new Label(width / 2 - 100, 125, 200, 20, "", true));
|
||||
this.decoded = this.add(new Label(width / 2 - 100, 160, 200, 20, "", true));
|
||||
this.descLines = this.add(new TransparentBox(width / 2 - 153, 242, 306, 160, ""));
|
||||
this.actionLabel = this.add(new Label(20, 20, 284, 20, this.getFolderDesc(), true));
|
||||
this.userLabel = this.add(new Label(20, 70, 284, 20, this.getUserDesc(), true));
|
||||
this.seed = this.add(new Label(20, 120, 284, 20, "", true));
|
||||
this.decoded = this.add(new Label(20, 164, 284, 20, "", true));
|
||||
this.descLines = this.add(new TransparentBox(0, 244, 324, 160, ""));
|
||||
this.shift();
|
||||
this.setDimButton();
|
||||
}
|
||||
|
||||
|
@ -302,14 +303,6 @@ public class GuiCreate extends Gui implements ActButton.Callback, Textbox.Callba
|
|||
}
|
||||
|
||||
private String getFolderDesc() {
|
||||
// FontRenderer.drawStringWithShadow("Startwert [" + this.seed + "]", this.width / 2 - 100, 125, -6250336);
|
||||
// FontRenderer.drawStringWithShadow("Dekodiert: " + this.decoded, this.width / 2 - 100, 160, -6250336);
|
||||
// FontRenderer.drawStringWithShadow(, this.width / 2 - 100, 49, -6250336);
|
||||
// FontRenderer.drawStringWithShadow((this.worldUserField.getText().isEmpty() ? TextColor.DARK_RED : "") + "Spielername", this.width / 2 - 100, 87, -6250336);
|
||||
//
|
||||
// for(int z = 1; z < this.descLines.length; z++) {
|
||||
// FontRenderer.drawStringWithShadow(this.descLines[z], this.width / 2 - 153, 242 + (z - 1) * (FontRenderer.FONT_HEIGHT + 1), -6250336);
|
||||
// }
|
||||
return (this.worldNameField.getText().trim().isEmpty() || this.fileExists ? TextColor.DRED : "")
|
||||
+ "Ordner der Welt" + (this.fileExists ? " - Existiert bereits" : "");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue