mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-08 23:07:33 +07:00
Cleanup
This commit is contained in:
@ -232,7 +232,7 @@ server.kicked.customClient = This server does not support custom builds. Downloa
|
||||
server.kicked.gameover = Game over!
|
||||
server.kicked.serverRestarting = The server is restarting.
|
||||
server.versions = Your version:[accent] {0}[]\nServer version:[accent] {1}[]
|
||||
host.info = The [accent]host[] button hosts a server on specified port.\nAnybody on the same [lightgray]wifi or local network[] should be able to see your server in their server list.\n\nIf you want people to be able to connect from anywhere by IP, [accent]port forwarding[] is required.\n\n[lightgray]Note: If someone is experiencing trouble connecting to your LAN game, make sure you have allowed Mindustry access to your local network in your firewall settings. Note that public networks sometimes do not allow server discovery.
|
||||
host.info = The [accent]host[] button hosts a server on the specified port.\nAnybody on the same [lightgray]wifi or local network[] should be able to see your server in their server list.\n\nIf you want people to be able to connect from anywhere by IP, [accent]port forwarding[] is required.\n\n[lightgray]Note: If someone is experiencing trouble connecting to your LAN game, make sure you have allowed Mindustry access to your local network in your firewall settings. Note that public networks sometimes do not allow server discovery.
|
||||
join.info = Here, you can enter a [accent]server IP[] to connect to, or discover [accent]local network[] or [accent]global[] servers to connect to.\nBoth LAN and WAN multiplayer is supported.\n\n[lightgray]If you want to connect to someone by IP, you would need to ask the host for their IP, which can be found by googling "my ip" from their device.
|
||||
hostserver = Host Multiplayer Game
|
||||
invitefriends = Invite Friends
|
||||
|
@ -14,7 +14,6 @@ import static mindustry.Vars.*;
|
||||
|
||||
public class HostDialog extends BaseDialog{
|
||||
float w = 300;
|
||||
TextField portField;
|
||||
|
||||
public HostDialog(){
|
||||
super("@hostserver");
|
||||
@ -49,20 +48,15 @@ public class HostDialog extends BaseDialog{
|
||||
|
||||
cont.row();
|
||||
|
||||
TextField[] portField = {null};
|
||||
|
||||
cont.table(t -> {
|
||||
t.add("@server.port").padRight(10);
|
||||
portField = t.field(String.valueOf(Core.settings.getInt("port", port)), text -> {
|
||||
Core.settings.put("port", Integer.parseInt(text));
|
||||
}).pad(8).grow().get();
|
||||
portField.setMaxLength(5);
|
||||
portField.setValidator(text -> {
|
||||
try {
|
||||
int port = Integer.parseInt(text);
|
||||
return port >= 1 && port <= 65535;
|
||||
} catch(NumberFormatException e){
|
||||
return false;
|
||||
}
|
||||
});
|
||||
portField[0] = t.field(String.valueOf(Core.settings.getInt("port", port)), text -> Core.settings.put("port", Strings.parseInt(text, 6567)))
|
||||
.pad(8).grow().maxTextLength(5).valid(text -> {
|
||||
int port = Strings.parseInt(text);
|
||||
return port >= 1 && port <= 65535;
|
||||
}).get();
|
||||
}).width(w).height(70f).pad(4).colspan(3);
|
||||
|
||||
cont.row();
|
||||
@ -76,7 +70,7 @@ public class HostDialog extends BaseDialog{
|
||||
}
|
||||
|
||||
runHost();
|
||||
}).width(w).height(70f).disabled(b -> !portField.isValid());
|
||||
}).width(w).height(70f).disabled(b -> !portField[0].isValid());
|
||||
|
||||
if(!steam){
|
||||
cont.button("?", () -> ui.showInfo("@host.info")).size(65f, 70f).padLeft(6f);
|
||||
|
Reference in New Issue
Block a user