Host dialog name selection

This commit is contained in:
Anuken
2018-11-23 13:35:16 -05:00
parent 66c29c49e5
commit 1baf3190cd
2 changed files with 7 additions and 2 deletions

View File

@@ -70,8 +70,8 @@ text.continue = Continue
text.nextmission = Next Mission text.nextmission = Next Mission
text.maps.none = [LIGHT_GRAY]No maps found! text.maps.none = [LIGHT_GRAY]No maps found!
text.about.button = About text.about.button = About
text.name = Player Name: text.name = Name:
text.noname = Pick a[accent] player name[] before connecting. text.noname = Pick in a[accent] player name[] first.
text.filename = File Name: text.filename = File Name:
text.unlocked = New Block Unlocked! text.unlocked = New Block Unlocked!
text.unlocked.plural = New Blocks Unlocked! text.unlocked.plural = New Blocks Unlocked!

View File

@@ -50,6 +50,11 @@ public class HostDialog extends FloatingDialog{
content().add().width(65f); content().add().width(65f);
content().addButton("$text.host", () -> { content().addButton("$text.host", () -> {
if(Settings.getString("name").trim().isEmpty()){
ui.showInfo("$text.noname");
return;
}
ui.loadfrag.show("$text.hosting"); ui.loadfrag.show("$text.hosting");
Timers.runTask(5f, () -> { Timers.runTask(5f, () -> {
try{ try{