diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 87d18617d1..d3b0ad6d3d 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -1242,6 +1242,7 @@ setting.mutemusic.name = Mute Music setting.sfxvol.name = SFX Volume setting.mutesound.name = Mute Sound setting.crashreport.name = Send Anonymous Crash Reports +setting.communityservers.name = Fetch Community Server List setting.savecreate.name = Auto-Create Saves setting.steampublichost.name = Public Game Visibility setting.playerlimit.name = Player Limit diff --git a/core/assets/contributors b/core/assets/contributors index 8bcc1913ab..f939b3c30f 100644 --- a/core/assets/contributors +++ b/core/assets/contributors @@ -170,3 +170,4 @@ Mythril hexagon-recursion JasonP01 BlueTheCube +sasha0552 diff --git a/core/src/mindustry/ui/dialogs/JoinDialog.java b/core/src/mindustry/ui/dialogs/JoinDialog.java index f6e4191c7b..e4db478179 100644 --- a/core/src/mindustry/ui/dialogs/JoinDialog.java +++ b/core/src/mindustry/ui/dialogs/JoinDialog.java @@ -138,7 +138,9 @@ public class JoinDialog extends BaseDialog{ refreshLocal(); refreshRemote(); - refreshCommunity(); + if(Core.settings.getBool("communityservers", true)){ + refreshCommunity(); + } } void setupRemote(){ @@ -317,7 +319,9 @@ public class JoinDialog extends BaseDialog{ section(steam ? "@servers.local.steam" : "@servers.local", local, false); section("@servers.remote", remote, false); - section("@servers.global", global, true); + if(Core.settings.getBool("communityservers", true)){ + section("@servers.global", global, true); + } ScrollPane pane = new ScrollPane(hosts); pane.setFadeScrollBars(false); @@ -631,12 +635,18 @@ public class JoinDialog extends BaseDialog{ Core.settings.remove("server-list"); } - var urls = Version.type.equals("bleeding-edge") || Vars.forceBeServers ? serverJsonBeURLs : serverJsonURLs; - - fetchServers(urls, 0); + fetchServers(); } - private void fetchServers(String[] urls, int index){ + public static void fetchServers(){ + var urls = Version.type.equals("bleeding-edge") || Vars.forceBeServers ? serverJsonBeURLs : serverJsonURLs; + + if(Core.settings.getBool("communityservers", true)){ + fetchServers(urls, 0); + } + } + + private static void fetchServers(String[] urls, int index){ if(index >= urls.length) return; //get servers diff --git a/core/src/mindustry/ui/dialogs/SettingsMenuDialog.java b/core/src/mindustry/ui/dialogs/SettingsMenuDialog.java index 01f7c05a53..9f5b8e2813 100644 --- a/core/src/mindustry/ui/dialogs/SettingsMenuDialog.java +++ b/core/src/mindustry/ui/dialogs/SettingsMenuDialog.java @@ -333,6 +333,13 @@ public class SettingsMenuDialog extends BaseDialog{ game.checkPref("crashreport", true); } + game.checkPref("communityservers", true, val -> { + defaultServers.clear(); + if(val){ + JoinDialog.fetchServers(); + } + }); + game.checkPref("savecreate", true); game.checkPref("blockreplace", true); game.checkPref("conveyorpathfinding", true);