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