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,51 +12,56 @@ 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",
|
"et", "Eesti",
|
||||||
"et", "Eesti",
|
"en", "English",
|
||||||
"en", "English",
|
"es", "Español",
|
||||||
"es", "Español",
|
"eu", "Euskara",
|
||||||
"eu", "Euskara",
|
"fil", "Filipino",
|
||||||
"fil", "Filipino",
|
"fr", "Français",
|
||||||
"fr", "Français",
|
"it", "Italiano",
|
||||||
"it", "Italiano",
|
"lt", "Lietuvių",
|
||||||
"lt", "Lietuvių",
|
"hu", "Magyar",
|
||||||
"hu", "Magyar",
|
"nl", "Nederlands",
|
||||||
"nl", "Nederlands",
|
"nl_BE", "Nederlands (België)",
|
||||||
"nl_BE", "Nederlands (België)",
|
"pl", "Polski",
|
||||||
"pl", "Polski",
|
"pt_BR", "Português (Brasil)",
|
||||||
"pt_BR", "Português (Brasil)",
|
"pt_PT", "Português (Portugal)",
|
||||||
"pt_PT", "Português (Portugal)",
|
"ro", "Română",
|
||||||
"ro", "Română",
|
"fi", "Suomi",
|
||||||
"fi", "Suomi",
|
"sv", "Svenska",
|
||||||
"sv", "Svenska",
|
"vi", "Tiếng Việt",
|
||||||
"vi", "Tiếng Việt",
|
"tk", "Türkmen dili",
|
||||||
"tk", "Türkmen dili",
|
"tr", "Türkçe",
|
||||||
"tr", "Türkçe",
|
"cs", "Čeština",
|
||||||
"cs", "Čeština",
|
"be", "Беларуская",
|
||||||
"be", "Беларуская",
|
"bg", "Български",
|
||||||
"bg", "Български",
|
"ru", "Русский",
|
||||||
"ru", "Русский",
|
"sr", "Српски",
|
||||||
"sr", "Српски",
|
"uk_UA", "Українська",
|
||||||
"uk_UA", "Українська",
|
"th", "ไทย",
|
||||||
"th", "ไทย",
|
"zh_CN", "简体中文",
|
||||||
"zh_CN", "简体中文",
|
"zh_TW", "正體中文",
|
||||||
"zh_TW", "正體中文",
|
"ja", "日本語",
|
||||||
"ja", "日本語",
|
"ko", "한국어",
|
||||||
"ko", "한국어",
|
"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