Merge remote-tracking branch 'origin/master'

This commit is contained in:
Anuken
2024-02-01 15:59:36 -05:00
6 changed files with 23 additions and 14 deletions

View File

@@ -613,7 +613,7 @@ filter.option.threshold2 = Secondary Threshold
filter.option.radius = Radius filter.option.radius = Radius
filter.option.percentile = Percentile filter.option.percentile = Percentile
locales.info = Here, you can add locale bundles for specific languages to your map. In locale bundles, each property has a name and a value. These properties can be used by world processors and objectives using their names. They support text formatting (replacing placeholders with actual values).\n\n[cyan]Example property:\n[]name: [accent]timer[]\nvalue: [accent]Example timer, time left: @[]\n\n[cyan]Usage:\n[]Set it as objective's text: [accent]@timer\n\n[]Print it in a world processor:\n[accent]localeprint "timer"\nformat time\n[gray](where time is a separately calculated variable) locales.info = Here, you can add locale bundles for specific languages to your map. In locale bundles, each property has a name and a value. These properties can be used by world processors and objectives using their names. They support text formatting (replacing placeholders with actual values).\n\n[cyan]Example property:\n[]name: [accent]timer[]\nvalue: [accent]Example timer, time left: {0}[]\n\n[cyan]Usage:\n[]Set it as objective's text: [accent]@timer\n\n[]Print it in a world processor:\n[accent]localeprint "timer"\nformat time\n[gray](where time is a separately calculated variable)
locales.deletelocale = Are you sure you want to delete this locale bundle? locales.deletelocale = Are you sure you want to delete this locale bundle?
locales.applytoall = Apply Changes To All Locales locales.applytoall = Apply Changes To All Locales
locales.addtoother = Add To Other Locales locales.addtoother = Add To Other Locales

View File

@@ -1904,13 +1904,13 @@ onset.turrets = Боевые единицы эффективны, но [accent]
onset.turretammo = Снабдите турель [accent]бериллиевыми боеприпасами.[] onset.turretammo = Снабдите турель [accent]бериллиевыми боеприпасами.[]
onset.walls = [accent]Стены[] могут предотвратить повреждение близлежащих построек.\nПоставьте \uf6ee [accent]бериллиевые стены[] вокруг турели. onset.walls = [accent]Стены[] могут предотвратить повреждение близлежащих построек.\nПоставьте \uf6ee [accent]бериллиевые стены[] вокруг турели.
onset.enemies = Враг на подходе, приготовьтесь защищаться. onset.enemies = Враг на подходе, приготовьтесь защищаться.
onset.defenses = [accent]Set up defenses:[lightgray] {0} onset.defenses = [accent]Приготовьте оборону:[lightgray] {0}
onset.attack = Враг уязвим. Начните контратаку. onset.attack = Враг уязвим. Начните контратаку.
onset.cores = Новые ядра могут быть поставлены на [accent]зоны ядра[].\nНовые ядра функционируют как передовые базы и имеют общий инвентарь между другими ядрами.\nПоставьте \uf725 ядро. onset.cores = Новые ядра могут быть поставлены на [accent]зоны ядра[].\nНовые ядра функционируют как передовые базы и имеют общий инвентарь между другими ядрами.\nПоставьте \uf725 ядро.
onset.detect = Враг обнаружит вас через 2 минуты.\nПриготовьте оборону, добычу и производство. onset.detect = Враг обнаружит вас через 2 минуты.\nПриготовьте оборону, добычу и производство.
onset.commandmode = Удерживайте [accent]shift[], чтобы войти в [accent]режим командования[].\n[accent]Щелкните левой кнопкой мыши и выделите область[] для выбора боевых единиц.\n[accent]Щелкните правой кнопкой мыши[], чтобы приказать выбранным единицам двигаться или атаковать. onset.commandmode = Удерживайте [accent]shift[], чтобы войти в [accent]режим командования[].\n[accent]Щелкните левой кнопкой мыши и выделите область[] для выбора боевых единиц.\n[accent]Щелкните правой кнопкой мыши[], чтобы приказать выбранным единицам двигаться или атаковать.
onset.commandmode.mobile = Нажмите [accent]Командовать[], чтобы войти в [accent]режим командования[].\nЗажмите палец, затем [accent]выделите область[] для выбора боевых единиц.\n[accent]Нажмите[], чтобы приказать выбранным единицам двигаться или атаковать. onset.commandmode.mobile = Нажмите [accent]Командовать[], чтобы войти в [accent]режим командования[].\nЗажмите палец, затем [accent]выделите область[] для выбора боевых единиц.\n[accent]Нажмите[], чтобы приказать выбранным единицам двигаться или атаковать.
aegis.tungsten = Tungsten can be mined using an [accent]impact drill[].\nThis structure requires [accent]water[] and [accent]power[]. aegis.tungsten = Вольфрам может быть добыт [accent]ударной дрелью[].\nЭта постройка требует [accent]воду[] и [accent]энергию[].
split.pickup = Некоторые блоки можно подобрать боевой единицей ядра.\nВозьмите этот [accent]контейнер[] и поставьте его на [accent]грузовой загрузчик[].\n(Клавиши по умолчанию - [ и ] для поднятия и разгрузки) split.pickup = Некоторые блоки можно подобрать боевой единицей ядра.\nВозьмите этот [accent]контейнер[] и поставьте его на [accent]грузовой загрузчик[].\n(Клавиши по умолчанию - [ и ] для поднятия и разгрузки)
split.pickup.mobile = Некоторые блоки можно подобрать боевой единицей ядра.\nВозьмите этот [accent]контейнер[] и поставьте его на [accent]грузовой загрузчик[].\n(Чтобы поднять или разгрузить что-либо, удерживайте палец.) split.pickup.mobile = Некоторые блоки можно подобрать боевой единицей ядра.\nВозьмите этот [accent]контейнер[] и поставьте его на [accent]грузовой загрузчик[].\n(Чтобы поднять или разгрузить что-либо, удерживайте палец.)

View File

@@ -164,3 +164,4 @@ summoner
OpalSoPL OpalSoPL
BalaM314 BalaM314
Redstonneur1256 Redstonneur1256
ApsZoldat

View File

@@ -91,6 +91,8 @@ public class MapLocalesDialog extends BaseDialog{
t.button("@edit", Icon.edit, this::editDialog).size(210f, 64f); t.button("@edit", Icon.edit, this::editDialog).size(210f, 64f);
}).growX(); }).growX();
resized(this::buildMain);
buttons.button("?", () -> ui.showInfo("@locales.info")).size(60f, 64f).uniform(); buttons.button("?", () -> ui.showInfo("@locales.info")).size(60f, 64f).uniform();
shown(this::setup); shown(this::setup);
@@ -158,7 +160,7 @@ public class MapLocalesDialog extends BaseDialog{
saved = false; saved = false;
buildMain(); buildMain();
}).padTop(10f).size(400f, 50f).fillX().row(); }).padTop(10f).size(cardWidth, 50f).fillX().row();
}).right(); }).right();
} }
@@ -184,7 +186,7 @@ public class MapLocalesDialog extends BaseDialog{
selectedLocale = name; selectedLocale = name;
buildTables(); buildTables();
}).update(b -> b.setChecked(selectedLocale.equals(name))).size(300f, 50f); }).update(b -> b.setChecked(selectedLocale.equals(name))).width(200f).minHeight(50f);
p.button(Icon.edit, Styles.flati, () -> localeEditDialog(name)).size(50f); p.button(Icon.edit, Styles.flati, () -> localeEditDialog(name)).size(50f);
p.button(Icon.trash, Styles.flati, () -> ui.showConfirm("@confirm", "@locales.deletelocale", () -> { p.button(Icon.trash, Styles.flati, () -> ui.showConfirm("@confirm", "@locales.deletelocale", () -> {
locales.remove(name); locales.remove(name);
@@ -196,7 +198,7 @@ public class MapLocalesDialog extends BaseDialog{
} }
} }
}).row(); }).row();
langs.button("@add", Icon.add, this::addLocaleDialog).padTop(10f).width(400f); langs.button("@add", Icon.add, this::addLocaleDialog).padTop(10f).width(250f);
} }
private void buildMain(){ private void buildMain(){
@@ -206,7 +208,7 @@ public class MapLocalesDialog extends BaseDialog{
main.image().color(Pal.gray).height(3f).growX().expandY().top().row(); main.image().color(Pal.gray).height(3f).growX().expandY().top().row();
main.pane(p -> { main.pane(p -> {
int cols = Math.max(1, (Core.graphics.getWidth() - 630) / ((int)cardWidth + 10)); int cols = Math.max(1, (int)((Core.graphics.getWidth() / Scl.scl() - 410f) / cardWidth) - 1);
if(props.size == 0){ if(props.size == 0){
main.add("@empty").center().row(); main.add("@empty").center().row();
return; return;
@@ -512,7 +514,7 @@ public class MapLocalesDialog extends BaseDialog{
propView.image().color(Pal.gray).height(3f).fillX().top().row(); propView.image().color(Pal.gray).height(3f).fillX().top().row();
propView.pane(p -> { propView.pane(p -> {
int cols = (Core.graphics.getWidth() - 100) / ((int)cardWidth + 10); int cols = Math.max(1, (int)((Core.graphics.getWidth() / Scl.scl() - 100f) / cardWidth));
if(cols == 0){ if(cols == 0){
propView.add("@empty").center().row(); propView.add("@empty").center().row();
return; return;
@@ -720,7 +722,9 @@ public class MapLocalesDialog extends BaseDialog{
if(!locales.containsKey(key)) return ""; if(!locales.containsKey(key)) return "";
for(var prop : locales.get(key).entries()){ for(var prop : locales.get(key).entries()){
data.append(prop.key).append(" = ").append(prop.value).append("\n"); // Convert \n in plain text to \\n, then convert newlines to \n
data.append(prop.key).append(" = ").append(prop.value
.replace("\\n", "\\\\n").replace("\n", "\\n")).append("\n");
} }
return data.toString(); return data.toString();
@@ -738,7 +742,9 @@ public class MapLocalesDialog extends BaseDialog{
}else{ }else{
int sepIndex = line.indexOf(" = "); int sepIndex = line.indexOf(" = ");
if(sepIndex != -1 && !currentLocale.isEmpty()){ if(sepIndex != -1 && !currentLocale.isEmpty()){
bundles.get(currentLocale).put(line.substring(0, sepIndex), line.substring(sepIndex + 3)); // Convert \n in file to newlines in text, then revert newlines with escape characters
bundles.get(currentLocale).put(line.substring(0, sepIndex), line.substring(sepIndex + 3)
.replace("\\n", "\n").replace("\\\n", "\\n"));
} }
} }
} }
@@ -752,7 +758,9 @@ public class MapLocalesDialog extends BaseDialog{
for(var line : data.split("\\r?\\n|\\r")){ for(var line : data.split("\\r?\\n|\\r")){
int sepIndex = line.indexOf(" = "); int sepIndex = line.indexOf(" = ");
if(sepIndex != -1){ if(sepIndex != -1){
map.put(line.substring(0, sepIndex), line.substring(sepIndex + 3)); // Convert \n in file to newlines in text, then revert newlines with escape characters
map.put(line.substring(0, sepIndex), line.substring(sepIndex + 3)
.replace("\\n", "\n").replace("\\\n", "\\n"));
} }
} }

View File

@@ -127,10 +127,10 @@ abstract class StatusComp implements Posc, Flyingc{
return entry; return entry;
} }
/** Uses a dynamic status effect to override speed. */ /** Uses a dynamic status effect to override speed (in tiles/second). */
public void statusSpeed(float speed){ public void statusSpeed(float speed){
//type.speed should never be 0 //type.speed should never be 0
applyDynamicStatus().speedMultiplier = speed / type.speed; applyDynamicStatus().speedMultiplier = speed / (type.speed * 60f / tilesize);
} }
/** Uses a dynamic status effect to change damage. */ /** Uses a dynamic status effect to change damage. */

View File

@@ -133,7 +133,7 @@
}, },
{ {
"name": "Eradication Mindustry", "name": "Eradication Mindustry",
"address": ["140.238.246.78:7000", "140.238.246.78:7001", "140.238.246.78:7002", "140.238.246.78:7003", "140.238.246.78:7004", "140.238.246.78:7005", "130.61.22.183:7000", "130.61.22.183:7001", "130.61.22.183:7002", "130.61.22.183:7003", "130.61.22.183:7004", "130.61.22.183:7005", "77.99.254.211:7000", "77.99.254.211:7001", "77.99.254.211:7002", "141.148.196.135:7000"] "address": ["140.238.246.78:7000", "140.238.246.78:7001", "140.238.246.78:7002", "140.238.246.78:7003", "140.238.246.78:7004", "130.61.22.183:7000", "130.61.22.183:7001", "130.61.22.183:7002", "130.61.22.183:7003", "130.61.22.183:7004", "77.99.254.211:7000", "77.99.254.211:7001", "77.99.254.211:7002", "141.148.196.135:7000", "130.61.220.99:7000", "130.61.220.99:7001"]
}, },
{ {
"name": "Conservatory", "name": "Conservatory",