mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-01-25 22:12:16 -08:00
Fixed autobuilding
This commit is contained in:
parent
9c46ae8b0f
commit
8212d441c2
3 changed files with 48 additions and 42 deletions
|
|
@ -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,51 +12,56 @@ import java.util.*;
|
|||
import static mindustry.Vars.*;
|
||||
|
||||
public class LanguageDialog extends BaseDialog{
|
||||
private Locale lastLocale;
|
||||
private ObjectMap<String, String> displayNames = ObjectMap.of(
|
||||
"in_ID", "Bahasa Indonesia (Indonesia)",
|
||||
"da", "Dansk",
|
||||
"de", "Deutsch",
|
||||
"et", "Eesti",
|
||||
"en", "English",
|
||||
"es", "Español",
|
||||
"eu", "Euskara",
|
||||
"fil", "Filipino",
|
||||
"fr", "Français",
|
||||
"it", "Italiano",
|
||||
"lt", "Lietuvių",
|
||||
"hu", "Magyar",
|
||||
"nl", "Nederlands",
|
||||
"nl_BE", "Nederlands (België)",
|
||||
"pl", "Polski",
|
||||
"pt_BR", "Português (Brasil)",
|
||||
"pt_PT", "Português (Portugal)",
|
||||
"ro", "Română",
|
||||
"fi", "Suomi",
|
||||
"sv", "Svenska",
|
||||
"vi", "Tiếng Việt",
|
||||
"tk", "Türkmen dili",
|
||||
"tr", "Türkçe",
|
||||
"cs", "Čeština",
|
||||
"be", "Беларуская",
|
||||
"bg", "Български",
|
||||
"ru", "Русский",
|
||||
"sr", "Српски",
|
||||
"uk_UA", "Українська",
|
||||
"th", "ไทย",
|
||||
"zh_CN", "简体中文",
|
||||
"zh_TW", "正體中文",
|
||||
"ja", "日本語",
|
||||
"ko", "한국어",
|
||||
"router", "router"
|
||||
public static final ObjectMap<String, String> displayNames = ObjectMap.of(
|
||||
"in_ID", "Bahasa Indonesia (Indonesia)",
|
||||
"da", "Dansk",
|
||||
"de", "Deutsch",
|
||||
"et", "Eesti",
|
||||
"en", "English",
|
||||
"es", "Español",
|
||||
"eu", "Euskara",
|
||||
"fil", "Filipino",
|
||||
"fr", "Français",
|
||||
"it", "Italiano",
|
||||
"lt", "Lietuvių",
|
||||
"hu", "Magyar",
|
||||
"nl", "Nederlands",
|
||||
"nl_BE", "Nederlands (België)",
|
||||
"pl", "Polski",
|
||||
"pt_BR", "Português (Brasil)",
|
||||
"pt_PT", "Português (Portugal)",
|
||||
"ro", "Română",
|
||||
"fi", "Suomi",
|
||||
"sv", "Svenska",
|
||||
"vi", "Tiếng Việt",
|
||||
"tk", "Türkmen dili",
|
||||
"tr", "Türkçe",
|
||||
"cs", "Čeština",
|
||||
"be", "Беларуская",
|
||||
"bg", "Български",
|
||||
"ru", "Русский",
|
||||
"sr", "Српски",
|
||||
"uk_UA", "Українська",
|
||||
"th", "ไทย",
|
||||
"zh_CN", "简体中文",
|
||||
"zh_TW", "正體中文",
|
||||
"ja", "日本語",
|
||||
"ko", "한국어",
|
||||
"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());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue