Fixed autobuilding
This commit is contained in:
@@ -26,6 +26,7 @@ import mindustry.maps.*;
|
|||||||
import mindustry.mod.*;
|
import mindustry.mod.*;
|
||||||
import mindustry.net.*;
|
import mindustry.net.*;
|
||||||
import mindustry.service.*;
|
import mindustry.service.*;
|
||||||
|
import mindustry.ui.dialogs.*;
|
||||||
import mindustry.world.*;
|
import mindustry.world.*;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
@@ -270,7 +271,7 @@ public class Vars implements Loadable{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Arrays.sort(locales, Structs.comparing(l -> l.getDisplayName(l), String.CASE_INSENSITIVE_ORDER));
|
Arrays.sort(locales, Structs.comparing(LanguageDialog::getDisplayName, String.CASE_INSENSITIVE_ORDER));
|
||||||
locales = Seq.with(locales).and(new Locale("router")).toArray(Locale.class);
|
locales = Seq.with(locales).and(new Locale("router")).toArray(Locale.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -462,7 +463,7 @@ public class Vars implements Loadable{
|
|||||||
Core.bundle = I18NBundle.createBundle(handle, locale);
|
Core.bundle = I18NBundle.createBundle(handle, locale);
|
||||||
|
|
||||||
//router
|
//router
|
||||||
if(locale.getDisplayName().equals("router")){
|
if(locale.toString().equals("router")){
|
||||||
bundle.debug("router");
|
bundle.debug("router");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ public class Control implements ApplicationListener, Loadable{
|
|||||||
|
|
||||||
float coreDelay = 0f;
|
float coreDelay = 0f;
|
||||||
|
|
||||||
if(!settings.getBool("skipcoreanimation")){
|
if(!settings.getBool("skipcoreanimation") && !state.rules.pvp){
|
||||||
coreDelay = coreLandDuration;
|
coreDelay = coreLandDuration;
|
||||||
//delay player respawn so animation can play.
|
//delay player respawn so animation can play.
|
||||||
player.deathTimer = -80f;
|
player.deathTimer = -80f;
|
||||||
@@ -216,7 +216,7 @@ public class Control implements ApplicationListener, Loadable{
|
|||||||
float unitsPerTick = 1f;
|
float unitsPerTick = 1f;
|
||||||
|
|
||||||
boolean anyBuilds = false;
|
boolean anyBuilds = false;
|
||||||
for(var build : state.rules.defaultTeam.data().buildings){
|
for(var build : state.rules.defaultTeam.data().buildings.copy()){
|
||||||
if(!(build instanceof CoreBuild) && !build.block.privileged){
|
if(!(build instanceof CoreBuild) && !build.block.privileged){
|
||||||
var ccore = build.closestCore();
|
var ccore = build.closestCore();
|
||||||
|
|
||||||
|
|||||||
@@ -12,8 +12,7 @@ import java.util.*;
|
|||||||
import static mindustry.Vars.*;
|
import static mindustry.Vars.*;
|
||||||
|
|
||||||
public class LanguageDialog extends BaseDialog{
|
public class LanguageDialog extends BaseDialog{
|
||||||
private Locale lastLocale;
|
public static final ObjectMap<String, String> displayNames = ObjectMap.of(
|
||||||
private ObjectMap<String, String> displayNames = ObjectMap.of(
|
|
||||||
"in_ID", "Bahasa Indonesia (Indonesia)",
|
"in_ID", "Bahasa Indonesia (Indonesia)",
|
||||||
"da", "Dansk",
|
"da", "Dansk",
|
||||||
"de", "Deutsch",
|
"de", "Deutsch",
|
||||||
@@ -51,12 +50,18 @@ public class LanguageDialog extends BaseDialog{
|
|||||||
"router", "router"
|
"router", "router"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
private Locale lastLocale;
|
||||||
|
|
||||||
public LanguageDialog(){
|
public LanguageDialog(){
|
||||||
super("@settings.language");
|
super("@settings.language");
|
||||||
addCloseButton();
|
addCloseButton();
|
||||||
setup();
|
setup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String getDisplayName(Locale locale){
|
||||||
|
return displayNames.get(locale.toString(), locale.toString());
|
||||||
|
}
|
||||||
|
|
||||||
private void setup(){
|
private void setup(){
|
||||||
Table langs = new Table();
|
Table langs = new Table();
|
||||||
langs.marginRight(24f).marginLeft(24f);
|
langs.marginRight(24f).marginLeft(24f);
|
||||||
@@ -66,7 +71,7 @@ public class LanguageDialog extends BaseDialog{
|
|||||||
ButtonGroup<TextButton> group = new ButtonGroup<>();
|
ButtonGroup<TextButton> group = new ButtonGroup<>();
|
||||||
|
|
||||||
for(Locale loc : locales){
|
for(Locale loc : locales){
|
||||||
TextButton button = new TextButton(displayNames.get(loc.toString(), loc.getDisplayName(Locale.ROOT)), Styles.clearTogglet);
|
TextButton button = new TextButton(getDisplayName(loc), Styles.clearTogglet);
|
||||||
button.clicked(() -> {
|
button.clicked(() -> {
|
||||||
if(getLocale().equals(loc)) return;
|
if(getLocale().equals(loc)) return;
|
||||||
Core.settings.put("locale", loc.toString());
|
Core.settings.put("locale", loc.toString());
|
||||||
|
|||||||
Reference in New Issue
Block a user