From 1dd0295c45e6ea6f0967f291b41ff3a58ab7202c Mon Sep 17 00:00:00 2001 From: DeltaNedas <39013340+DeltaNedas@users.noreply.github.com> Date: Sat, 4 Jan 2020 17:15:43 +0000 Subject: [PATCH 1/3] make turnCursor: false mechs not cross eyed (#1301) * create new branch * add targetDistance to weapons for mechs players will use if turnCursor is false --- core/src/mindustry/entities/type/Player.java | 2 +- core/src/mindustry/type/Weapon.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/entities/type/Player.java b/core/src/mindustry/entities/type/Player.java index 4077da0e4e..6f28acb17c 100644 --- a/core/src/mindustry/entities/type/Player.java +++ b/core/src/mindustry/entities/type/Player.java @@ -637,7 +637,7 @@ public class Player extends Unit implements BuilderMinerTrait, ShooterTrait{ if(!state.isEditor() && isShooting() && mech.canShoot(this)){ if(!mech.turnCursor){ //shoot forward ignoring cursor - mech.weapon.update(this, x + Angles.trnsx(rotation, 1f), y + Angles.trnsy(rotation, 1f)); + mech.weapon.update(this, x + Angles.trnsx(rotation, mech.weapon.targetDistance), y + Angles.trnsy(rotation, mech.weapon.targetDistance)); }else{ mech.weapon.update(this, pointerX, pointerY); } diff --git a/core/src/mindustry/type/Weapon.java b/core/src/mindustry/type/Weapon.java index 0e3583a552..175abd1d24 100644 --- a/core/src/mindustry/type/Weapon.java +++ b/core/src/mindustry/type/Weapon.java @@ -55,6 +55,8 @@ public class Weapon{ public float shotDelay = 0; /** whether shooter rotation is ignored when shooting. */ public boolean ignoreRotation = false; + /** if turnCursor is false for a mech, how far away will the weapon target. */ + public float targetDistance = 1f; public Sound shootSound = Sounds.pew; From 5f1ea4b098b4158388acb143a47bfc63643e52a1 Mon Sep 17 00:00:00 2001 From: Dave <16521341+davidmfritz@users.noreply.github.com> Date: Sat, 4 Jan 2020 18:39:57 +0100 Subject: [PATCH 2/3] UX improvements for showTextInput (#1290) * Added keyDown support for showTextInput (Enter, Escape, Back) * Removed unnecessary "this" * Added cursor autofocus on showTextInput --- core/src/mindustry/core/UI.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/core/UI.java b/core/src/mindustry/core/UI.java index 58cb23d802..f1b578cc9c 100644 --- a/core/src/mindustry/core/UI.java +++ b/core/src/mindustry/core/UI.java @@ -307,7 +307,19 @@ public class UI implements ApplicationListener, Loadable{ hide(); }).disabled(b -> field.getText().isEmpty()); buttons.addButton("$cancel", this::hide); - }}.show(); + keyDown(KeyCode.ENTER, () -> { + String text = field.getText(); + if(!text.isEmpty()){ + confirmed.get(text); + hide(); + } + }); + keyDown(KeyCode.ESCAPE, this::hide); + keyDown(KeyCode.BACK, this::hide); + show(); + Core.scene.setKeyboardFocus(field); + field.setCursorPosition(def.length()); + }}; } } From eb70283355101fb1a5b832ac051e35e0742b0f02 Mon Sep 17 00:00:00 2001 From: Patrick 'Quezler' Mounier Date: Sat, 4 Jan 2020 18:40:12 +0100 Subject: [PATCH 3/3] Use current directory explicitly for bundle updator (#1316) --- tools/src/mindustry/tools/BundleLauncher.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/src/mindustry/tools/BundleLauncher.java b/tools/src/mindustry/tools/BundleLauncher.java index 668d4665fe..1f73b26f28 100644 --- a/tools/src/mindustry/tools/BundleLauncher.java +++ b/tools/src/mindustry/tools/BundleLauncher.java @@ -15,7 +15,7 @@ public class BundleLauncher{ OrderedMap base = new OrderedMap<>(); PropertiesUtils.load(base, new InputStreamReader(new FileInputStream(file))); Array removals = new Array<>(); - Fi.get("").walk(child -> { + Fi.get(".").walk(child -> { if(child.name().equals("bundle.properties") || child.isDirectory() || child.toString().contains("output")) return;