diff --git a/TRANSLATING.md b/TRANSLATING.md index 945fc76788..69065a91ba 100644 --- a/TRANSLATING.md +++ b/TRANSLATING.md @@ -1,8 +1,5 @@ ## Translating for Mindustry -**DISCLAIMER:** *Currently, 4.0 is far from done, which means that things such as block names, descriptions, and core text will be changing often. If you begin translating now, you might have to re-do large chunks of the bundle before final release.* - - To begin, log in to your GitHub account, or if you don't have one yet, create it [here](https://github.com/). Consult [this list](https://www.science.co.il/language/Locale-codes.php) to find the locale code for your language. Once you've found it, diff --git a/annotations/src/main/java/io/anuke/annotations/AssetsAnnotationProcessor.java b/annotations/src/main/java/io/anuke/annotations/AssetsAnnotationProcessor.java index 32bd471288..6fed3137de 100644 --- a/annotations/src/main/java/io/anuke/annotations/AssetsAnnotationProcessor.java +++ b/annotations/src/main/java/io/anuke/annotations/AssetsAnnotationProcessor.java @@ -80,7 +80,7 @@ public class AssetsAnnotationProcessor extends AbstractProcessor{ } load.addStatement(name + " = io.anuke.arc.Core.audio."+loadMethod+"(io.anuke.arc.Core.files.internal(io.anuke.arc.Core.app.getType() != io.anuke.arc.Application.ApplicationType.iOS ? $S : $S))", - path.substring(path.lastIndexOf("/") + 1) + "/" + fname, (path.substring(path.lastIndexOf("/") + 1) + "/" + fname).replace(".ogg", ".caf")); + path.substring(path.lastIndexOf("/") + 1) + "/" + fname, (path.substring(path.lastIndexOf("/") + 1) + "/" + fname).replace(".ogg", ".mp3")); dispose.addStatement(name + ".dispose()"); dispose.addStatement(name + " = null"); type.addField(FieldSpec.builder(ClassName.bestGuess(rtype), name, Modifier.STATIC, Modifier.PUBLIC).initializer("new io.anuke.arc.audio.mock.Mock" + rtype.substring(rtype.lastIndexOf(".") + 1)+ "()").build()); diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 5f19cec78d..99669a7b73 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -371,7 +371,7 @@ zone.crags.name = Crags zone.fungalPass.name = Fungal Pass zone.groundZero.description = The optimal location to begin once more. Low enemy threat. Few resources.\nGather as much lead and copper as possible.\nMove on. -zone.frozenForest.description = Even here, closer to mountains, the spores have spread. The fridgid temperatures cannot contain them forever.\n\nBegin the venture into power. Build combustion generators. Learn to use menders. +zone.frozenForest.description = Even here, closer to mountains, the spores have spread. The frigid temperatures cannot contain them forever.\n\nBegin the venture into power. Build combustion generators. Learn to use menders. zone.desertWastes.description = These wastes are vast, unpredictable, and criss-crossed with derelict sector structures.\nCoal is present in the region. Burn it for power, or synthesize graphite.\n\n[lightgray]This landing location cannot be guaranteed. zone.saltFlats.description = On the outskirts of the desert lie the Salt Flats. Few resources can be found in this location.\n\nThe enemy has erected a resource storage complex here. Eradicate their core. Leave nothing standing. zone.craters.description = Water has accumulated in this crater, relic of the old wars. Reclaim the area. Collect sand. Smelt metaglass. Pump water to cool turrets and drills. diff --git a/core/assets/maps/veins.msav b/core/assets/maps/veins.msav index d63dc2c1e8..87e62486c7 100644 Binary files a/core/assets/maps/veins.msav and b/core/assets/maps/veins.msav differ diff --git a/core/assets/sprites/uiskin.json b/core/assets/sprites/uiskin.json index 30e049a889..b929cf8457 100644 --- a/core/assets/sprites/uiskin.json +++ b/core/assets/sprites/uiskin.json @@ -188,7 +188,8 @@ up: button, over: button-over, imageDisabledColor: gray, - imageUpColor: white + imageUpColor: white, + disabled: button-disabled }, node: { up: button-over, diff --git a/core/src/io/anuke/mindustry/entities/traits/BuilderTrait.java b/core/src/io/anuke/mindustry/entities/traits/BuilderTrait.java index 7734838d3d..92d48aa655 100644 --- a/core/src/io/anuke/mindustry/entities/traits/BuilderTrait.java +++ b/core/src/io/anuke/mindustry/entities/traits/BuilderTrait.java @@ -285,6 +285,10 @@ public interface BuilderTrait extends Entity, TeamTrait{ this.breaking = true; } + public Tile tile(){ + return world.tile(x, y); + } + @Override public String toString(){ return "BuildRequest{" + diff --git a/core/src/io/anuke/mindustry/entities/type/Player.java b/core/src/io/anuke/mindustry/entities/type/Player.java index 61b5ff7d65..dbc26c34fb 100644 --- a/core/src/io/anuke/mindustry/entities/type/Player.java +++ b/core/src/io/anuke/mindustry/entities/type/Player.java @@ -70,7 +70,6 @@ public class Player extends Unit implements BuilderMinerTrait, ShooterTrait{ private Tile mining; private Vector2 movement = new Vector2(); private boolean moved; - private SoundLoop buildSound = new SoundLoop(Sounds.build, 0.75f); //endregion @@ -131,11 +130,6 @@ public class Player extends Unit implements BuilderMinerTrait, ShooterTrait{ } } - @Override - public void removed(){ - buildSound.stop(); - } - @Override public float drag(){ return mech.drag; @@ -518,7 +512,9 @@ public class Player extends Unit implements BuilderMinerTrait, ShooterTrait{ } BuildRequest request = buildRequest(); - buildSound.update(request == null ? x : request.x * tilesize, request == null ? y : request.y * tilesize, isBuilding() && (Mathf.within(request.x * tilesize, request.y * tilesize, x, y, placeDistance) || state.isEditor())); + if(isBuilding() && request.tile() != null && (request.tile().withinDst(x, y, placeDistance) || state.isEditor())){ + loops.play(Sounds.build, request.tile(), 0.75f); + } if(isDead()){ isBoosting = false; diff --git a/core/src/io/anuke/mindustry/game/Stats.java b/core/src/io/anuke/mindustry/game/Stats.java index ebaa62dfc6..afdd5c0706 100644 --- a/core/src/io/anuke/mindustry/game/Stats.java +++ b/core/src/io/anuke/mindustry/game/Stats.java @@ -26,8 +26,10 @@ public class Stats{ public RankResult calculateRank(Zone zone, boolean launched){ float score = 0; - //each new launch period adds onto the rank 'points' - if(wavesLasted >= zone.conditionWave){ + if(launched && zone.getRules().attackMode){ + score += 3f; + }else if(wavesLasted >= zone.conditionWave){ + //each new launch period adds onto the rank 'points' score += (float)((wavesLasted - zone.conditionWave) / zone.launchPeriod + 1) * 1.2f; } diff --git a/core/src/io/anuke/mindustry/input/DesktopInput.java b/core/src/io/anuke/mindustry/input/DesktopInput.java index ae574d906f..caf01eeb25 100644 --- a/core/src/io/anuke/mindustry/input/DesktopInput.java +++ b/core/src/io/anuke/mindustry/input/DesktopInput.java @@ -131,7 +131,7 @@ public class DesktopInput extends InputHandler{ player.isShooting = false; } - if(!state.is(State.menu) && Core.input.keyTap(Binding.minimap) && !ui.chatfrag.chatOpen() && !(scene.getKeyboardFocus() instanceof TextField)){ + if(!state.is(State.menu) && Core.input.keyTap(Binding.minimap) && (scene.getKeyboardFocus() == ui.minimap || !scene.hasDialog()) && !ui.chatfrag.chatOpen() && !(scene.getKeyboardFocus() instanceof TextField)){ if(!ui.minimap.isShown()){ ui.minimap.show(); }else{ diff --git a/core/src/io/anuke/mindustry/ui/dialogs/FileChooser.java b/core/src/io/anuke/mindustry/ui/dialogs/FileChooser.java index d5ddbb1233..e81c312347 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/FileChooser.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/FileChooser.java @@ -31,7 +31,6 @@ public class FileChooser extends FloatingDialog{ private Predicate filter; private Consumer selectListener; private boolean open; - private int lastWidth = Core.graphics.getWidth(), lastHeight = Core.graphics.getHeight(); public static final Predicate pngFiles = str -> str.equals("png"); public static final Predicate anyMapFiles = str -> str.equals(oldMapExtension) || str.equals(mapExtension); @@ -44,12 +43,14 @@ public class FileChooser extends FloatingDialog{ this.filter = filter; this.selectListener = result; - update(() -> { - if(Core.graphics.getWidth() != lastWidth || Core.graphics.getHeight() != lastHeight){ - updateFiles(false); - lastHeight = Core.graphics.getHeight(); - lastWidth = Core.graphics.getWidth(); - } + onResize(() -> { + cont.clear(); + setupWidgets(); + }); + + shown(() -> { + cont.clear(); + setupWidgets(); }); } @@ -121,8 +122,9 @@ public class FileChooser extends FloatingDialog{ forward.resizeImage(isize); forward.clicked(() -> stack.forward()); - back.clicked(() -> stack.back()); + forward.setDisabled(() -> !stack.canForward()); + back.setDisabled(() -> !stack.canBack()); ImageButton home = new ImageButton("icon-home"); home.resizeImage(isize); @@ -206,7 +208,7 @@ public class FileChooser extends FloatingDialog{ //macs are confined to the Downloads/ directory if(!OS.isMac){ - Image upimage = new Image("icon-folder-parent"); + Image upimage = new Image("icon-folder-parent-small"); TextButton upbutton = new TextButton(".." + directory.toString(), "clear-toggle"); upbutton.clicked(() -> { directory = directory.parent(); @@ -214,7 +216,7 @@ public class FileChooser extends FloatingDialog{ updateFiles(true); }); - upbutton.left().add(upimage).padRight(4f).size(iconsize); + upbutton.left().add(upimage).padRight(4f).size(iconsizesmall).padLeft(4); upbutton.getLabel().setAlignment(Align.left); upbutton.getCells().reverse(); @@ -248,9 +250,9 @@ public class FileChooser extends FloatingDialog{ button.setChecked(filename.equals(filefield.getText())); }); - Image image = new Image(file.isDirectory() ? "icon-folder" : "icon-file-text"); + Image image = new Image(file.isDirectory() ? "icon-folder-small" : "icon-file-text-small"); - button.add(image).padRight(4f).size(iconsize); + button.add(image).padRight(4f).padLeft(4).size(iconsizesmall); button.getCells().reverse(); files.top().left().add(button).align(Align.topLeft).fillX().expandX() .height(50).pad(2).padTop(0).padBottom(0).colspan(2); @@ -273,17 +275,6 @@ public class FileChooser extends FloatingDialog{ } } - @Override - public Dialog show(){ - Time.runTask(2f, () -> { - cont.clear(); - setupWidgets(); - super.show(); - Core.scene.setScrollFocus(pane); - }); - return this; - } - public class FileHistory{ private Array history = new Array<>(); private int index; diff --git a/core/src/io/anuke/mindustry/ui/dialogs/FloatingDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/FloatingDialog.java index 748d0e93a6..54a502627e 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/FloatingDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/FloatingDialog.java @@ -39,18 +39,6 @@ public class FloatingDialog extends Dialog{ state.set(State.paused); } }); - - boolean[] done = {false}; - - shown(() -> Core.app.post(() -> - forEach(child -> { - if(done[0]) return; - - if(child instanceof ScrollPane){ - Core.scene.setScrollFocus(child); - done[0] = true; - } - }))); } public FloatingDialog(String title){ @@ -59,8 +47,9 @@ public class FloatingDialog extends Dialog{ protected void onResize(Runnable run){ Events.on(ResizeEvent.class, event -> { - if(isShown()){ + if(isShown() && Core.scene.getDialog() == this){ run.run(); + updateScrollFocus(); } }); } diff --git a/core/src/io/anuke/mindustry/ui/dialogs/GameOverDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/GameOverDialog.java index ca7cdcf5d7..3078c01d56 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/GameOverDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/GameOverDialog.java @@ -1,11 +1,11 @@ package io.anuke.mindustry.ui.dialogs; -import io.anuke.arc.Core; -import io.anuke.mindustry.core.GameState.State; -import io.anuke.mindustry.game.Stats.RankResult; -import io.anuke.mindustry.game.Team; -import io.anuke.mindustry.type.Item; -import io.anuke.mindustry.type.Item.Icon; +import io.anuke.arc.*; +import io.anuke.mindustry.core.GameState.*; +import io.anuke.mindustry.game.Stats.*; +import io.anuke.mindustry.game.*; +import io.anuke.mindustry.type.*; +import io.anuke.mindustry.type.Item.*; import static io.anuke.mindustry.Vars.*; diff --git a/ios/convert_audio.sh b/ios/convert_audio.sh index c4772fadc3..8e27eb60df 100755 --- a/ios/convert_audio.sh +++ b/ios/convert_audio.sh @@ -1,7 +1,15 @@ #!/usr/bin/bash -#convert ogg to .caf files for iOS -for i in $1/*.ogg; do +cd $1 + +#convert ogg to .mp3 files for iOS +for i in *.ogg; do echo $i - ffmpeg -i "$i" "${i%.*}.caf" -done \ No newline at end of file + ffmpeg -i "$i" "OUT_${i%.*}.mp3" +done + +find . -type f ! -name "OUT_*" -delete + +for file in OUT_*; do mv "$file" "${file#OUT_}"; done; + +cd ../../