diff --git a/TODO.md b/TODO.md index d58b54452f..dafc45ee9a 100644 --- a/TODO.md +++ b/TODO.md @@ -12,6 +12,15 @@ _Keep in mind that this is just a basic outline of planned features, and will be - Fix bugs with junction not accepting blocks(low FPS) - Fix bugs with tunnel merging and/or removing items (low FPS) - Investigate #6 +- Edit descriptions for conveyors to be more clear about how to use them +- Add link to Mindustry discord everywhere + +### Major Bugs +- Black screen when tabbing out on Android +- Infinite explosions that destroy blocks +- Random map reload when playing, leading to a crash (UI cause?) +- Google Payments verify crash +- Google Payments IllegalArgument crash ### 4.0 Planned - Multiplayer framework, possibly implementation diff --git a/build.gradle b/build.gradle index 079862f896..37551d179a 100644 --- a/build.gradle +++ b/build.gradle @@ -79,7 +79,7 @@ project(":core") { apply plugin: "java" dependencies { - compile 'com.github.Anuken:ucore:6eea0a3' + compile 'com.github.Anuken:ucore:5984abc' compile "com.badlogicgames.gdx:gdx:$gdxVersion" compile "com.badlogicgames.gdx:gdx-ai:1.8.1" } diff --git a/core/assets-raw/sprites/ui/icon-arrow.png b/core/assets-raw/sprites/ui/icon-arrow.png new file mode 100644 index 0000000000..93e300c108 Binary files /dev/null and b/core/assets-raw/sprites/ui/icon-arrow.png differ diff --git a/core/assets-raw/sprites/ui/icon-holdDelete.png b/core/assets-raw/sprites/ui/icon-holdDelete.png new file mode 100644 index 0000000000..ea2f55b269 Binary files /dev/null and b/core/assets-raw/sprites/ui/icon-holdDelete.png differ diff --git a/core/assets-raw/sprites/ui/icon-rotate-left.png b/core/assets-raw/sprites/ui/icon-rotate-left.png new file mode 100644 index 0000000000..22b3b3c582 Binary files /dev/null and b/core/assets-raw/sprites/ui/icon-rotate-left.png differ diff --git a/core/assets-raw/sprites/ui/icon-rotate-right.png b/core/assets-raw/sprites/ui/icon-rotate-right.png new file mode 100644 index 0000000000..d163dfcb5c Binary files /dev/null and b/core/assets-raw/sprites/ui/icon-rotate-right.png differ diff --git a/core/assets-raw/sprites/ui/icon-touchDelete.png b/core/assets-raw/sprites/ui/icon-touchDelete.png new file mode 100644 index 0000000000..29b2cd89ea Binary files /dev/null and b/core/assets-raw/sprites/ui/icon-touchDelete.png differ diff --git a/core/assets/sprites/sprites.atlas b/core/assets/sprites/sprites.atlas index c5334ab861..125a856d87 100644 --- a/core/assets/sprites/sprites.atlas +++ b/core/assets/sprites/sprites.atlas @@ -34,42 +34,42 @@ blocks/blackrockshadow1 index: -1 blocks/blackstone1 rotate: false - xy: 724, 371 + xy: 734, 406 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/blackstone2 rotate: false - xy: 724, 361 + xy: 734, 396 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/blackstone3 rotate: false - xy: 724, 351 + xy: 724, 371 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/blackstoneblock1 rotate: false - xy: 498, 110 + xy: 724, 361 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/blackstoneblock2 rotate: false - xy: 508, 110 + xy: 724, 351 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/blackstoneblock3 rotate: false - xy: 704, 265 + xy: 734, 386 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -83,7 +83,7 @@ blocks/blackstoneedge index: -1 blocks/block rotate: false - xy: 702, 245 + xy: 734, 366 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -111,14 +111,14 @@ blocks/chainturret index: -1 blocks/chainturret-icon rotate: false - xy: 529, 177 + xy: 569, 215 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 blocks/coal1 rotate: false - xy: 416, 99 + xy: 734, 346 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -132,98 +132,98 @@ blocks/coal2 index: -1 blocks/coal3 rotate: false - xy: 224, 83 + xy: 175, 79 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/coaldrill rotate: false - xy: 234, 83 + xy: 185, 79 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/coalgenerator rotate: false - xy: 244, 83 + xy: 195, 79 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/coalgenerator-top rotate: false - xy: 254, 83 + xy: 205, 79 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/coalpurifier rotate: false - xy: 264, 83 + xy: 215, 79 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/combustiongenerator rotate: false - xy: 274, 83 + xy: 225, 83 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/compositewall rotate: false - xy: 284, 83 + xy: 235, 83 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/conduit rotate: false - xy: 294, 83 + xy: 245, 83 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/conduitbottom rotate: false - xy: 304, 83 + xy: 255, 83 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/conduitliquid rotate: false - xy: 314, 83 + xy: 265, 83 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/conduittop rotate: false - xy: 324, 83 + xy: 275, 83 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/conveyor rotate: false - xy: 334, 83 + xy: 285, 83 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/conveyormove rotate: false - xy: 344, 83 + xy: 295, 83 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/conveyortunnel rotate: false - xy: 354, 83 + xy: 305, 83 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -237,42 +237,42 @@ blocks/core index: -1 blocks/cross rotate: false - xy: 364, 83 + xy: 315, 83 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/crucible rotate: false - xy: 374, 83 + xy: 325, 83 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/deepwater rotate: false - xy: 384, 83 + xy: 335, 83 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/dirt1 rotate: false - xy: 394, 83 + xy: 345, 83 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/dirt2 rotate: false - xy: 404, 89 + xy: 355, 83 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/dirt3 rotate: false - xy: 414, 89 + xy: 365, 83 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -286,7 +286,7 @@ blocks/dirtedge index: -1 blocks/door rotate: false - xy: 404, 79 + xy: 375, 83 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -300,7 +300,7 @@ blocks/door-large index: -1 blocks/door-large-icon rotate: false - xy: 414, 79 + xy: 385, 83 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -314,21 +314,21 @@ blocks/door-large-open index: -1 blocks/door-open rotate: false - xy: 115, 4 + xy: 395, 83 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/doubleturret rotate: false - xy: 514, 124 + xy: 529, 177 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 blocks/duriumwall rotate: false - xy: 163, 30 + xy: 514, 114 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -342,42 +342,42 @@ blocks/duriumwall-large index: -1 blocks/duriumwall-large-icon rotate: false - xy: 163, 20 + xy: 115, 4 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/flameturret rotate: false - xy: 188, 89 + xy: 514, 124 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 blocks/fluxpump rotate: false - xy: 732, 381 + xy: 163, 20 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/grass1 rotate: false - xy: 734, 371 + xy: 167, 10 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/grass2 rotate: false - xy: 734, 361 + xy: 406, 99 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/grass3 rotate: false - xy: 734, 351 + xy: 416, 99 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -426,175 +426,175 @@ blocks/ice3 index: -1 blocks/iceedge rotate: false - xy: 524, 217 + xy: 781, 426 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 blocks/icerock1 rotate: false - xy: 518, 114 + xy: 225, 73 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/icerock2 rotate: false - xy: 175, 76 + xy: 235, 73 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/icerockshadow1 rotate: false - xy: 185, 79 + xy: 245, 73 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/rockshadow1 rotate: false - xy: 185, 79 + xy: 245, 73 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/icerockshadow2 rotate: false - xy: 195, 79 + xy: 255, 73 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/rockshadow2 rotate: false - xy: 195, 79 + xy: 255, 73 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/iron1 rotate: false - xy: 498, 90 + xy: 335, 73 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/iron2 rotate: false - xy: 508, 90 + xy: 345, 73 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/iron3 rotate: false - xy: 518, 94 + xy: 355, 73 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/irondrill rotate: false - xy: 518, 84 + xy: 365, 73 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/ironwall rotate: false - xy: 592, 238 + xy: 375, 73 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/junction rotate: false - xy: 602, 238 + xy: 385, 73 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/laserturret rotate: false - xy: 131, 8 + xy: 155, 8 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 blocks/lava rotate: false - xy: 612, 238 + xy: 395, 73 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/lavaedge rotate: false - xy: 538, 217 + xy: 524, 217 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 blocks/lavasmelter rotate: false - xy: 622, 238 + xy: 478, 103 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/liquiditemjunction rotate: false - xy: 632, 238 + xy: 488, 105 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/liquidjunction rotate: false - xy: 642, 238 + xy: 592, 238 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/liquidrouter rotate: false - xy: 591, 228 + xy: 602, 238 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/machineturret rotate: false - xy: 143, 8 + xy: 709, 279 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 blocks/megarepairturret rotate: false - xy: 155, 8 + xy: 721, 281 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 blocks/mortarturret rotate: false - xy: 709, 279 + xy: 541, 177 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 blocks/mossblock rotate: false - xy: 611, 228 + xy: 622, 238 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/mossstone rotate: false - xy: 611, 228 + xy: 622, 238 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -615,7 +615,7 @@ blocks/nuclearreactor-center index: -1 blocks/nuclearreactor-icon rotate: false - xy: 631, 228 + xy: 642, 238 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -636,322 +636,322 @@ blocks/nuclearreactor-small index: -1 blocks/oil rotate: false - xy: 641, 228 + xy: 591, 228 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/oiledge rotate: false - xy: 519, 189 + xy: 519, 203 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 blocks/oilrefinery rotate: false - xy: 595, 218 + xy: 601, 228 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/omnidrill rotate: false - xy: 605, 218 + xy: 611, 228 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/plasmaturret rotate: false - xy: 721, 281 + xy: 498, 108 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 blocks/powerbooster rotate: false - xy: 615, 218 + xy: 621, 228 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/poweredconveyor rotate: false - xy: 625, 218 + xy: 631, 228 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/poweredconveyormove rotate: false - xy: 635, 218 + xy: 641, 228 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/powerlaser rotate: false - xy: 645, 218 + xy: 593, 218 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/powerlasercorner rotate: false - xy: 651, 228 + xy: 603, 218 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/powerlaserrouter rotate: false - xy: 655, 218 + xy: 613, 218 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/pulseconduit rotate: false - xy: 661, 234 + xy: 623, 218 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/pulseconduitbottom rotate: false - xy: 671, 234 + xy: 633, 218 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/pulseconduittop rotate: false - xy: 681, 234 + xy: 643, 218 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/pump rotate: false - xy: 691, 235 + xy: 405, 89 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/repairturret rotate: false - xy: 541, 177 + xy: 704, 263 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 blocks/rock1 rotate: false - xy: 665, 224 + xy: 415, 89 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/rock2 rotate: false - xy: 675, 224 + xy: 415, 79 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/router rotate: false - xy: 665, 214 + xy: 405, 69 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/rtgenerator rotate: false - xy: 675, 214 + xy: 415, 69 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/rtgenerator-top rotate: false - xy: 685, 224 + xy: 175, 69 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/sand1 rotate: false - xy: 685, 214 + xy: 185, 69 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/sand2 rotate: false - xy: 695, 225 + xy: 195, 69 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/sand3 rotate: false - xy: 695, 215 + xy: 205, 69 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/sandblock1 rotate: false - xy: 705, 225 + xy: 215, 69 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/sandblock2 rotate: false - xy: 705, 215 + xy: 171, 59 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/sandblock3 rotate: false - xy: 711, 235 + xy: 171, 49 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/sandedge rotate: false - xy: 533, 203 + xy: 519, 189 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 blocks/shadow rotate: false - xy: 722, 415 + xy: 704, 251 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 blocks/shieldgenerator rotate: false - xy: 715, 225 + xy: 181, 49 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/shotgunturret rotate: false - xy: 722, 403 + xy: 704, 239 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 blocks/shrub rotate: false - xy: 725, 225 + xy: 201, 59 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/shrubshadow rotate: false - xy: 725, 215 + xy: 201, 49 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/smelter rotate: false - xy: 742, 382 + xy: 211, 59 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/sniperturret rotate: false - xy: 722, 391 + xy: 722, 415 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 blocks/snow1 rotate: false - xy: 744, 372 + xy: 211, 49 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/snow2 rotate: false - xy: 744, 362 + xy: 225, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/snow3 rotate: false - xy: 744, 352 + xy: 235, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/snowblock1 rotate: false - xy: 185, 69 + xy: 245, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/snowblock2 rotate: false - xy: 195, 69 + xy: 255, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/snowblock3 rotate: false - xy: 205, 69 + xy: 265, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/snowedge rotate: false - xy: 533, 189 + xy: 533, 203 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 blocks/sorter rotate: false - xy: 595, 208 + xy: 275, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/steelconveyor rotate: false - xy: 605, 208 + xy: 285, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/steelconveyormove rotate: false - xy: 615, 208 + xy: 295, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/steelwall rotate: false - xy: 625, 208 + xy: 305, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -965,98 +965,98 @@ blocks/steelwall-large index: -1 blocks/steelwall-large-icon rotate: false - xy: 635, 208 + xy: 315, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stone1 rotate: false - xy: 645, 208 + xy: 325, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stone2 rotate: false - xy: 655, 208 + xy: 335, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stone3 rotate: false - xy: 665, 204 + xy: 345, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stoneblock1 rotate: false - xy: 675, 204 + xy: 355, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stoneblock2 rotate: false - xy: 685, 204 + xy: 365, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stoneblock3 rotate: false - xy: 695, 205 + xy: 375, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stonedrill rotate: false - xy: 705, 205 + xy: 385, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stoneedge rotate: false - xy: 555, 213 + xy: 533, 189 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 blocks/stoneformer rotate: false - xy: 715, 205 + xy: 395, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stonewall rotate: false - xy: 725, 205 + xy: 221, 53 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/teleporter rotate: false - xy: 714, 269 + xy: 231, 53 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/teleporter-top rotate: false - xy: 714, 259 + xy: 241, 53 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/thermalgenerator rotate: false - xy: 724, 271 + xy: 251, 53 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1070,56 +1070,56 @@ blocks/titancannon index: -1 blocks/titancannon-icon rotate: false - xy: 734, 416 + xy: 722, 403 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 blocks/titanium1 rotate: false - xy: 724, 261 + xy: 261, 53 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/titanium2 rotate: false - xy: 899, 487 + xy: 271, 53 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/titanium3 rotate: false - xy: 909, 487 + xy: 281, 53 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/titaniumdrill rotate: false - xy: 919, 487 + xy: 291, 53 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/titaniumpurifier rotate: false - xy: 929, 487 + xy: 301, 53 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/titaniumshieldwall rotate: false - xy: 939, 487 + xy: 311, 53 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/titaniumwall rotate: false - xy: 949, 487 + xy: 321, 53 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1133,70 +1133,70 @@ blocks/titaniumwall-large index: -1 blocks/titaniumwall-large-icon rotate: false - xy: 959, 487 + xy: 331, 53 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/turret rotate: false - xy: 734, 404 + xy: 722, 391 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 blocks/uranium1 rotate: false - xy: 989, 487 + xy: 361, 53 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/uranium2 rotate: false - xy: 999, 487 + xy: 371, 53 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/uranium3 rotate: false - xy: 781, 446 + xy: 381, 53 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/uraniumdrill rotate: false - xy: 781, 436 + xy: 391, 53 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/water rotate: false - xy: 791, 446 + xy: 405, 59 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/wateredge rotate: false - xy: 569, 213 + xy: 555, 213 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 blocks/waveturret rotate: false - xy: 734, 392 + xy: 734, 416 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 bullet rotate: false - xy: 406, 99 + xy: 734, 356 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1280,7 +1280,7 @@ enemies/targetenemy-t1 index: -1 enemies/enemy-t2 rotate: false - xy: 688, 245 + xy: 797, 442 size: 12, 12 orig: 12, 12 offset: 0, 0 @@ -1378,63 +1378,63 @@ enemies/healerenemy-t3 index: -1 enemies/mortarenemy-t1 rotate: false - xy: 624, 248 + xy: 640, 248 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 enemies/mortarenemy-t2 rotate: false - xy: 640, 264 + xy: 693, 275 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 enemies/mortarenemy-t3 rotate: false - xy: 640, 248 + xy: 656, 260 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 enemies/rapidenemy-t1 rotate: false - xy: 693, 275 + xy: 672, 260 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 enemies/rapidenemy-t2 rotate: false - xy: 656, 260 + xy: 656, 244 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 enemies/rapidenemy-t3 rotate: false - xy: 672, 260 + xy: 672, 244 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 enemies/tankenemy-t1 rotate: false - xy: 656, 244 + xy: 688, 259 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 enemies/tankenemy-t2 rotate: false - xy: 672, 244 + xy: 688, 243 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 enemies/tankenemy-t3 rotate: false - xy: 688, 259 + xy: 781, 440 size: 14, 14 orig: 14, 14 offset: 0, 0 @@ -1469,49 +1469,49 @@ enemyarrow index: -1 icon-coal rotate: false - xy: 205, 79 + xy: 265, 73 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-dirium rotate: false - xy: 478, 103 + xy: 275, 73 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-iron rotate: false - xy: 488, 105 + xy: 285, 73 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-steel rotate: false - xy: 498, 100 + xy: 295, 73 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-stone rotate: false - xy: 508, 100 + xy: 305, 73 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-titanium rotate: false - xy: 518, 104 + xy: 315, 73 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-uranium rotate: false - xy: 488, 95 + xy: 325, 73 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1539,35 +1539,35 @@ laserfull index: -1 mechs/mech-standard rotate: false - xy: 519, 203 + xy: 538, 217 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 shell rotate: false - xy: 712, 245 + xy: 181, 59 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shot rotate: false - xy: 715, 215 + xy: 191, 59 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shot-long rotate: false - xy: 721, 235 + xy: 191, 49 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titanshell rotate: false - xy: 969, 487 + xy: 341, 53 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1659,7 +1659,7 @@ ui/check-over index: -1 ui/clear rotate: false - xy: 583, 215 + xy: 581, 215 size: 10, 10 orig: 10, 10 offset: 0, 0 @@ -1672,6 +1672,13 @@ ui/cursor offset: 0, 0 index: -1 ui/icon-areaDelete + rotate: false + xy: 188, 89 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +ui/icon-arrow rotate: false xy: 200, 89 size: 10, 10 @@ -1769,13 +1776,20 @@ ui/icon-hold orig: 10, 10 offset: 0, 0 index: -1 -ui/icon-info +ui/icon-holdDelete rotate: false xy: 296, 93 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 +ui/icon-info + rotate: false + xy: 308, 93 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 ui/icon-load rotate: false xy: 645, 280 @@ -1785,21 +1799,21 @@ ui/icon-load index: -1 ui/icon-menu rotate: false - xy: 308, 93 + xy: 320, 93 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 ui/icon-pause rotate: false - xy: 320, 93 + xy: 332, 93 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 ui/icon-play rotate: false - xy: 332, 93 + xy: 344, 93 size: 10, 10 orig: 10, 10 offset: 0, 0 @@ -1813,14 +1827,14 @@ ui/icon-play-2 index: -1 ui/icon-power rotate: false - xy: 344, 93 + xy: 356, 93 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 ui/icon-production rotate: false - xy: 356, 93 + xy: 368, 93 size: 10, 10 orig: 10, 10 offset: 0, 0 @@ -1846,48 +1860,69 @@ ui/icon-rotate-arrow orig: 14, 14 offset: 0, 0 index: -1 -ui/icon-save +ui/icon-rotate-left rotate: false xy: 608, 264 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 -ui/icon-settings - rotate: false - xy: 368, 93 - size: 10, 10 - orig: 10, 10 - offset: 0, 0 - index: -1 -ui/icon-tools +ui/icon-rotate-right rotate: false xy: 608, 248 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 -ui/icon-touch - rotate: false - xy: 380, 93 - size: 10, 10 - orig: 10, 10 - offset: 0, 0 - index: -1 -ui/icon-tutorial +ui/icon-save rotate: false xy: 624, 264 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 -ui/icon-weapon +ui/icon-settings + rotate: false + xy: 380, 93 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +ui/icon-tools + rotate: false + xy: 624, 248 + size: 14, 14 + orig: 14, 14 + offset: 0, 0 + index: -1 +ui/icon-touch rotate: false xy: 392, 93 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 +ui/icon-touchDelete + rotate: false + xy: 131, 8 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +ui/icon-tutorial + rotate: false + xy: 640, 264 + size: 14, 14 + orig: 14, 14 + offset: 0, 0 + index: -1 +ui/icon-weapon + rotate: false + xy: 143, 8 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 ui/logotext rotate: false xy: 1, 85 @@ -1961,14 +1996,14 @@ ui/selection index: -1 ui/separator rotate: false - xy: 179, 86 + xy: 169, 86 size: 1, 1 orig: 1, 1 offset: 0, 0 index: -1 ui/slider rotate: false - xy: 652, 238 + xy: 547, 207 size: 1, 8 orig: 1, 8 offset: 0, 0 @@ -1996,7 +2031,7 @@ ui/slider-knob-over index: -1 ui/slider-vertical rotate: false - xy: 169, 86 + xy: 724, 348 size: 8, 1 orig: 8, 1 offset: 0, 0 @@ -2098,42 +2133,42 @@ ui/window-empty index: -1 weapons/blaster rotate: false - xy: 704, 255 + xy: 734, 376 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 weapons/flamer rotate: false - xy: 167, 10 + xy: 163, 30 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 weapons/mortar rotate: false - xy: 601, 228 + xy: 612, 238 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 weapons/multigun rotate: false - xy: 621, 228 + xy: 632, 238 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 weapons/railgun rotate: false - xy: 701, 235 + xy: 405, 79 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 weapons/triblaster rotate: false - xy: 979, 487 + xy: 351, 53 size: 8, 8 orig: 8, 8 offset: 0, 0 diff --git a/core/assets/sprites/sprites.png b/core/assets/sprites/sprites.png index 56c1f842b0..872f1f380b 100644 Binary files a/core/assets/sprites/sprites.png and b/core/assets/sprites/sprites.png differ diff --git a/core/src/io/anuke/mindustry/Vars.java b/core/src/io/anuke/mindustry/Vars.java index feb127324a..5bcb36b92c 100644 --- a/core/src/io/anuke/mindustry/Vars.java +++ b/core/src/io/anuke/mindustry/Vars.java @@ -9,7 +9,7 @@ import io.anuke.mindustry.entities.Player; import io.anuke.ucore.scene.ui.layout.Unit; public class Vars{ - public static final boolean testAndroid = true; + public static final boolean testAndroid = false; //shorthand for whether or not this is running on android public static final boolean android = (Gdx.app.getType() == ApplicationType.Android) || testAndroid; //shorthand for whether or not this is running on GWT diff --git a/core/src/io/anuke/mindustry/core/Control.java b/core/src/io/anuke/mindustry/core/Control.java index 4258c8df6a..15cf22dd93 100644 --- a/core/src/io/anuke/mindustry/core/Control.java +++ b/core/src/io/anuke/mindustry/core/Control.java @@ -421,6 +421,7 @@ public class Control extends Module{ public void update(){ if(debug){ + //debug actions if(Inputs.keyUp(Keys.P)){ Effects.effect(Fx.shellsmoke, player); Effects.effect(Fx.shellexplosion, player); @@ -436,7 +437,10 @@ public class Control extends Module{ } if(Inputs.keyUp(Keys.C)){ - GameState.set(State.playing); + //crash cause: + //map is null. + //core is null. + //tiles are null. } if(Inputs.keyUp(Keys.U)){ @@ -452,7 +456,7 @@ public class Control extends Module{ new HealerEnemy().set(player.x, player.y).add(); }else{ float px = player.x, py = player.y; - Timers.run(30f, ()->new BlastEnemy().set(px, py).add()); + Timers.run(30f, ()-> new BlastEnemy().set(px, py).add()); } } } diff --git a/core/src/io/anuke/mindustry/core/Renderer.java b/core/src/io/anuke/mindustry/core/Renderer.java index d99fac4c12..09d4aa9d79 100644 --- a/core/src/io/anuke/mindustry/core/Renderer.java +++ b/core/src/io/anuke/mindustry/core/Renderer.java @@ -520,29 +520,32 @@ public class Renderer extends RendererModule{ int tilex = control.input.getBlockX(); int tiley = control.input.getBlockY(); - - //draw placement box - if((player.recipe != null && Vars.control.hasItems(player.recipe.requirements) && (!ui.hasMouse() || android) - && control.input.drawPlace()) || (player.placeMode.delete && Inputs.keyDown("area_delete_mode"))){ - - player.placeMode.draw(tilex, tiley, control.input.getBlockEndX(), control.input.getBlockEndY()); - - Draw.thickness(1f); - Draw.color(Color.SCARLET); - for(SpawnPoint spawn : control.getSpawnPoints()){ - Draw.dashCircle(spawn.start.worldx(), spawn.start.worldy(), enemyspawnspace); - } - - Draw.reset(); - } if(Vars.android){ Vector2 vec = Graphics.world(Gdx.input.getX(0), Gdx.input.getY(0)); tilex = Mathf.scl2(vec.x, tilesize); tiley = Mathf.scl2(vec.y, tilesize); } + + //draw placement box + if((player.recipe != null && Vars.control.hasItems(player.recipe.requirements) && (!ui.hasMouse() || android) + && control.input.drawPlace()) || (player.placeMode.delete && Inputs.keyDown("area_delete_mode"))){ + + player.placeMode.draw(control.input.getBlockX(), control.input.getBlockY(), control.input.getBlockEndX(), control.input.getBlockEndY()); + + Draw.thickness(1f); + Draw.color(Color.SCARLET); + for(SpawnPoint spawn : control.getSpawnPoints()){ + Draw.dashCircle(spawn.start.worldx(), spawn.start.worldy(), enemyspawnspace); + } + + PlaceMode.holdDelete.draw(tilex, tiley, 0, 0); + }else if(player.breakMode.delete && control.input.drawPlace()){ + player.breakMode.draw(control.input.getBlockX(), control.input.getBlockY(), + control.input.getBlockEndX(), control.input.getBlockEndY()); + } - PlaceMode.breaker.draw(tilex, tiley, 0, 0); + Draw.reset(); //draw selected block health if(player.recipe == null && !ui.hasMouse()){ diff --git a/core/src/io/anuke/mindustry/entities/Player.java b/core/src/io/anuke/mindustry/entities/Player.java index ae6b0c920b..737f1083f9 100644 --- a/core/src/io/anuke/mindustry/entities/Player.java +++ b/core/src/io/anuke/mindustry/entities/Player.java @@ -27,6 +27,7 @@ public class Player extends DestructibleEntity{ public transient Recipe recipe; public transient int rotation; public transient PlaceMode placeMode = android ? PlaceMode.cursor : PlaceMode.hold; + public transient PlaceMode breakMode = PlaceMode.holdDelete; public Player(){ hitbox.setSize(5); diff --git a/core/src/io/anuke/mindustry/input/AndroidInput.java b/core/src/io/anuke/mindustry/input/AndroidInput.java index ba7aa18447..6bde08dfbc 100644 --- a/core/src/io/anuke/mindustry/input/AndroidInput.java +++ b/core/src/io/anuke/mindustry/input/AndroidInput.java @@ -3,7 +3,6 @@ package io.anuke.mindustry.input; import static io.anuke.mindustry.Vars.*; import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.Input.Keys; import com.badlogic.gdx.input.GestureDetector; import com.badlogic.gdx.math.Vector2; @@ -22,7 +21,7 @@ public class AndroidInput extends InputHandler{ public float lmousex, lmousey; public float mousex, mousey; public boolean brokeBlock = false; - private boolean placing = true; + private boolean placing = false; private float warmup; private float warmupDelay = 20; @@ -34,23 +33,19 @@ public class AndroidInput extends InputHandler{ @Override public float getCursorEndY(){ return Gdx.input.getY(0); } @Override public float getCursorX(){ return mousex; } @Override public float getCursorY(){ return mousey; } - @Override public boolean drawPlace(){ return placing; } - - @Override - public boolean keyDown(int keycode){ - if(keycode == Keys.E){ - - } - return false; - } + @Override public boolean drawPlace(){ return placing || (player.placeMode.pan && player.recipe != null); } @Override public boolean touchUp(int screenX, int screenY, int pointer, int button){ + //if(ui.hasMouse()) return false; + brokeBlock = false; if(placing && pointer == 0 && !player.placeMode.pan){ player.placeMode.released(getBlockX(), getBlockY(), getBlockEndX(), getBlockEndY()); - placing = false; + }else if(pointer == 0 && !player.breakMode.pan && player.recipe == null && drawPlace()){ + player.breakMode.released(getBlockX(), getBlockY(), getBlockEndX(), getBlockEndY()); } + placing = false; return false; } @@ -62,16 +57,15 @@ public class AndroidInput extends InputHandler{ lmousex = screenX; lmousey = screenY; - if(!player.placeMode.pan){ - if(pointer == 0){ - placing = true; - - mousex = screenX; - mousey = screenY; - - }else{ - placing = false; - } + if((!player.placeMode.pan || player.recipe == null) && pointer == 0){ + mousex = screenX; + mousey = screenY; + } + + if(pointer != 0){ + placing = false; + }else{ + placing = true; } warmup = 0; diff --git a/core/src/io/anuke/mindustry/input/GestureHandler.java b/core/src/io/anuke/mindustry/input/GestureHandler.java index bc2274eb8a..66ddaff00d 100644 --- a/core/src/io/anuke/mindustry/input/GestureHandler.java +++ b/core/src/io/anuke/mindustry/input/GestureHandler.java @@ -28,20 +28,27 @@ public class GestureHandler extends GestureAdapter{ @Override public boolean tap (float x, float y, int count, int button) { - if(!player.placeMode.pan){ + if(ui.hasMouse()) return false; + + if(!player.placeMode.pan || player.recipe == null){ input.mousex = x; input.mousey = y; - player.placeMode.tapped(input.getBlockX(), input.getBlockY()); + + if(player.recipe == null) + player.breakMode.tapped(input.getBlockX(), input.getBlockY()); + else + player.placeMode.tapped(input.getBlockX(), input.getBlockY()); } return false; } @Override public boolean pan(float x, float y, float deltaX, float deltaY){ - if(player.recipe == null || !Vars.control.hasItems(player.recipe.requirements) || !player.placeMode.lockCamera){ + if(!(player.recipe != null && Vars.control.hasItems(player.recipe.requirements) && player.placeMode.lockCamera) && + !(player.recipe == null && player.breakMode.lockCamera)){ player.x -= deltaX*Core.camera.zoom/Core.cameraScale; player.y += deltaY*Core.camera.zoom/Core.cameraScale; - }else if(player.placeMode.lockCamera){ + }else if(player.placeMode.lockCamera && (player.placeMode.pan && player.recipe != null)){ input.mousex += deltaX; input.mousey += deltaY; } diff --git a/core/src/io/anuke/mindustry/input/InputHandler.java b/core/src/io/anuke/mindustry/input/InputHandler.java index f5c83e089b..bfb2585dca 100644 --- a/core/src/io/anuke/mindustry/input/InputHandler.java +++ b/core/src/io/anuke/mindustry/input/InputHandler.java @@ -224,7 +224,7 @@ public abstract class InputHandler extends InputAdapter{ Vars.control.addItem(tile.block().drops.item, tile.block().drops.amount); } - Effects.shake(3f, 1f, player); + //Effects.shake(3f, 1f, player); Sounds.play("break"); if(!tile.block().isMultiblock() && !tile.isLinked()){ diff --git a/core/src/io/anuke/mindustry/input/PlaceMode.java b/core/src/io/anuke/mindustry/input/PlaceMode.java index 35c9d207d2..855f158445 100644 --- a/core/src/io/anuke/mindustry/input/PlaceMode.java +++ b/core/src/io/anuke/mindustry/input/PlaceMode.java @@ -58,7 +58,6 @@ public enum PlaceMode{ } public void tapped(int tilex, int tiley){ - System.out.println("tap " + tilex + " " + tiley); control.getInput().tryPlaceBlock(tilex, tiley); } }, @@ -74,6 +73,45 @@ public enum PlaceMode{ control.getInput().tryPlaceBlock(x, y); } }, + holdDelete{ + { + delete = true; + shown = true; + } + + public void draw(int tilex, int tiley, int endx, int endy){ + Tile tile = world.tile(tilex, tiley); + + if(tile != null && control.getInput().validBreak(tilex, tiley)){ + if(tile.isLinked()) + tile = tile.getLinked(); + Vector2 offset = tile.block().getPlaceOffset(); + float fract = player.breaktime / tile.getBreakTime(); + + if(Inputs.buttonDown(Buttons.RIGHT)){ + Draw.color(Color.YELLOW, Color.SCARLET, fract); + Draw.linecrect(tile.worldx() + offset.x, tile.worldy() + offset.y, tile.block().width * Vars.tilesize, tile.block().height * Vars.tilesize); + }else if(android && player.breaktime > 0){ + Draw.color(Colors.get("breakStart"), Colors.get("break"), fract); + Draw.polygon(25, tile.worldx() + offset.x, tile.worldy() + offset.y, 4 + (1f - fract) * 26); + } + Draw.reset(); + } + } + }, + touchDelete{ + { + shown = true; + lockCamera = false; + showRotate = true; + showCancel = true; + delete = true; + } + + public void tapped(int x, int y){ + control.getInput().tryDeleteBlock(x, y); + } + }, areaDelete{ int maxlen = 10; int tilex; @@ -306,27 +344,6 @@ public enum PlaceMode{ this.tilex = tilex; this.tiley = tiley; } - }, - breaker{ - public void draw(int tilex, int tiley, int endx, int endy){ - Tile tile = world.tile(tilex, tiley); - - if(tile != null && control.getInput().validBreak(tilex, tiley)){ - if(tile.isLinked()) - tile = tile.getLinked(); - Vector2 offset = tile.block().getPlaceOffset(); - float fract = player.breaktime / tile.getBreakTime(); - - if(Inputs.buttonDown(Buttons.RIGHT)){ - Draw.color(Color.YELLOW, Color.SCARLET, fract); - Draw.linecrect(tile.worldx() + offset.x, tile.worldy() + offset.y, tile.block().width * Vars.tilesize, tile.block().height * Vars.tilesize); - }else if(android && player.breaktime > 0){ - Draw.color(Colors.get("breakStart"), Colors.get("break"), fract); - Draw.polygon(25, tile.worldx() + offset.x, tile.worldy() + offset.y, 4 + (1f - fract) * 26); - } - Draw.reset(); - } - } }; public boolean lockCamera; public boolean pan = false; diff --git a/core/src/io/anuke/mindustry/ui/fragments/PlacementFragment.java b/core/src/io/anuke/mindustry/ui/fragments/PlacementFragment.java index 4e20bc3c12..858d7ac928 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/PlacementFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/PlacementFragment.java @@ -2,6 +2,7 @@ package io.anuke.mindustry.ui.fragments; import static io.anuke.mindustry.Vars.*; +import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.utils.Align; import io.anuke.mindustry.core.GameState; @@ -11,8 +12,10 @@ import io.anuke.ucore.scene.builders.imagebutton; import io.anuke.ucore.scene.builders.table; import io.anuke.ucore.scene.event.Touchable; import io.anuke.ucore.scene.ui.ButtonGroup; +import io.anuke.ucore.scene.ui.Image; import io.anuke.ucore.scene.ui.ImageButton; import io.anuke.ucore.scene.ui.layout.Unit; +import io.anuke.ucore.util.Mathf; public class PlacementFragment implements Fragment{ @@ -24,54 +27,91 @@ public class PlacementFragment implements Fragment{ abottom(); aleft(); + Image image = new Image("icon-arrow"); + image.setVisible(() -> player.recipe != null && player.recipe.result.rotate); + image.update(() -> { + image.setRotation(player.rotation*90); + image.setOrigin(Align.center); + }); new table("pane"){{ - get().setTouchable(Touchable.enabled); - //new label(()->"Placement Mode: [orange]" + player.placeMode.name()).pad(4).units(Unit.dp); - //row(); + add(image).size(40f).units(Unit.dp); + }}.size(54f).units(Unit.dp).end(); + + row(); + + new table(){{ + touchable(Touchable.enabled); aleft(); - new table(){{ + new table("pane"){{ + get().pad(5); aleft(); ButtonGroup group = new ButtonGroup<>(); - defaults().size(52, 56).pad(0).units(Unit.dp); - - int d = 0; + defaults().size(54, 58).pad(0).units(Unit.dp); for(PlaceMode mode : PlaceMode.values()){ - if(!mode.shown) continue; + if(!mode.shown || mode.delete) continue; + + defaults().padBottom(-5.5f); new imagebutton("icon-" + mode.name(), "toggle", Unit.dp.inPixels(10*3), ()->{ control.getInput().resetCursor(); player.placeMode = mode; - }){{ - group.add(get()); - }}.padBottom(-5.5f).units(Unit.dp); - - if(++d % 2 == 0){ - row(); - } + }).group(group).units(Unit.dp); } + row(); + new imagebutton("icon-cancel", Unit.dp.inPixels(14*3), ()->{ player.recipe = null; - }).visible(()->player.recipe != null && player.placeMode.showCancel); + }).imageColor(Color.valueOf("4d4d4d")) + .visible(()->player.recipe != null); - new imagebutton("icon-rotate-arrow", Unit.dp.inPixels(14*3), ()->{ - player.rotation ++; - player.rotation %= 4; - }).update(i->{ - i.getImage().setOrigin(Align.center); - i.getImage().setRotation(player.rotation*90); - }).visible(() -> player.recipe != null && player.placeMode.showRotate - && player.recipe.result.rotate); + new imagebutton("icon-rotate-left", Unit.dp.inPixels(14*3), ()->{ + player.rotation = Mathf.mod(player.rotation + 1, 4); + }).imageColor(Color.valueOf("4d4d4d")).visible(() -> player.recipe != null); + + new imagebutton("icon-rotate-right", Unit.dp.inPixels(14*3), ()->{ + player.rotation = Mathf.mod(player.rotation - 1, 4); + }).imageColor(Color.valueOf("4d4d4d")).visible(() -> player.recipe != null); }}.left().end(); }}.end(); }}.end(); - + + new table(){{ + visible(()->player.recipe == null && !GameState.is(State.menu)); + abottom(); + aleft(); + + new table("pane"){{ + get().pad(5); + touchable(Touchable.enabled); + aleft(); + ButtonGroup group = new ButtonGroup<>(); + + defaults().size(54, 58).pad(0).units(Unit.dp); + + int d = 0; + + for(PlaceMode mode : PlaceMode.values()){ + if(!mode.shown || !mode.delete) continue; + + defaults().padBottom(d < 2 ? -5.5f : 0); + + new imagebutton("icon-" + mode.name(), "toggle", Unit.dp.inPixels(10*3), ()->{ + control.getInput().resetCursor(); + player.breakMode = mode; + }){{ + group.add(get()); + }}.units(Unit.dp); + } + + }}.end(); + }}.end(); } } } diff --git a/core/src/io/anuke/mindustry/world/Block.java b/core/src/io/anuke/mindustry/world/Block.java index 0d2c38b571..aa384994ba 100644 --- a/core/src/io/anuke/mindustry/world/Block.java +++ b/core/src/io/anuke/mindustry/world/Block.java @@ -144,7 +144,7 @@ public class Block{ * containers, it gets added to the block's inventory.*/ protected void offloadNear(Tile tile, Item item){ byte i = tile.getDump(); - byte pdump = i; + byte pdump = (byte)(i % 4); Tile[] tiles = tile.getNearby(); diff --git a/core/src/io/anuke/mindustry/world/blocks/types/distribution/Router.java b/core/src/io/anuke/mindustry/world/blocks/types/distribution/Router.java index b1fe473720..f96e75c26a 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/distribution/Router.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/distribution/Router.java @@ -36,7 +36,7 @@ public class Router extends Block{ //TODO fix, check issue tile.setRotation((byte)Mathf.mod(tile.getRotation(), 4)); - if(tile.entity.timer.get(timerDump, 2) && tile.entity.totalItems() > 0){ + if(tile.entity.totalItems() > 0){ if(tile.getExtra() != tile.getRotation() || Mathf.chance(0.35)){ //sometimes dump backwards at a 1/4 chance... this somehow works? tryDump(tile, tile.getRotation(), null); diff --git a/core/src/io/anuke/mindustry/world/blocks/types/distribution/Teleporter.java b/core/src/io/anuke/mindustry/world/blocks/types/distribution/Teleporter.java index c98e682b9c..2f3b2b3e35 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/distribution/Teleporter.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/distribution/Teleporter.java @@ -38,6 +38,7 @@ public class Teleporter extends Block implements Configurable{ super(name); update = true; solid = true; + health = 80; } @Override