Ask players if they want to make games public

This commit is contained in:
Anuken
2019-09-27 20:39:30 -04:00
parent 0b0aa36aab
commit 8609400d76
3 changed files with 15 additions and 0 deletions

View File

@@ -67,6 +67,15 @@ public class HostDialog extends FloatingDialog{
try{
net.host(Vars.port);
player.isAdmin = true;
if(steam){
Core.app.post(() -> Core.settings.getBoolOnce("steampublic", () -> {
ui.showConfirm("$setting.publichost.name", "$public.confirm", () -> {
Core.settings.putSave("publichost", true);
platform.updateLobby();
});
}));
}
}catch(IOException e){
ui.showException("$server.error", e);
}

View File

@@ -190,6 +190,11 @@ public class UnitFactory extends Block{
return entity.spawned < maxSpawn;
}
@Override
public boolean shouldConsume(Tile tile){
return canProduce(tile);
}
public static class UnitFactoryEntity extends TileEntity{
float buildTime;
float time;