Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bundle dev, translation update #10517

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ public static void write(TypeSpec.Builder builder) throws Exception{
}

public static void write(TypeSpec.Builder builder, Seq<String> imports) throws Exception{
builder.superinterfaces.sort(Structs.comparing(t -> t.toString()));
builder.methodSpecs.sort(Structs.comparing(m -> m.toString()));
builder.superinterfaces.sort(Structs.comparing(TypeName::toString));
builder.methodSpecs.sort(Structs.comparing(MethodSpec::toString));
builder.fieldSpecs.sort(Structs.comparing(f -> f.name));

JavaFile file = JavaFile.builder(packageName, builder.build()).skipJavaLangImports(true).build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,14 @@ static String bitString(int offset, int size, int totalSize){
for(int i = 0; i < offset; i++) builder.append('0');
for(int i = 0; i < size; i++) builder.append('1');
for(int i = 0; i < totalSize - size - offset; i++) builder.append('0');
return "0b" + builder.reverse().toString() + "L";
return "0b" + builder.reverse() + "L";
}

static String bitString(int size, int totalSize){
StringBuilder builder = new StringBuilder();
for(int i = 0; i < size; i++) builder.append('1');
for(int i = 0; i < totalSize - size; i++) builder.append('0');
return "0b" + builder.reverse().toString() + "L";
return "0b" + builder.reverse() + "L";
}

static int varSize(Svar var) throws IllegalArgumentException{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ public void process(RoundEnvironment env) throws Exception{
}

Seq<Stype> entries = Seq.with(fieldMap.keys());
entries.sortComparing(e -> e.name());
entries.sortComparing(Selement::name);

for(Stype type : entries){
Seq<Svar> fields = fieldMap.get(type);
fields.sortComparing(s -> s.name());
fields.sortComparing(Selement::name);
method.beginControlFlow("if(content instanceof $L)", type.fullName());

for(Svar field : fields){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,12 +373,12 @@ public static MethodSpec writeHandleMethod(MethodEntry ent, boolean isClient){

//execute the relevant method before the forward
//if it throws a ValidateException, the method won't be forwarded
builder.addStatement("$N." + elem.name() + "(" + params.toString(", ", s -> s.name()) + ")", ((TypeElement)elem.up()).getQualifiedName().toString());
builder.addStatement("$N." + elem.name() + "(" + params.toString(", ", Selement::name) + ")", ((TypeElement)elem.up()).getQualifiedName().toString());

//call forwarded method, don't forward on the client reader
if(ent.forward && ent.where.isServer && !isClient){
//call forwarded method
builder.addStatement("$L.$L.$L__forward(con, $L)", packageName, ent.className, elem.name(), params.toString(", ", s -> s.name()));
builder.addStatement("$L.$L.$L__forward(con, $L)", packageName, ent.className, elem.name(), params.toString(", ", Selement::name));
}

return builder.build();
Expand Down
66 changes: 33 additions & 33 deletions core/assets/bundles/bundle_zh_CN.properties
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ marker.shape.name = 形状
marker.text.name = 文本
marker.line.name = 线
marker.quad.name = 四边形
marker.texture.name = Texture
marker.texture.name = 纹理

marker.background = 背景
marker.outline = 轮廓
Expand Down Expand Up @@ -813,11 +813,11 @@ threat.medium = 中度
threat.high = 高度
threat.extreme = 极高
threat.eradication = 毁灭
difficulty.casual = Casual
difficulty.easy = Easy
difficulty.normal = Normal
difficulty.hard = Hard
difficulty.eradication = Eradication
difficulty.casual = 休闲
difficulty.easy = 简单
difficulty.normal = 普通
difficulty.hard = 困难
difficulty.eradication = 扫荡

planets = 行星

Expand Down Expand Up @@ -874,16 +874,16 @@ sector.coastline.description = 这里探测到了海军单位科技的遗迹。
sector.navalFortress.description = 敌人在一个有天然防御屏障的偏远岛屿上建立了基地。 摧毁它,并研究高级海军科技。
sector.cruxscape.name = 赤色总部
sector.geothermalStronghold.name = 熔石要塞
sector.facility32m.description = WIP, map submission by Stormride_R
sector.taintedWoods.description = WIP, map submission by Stormride_R
sector.atolls.description = WIP, map submission by Stormride_R
sector.frontier.description = WIP, map submission by Stormride_R
sector.infestedCanyons.description = WIP, map submission by Skeledragon
sector.polarAerodrome.description = WIP, map submission by hhh i 17
sector.testingGrounds.description = WIP, map submission by dnx2019
sector.seaPort.description = WIP, map submission by inkognito626
sector.weatheredChannels.description = WIP, map submission by Skeledragon
sector.mycelialBastion.description = WIP, map submission by Skeledragon
sector.facility32m.description = WIP, 地图由 Stormride_R 提交
sector.taintedWoods.description = WIP, 地图由 Stormride_R 提交
sector.atolls.description = WIP, 地图由 Stormride_R 提交
sector.frontier.description = WIP, 地图由 Stormride_R 提交
sector.infestedCanyons.description = WIP, 地图由 Skeledragon 提交
sector.polarAerodrome.description = WIP, 地图由 hhh i 17 提交
sector.testingGrounds.description = WIP, 地图由 dnx2019 提交
sector.seaPort.description = WIP, 地图由 inkognito626 提交
sector.weatheredChannels.description = WIP, 地图由 Skeledragon 提交
sector.mycelialBastion.description = WIP, 地图由 Skeledragon 提交

sector.onset.name = 始发地区
sector.aegis.name = 庇护前哨
Expand Down Expand Up @@ -1225,8 +1225,8 @@ setting.displayselection.name = Display Block Configs on Hover
setting.conveyorpathfinding.name = 传送带自动寻路
setting.sensitivity.name = 控制器灵敏度
setting.saveinterval.name = 自动保存间隔
setting.seconds = {0}秒
setting.milliseconds = {0}毫秒
setting.seconds = {0}
setting.milliseconds = {0} 毫秒
setting.fullscreen.name = 全屏
setting.borderlesswindow.name = 无边框窗口
setting.borderlesswindow.name.windows = 无边框全屏
Expand Down Expand Up @@ -1263,9 +1263,9 @@ setting.macnotch.name = 立陶宛語
setting.macnotch.description = 需要重新启动
steam.friendsonly = 仅限好友
steam.friendsonly.tooltip = 是否只有 Steam 好友才能加入您的游戏。\n取消选中此选项将使您的游戏公开 - 任何人都可以加入。
setting.maxmagnificationmultiplierpercent.name = Min Camera Distance
setting.minmagnificationmultiplierpercent.name = Max Camera Distance
setting.minmagnificationmultiplierpercent.description = High values may cause performance issues.
setting.maxmagnificationmultiplierpercent.name = 最小相距
setting.minmagnificationmultiplierpercent.name = 最大相距
setting.minmagnificationmultiplierpercent.description = 较高的值可能会导致游戏体验变差
public.beta = 请注意,测试版的游戏不能公开可见。
uiscale.reset = UI缩放比例已更改。\n点击“确定”接受更改。\n[accent]{0}[]秒后[scarlet]将自动退出并还原设置。
uiscale.cancel = 取消并退出
Expand Down Expand Up @@ -1310,7 +1310,7 @@ keybind.unit_command_load_units.name = 单位命令: 装载单位
keybind.unit_command_load_blocks.name = 单位命令: 转载建筑
keybind.unit_command_unload_payload.name = 单位命令: 卸载有效载荷
keybind.unit_command_enter_payload.name = 单位命令: 进入入有效载荷
keybind.unit_command_loop_payload.name = Unit Command: Loop Unit Transfer
keybind.unit_command_loop_payload.name = 单位命令: Loop Unit Transfer

keybind.rebuild_select.name = 重建建筑
keybind.schematic_select.name = 框选建筑
Expand Down Expand Up @@ -1415,14 +1415,14 @@ rules.unitcostmultiplier = 单位生产花费倍率
rules.unithealthmultiplier = 单位生命倍率
rules.unitdamagemultiplier = 单位伤害倍率
rules.unitcrashdamagemultiplier = 单位坠毁伤害倍率
rules.unitminespeedmultiplier = Unit Mine Speed Multiplier
rules.unitminespeedmultiplier = 单位采矿效率倍率
rules.solarmultiplier = 太阳能发电倍率
rules.unitcapvariable = 核心可增加单位上限
rules.unitpayloadsexplode = 单位携带载荷与单位一起爆炸
rules.unitcap = 基础单位上限
rules.limitarea = 限制地图有效区域
rules.enemycorebuildradius = 敌方核心不可建造区域半径[lightgray](格)
rules.extracorebuildradius = Extra No-Build Radius:[lightgray] (tiles)
rules.enemycorebuildradius = 敌方核心不可建造区域半径:[lightgray] (格)
rules.extracorebuildradius = 敌方额外不可建造区域半径:[lightgray] ()
rules.wavespacing = 波次间隔:[lightgray](秒)
rules.initialwavespacing = 第一波间隔:[lightgray](秒)
rules.buildcostmultiplier = 建造花费倍率
Expand Down Expand Up @@ -2151,10 +2151,10 @@ block.phase-wall.description = 保护己方建筑,挡下敌方炮弹。 受大
block.phase-wall-large.description = 保护己方建筑,挡下敌方炮弹。 受大多数子弹攻击时有概率将其反弹。
block.surge-wall.description = 保护己方建筑,挡下敌方炮弹。 受攻击时间断释放电弧。
block.surge-wall-large.description = 保护己方建筑,挡下敌方炮弹。 受攻击时间断释放电弧。
block.scrap-wall.description = Protects structures from enemy projectiles.
block.scrap-wall-large.description = Protects structures from enemy projectiles.
block.scrap-wall-huge.description = Protects structures from enemy projectiles.
block.scrap-wall-gigantic.description = Protects structures from enemy projectiles.
block.scrap-wall.description = 保护己方建筑,挡下敌方炮弹。
block.scrap-wall-large.description = 保护己方建筑,挡下敌方炮弹。
block.scrap-wall-huge.description = 保护己方建筑,挡下敌方炮弹。
block.scrap-wall-gigantic.description = 保护己方建筑,挡下敌方炮弹。
block.door.description = 可以开关的墙。
block.door-large.description = 可以开关的墙。
block.mender.description = 定期修复附近的建筑。\n可使用硅提高范围和效率。
Expand Down Expand Up @@ -2221,10 +2221,10 @@ block.vault.description = 大量存储各种类型的物品。 可使用装卸
block.container.description = 少量存储各种类型的物品。 可使用装卸器卸载物品。
block.unloader.description = 从周围的建筑卸载指定物品。
block.launch-pad.description = 将货物发射至指定区块。
block.advanced-launch-pad.description = Launches batches of items to selected sectors. Only accepts one item type at a time.
block.advanced-launch-pad.details = Sub-orbital system for point-to-point transportation of resources.
block.landing-pad.description = Receives items from launch pads in other sectors. Requires large amounts of water to protect against impacts of landings.
block.duo.description = 交替向敌人发射子弹
block.advanced-launch-pad.description = 将批量物品发射至选定的区域。 仅接受一种物品类型。
block.advanced-launch-pad.details = 近轨道系统,用于资源的点对点运输。
block.landing-pad.description = 从其他区域的发射台接收物品。 需要大量水以防止冲击造成的损害。
block.duo.description = 交替地向敌人发射子弹
block.scatter.description = 向敌方战机发射铅、 废料或钢化玻璃高射炮弹。
block.scorch.description = 焚烧任何靠近它的地面敌人。 近距离内十分有效。
block.hail.description = 向远距离地面敌人发射小型炮弹。
Expand Down
68 changes: 35 additions & 33 deletions core/assets/bundles/bundle_zh_TW.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2653,36 +2653,38 @@ lenum.build = 建造一個建築
lenum.getblock = Fetch building, floor and block type at coordinates.\nUnit must be in range of the position, otherwise null is returned.
lenum.within = 單位是否在指定範圍內
lenum.boost = 使用推進器
lenum.flushtext = Flush print buffer's content to marker, if applicable.\nIf fetch is set to true, tries to fetch properties from map locale bundle or game's bundle.
lenum.texture = Texture name straight from game's texture atlas (using kebab-case naming style).\nIf printFlush is set to true, consumes text buffer content as text argument.
lenum.texturesize = Size of texture in tiles. Zero value scales marker width to original texture's size.
lenum.autoscale = Whether to scale marker corresponding to player's zoom level.
lenum.posi = Indexed position, used for line and quad markers with index zero being the first position.
lenum.uvi = Texture's position ranging from zero to one, used for quad markers.
lenum.colori = Indexed position, used for line and quad markers with index zero being the first color.
lenum.wavetimer = Whether the waves come automatically on a timer. If not, waves come when the play button is pressed.
lenum.wave = Current wave number. Can be anything in non-wave modes.
lenum.currentwavetime = Wave countdown in ticks.
lenum.waves = Whether waves are spawnable at all.
lenum.wavesending = Whether the waves can be manually summoned with the play button.
lenum.attackmode = Determines if gamemode is attack mode.
lenum.wavespacing = Time between waves in ticks.
lenum.enemycorebuildradius = No-build zone around enemy core radius.
lenum.dropzoneradius = Radius around enemy wave drop zones.
lenum.unitcap = Base unit cap. Can still be increased by blocks.
lenum.lighting = Whether ambient lighting is enabled.
lenum.buildspeed = Multiplier for building speed.
lenum.unithealth = How much health units start with.
lenum.unitbuildspeed = How fast unit factories build units.
lenum.unitcost = Multiplier of resources that units take to build.
lenum.unitdamage = How much damage units deal.
lenum.blockhealth = How much health blocks start with.
lenum.blockdamage = How much damage blocks (turrets) deal.
lenum.rtsminweight = Minimum "advantage" needed for a squad to attack. Higher -> more cautious.
lenum.rtsminsquad = Minimum size of attack squads.
lenum.maparea = Playable map area. Anything outside the area will not be interactable.
lenum.ambientlight = Ambient light color. Used when lighting is enabled.
lenum.solarmultiplier = Multiplies power output of solar panels.
lenum.dragmultiplier = Environment drag multiplier.
lenum.ban = Blocks or units that cannot be placed or built.
lenum.unban = Unban a unit or block.
lenum.flushtext = 如果適用的話,將打印緩沖區的內容刷新到標記。\n如果 fetch 設置為 true,則嘗試從地圖本地化包或遊戲的包中獲取屬性。
lenum.texture = 直接來自遊戲紋理圖集的紋理名稱(使用 kebab-case 命名風格)。\n如果 printFlush 設置為 true,則將文本緩沖區內容作為文本參數消耗。
lenum.texturesize = 紋理的大小(格)。零值將標記寬度縮放為原始紋理的大小。
lenum.autoscale = 是否根據玩家的縮放級別縮放標記。
lenum.posi = 索引位置,用於線和四邊形標記,索引零表示第一個位置。
lenum.uvi = 紋理的位置範圍從零到一,用於四邊形標記。
lenum.colori = 索引位置,用於線和四邊形標記,索引零表示第一個顏色。

lenum.wavetimer = 波次是否自動出現在計時器上。如果沒有,按下播放按鈕時會出現波次
lenum.wave = 當前波數,可以是非波次模式下的任何值
lenum.currentwavetime = 波次倒計時(以tick為單位)
lenum.waves = 波次是否可以生成
lenum.wavesending = 是否可以通過播放按鈕手動生成波次
lenum.attackmode = 確定遊戲模式是否為攻擊模式
lenum.wavespacing = 波形之間的時間(以tick為單位)
lenum.enemycorebuildradius = 敵人核心半徑周圍無建築區
lenum.dropzoneradius = 敵人出生點周圍的半徑
lenum.unitcap = 基本單位上限。但仍然可以通過方塊增加
lenum.lighting = 是否啟用環境照明
lenum.buildspeed = 建築速度倍率
lenum.unithealth = 單位受傷減免, 計算方式是傷害除以減免值
lenum.unitbuildspeed = 單元工廠建造單元的速度
lenum.unitcost = 單位建設所需資源的倍率
lenum.unitdamage = 單位造成多少傷害
lenum.blockhealth = 方塊受傷減免, 計算方式是傷害除以減免值
lenum.blockdamage = 方塊(炮塔)造成的傷害有多大
lenum.rtsminweight = 進攻小隊所需的最小“優勢”。越高->越謹慎
lenum.rtsminsquad = 攻擊小隊的最小規模
lenum.maparea = 設置區域範圍
lenum.ambientlight = 環境光顏色,啟用照明時使用
lenum.solarmultiplier = 太陽能電池板的功率輸出倍率
lenum.dragmultiplier = 環境阻力乘數
lenum.ban = 無法放置或構建的塊或單元
lenum.unban = 取消ban

4 changes: 1 addition & 3 deletions core/src/mindustry/Vars.java
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,7 @@ public static void init(){

modDirectory.mkdirs();

Events.on(ContentInitEvent.class, e -> {
emptyTile = new Tile(Short.MAX_VALUE - 20, Short.MAX_VALUE - 20);
});
Events.on(ContentInitEvent.class, e -> emptyTile = new Tile(Short.MAX_VALUE - 20, Short.MAX_VALUE - 20));

mods.load();
maps.load();
Expand Down
8 changes: 2 additions & 6 deletions core/src/mindustry/ai/BlockIndexer.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,9 @@ public class BlockIndexer{
public BlockIndexer(){
clearFlags();

Events.on(TilePreChangeEvent.class, event -> {
removeIndex(event.tile);
});
Events.on(TilePreChangeEvent.class, event -> removeIndex(event.tile));

Events.on(TileChangeEvent.class, event -> {
addIndex(event.tile);
});
Events.on(TileChangeEvent.class, event -> addIndex(event.tile));

Events.on(WorldLoadEvent.class, event -> {
damagedTiles = new Seq[Team.all.length];
Expand Down
6 changes: 2 additions & 4 deletions core/src/mindustry/ai/ControlPathfinder.java
Original file line number Diff line number Diff line change
Expand Up @@ -1529,10 +1529,8 @@ public void run(){
clustersToInnerUpdate.remove(cluster);
});

clustersToInnerUpdate.each(cluster -> {
//only recompute the inner links
updateClustersInner(cluster);
});
//only recompute the inner links
clustersToInnerUpdate.each(this::updateClustersInner);

clustersToInnerUpdate.clear();
clustersToUpdate.clear();
Expand Down
1 change: 0 additions & 1 deletion core/src/mindustry/ai/PathfindQueue.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import arc.util.*;

/** A priority queue. */
@SuppressWarnings("unchecked")
public class PathfindQueue{
private static final double CAPACITY_RATIO_LOW = 1.5f;
private static final double CAPACITY_RATIO_HI = 2f;
Expand Down
20 changes: 8 additions & 12 deletions core/src/mindustry/ai/RtsAI.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,15 @@ public RtsAI(TeamData data){
//TODO remove: debugging!

if(debug){
Events.run(Trigger.draw, () -> {
Events.run(Trigger.draw, () -> Draw.draw(Layer.overlayUI, () -> {

Draw.draw(Layer.overlayUI, () -> {

float s = Fonts.outline.getScaleX();
Fonts.outline.getData().setScale(0.5f);
for(var target : weights){
Fonts.outline.draw("[sky]" + Strings.fixed(target.value, 2), target.key.x, target.key.y, Align.center);
}
Fonts.outline.getData().setScale(s);
});

});
float s = Fonts.outline.getScaleX();
Fonts.outline.getData().setScale(0.5f);
for(var target : weights){
Fonts.outline.draw("[sky]" + Strings.fixed(target.value, 2), target.key.x, target.key.y, Align.center);
}
Fonts.outline.getData().setScale(s);
}));
}
}

Expand Down
4 changes: 1 addition & 3 deletions core/src/mindustry/ai/WaveSpawner.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ public WaveSpawner(){
@Nullable
public Tile getFirstSpawn(){
firstSpawn = null;
eachGroundSpawn((cx, cy) -> {
firstSpawn = world.tile(cx, cy);
});
eachGroundSpawn((cx, cy) -> firstSpawn = world.tile(cx, cy));
return firstSpawn;
}

Expand Down
4 changes: 1 addition & 3 deletions core/src/mindustry/audio/SoundControl.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ public SoundControl(){

setupFilters();

Events.on(ResetEvent.class, e -> {
lastPlayed = Time.millis();
});
Events.on(ResetEvent.class, e -> lastPlayed = Time.millis());
}

protected void setupFilters(){
Expand Down
Loading