From 40bb499eeb360abec431d85252287f5ef5efbaf7 Mon Sep 17 00:00:00 2001 From: Anuken Date: Tue, 26 Dec 2017 12:57:56 -0500 Subject: [PATCH] Fixes to shader code, collapsible placement menu --- .gitignore | 2 ++ android/AndroidManifest.xml | 4 ++-- .../sprites/ui/icons/icon-arrow-down.png | Bin 0 -> 168 bytes .../assets-raw/sprites/ui/icons/icon-arrow-up.png | Bin 0 -> 201 bytes core/src/io/anuke/mindustry/graphics/Shaders.java | 4 +++- .../src/io/anuke/mindustry/mapeditor/MapView.java | 1 + .../mindustry/ui/fragments/BlocksFragment.java | 13 ++++++++----- .../mindustry/world/blocks/ProductionBlocks.java | 4 ++-- .../mindustry/world/blocks/WeaponBlocks.java | 2 +- .../world/blocks/types/defense/ShieldBlock.java | 4 ++-- .../world/blocks/types/distribution/Conveyor.java | 9 ++++++--- .../blocks/types/production/NuclearReactor.java | 6 +++--- 12 files changed, 30 insertions(+), 19 deletions(-) create mode 100644 core/assets-raw/sprites/ui/icons/icon-arrow-down.png create mode 100644 core/assets-raw/sprites/ui/icons/icon-arrow-up.png diff --git a/.gitignore b/.gitignore index b4ca8ba2d7..e50192a4ef 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ ##Packr, build stuff +/core/assets/mindustry-saves/ +/core/assets/mindustry-maps/ /deploy/ /desktop/packr-out/ /desktop/packr-export/ diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index f08f30ce57..68e1fba775 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -1,8 +1,8 @@ + android:versionCode="48" + android:versionName="3.2.1" > diff --git a/core/assets-raw/sprites/ui/icons/icon-arrow-down.png b/core/assets-raw/sprites/ui/icons/icon-arrow-down.png new file mode 100644 index 0000000000000000000000000000000000000000..e3e941b082361cb31cad125021c3581ed735168a GIT binary patch literal 168 zcmeAS@N?(olHy`uVBq!ia0vp^AT}2V8<6ZZI=>f4u_bxCyDx`7I;J! zGca%qgD@k*tT_@uLG}_)Usv{rJW>KmX7jgsYyk?Hdb&77hUa7(8A5T-G@y GGywnxc`+aW literal 0 HcmV?d00001 diff --git a/core/assets-raw/sprites/ui/icons/icon-arrow-up.png b/core/assets-raw/sprites/ui/icons/icon-arrow-up.png new file mode 100644 index 0000000000000000000000000000000000000000..30e1a4201cf639e407af502d23206c651eb7f34f GIT binary patch literal 201 zcmeAS@N?(olHy`uVBq!ia0vp^AT}2V8<6ZZI=>f4u_bxCyDx`7I;J! zGca%qgD@k*tT_@uLG}_)Usv{rJW>Km24z>@HUfphJY5_^Brf+(xX8<($l=UgsDC`+ zm~`{e1M@F0NO}UI{b0kQK`0jIfzNay>^vjREE1Se}v^0OM qiafS|N0{lFFV !GameState.is(State.menu)); + new table(){{ new table("button") {{ @@ -133,8 +136,6 @@ public class BlocksFragment implements Fragment{ get().marginLeft(0f); get().marginRight(0f); - - end(); }}.right().bottom().uniformX(); @@ -142,10 +143,12 @@ public class BlocksFragment implements Fragment{ }}.end(); - //new imagebutton("icon-arrow-right", 10*2, () -> { - // shown = !shown; - //}).uniformY().fillY(); + row(); + new imagebutton("icon-arrow-down", 10*2, () -> { + shown = !shown; + }).padBottom(-5).uniformX().fillX() + .update(i -> i.getStyle().imageUp = Core.skin.getDrawable(shown ? "icon-arrow-down" : "icon-arrow-up")); }}.end(); } diff --git a/core/src/io/anuke/mindustry/world/blocks/ProductionBlocks.java b/core/src/io/anuke/mindustry/world/blocks/ProductionBlocks.java index a589b82d76..98a2d7b36d 100644 --- a/core/src/io/anuke/mindustry/world/blocks/ProductionBlocks.java +++ b/core/src/io/anuke/mindustry/world/blocks/ProductionBlocks.java @@ -257,8 +257,8 @@ public class ProductionBlocks{ formalName = "RTG generator"; generateItem = Item.uranium; powerCapacity = 40f; - powerOutput = 0.05f; - itemDuration = 250f; + powerOutput = 0.04f; + itemDuration = 240f; description = "Generates power from uranium."; fullDescription = "Generates small amounts of power from the radioactive decay of uranium. Outputs power as lasers to its 4 sides."; } diff --git a/core/src/io/anuke/mindustry/world/blocks/WeaponBlocks.java b/core/src/io/anuke/mindustry/world/blocks/WeaponBlocks.java index 61bd306bbd..bffbfc34c9 100644 --- a/core/src/io/anuke/mindustry/world/blocks/WeaponBlocks.java +++ b/core/src/io/anuke/mindustry/world/blocks/WeaponBlocks.java @@ -92,7 +92,7 @@ public class WeaponBlocks{ bullet = BulletType.flame; ammo = Item.coal; health = 90; - fullDescription = "Advanced close-range turret. Uses coal for ammo. Has very low range, but very high damage and damage. " + fullDescription = "Advanced close-range turret. Uses coal for ammo. Has very low range, but very high damage. " + "Good for close quarters. Recommended to be used behind walls."; } }, diff --git a/core/src/io/anuke/mindustry/world/blocks/types/defense/ShieldBlock.java b/core/src/io/anuke/mindustry/world/blocks/types/defense/ShieldBlock.java index ccc4b03f32..25cbe8c8ca 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/defense/ShieldBlock.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/defense/ShieldBlock.java @@ -17,9 +17,9 @@ import io.anuke.ucore.util.Strings; public class ShieldBlock extends PowerBlock{ public float shieldRadius = 40f; public float powerDrain = 0.005f; - public float powerPerDamage = 0.2f; + public float powerPerDamage = 0.13f; public float maxRadius = 40f; - public float radiusScale = 160f; + public float radiusScale = 200f; public ShieldBlock(String name) { super(name); diff --git a/core/src/io/anuke/mindustry/world/blocks/types/distribution/Conveyor.java b/core/src/io/anuke/mindustry/world/blocks/types/distribution/Conveyor.java index 7d7e3f157a..7e7ce43ae4 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/distribution/Conveyor.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/distribution/Conveyor.java @@ -24,6 +24,9 @@ public class Conveyor extends Block{ private static ItemPos pos1 = new ItemPos(); private static ItemPos pos2 = new ItemPos(); private static IntArray removals = new IntArray(); + private static final float itemSpace = 0.135f; + private static final float offsetScl = 128f*3f; + private static final float itemSize = 4f; public float speed = 0.02f; @@ -68,7 +71,7 @@ public class Conveyor extends Block{ Draw.rect("icon-" + pos.item.name(), tile.x * tilesize + Tmp.v1.x * pos.y + Tmp.v2.x, - tile.y * tilesize + Tmp.v1.y * pos.y + Tmp.v2.y, 4, 4); + tile.y * tilesize + Tmp.v1.y * pos.y + Tmp.v2.y, itemSize, itemSize); } } @@ -85,13 +88,13 @@ public class Conveyor extends Block{ ItemPos pos = pos1.set(value); boolean canmove = i == entity.convey.size - 1 || - !(pos2.set(entity.convey.get(i + 1)).y - pos.y < 0.135 * Timers.delta()); + !(pos2.set(entity.convey.get(i + 1)).y - pos.y < itemSpace * Timers.delta()); if(canmove){ pos.y += Math.max(speed * Timers.delta(), 1f/252f); //TODO fix precision issues? pos.x = Mathf.lerpDelta(pos.x, 0, 0.06f); }else{ - pos.x = Mathf.lerpDelta(pos.x, pos.seed/128f/3f, 0.1f); + pos.x = Mathf.lerpDelta(pos.x, pos.seed/offsetScl, 0.1f); } pos.y = Mathf.clamp(pos.y); diff --git a/core/src/io/anuke/mindustry/world/blocks/types/production/NuclearReactor.java b/core/src/io/anuke/mindustry/world/blocks/types/production/NuclearReactor.java index 3c5eb8adb8..762841c289 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/production/NuclearReactor.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/production/NuclearReactor.java @@ -25,14 +25,14 @@ public class NuclearReactor extends LiquidItemPowerGenerator{ protected Color coolColor = new Color(1, 1, 1, 0f); protected Color hotColor = Color.valueOf("ff9575a3"); - protected int fuelUseTime = 120; //time to consume 1 fuel - protected float powerMultiplier = 0.3f; //power per frame, depends on full capacity + protected int fuelUseTime = 140; //time to consume 1 fuel + protected float powerMultiplier = 0.4f; //power per frame, depends on full capacity protected float heating = 0.007f; //heating per frame protected float coolantPower = 0.007f; //how much heat decreases per coolant unit protected float smokeThreshold = 0.3f; //threshold at which block starts smoking protected int explosionRadius = 19; protected int explosionDamage = 135; - protected float flashThreshold = 0.46f; + protected float flashThreshold = 0.46f; //heat threshold at which the lights start flashing public NuclearReactor(String name) { super(name);