diff --git a/core/assets-raw/sprites/blocks/extra/block-elevation.png b/core/assets-raw/sprites/blocks/extra/block-elevation.png new file mode 100644 index 0000000000..06b3214b56 Binary files /dev/null and b/core/assets-raw/sprites/blocks/extra/block-elevation.png differ diff --git a/core/assets-raw/sprites/ui/icons/icon-eraser.png b/core/assets-raw/sprites/ui/icons/icon-eraser.png new file mode 100644 index 0000000000..76b43c4887 Binary files /dev/null and b/core/assets-raw/sprites/ui/icons/icon-eraser.png differ diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 13ac170234..ef400f03ef 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -170,6 +170,7 @@ text.editor.author=Author: text.editor.description=Description: text.editor.name=Name: text.editor.teams=Teams +text.editor.elevation=Elevation text.editor.badsize=[orange]Invalid image dimensions![]\nValid map dimensions: {0} text.editor.errorimageload=Error loading file:\n[orange]{0} text.editor.errorimagesave=Error saving file:\n[orange]{0} diff --git a/core/assets/sprites/sprites.atlas b/core/assets/sprites/sprites.atlas index a977f04e4f..023209b6f6 100644 --- a/core/assets/sprites/sprites.atlas +++ b/core/assets/sprites/sprites.atlas @@ -13,196 +13,196 @@ background index: -1 bridgeconduit rotate: false - xy: 189, 44 + xy: 759, 346 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 bridgeconduit-arrow rotate: false - xy: 199, 44 + xy: 759, 336 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 bridgeconduit-bridge rotate: false - xy: 181, 34 + xy: 821, 421 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 bridgeconduit-end rotate: false - xy: 181, 24 + xy: 821, 411 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 bridgeconveyor rotate: false - xy: 191, 34 + xy: 821, 401 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 bridgeconveyor-arrow rotate: false - xy: 181, 14 + xy: 821, 391 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 bridgeconveyor-bridge rotate: false - xy: 191, 24 + xy: 831, 423 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 bridgeconveyor-end rotate: false - xy: 181, 4 + xy: 841, 425 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 conduit-bottom rotate: false - xy: 695, 231 + xy: 831, 393 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 conduit-top rotate: false - xy: 715, 231 + xy: 841, 395 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 conduittunnel rotate: false - xy: 759, 346 + xy: 851, 405 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 conveyor rotate: false - xy: 759, 336 + xy: 861, 415 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 conveyormove rotate: false - xy: 821, 421 + xy: 851, 395 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 conveyortunnel rotate: false - xy: 821, 411 + xy: 861, 405 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 junction rotate: false - xy: 221, 24 + xy: 971, 409 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 laserconduit rotate: false - xy: 221, 14 + xy: 981, 419 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 laserconduit-arrow rotate: false - xy: 221, 4 + xy: 991, 419 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 laserconduit-bridge rotate: false - xy: 673, 217 + xy: 961, 389 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 laserconduit-end rotate: false - xy: 683, 221 + xy: 971, 399 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 laserconveyor rotate: false - xy: 693, 221 + xy: 981, 409 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 laserconveyor-arrow rotate: false - xy: 703, 221 + xy: 971, 389 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 laserconveyor-bridge rotate: false - xy: 713, 221 + xy: 981, 399 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 laserconveyor-end rotate: false - xy: 769, 348 + xy: 991, 409 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 liquidjunction rotate: false - xy: 931, 409 + xy: 1001, 388 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 liquidrouter rotate: false - xy: 941, 419 + xy: 1011, 418 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 liquidrouter-bottom rotate: false - xy: 931, 399 + xy: 1011, 408 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 liquidrouter-liquid rotate: false - xy: 941, 409 + xy: 1011, 398 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 liquidrouter-top rotate: false - xy: 951, 419 + xy: 1011, 388 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -230,77 +230,77 @@ liquidtank-top index: -1 multiplexer rotate: false - xy: 597, 176 + xy: 597, 158 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 overflowgate rotate: false - xy: 981, 419 + xy: 445, 116 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 poweredconveyor rotate: false - xy: 971, 399 + xy: 445, 96 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 poweredconveyormove rotate: false - xy: 981, 409 + xy: 255, 99 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 pulseconduit-bottom rotate: false - xy: 1001, 418 + xy: 181, 28 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 pulseconduit-top rotate: false - xy: 981, 389 + xy: 191, 38 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 router rotate: false - xy: 703, 211 + xy: 211, 18 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sorter rotate: false - xy: 445, 96 + xy: 753, 217 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 splitter rotate: false - xy: 732, 257 + xy: 831, 373 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 steelconveyor rotate: false - xy: 721, 247 + xy: 841, 375 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 steelconveyormove rotate: false - xy: 731, 247 + xy: 851, 375 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -335,35 +335,35 @@ blackstone1 index: -1 blackstone2 rotate: false - xy: 669, 295 + xy: 181, 64 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blackstone3 rotate: false - xy: 643, 291 + xy: 669, 295 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blackstoneblock1 rotate: false - xy: 169, 56 + xy: 643, 291 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blackstoneblock2 rotate: false - xy: 169, 46 + xy: 185, 48 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blackstoneblock3 rotate: false - xy: 179, 64 + xy: 195, 48 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -377,49 +377,49 @@ blackstoneedge index: -1 coal1 rotate: false - xy: 201, 34 + xy: 841, 415 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 coal2 rotate: false - xy: 201, 24 + xy: 831, 403 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 coal3 rotate: false - xy: 201, 14 + xy: 861, 425 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 deepwater rotate: false - xy: 821, 391 + xy: 861, 395 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 dirt1 rotate: false - xy: 831, 423 + xy: 871, 405 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 dirt2 rotate: false - xy: 841, 425 + xy: 871, 395 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 dirt3 rotate: false - xy: 831, 413 + xy: 881, 425 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -433,35 +433,35 @@ dirtedge index: -1 grass1 rotate: false - xy: 841, 395 + xy: 901, 417 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 grass2 rotate: false - xy: 851, 405 + xy: 921, 427 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 grass3 rotate: false - xy: 861, 415 + xy: 891, 397 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 grassblock1 rotate: false - xy: 851, 395 + xy: 901, 407 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 grassblock2 rotate: false - xy: 861, 405 + xy: 911, 417 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -475,21 +475,21 @@ grassedge index: -1 ice1 rotate: false - xy: 871, 415 + xy: 901, 397 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 ice2 rotate: false - xy: 861, 395 + xy: 911, 407 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 ice3 rotate: false - xy: 871, 405 + xy: 921, 417 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -503,70 +503,70 @@ iceedge index: -1 icerock1 rotate: false - xy: 871, 395 + xy: 911, 397 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icerock2 rotate: false - xy: 881, 425 + xy: 921, 407 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icerockshadow1 rotate: false - xy: 881, 415 + xy: 921, 397 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 rockshadow1 rotate: false - xy: 881, 415 + xy: 921, 397 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icerockshadow2 rotate: false - xy: 881, 405 + xy: 821, 381 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 rockshadow2 rotate: false - xy: 881, 405 + xy: 821, 381 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 iron1 rotate: false - xy: 901, 427 + xy: 851, 385 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 iron2 rotate: false - xy: 891, 417 + xy: 861, 385 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 iron3 rotate: false - xy: 911, 427 + xy: 871, 385 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 lava rotate: false - xy: 769, 338 + xy: 1001, 418 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -580,63 +580,63 @@ lavaedge index: -1 lead1 rotate: false - xy: 779, 339 + xy: 991, 399 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 lead2 rotate: false - xy: 789, 351 + xy: 1001, 408 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 lead3 rotate: false - xy: 789, 341 + xy: 991, 389 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 metalfloor1 rotate: false - xy: 951, 409 + xy: 703, 211 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 metalfloor2 rotate: false - xy: 961, 419 + xy: 713, 211 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 metalfloor3 rotate: false - xy: 941, 389 + xy: 231, 73 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 metalfloor4 rotate: false - xy: 951, 399 + xy: 241, 73 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 metalfloor5 rotate: false - xy: 961, 409 + xy: 746, 269 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 metalfloor6 rotate: false - xy: 971, 419 + xy: 435, 125 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -650,14 +650,14 @@ metalflooredge index: -1 mossblock rotate: false - xy: 951, 389 + xy: 435, 115 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 oil rotate: false - xy: 961, 399 + xy: 435, 105 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -671,56 +671,56 @@ oiledge index: -1 rock1 rotate: false - xy: 683, 211 + xy: 211, 28 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 rock2 rotate: false - xy: 693, 211 + xy: 201, 8 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sand1 rotate: false - xy: 229, 47 + xy: 221, 28 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sand2 rotate: false - xy: 241, 57 + xy: 221, 18 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sand3 rotate: false - xy: 239, 47 + xy: 221, 8 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sandblock1 rotate: false - xy: 231, 37 + xy: 722, 257 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sandblock2 rotate: false - xy: 231, 27 + xy: 732, 257 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sandblock3 rotate: false - xy: 231, 17 + xy: 721, 247 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -734,56 +734,56 @@ sandedge index: -1 shrub rotate: false - xy: 251, 37 + xy: 735, 227 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shrubshadow rotate: false - xy: 251, 27 + xy: 723, 217 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 snow1 rotate: false - xy: 746, 269 + xy: 745, 227 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 snow2 rotate: false - xy: 435, 125 + xy: 743, 217 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 snow3 rotate: false - xy: 435, 115 + xy: 723, 207 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 snowblock1 rotate: false - xy: 435, 105 + xy: 733, 207 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 snowblock2 rotate: false - xy: 445, 126 + xy: 743, 207 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 snowblock3 rotate: false - xy: 445, 116 + xy: 751, 247 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -797,7 +797,7 @@ snowedge index: -1 space rotate: false - xy: 722, 257 + xy: 753, 207 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -811,42 +811,42 @@ spaceedge index: -1 stone1 rotate: false - xy: 725, 227 + xy: 901, 377 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stone2 rotate: false - xy: 735, 227 + xy: 911, 377 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stone3 rotate: false - xy: 723, 217 + xy: 921, 377 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stoneblock1 rotate: false - xy: 733, 217 + xy: 931, 379 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stoneblock2 rotate: false - xy: 745, 237 + xy: 941, 379 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stoneblock3 rotate: false - xy: 745, 227 + xy: 951, 379 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -860,49 +860,49 @@ stoneedge index: -1 thorium1 rotate: false - xy: 751, 247 + xy: 1001, 378 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 thorium2 rotate: false - xy: 755, 237 + xy: 1011, 378 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 thorium3 rotate: false - xy: 755, 227 + xy: 769, 328 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titanium1 rotate: false - xy: 753, 217 + xy: 779, 329 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titanium2 rotate: false - xy: 753, 207 + xy: 789, 331 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titanium3 rotate: false - xy: 831, 373 + xy: 223, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 water rotate: false - xy: 941, 379 + xy: 231, 13 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -916,42 +916,56 @@ wateredge index: -1 block-border rotate: false - xy: 199, 64 + xy: 685, 231 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +block-elevation + rotate: false + xy: 695, 231 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +combustiongenerator-top + rotate: false + xy: 695, 231 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 block-middle rotate: false - xy: 199, 54 + xy: 705, 231 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 pump-liquid rotate: false - xy: 199, 54 + xy: 705, 231 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 border rotate: false - xy: 179, 44 + xy: 715, 231 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 conduit-liquid rotate: false - xy: 705, 231 + xy: 871, 425 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 cross-1 rotate: false - xy: 821, 401 + xy: 871, 415 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -979,7 +993,7 @@ cross-4 index: -1 enemyspawn rotate: false - xy: 851, 415 + xy: 891, 417 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -993,14 +1007,14 @@ nuclearreactor-shadow index: -1 place-arrow rotate: false - xy: 991, 419 + xy: 445, 106 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 playerspawn rotate: false - xy: 961, 389 + xy: 435, 95 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1014,28 +1028,28 @@ ripples index: -1 rubble-1-0 rotate: false - xy: 789, 431 + xy: 807, 431 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 rubble-1-1 rotate: false - xy: 807, 431 + xy: 733, 374 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 rubble-2-0 rotate: false - xy: 733, 374 + xy: 733, 356 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 rubble-2-1 rotate: false - xy: 733, 356 + xy: 741, 338 size: 16, 16 orig: 16, 16 offset: 0, 0 @@ -1126,14 +1140,7 @@ batterylarge index: -1 combustiongenerator rotate: false - xy: 201, 4 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -combustiongenerator-top - rotate: false - xy: 673, 227 + xy: 841, 405 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1203,7 +1210,7 @@ largesolarpanel index: -1 liquidcombustiongenerator rotate: false - xy: 931, 419 + xy: 1001, 398 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1231,63 +1238,63 @@ nuclearreactor-lights index: -1 powerinfinite rotate: false - xy: 971, 389 + xy: 265, 99 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 powernode rotate: false - xy: 981, 399 + xy: 275, 99 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 powernodelarge rotate: false - xy: 731, 392 + xy: 753, 430 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 powervoid rotate: false - xy: 991, 409 + xy: 181, 38 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 rtgenerator rotate: false - xy: 713, 211 + xy: 211, 8 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 rtgenerator-top rotate: false - xy: 231, 57 + xy: 221, 38 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shieldgenerator rotate: false - xy: 241, 27 + xy: 741, 247 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shieldprojector rotate: false - xy: 741, 338 + xy: 163, 22 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 solarpanel rotate: false - xy: 445, 106 + xy: 755, 237 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1308,7 +1315,7 @@ teleporter-top index: -1 thermalgenerator rotate: false - xy: 743, 207 + xy: 991, 379 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1420,105 +1427,105 @@ cultivator-top index: -1 extractor rotate: false - xy: 831, 393 + xy: 911, 427 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 fluxpump rotate: false - xy: 871, 425 + xy: 891, 407 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 incinerator rotate: false - xy: 891, 427 + xy: 841, 385 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 irondrill rotate: false - xy: 891, 407 + xy: 881, 385 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 irondrill-rotator rotate: false - xy: 901, 417 + xy: 891, 387 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titaniumdrill-rotator rotate: false - xy: 901, 417 + xy: 891, 387 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 irondrill-top rotate: false - xy: 921, 427 + xy: 901, 387 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 itemsource rotate: false - xy: 211, 4 + xy: 951, 389 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 itemvoid rotate: false - xy: 221, 34 + xy: 961, 399 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 laserdrill rotate: false - xy: 571, 121 + xy: 589, 121 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 laserdrill-rotator rotate: false - xy: 589, 121 + xy: 597, 194 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 laserdrill-top rotate: false - xy: 597, 194 + xy: 597, 176 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 lavasmelter rotate: false - xy: 779, 349 + xy: 981, 389 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 liquidsource rotate: false - xy: 931, 389 + xy: 683, 211 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 melter rotate: false - xy: 941, 399 + xy: 693, 211 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1581,7 +1588,7 @@ oilextractor-top index: -1 oilrefinery rotate: false - xy: 971, 409 + xy: 445, 126 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1616,210 +1623,210 @@ plasmadrill-top index: -1 plasticformer rotate: false - xy: 597, 158 + xy: 607, 140 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 plasticformer-top rotate: false - xy: 607, 140 + xy: 607, 122 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 poweralloysmelter rotate: false - xy: 607, 122 + xy: 731, 410 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 poweralloysmelter-top rotate: false - xy: 731, 410 + xy: 731, 392 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 powersmelter rotate: false - xy: 753, 430 + xy: 771, 431 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 powersmelter-top rotate: false - xy: 771, 431 + xy: 789, 431 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 siliconsmelter-top rotate: false - xy: 771, 431 + xy: 789, 431 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 pulverizer rotate: false - xy: 991, 399 + xy: 181, 18 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 pulverizer-rotator rotate: false - xy: 1001, 408 + xy: 191, 28 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 pump rotate: false - xy: 991, 389 + xy: 201, 38 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 reinforceddrill rotate: false - xy: 1001, 398 + xy: 181, 8 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 reinforceddrill-rotator rotate: false - xy: 1001, 388 + xy: 191, 18 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 reinforceddrill-top rotate: false - xy: 1011, 418 + xy: 201, 28 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 separator rotate: false - xy: 231, 7 + xy: 731, 247 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 separator-liquid rotate: false - xy: 241, 37 + xy: 742, 257 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 siliconextractor rotate: false - xy: 251, 17 + xy: 733, 217 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 siliconsmelter rotate: false - xy: 163, 22 + xy: 163, 4 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 smelter rotate: false - xy: 251, 7 + xy: 745, 237 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 steeldrill rotate: false - xy: 742, 257 + xy: 861, 375 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 steeldrill-rotator rotate: false - xy: 741, 247 + xy: 871, 375 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 steeldrill-top rotate: false - xy: 725, 237 + xy: 881, 375 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stonedrill rotate: false - xy: 743, 217 + xy: 961, 379 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stoneformer rotate: false - xy: 723, 207 + xy: 971, 379 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titaniumdrill rotate: false - xy: 841, 375 + xy: 233, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titaniumdrill-top rotate: false - xy: 851, 375 + xy: 243, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 waterextractor rotate: false - xy: 615, 168 + xy: 625, 150 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 waterextractor-liquid rotate: false - xy: 625, 150 + xy: 625, 132 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 waterextractor-rotator rotate: false - xy: 625, 132 + xy: 625, 114 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 waterextractor-top rotate: false - xy: 625, 114 + xy: 607, 104 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 weaponfactory rotate: false - xy: 165, 82 + xy: 163, 64 size: 16, 16 orig: 16, 16 offset: 0, 0 @@ -1847,14 +1854,14 @@ core-top index: -1 sortedunloader rotate: false - xy: 435, 95 + xy: 755, 227 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 unloader rotate: false - xy: 911, 377 + xy: 241, 43 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1868,7 +1875,7 @@ vault index: -1 block-1 rotate: false - xy: 189, 54 + xy: 673, 227 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1966,7 +1973,7 @@ crux-panel-right index: -1 duo rotate: false - xy: 861, 425 + xy: 891, 427 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -2043,21 +2050,21 @@ scorch-shoot index: -1 swarmer rotate: false - xy: 615, 204 + xy: 615, 186 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 wave rotate: false - xy: 607, 104 + xy: 625, 96 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 wave-liquid rotate: false - xy: 625, 96 + xy: 165, 82 size: 16, 16 orig: 16, 16 offset: 0, 0 @@ -2106,42 +2113,42 @@ walkerfactory-top-open index: -1 droppoint rotate: false - xy: 831, 403 + xy: 881, 395 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 repairpoint rotate: false - xy: 1011, 408 + xy: 211, 38 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 repairpoint-turret rotate: false - xy: 1011, 398 + xy: 191, 8 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 resupplypoint rotate: false - xy: 1011, 388 + xy: 201, 18 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 compositewall rotate: false - xy: 685, 231 + xy: 851, 415 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 door rotate: false - xy: 851, 425 + xy: 881, 415 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -2162,14 +2169,14 @@ door-large-open index: -1 door-open rotate: false - xy: 841, 415 + xy: 881, 405 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 duriumwall rotate: false - xy: 841, 405 + xy: 901, 427 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -2183,49 +2190,49 @@ duriumwall-large index: -1 ironwall rotate: false - xy: 891, 397 + xy: 911, 387 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 steelwall rotate: false - xy: 735, 237 + xy: 891, 377 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 steelwall-large rotate: false - xy: 163, 4 + xy: 615, 204 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 stonewall rotate: false - xy: 733, 207 + xy: 981, 379 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titaniumshieldwall rotate: false - xy: 861, 375 + xy: 225, 53 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titaniumwall rotate: false - xy: 871, 375 + xy: 235, 53 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titaniumwall-large rotate: false - xy: 615, 186 + xy: 615, 168 size: 16, 16 orig: 16, 16 offset: 0, 0 @@ -2337,7 +2344,7 @@ shell-back index: -1 shot rotate: false - xy: 249, 47 + xy: 725, 227 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -2351,7 +2358,7 @@ transfer index: -1 transfer-arrow rotate: false - xy: 881, 375 + xy: 245, 53 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -2365,182 +2372,182 @@ transfer-end index: -1 item-armor-piercing-bullet rotate: false - xy: 901, 407 + xy: 921, 387 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-composite-flak rotate: false - xy: 921, 417 + xy: 703, 221 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-explosive-shell rotate: false - xy: 911, 397 + xy: 713, 221 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-frag-shell rotate: false - xy: 921, 407 + xy: 769, 348 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-homing-bullet rotate: false - xy: 921, 397 + xy: 769, 338 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-incendiary-mortar-shell rotate: false - xy: 821, 381 + xy: 779, 349 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-lead-bullet rotate: false - xy: 851, 385 + xy: 789, 341 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-scythe-missile rotate: false - xy: 881, 385 + xy: 941, 419 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-surge-mortar-shell rotate: false - xy: 209, 54 + xy: 941, 399 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-swarm-missile rotate: false - xy: 209, 44 + xy: 951, 409 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-thorium-shell rotate: false - xy: 211, 34 + xy: 951, 399 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-tracer-bullet rotate: false - xy: 211, 14 + xy: 971, 419 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-biomatter rotate: false - xy: 911, 417 + xy: 673, 217 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-blast-compound rotate: false - xy: 901, 397 + xy: 683, 221 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-coal rotate: false - xy: 911, 407 + xy: 693, 221 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-iron rotate: false - xy: 831, 383 + xy: 779, 339 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-lead rotate: false - xy: 841, 385 + xy: 789, 351 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-plastic rotate: false - xy: 861, 385 + xy: 931, 419 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-sand rotate: false - xy: 871, 385 + xy: 931, 409 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-silicon rotate: false - xy: 891, 387 + xy: 931, 399 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-steel rotate: false - xy: 901, 387 + xy: 941, 409 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-stone rotate: false - xy: 911, 387 + xy: 951, 419 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-surge-alloy rotate: false - xy: 921, 387 + xy: 931, 389 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-thermite rotate: false - xy: 219, 54 + xy: 961, 419 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-thorium rotate: false - xy: 219, 44 + xy: 941, 389 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-titanium rotate: false - xy: 211, 24 + xy: 961, 409 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -2925,86 +2932,93 @@ icon-egg orig: 14, 14 offset: 0, 0 index: -1 -icon-exit - rotate: false - xy: 163, 66 - size: 14, 14 - orig: 14, 14 - offset: 0, 0 - index: -1 -icon-file +icon-eraser rotate: false xy: 713, 347 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 -icon-file-image - rotate: false - xy: 715, 313 - size: 16, 16 - orig: 16, 16 - offset: 0, 0 - index: -1 -icon-file-text +icon-exit rotate: false xy: 183, 74 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 -icon-fill +icon-file + rotate: false + xy: 715, 313 + size: 16, 16 + orig: 16, 16 + offset: 0, 0 + index: -1 +icon-file-image rotate: false xy: 715, 295 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 -icon-floppy +icon-file-text rotate: false xy: 199, 74 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 -icon-floppy-16 +icon-fill rotate: false xy: 589, 139 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 +icon-floppy + rotate: false + xy: 169, 48 + size: 14, 14 + orig: 14, 14 + offset: 0, 0 + index: -1 +icon-floppy-16 + rotate: false + xy: 291, 99 + size: 16, 16 + orig: 16, 16 + offset: 0, 0 + index: -1 icon-folder rotate: false - xy: 825, 433 + xy: 191, 58 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-folder-parent rotate: false - xy: 841, 435 + xy: 207, 58 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-github rotate: false - xy: 857, 435 + xy: 825, 433 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-google-play rotate: false - xy: 873, 435 + xy: 841, 435 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-grid rotate: false - xy: 291, 99 + xy: 309, 99 size: 16, 16 orig: 16, 16 offset: 0, 0 @@ -3025,14 +3039,14 @@ icon-holdDelete index: -1 icon-home rotate: false - xy: 889, 437 + xy: 857, 435 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-host rotate: false - xy: 905, 437 + xy: 873, 435 size: 14, 14 orig: 14, 14 offset: 0, 0 @@ -3046,28 +3060,28 @@ icon-info index: -1 icon-itch.io rotate: false - xy: 921, 437 + xy: 889, 437 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-items-none rotate: false - xy: 881, 395 + xy: 831, 383 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-line rotate: false - xy: 309, 99 + xy: 327, 99 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-link rotate: false - xy: 215, 80 + xy: 905, 437 size: 14, 14 orig: 14, 14 offset: 0, 0 @@ -3081,28 +3095,28 @@ icon-liquid index: -1 icon-load rotate: false - xy: 231, 83 + xy: 921, 437 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-load-image rotate: false - xy: 327, 99 + xy: 345, 99 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-load-map rotate: false - xy: 345, 99 + xy: 363, 99 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-loading rotate: false - xy: 363, 99 + xy: 381, 99 size: 16, 16 orig: 16, 16 offset: 0, 0 @@ -3123,7 +3137,7 @@ icon-menu index: -1 icon-menu-large rotate: false - xy: 381, 99 + xy: 399, 99 size: 16, 16 orig: 16, 16 offset: 0, 0 @@ -3144,21 +3158,21 @@ icon-pause index: -1 icon-pencil rotate: false - xy: 399, 99 + xy: 417, 99 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-pencil-small rotate: false - xy: 937, 429 + xy: 215, 80 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-pick rotate: false - xy: 417, 99 + xy: 209, 96 size: 16, 16 orig: 16, 16 offset: 0, 0 @@ -3172,7 +3186,7 @@ icon-play index: -1 icon-play-2 rotate: false - xy: 953, 429 + xy: 231, 83 size: 14, 14 orig: 14, 14 offset: 0, 0 @@ -3200,35 +3214,35 @@ icon-production index: -1 icon-quit rotate: false - xy: 969, 429 + xy: 937, 429 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-redo rotate: false - xy: 209, 96 + xy: 227, 99 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-refresh rotate: false - xy: 215, 64 + xy: 953, 429 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-rename rotate: false - xy: 231, 67 + xy: 969, 429 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-resize rotate: false - xy: 227, 99 + xy: 733, 313 size: 16, 16 orig: 16, 16 offset: 0, 0 @@ -3270,14 +3284,14 @@ icon-save index: -1 icon-save-image rotate: false - xy: 733, 313 + xy: 733, 295 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-save-map rotate: false - xy: 733, 295 + xy: 499, 121 size: 16, 16 orig: 16, 16 offset: 0, 0 @@ -3291,7 +3305,7 @@ icon-settings index: -1 icon-terrain rotate: false - xy: 499, 121 + xy: 517, 121 size: 16, 16 orig: 16, 16 offset: 0, 0 @@ -3326,7 +3340,7 @@ icon-trash index: -1 icon-trash-16 rotate: false - xy: 517, 121 + xy: 535, 121 size: 16, 16 orig: 16, 16 offset: 0, 0 @@ -3347,7 +3361,7 @@ icon-tutorial index: -1 icon-undo rotate: false - xy: 535, 121 + xy: 553, 121 size: 16, 16 orig: 16, 16 offset: 0, 0 @@ -3375,7 +3389,7 @@ icon-wiki index: -1 icon-zoom rotate: false - xy: 553, 121 + xy: 571, 121 size: 16, 16 orig: 16, 16 offset: 0, 0 @@ -3632,70 +3646,70 @@ beam-equip index: -1 blaster rotate: false - xy: 179, 54 + xy: 205, 48 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blaster-equip rotate: false - xy: 189, 64 + xy: 215, 48 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 clustergun rotate: false - xy: 191, 14 + xy: 831, 413 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 clustergun-equip rotate: false - xy: 191, 4 + xy: 851, 425 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shockgun rotate: false - xy: 241, 17 + xy: 725, 237 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shockgun-equip rotate: false - xy: 241, 7 + xy: 735, 237 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 triblaster rotate: false - xy: 891, 377 + xy: 231, 43 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 triblaster-equip rotate: false - xy: 901, 377 + xy: 231, 33 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 vulcan rotate: false - xy: 921, 377 + xy: 231, 23 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 vulcan-equip rotate: false - xy: 931, 379 + xy: 241, 33 size: 8, 8 orig: 8, 8 offset: 0, 0 diff --git a/core/assets/sprites/sprites.png b/core/assets/sprites/sprites.png index 76a23031cd..687d2fd5c3 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/Mindustry.java b/core/src/io/anuke/mindustry/Mindustry.java index 077a7ae4d3..79c208d4cb 100644 --- a/core/src/io/anuke/mindustry/Mindustry.java +++ b/core/src/io/anuke/mindustry/Mindustry.java @@ -1,5 +1,6 @@ package io.anuke.mindustry; +import com.badlogic.gdx.utils.async.AsyncExecutor; import io.anuke.mindustry.core.*; import io.anuke.mindustry.io.BundleLoader; import io.anuke.ucore.core.Timers; @@ -9,21 +10,20 @@ import io.anuke.ucore.util.Log; import static io.anuke.mindustry.Vars.*; public class Mindustry extends ModuleCore { + private AsyncExecutor exec = new AsyncExecutor(1); @Override public void init(){ + Timers.mark(); + Vars.init(); debug = Platform.instance.isDebug(); - Timers.mark(); - Log.setUseColors(false); BundleLoader.load(); ContentLoader.load(); - Log.info("Time to load content: {0}", Timers.elapsed()); - module(logic = new Logic()); module(world = new World()); module(control = new Control()); @@ -31,6 +31,8 @@ public class Mindustry extends ModuleCore { module(ui = new UI()); module(netServer = new NetServer()); module(netClient = new NetClient()); + + Log.info("Time to load [total]: {0}", Timers.elapsed()); } @Override diff --git a/core/src/io/anuke/mindustry/ai/Pathfinder.java b/core/src/io/anuke/mindustry/ai/Pathfinder.java index 76945f56c7..89ec76507f 100644 --- a/core/src/io/anuke/mindustry/ai/Pathfinder.java +++ b/core/src/io/anuke/mindustry/ai/Pathfinder.java @@ -152,7 +152,7 @@ public class Pathfinder { if (other != null && (path.weights[dx][dy] > cost + 1 || path.searches[dx][dy] < path.search) && passable(other, team)){ path.frontier.addFirst(world.tile(dx, dy)); - path.weights[dx][dy] = cost + other.cost; + path.weights[dx][dy] = cost + other.cost/2f; path.searches[dx][dy] = path.search; } } diff --git a/core/src/io/anuke/mindustry/content/blocks/Blocks.java b/core/src/io/anuke/mindustry/content/blocks/Blocks.java index 782b43c7e7..1989e210d1 100644 --- a/core/src/io/anuke/mindustry/content/blocks/Blocks.java +++ b/core/src/io/anuke/mindustry/content/blocks/Blocks.java @@ -12,13 +12,18 @@ import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.blocks.*; public class Blocks extends BlockList implements ContentList{ - public static Block air, spawn, blockpart, defaultFloor, space, metalfloor, deepwater, water, lava, oil, stone, blackstone, iron, lead, coal, titanium, thorium, dirt, sand, ice, snow, grass, sandblock, snowblock, stoneblock, blackstoneblock, grassblock, mossblock, shrub, rock, icerock, blackrock, dirtblock; + public static Block air, spawn, blockpart, space, metalfloor, deepwater, water, lava, oil, stone, blackstone, iron, lead, coal, titanium, thorium, dirt, sand, ice, snow, grass, sandblock, snowblock, stoneblock, blackstoneblock, grassblock, mossblock, shrub, rock, icerock, blackrock, dirtblock; @Override public void load() { air = new Floor("air") { + { + blend = false; + } //don't draw public void draw(Tile tile) {} + public void load() {} + public void init() {} }; blockpart = new BlockPart(); @@ -28,13 +33,12 @@ public class Blocks extends BlockList implements ContentList{ new BreakBlock("break" + i); } - defaultFloor = new Floor("defaultfloor"); - space = new Floor("space") {{ placeableOn = false; variants = 0; cacheLayer = CacheLayer.space; solid = true; + blend = false; }}; metalfloor = new Floor("metalfloor") {{ diff --git a/core/src/io/anuke/mindustry/core/ContentLoader.java b/core/src/io/anuke/mindustry/core/ContentLoader.java index b98a032321..08b18207ad 100644 --- a/core/src/io/anuke/mindustry/core/ContentLoader.java +++ b/core/src/io/anuke/mindustry/core/ContentLoader.java @@ -116,7 +116,6 @@ public class ContentLoader { /**Initializes all content with the specified function.*/ public static void initialize(Consumer callable){ - for(Array arr : contentSet){ for(Content content : arr){ callable.accept(content); diff --git a/core/src/io/anuke/mindustry/core/Control.java b/core/src/io/anuke/mindustry/core/Control.java index 371301be14..f37eca7234 100644 --- a/core/src/io/anuke/mindustry/core/Control.java +++ b/core/src/io/anuke/mindustry/core/Control.java @@ -50,6 +50,7 @@ public class Control extends Module{ private Input gdxInput; public Control(){ + saves = new Saves(); db = new ContentDatabase(); @@ -60,9 +61,7 @@ public class Control extends Module{ Effects.setShakeFalloff(10000f); ContentLoader.initialize(Content::init); - Core.atlas = new Atlas("sprites.atlas"); - ContentLoader.initialize(Content::load); db.load(); diff --git a/core/src/io/anuke/mindustry/core/UI.java b/core/src/io/anuke/mindustry/core/UI.java index 16a60decf1..342a3eafc3 100644 --- a/core/src/io/anuke/mindustry/core/UI.java +++ b/core/src/io/anuke/mindustry/core/UI.java @@ -250,21 +250,21 @@ public class UI extends SceneModule{ public void showInfo(String info){ new Dialog("$text.info.title", "dialog"){{ getCell(content()).growX(); - content().margin(15).add(info).width(400f).wrap(); + content().margin(15).add(info).width(400f).wrap().get().setAlignment(Align.center, Align.center); buttons().addButton("$text.ok", this::hide).size(90, 50).pad(4); }}.show(); } public void showError(String text){ new Dialog("$text.error.title", "dialog"){{ - content().margin(15).add(text).width(400f).wrap(); + content().margin(15).add(text).width(400f).wrap().get().setAlignment(Align.center, Align.center); buttons().addButton("$text.ok", this::hide).size(90, 50).pad(4); }}.show(); } public void showConfirm(String title, String text, Listenable confirmed){ FloatingDialog dialog = new FloatingDialog(title); - dialog.content().add(text).width(400f).wrap().pad(4f); + dialog.content().add(text).width(400f).wrap().pad(4f).get().setAlignment(Align.center, Align.center); dialog.buttons().defaults().size(200f, 54f).pad(2f); dialog.buttons().addButton("$text.cancel", dialog::hide); dialog.buttons().addButton("$text.ok", () -> { diff --git a/core/src/io/anuke/mindustry/editor/EditorTool.java b/core/src/io/anuke/mindustry/editor/EditorTool.java index 41b14efdaa..b234c96899 100644 --- a/core/src/io/anuke/mindustry/editor/EditorTool.java +++ b/core/src/io/anuke/mindustry/editor/EditorTool.java @@ -2,6 +2,7 @@ package io.anuke.mindustry.editor; import com.badlogic.gdx.utils.IntArray; import com.badlogic.gdx.utils.IntSet; +import io.anuke.mindustry.content.blocks.Blocks; import io.anuke.mindustry.io.MapTileData.DataPosition; import io.anuke.mindustry.io.MapTileData.TileDataMarker; import io.anuke.mindustry.world.Block; @@ -32,6 +33,7 @@ public enum EditorTool{ pencil{ { edit = true; + draggable = true; } @Override @@ -39,6 +41,17 @@ public enum EditorTool{ editor.draw(x, y); } }, + eraser{ + { + edit = true; + draggable = true; + } + + @Override + public void touched(MapEditor editor, int x, int y){ + editor.draw(x, y, Blocks.air); + } + }, line{ { @@ -110,7 +123,8 @@ public enum EditorTool{ } }, zoom; - boolean edit; + + boolean edit, draggable; public void touched(MapEditor editor, int x, int y){ diff --git a/core/src/io/anuke/mindustry/editor/MapEditor.java b/core/src/io/anuke/mindustry/editor/MapEditor.java index 8bfce352a9..c563e96c32 100644 --- a/core/src/io/anuke/mindustry/editor/MapEditor.java +++ b/core/src/io/anuke/mindustry/editor/MapEditor.java @@ -22,6 +22,7 @@ public class MapEditor{ private MapRenderer renderer = new MapRenderer(this); private int brushSize = 1; + private byte elevation; private int rotation; private Block drawBlock = Blocks.stone; private Team drawTeam = Team.none; @@ -47,6 +48,14 @@ public class MapEditor{ renderer.resize(map.width(), map.height()); } + public void setDrawElevation(int elevation){ + this.elevation = (byte)elevation; + } + + public byte getDrawElevation(){ + return elevation; + } + public int getDrawRotation(){ return rotation; } @@ -80,6 +89,10 @@ public class MapEditor{ } public void draw(int x, int y){ + draw(x, y, drawBlock); + } + + public void draw(int x, int y, Block drawBlock){ if(x < 0 || y < 0 || x >= map.width() || y >= map.height()){ return; } @@ -88,7 +101,7 @@ public class MapEditor{ byte partID = (byte)Blocks.blockpart.id; byte rotationTeam = Bits.packByte(drawBlock.rotate ? (byte)rotation : 0, drawBlock.synthetic() ? (byte)drawTeam.ordinal() : 0); - boolean isfloor = drawBlock instanceof Floor; + boolean isfloor = drawBlock instanceof Floor && drawBlock != Blocks.air; if(drawBlock.isMultiblock()) { @@ -155,6 +168,7 @@ public class MapEditor{ if(isfloor){ map.write(wx, wy, DataPosition.floor, writeID); + map.write(wx, wy, DataPosition.elevation, elevation); }else{ map.write(wx, wy, DataPosition.wall, writeID); map.write(wx, wy, DataPosition.link, (byte)0); diff --git a/core/src/io/anuke/mindustry/editor/MapEditorDialog.java b/core/src/io/anuke/mindustry/editor/MapEditorDialog.java index aaf400b3c7..3607290e93 100644 --- a/core/src/io/anuke/mindustry/editor/MapEditorDialog.java +++ b/core/src/io/anuke/mindustry/editor/MapEditorDialog.java @@ -24,6 +24,7 @@ import io.anuke.ucore.core.Core; import io.anuke.ucore.core.Graphics; import io.anuke.ucore.core.Inputs; import io.anuke.ucore.core.Timers; +import io.anuke.ucore.function.Consumer; import io.anuke.ucore.function.Listenable; import io.anuke.ucore.graphics.Pixmaps; import io.anuke.ucore.input.Input; @@ -192,11 +193,7 @@ public class MapEditorDialog extends Dialog implements Disposable{ menu.content().row(); menu.content().addImageTextButton("$text.quit", "icon-back", isize, () -> { - if(!saved){ - ui.showConfirm("$text.confirm", "$text.editor.unsaved", this::hide); - }else{ - hide(); - } + tryExit(); menu.hide(); }).padTop(-5).size(swidth*2f + 10, 60f); @@ -382,8 +379,11 @@ public class MapEditorDialog extends Dialog implements Disposable{ } public void build(){ - float size = mobile ? (int)(Gdx.graphics.getHeight() / 9.5f / Unit.dp.scl(1f)) : 60; - + float amount = 9.5f, baseSize = 60f; + + float size = mobile ? (int)(Gdx.graphics.getHeight() / amount / Unit.dp.scl(1f)) : + Math.min(Gdx.graphics.getDisplayMode().height / amount, baseSize); + new table(){{ aleft(); @@ -394,11 +394,22 @@ public class MapEditorDialog extends Dialog implements Disposable{ atop(); ButtonGroup group = new ButtonGroup<>(); - int i = 1; + + Consumer addTool = tool -> { + ImageButton button = new ImageButton("icon-" + tool.name(), "toggle"); + button.clicked(() -> view.setTool(tool)); + button.resizeImage(16*2f); + button.update(() -> button.setChecked(view.getTool() == tool)); + group.add(button); + if (tool == EditorTool.pencil) + button.setChecked(true); + + tools.add(button).padBottom(-5.1f); + }; tools.defaults().size(size, size + 4f).padBottom(-5.1f); - //tools.addImageButton("icon-back", 16*2, () -> hide()); + tools.addImageButton("icon-back", 16*2, () -> tryExit()); tools.addImageButton("icon-menu-large", 16*2f, menu::show); @@ -409,6 +420,8 @@ public class MapEditorDialog extends Dialog implements Disposable{ ImageButton undo = tools.addImageButton("icon-undo", 16*2f, () -> view.undo()).get(); ImageButton redo = tools.addImageButton("icon-redo", 16*2f, () -> view.redo()).get(); + addTool.accept(EditorTool.pick); + tools.row(); undo.setDisabled(() -> !view.getStack().canUndo()); @@ -418,18 +431,14 @@ public class MapEditorDialog extends Dialog implements Disposable{ redo.update(() -> redo.getImage().setColor(redo.isDisabled() ? Color.GRAY : Color.WHITE)); grid.update(() -> grid.setChecked(view.isGrid())); - for(EditorTool tool : EditorTool.values()){ - ImageButton button = new ImageButton("icon-" + tool.name(), "toggle"); - button.clicked(() -> view.setTool(tool)); - button.resizeImage(16*2f); - button.update(() -> button.setChecked(view.getTool() == tool)); - group.add(button); - if (tool == EditorTool.pencil) - button.setChecked(true); + addTool.accept(EditorTool.line); + addTool.accept(EditorTool.pencil); + addTool.accept(EditorTool.eraser); - tools.add(button).padBottom(-5.1f); - if(i++ % 2 == 0) tools.row(); - } + tools.row(); + + addTool.accept(EditorTool.fill); + addTool.accept(EditorTool.zoom); ImageButton rotate = tools.addImageButton("icon-arrow-16", 16*2f, () -> editor.setDrawRotation((editor.getDrawRotation() + 1)%4)).get(); rotate.getImage().update(() ->{ @@ -441,12 +450,14 @@ public class MapEditorDialog extends Dialog implements Disposable{ tools.table("button", t -> { t.add("$text.editor.teams"); - }).colspan(2).height(40).width(size*2f); + }).colspan(3).height(40).width(size*3f); tools.row(); ButtonGroup teamgroup = new ButtonGroup<>(); + int i = 0; + for(Team team : Team.values()){ ImageButton button = new ImageButton("white", "toggle"); button.margin(4f, 4f, 10f, 4f); @@ -457,7 +468,7 @@ public class MapEditorDialog extends Dialog implements Disposable{ teamgroup.add(button); tools.add(button).padBottom(-5.1f); - if(i++ % 2 == 1) tools.row(); + if(i++ % 3 == 2) tools.row(); } add(tools).top().padBottom(-6); @@ -469,10 +480,30 @@ public class MapEditorDialog extends Dialog implements Disposable{ Slider slider = new Slider(0, MapEditor.brushSizes.length-1, 1, false); slider.moved(f -> editor.setBrushSize(MapEditor.brushSizes[(int)(float)f])); new label("brush"); - //new label(() -> Bundles.format("text.editor.brushsize", MapEditor.brushSizes[(int)slider.getValue()])).left(); row(); - add(slider).width(size*2f-20).padTop(4f); - }}.padTop(5).growY().top().end(); + add(slider).width(size*3f-20).padTop(4f); + }}.padTop(5).growX().growY().top().end(); + + row(); + + get().table("button", t -> { + t.add("$text.editor.elevation"); + }).colspan(3).height(40).width(size*3f); + + row(); + + get().table("button", t -> { + t.margin(0); + t.addImageButton("icon-arrow-left", 16*2f, () -> { + editor.setDrawElevation(editor.getDrawElevation() - 1); + }).disabled(b -> editor.getDrawElevation() <= 0).size(size); + + t.label(() -> editor.getDrawElevation() + "").size(size).get().setAlignment(Align.center, Align.center); + + t.addImageButton("icon-arrow-right", 16*2f, () -> { + editor.setDrawElevation(editor.getDrawElevation() + 1); + }).disabled(b -> editor.getDrawElevation() >= 127).size(size); + }).colspan(3).height(size).padTop(-5).width(size*3f); }}.left().growY().end(); @@ -532,6 +563,14 @@ public class MapEditorDialog extends Dialog implements Disposable{ } } + private void tryExit(){ + if(!saved){ + ui.showConfirm("$text.confirm", "$text.editor.unsaved", this::hide); + }else{ + hide(); + } + } + private void addBlockSelection(Table table){ Table content = new Table(); pane = new ScrollPane(content, "volume"); diff --git a/core/src/io/anuke/mindustry/editor/MapLoadDialog.java b/core/src/io/anuke/mindustry/editor/MapLoadDialog.java index eafa4386e3..f6e921cbee 100644 --- a/core/src/io/anuke/mindustry/editor/MapLoadDialog.java +++ b/core/src/io/anuke/mindustry/editor/MapLoadDialog.java @@ -36,7 +36,9 @@ public class MapLoadDialog extends FloatingDialog{ public void rebuild(){ content().clear(); - selected = world.maps().all().first(); + if(world.maps().all().size > 0){ + selected = world.maps().all().first(); + } ButtonGroup group = new ButtonGroup<>(); diff --git a/core/src/io/anuke/mindustry/editor/MapRenderer.java b/core/src/io/anuke/mindustry/editor/MapRenderer.java index e3c6006e27..400725973b 100644 --- a/core/src/io/anuke/mindustry/editor/MapRenderer.java +++ b/core/src/io/anuke/mindustry/editor/MapRenderer.java @@ -9,6 +9,7 @@ import com.badlogic.gdx.graphics.Texture.TextureFilter; import com.badlogic.gdx.graphics.g2d.PixmapPacker; import com.badlogic.gdx.graphics.g2d.PixmapPacker.Page; import com.badlogic.gdx.graphics.g2d.TextureRegion; +import com.badlogic.gdx.math.GridPoint2; import com.badlogic.gdx.math.Rectangle; import com.badlogic.gdx.utils.Disposable; import com.badlogic.gdx.utils.IntSet; @@ -23,7 +24,9 @@ import io.anuke.ucore.core.Timers; import io.anuke.ucore.graphics.Draw; import io.anuke.ucore.graphics.IndexedRenderer; import io.anuke.ucore.util.Bits; +import io.anuke.ucore.util.Geometry; import io.anuke.ucore.util.Log; +import io.anuke.ucore.util.Mathf; import static io.anuke.mindustry.Vars.tilesize; @@ -31,8 +34,10 @@ public class MapRenderer implements Disposable{ private static final int chunksize = 64; private IndexedRenderer[][] chunks; private IntSet updates = new IntSet(); + private IntSet delayedUpdates = new IntSet(); private MapEditor editor; private int width, height; + private Color tmpColor = Color.WHITE.cpy(); private ObjectMap blockIcons = new ObjectMap<>(); private ObjectMap regions = new ObjectMap<>(); @@ -65,6 +70,7 @@ public class MapRenderer implements Disposable{ add("clear", packer); add("block-border", packer); + add("block-elevation", packer); if(packer.getPages().size > 1){ throw new IllegalArgumentException("Pixmap packer may not have more than 1 page!"); @@ -131,6 +137,9 @@ public class MapRenderer implements Disposable{ } updates.clear(); + updates.addAll(delayedUpdates); + delayedUpdates.clear(); + for(int x = 0; x < chunks.length; x ++){ for(int y = 0; y < chunks[0].length; y ++){ IndexedRenderer mesh = chunks[x][y]; @@ -166,6 +175,7 @@ public class MapRenderer implements Disposable{ byte bf = editor.getMap().read(wx, wy, DataPosition.floor); byte bw = editor.getMap().read(wx, wy, DataPosition.wall); byte btr = editor.getMap().read(wx, wy, DataPosition.rotationTeam); + byte elev = editor.getMap().read(wx, wy, DataPosition.elevation); byte rotation = Bits.getLeftByte(btr); Team team = Team.values()[Bits.getRightByte(btr)]; @@ -198,6 +208,9 @@ public class MapRenderer implements Disposable{ if(wall.update || wall.destructible) { mesh.setColor(team.color); region = regions.get("block-border"); + }else if(elev > 0 && checkElevation(elev, wx, wy)){ + mesh.setColor(tmpColor.fromHsv((360f * elev/127f * 4f) % 360f, 0.5f + (elev / 4f) % 0.5f, 1f)); + region = regions.get("block-elevation"); }else{ region = regions.get("clear"); } @@ -208,6 +221,23 @@ public class MapRenderer implements Disposable{ mesh.setColor(Color.WHITE); } + private boolean checkElevation(byte elev, int x, int y){ + for(GridPoint2 p : Geometry.d4){ + int wx = x + p.x, wy = y + p.y; + if(!Mathf.inBounds(wx, wy, editor.getMap().width(), editor.getMap().height())){ + return true; + } + byte value = editor.getMap().read(wx, wy, DataPosition.elevation); + + if(value < elev){ + return true; + }else if(value > elev){ + delayedUpdates.add(wx + wy*width); + } + } + return false; + } + @Override public void dispose() { if(chunks == null){ diff --git a/core/src/io/anuke/mindustry/editor/MapView.java b/core/src/io/anuke/mindustry/editor/MapView.java index f7121a2104..acab432e5b 100644 --- a/core/src/io/anuke/mindustry/editor/MapView.java +++ b/core/src/io/anuke/mindustry/editor/MapView.java @@ -1,5 +1,6 @@ package io.anuke.mindustry.editor; +import com.badlogic.gdx.Input.Buttons; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.input.GestureDetector; @@ -50,6 +51,7 @@ public class MapView extends Element implements GestureListener{ private int lastx, lasty; private int startx, starty; private float mousex, mousey; + private EditorTool lastTool; public void setTool(EditorTool tool){ this.tool = tool; @@ -123,6 +125,15 @@ public class MapView extends Element implements GestureListener{ return false; } + if(!mobile && button != Buttons.LEFT && button != Buttons.MIDDLE){ + return true; + } + + if(button == Buttons.MIDDLE){ + lastTool = tool; + tool = EditorTool.zoom; + } + mousex = x; mousey = y; @@ -148,6 +159,10 @@ public class MapView extends Element implements GestureListener{ @Override public void touchUp (InputEvent event, float x, float y, int pointer, int button) { + if(!mobile && button != Buttons.LEFT && button != Buttons.MIDDLE){ + return; + } + drawing = false; GridPoint2 p = project(x, y); @@ -168,6 +183,11 @@ public class MapView extends Element implements GestureListener{ op = null; } + if(lastTool != null){ + tool = lastTool; + lastTool = null; + } + } @Override @@ -177,11 +197,11 @@ public class MapView extends Element implements GestureListener{ GridPoint2 p = project(x, y); - if(drawing && tool == EditorTool.pencil){ + if(drawing && tool.draggable){ ui.editor.resetSaved(); Array points = br.line(lastx, lasty, p.x, p.y); for(GridPoint2 point : points){ - editor.draw(point.x, point.y); + tool.touched(editor, point.x, point.y); } updated = true; } @@ -221,7 +241,7 @@ public class MapView extends Element implements GestureListener{ x = (x - getWidth()/2 + sclwidth/2 - offsetx*zoom) / sclwidth * editor.getMap().width(); y = (y - getHeight()/2 + sclheight/2 - offsety*zoom) / sclheight * editor.getMap().height(); - if(editor.getDrawBlock().size % 2 == 0){ + if(editor.getDrawBlock().size % 2 == 0 && tool != EditorTool.eraser){ return Tmp.g1.set((int)(x - 0.5f), (int)(y - 0.5f)); }else{ return Tmp.g1.set((int)x, (int)y); @@ -280,7 +300,7 @@ public class MapView extends Element implements GestureListener{ Draw.color(Palette.accent); Lines.stroke(Unit.dp.scl(1f * zoom)); - if(!editor.getDrawBlock().isMultiblock()) { + if(!editor.getDrawBlock().isMultiblock() || tool == EditorTool.eraser) { if (tool == EditorTool.line && drawing) { Vector2 v1 = unproject(startx, starty).add(x, y); float sx = v1.x, sy = v1.y; diff --git a/core/src/io/anuke/mindustry/entities/Unit.java b/core/src/io/anuke/mindustry/entities/Unit.java index 03ae5cc706..aeaebb2242 100644 --- a/core/src/io/anuke/mindustry/entities/Unit.java +++ b/core/src/io/anuke/mindustry/entities/Unit.java @@ -160,7 +160,7 @@ public abstract class Unit extends DestructibleEntity implements SaveTrait, Targ public Floor getFloorOn(){ Tile tile = world.tileWorld(x, y); - return (Floor)(tile == null || (tile.floor() == null) ? Blocks.defaultFloor : tile.floor()); + return tile == null ? (Floor) Blocks.air : tile.floor(); } /**Updates velocity and status effects.*/ diff --git a/core/src/io/anuke/mindustry/game/Team.java b/core/src/io/anuke/mindustry/game/Team.java index 08dcc2a6ec..d38200fcfc 100644 --- a/core/src/io/anuke/mindustry/game/Team.java +++ b/core/src/io/anuke/mindustry/game/Team.java @@ -6,7 +6,9 @@ public enum Team { none(Color.DARK_GRAY), blue(Color.ROYAL), red(Color.valueOf("e84737")), - green(Color.valueOf("1dc645")); + green(Color.valueOf("1dc645")), + purple(Color.valueOf("ba5bd9")), + orange(Color.valueOf("e8c66a")); public final Color color; public final int intColor; diff --git a/core/src/io/anuke/mindustry/io/MapTileData.java b/core/src/io/anuke/mindustry/io/MapTileData.java index 1ad7aeed8a..84579c40f7 100644 --- a/core/src/io/anuke/mindustry/io/MapTileData.java +++ b/core/src/io/anuke/mindustry/io/MapTileData.java @@ -6,12 +6,13 @@ import io.anuke.ucore.util.Bits; import java.nio.ByteBuffer; public class MapTileData { - /**Tile size: 3 bytes.
+ /**Tile size: 4 bytes.
* 0: ground tile
* 1: wall tile
* 2: rotation + team
- * 3: link (x/y)
*/ - private final static int TILE_SIZE = 4; + * 3: link (x/y)
+ * 4: elevation
*/ + private final static int TILE_SIZE = 5; private final ByteBuffer buffer; private final int width, height; @@ -91,7 +92,7 @@ public class MapTileData { } public enum DataPosition{ - floor, wall, link, rotationTeam + floor, wall, link, rotationTeam, elevation } public class TileDataMarker { @@ -99,12 +100,14 @@ public class MapTileData { public byte link; public byte rotation; public byte team; + public byte elevation; public void read(ByteBuffer buffer){ floor = buffer.get(); wall = buffer.get(); link = buffer.get(); byte rt = buffer.get(); + elevation = buffer.get(); rotation = Bits.getLeftByte(rt); team = Bits.getRightByte(rt); @@ -120,6 +123,7 @@ public class MapTileData { buffer.put(wall); buffer.put(link); buffer.put(Bits.packByte(rotation, team)); + buffer.put(elevation); } } } diff --git a/core/src/io/anuke/mindustry/io/Maps.java b/core/src/io/anuke/mindustry/io/Maps.java index ccb229b473..e8aa937786 100644 --- a/core/src/io/anuke/mindustry/io/Maps.java +++ b/core/src/io/anuke/mindustry/io/Maps.java @@ -18,7 +18,7 @@ import static io.anuke.mindustry.Vars.*; public class Maps implements Disposable{ /**List of all built-in maps.*/ - private static final String[] defaultMapNames = {"test"}; + private static final String[] defaultMapNames = {}; /**Tile format version.*/ private static final int version = 0; diff --git a/core/src/io/anuke/mindustry/world/Block.java b/core/src/io/anuke/mindustry/world/Block.java index f848408578..4e3dd230c7 100644 --- a/core/src/io/anuke/mindustry/world/Block.java +++ b/core/src/io/anuke/mindustry/world/Block.java @@ -79,8 +79,6 @@ public class Block extends BaseBlock implements UnlockableContent{ public float baseExplosiveness = 0f; /**whether to display a different shadow per variant*/ public boolean varyShadow = false; - /**edge fallback, used mainly for ores*/ - public String edge = "stone"; /**number of block variants, 0 to disable*/ public int variants = 0; /**stuff that drops when broken*/ diff --git a/core/src/io/anuke/mindustry/world/Tile.java b/core/src/io/anuke/mindustry/world/Tile.java index 0219a3003b..3a5806dccf 100644 --- a/core/src/io/anuke/mindustry/world/Tile.java +++ b/core/src/io/anuke/mindustry/world/Tile.java @@ -16,6 +16,7 @@ import io.anuke.mindustry.world.blocks.modules.PowerModule; import io.anuke.ucore.function.Consumer; import io.anuke.ucore.util.Bits; import io.anuke.ucore.entities.trait.PosTrait; +import io.anuke.ucore.util.Geometry; import static io.anuke.mindustry.Vars.tilesize; import static io.anuke.mindustry.Vars.world; @@ -26,15 +27,21 @@ public class Tile implements PosTrait, TargetTrait { /**Block ID data.*/ private byte floor, wall; + /**Rotation, 0-3. Also used to store offload location.*/ private byte rotation; - private byte dump; + /**Team ordinal.*/ private byte team; /**The coordinates of the core tile this is linked to, in the form of two bytes packed into one. * This is relative to the block it is linked to; negate coords to find the link.*/ public byte link = 0; public short x, y; - /**Tile traversal cost*/ - public float cost = 1f; + /**Tile traversal cost.*/ + public byte cost = 1; + /**Elevation of tile.*/ + public byte elevation; + /**Position of cliffs around the tile, packed into bits 0-8.*/ + public byte cliffs; + /**Tile entity, usually null.*/ public TileEntity entity; public Tile(int x, int y){ @@ -49,11 +56,12 @@ public class Tile implements PosTrait, TargetTrait { changed(); } - public Tile(int x, int y, byte floor, byte wall, byte rotation, byte team){ + public Tile(int x, int y, byte floor, byte wall, byte rotation, byte team, byte elevation){ this(x, y); this.floor = floor; this.wall = wall; this.rotation = rotation; + this.elevation = elevation; changed(); this.team = team; } @@ -172,7 +180,7 @@ public class Tile implements PosTrait, TargetTrait { } public void setDump(byte dump){ - this.dump = dump; + this.rotation = dump; } public byte getRotation(){ @@ -180,7 +188,7 @@ public class Tile implements PosTrait, TargetTrait { } public byte getDump(){ - return dump; + return rotation; } public boolean passable(){ @@ -198,7 +206,7 @@ public class Tile implements PosTrait, TargetTrait { public boolean solid(){ Block block = block(); Block floor = floor(); - return block.solid || (floor.solid && (block == Blocks.air || block.solidifes)) || block.isSolidFor(this) + return block.solid || cliffs != 0 || (floor.solid && (block == Blocks.air || block.solidifes)) || block.isSolidFor(this) || (isLinked() && getLinked().block().isSolidFor(getLinked())); } @@ -300,20 +308,23 @@ public class Tile implements PosTrait, TargetTrait { } public void updateOcclusion(){ - cost = 0.5f; + cost = 1; + cliffs = 0; boolean occluded = false; - outer: - for(int dx = -1; dx <= 1; dx ++){ - for(int dy = -1; dy <= 1; dy ++){ - Tile tile = world.tile(x + dx, y + dy); - if(tile != null && tile.solid()){ + for(int i = 0; i < 8; i ++){ + GridPoint2 point = Geometry.d8[i]; + Tile tile = world.tile(x + point.x, y + point.y); + if(tile != null){ + if(tile.solid()){ occluded = true; - break outer; + } + if(tile.elevation < elevation){ + cliffs |= (0x1 << i); } } } if(occluded){ - cost += 0.5f; + cost += 1; } } diff --git a/core/src/io/anuke/mindustry/world/WorldGenerator.java b/core/src/io/anuke/mindustry/world/WorldGenerator.java index 583174b227..a4f21c10f4 100644 --- a/core/src/io/anuke/mindustry/world/WorldGenerator.java +++ b/core/src/io/anuke/mindustry/world/WorldGenerator.java @@ -25,20 +25,23 @@ public class WorldGenerator { for(int y = 0; y < data.height(); y ++){ for(int x = 0; x < data.width(); x ++){ - TileDataMarker tile = data.read(marker); - tiles[x][y] = new Tile(x, y, tile.floor, tile.wall == Blocks.blockpart.id ? 0 : tile.wall, tile.rotation, tile.team); + data.read(marker); - Team team = Team.values()[tile.team]; + Tile tile = new Tile(x, y, marker.floor, marker.wall == Blocks.blockpart.id ? 0 : marker.wall, marker.rotation, marker.team, marker.elevation); - if(tiles[x][y].block().isMultiblock()){ - multiblocks.add(tiles[x][y].packedPosition()); + Team team = Team.values()[marker.team]; + + if(tile.block().isMultiblock()){ + multiblocks.add(tile.packedPosition()); } - if(tiles[x][y].block() == StorageBlocks.core && + if(tile.block() == StorageBlocks.core && state.teams.has(team)){ - state.teams.get(team).cores.add(tiles[x][y]); + state.teams.get(team).cores.add(tile); } + tiles[x][y] = tile; + //TODO ores, plants, extra decoration? } } diff --git a/core/src/io/anuke/mindustry/world/blocks/Floor.java b/core/src/io/anuke/mindustry/world/blocks/Floor.java index 3b5988ebd3..afb9b5c75f 100644 --- a/core/src/io/anuke/mindustry/world/blocks/Floor.java +++ b/core/src/io/anuke/mindustry/world/blocks/Floor.java @@ -6,8 +6,8 @@ import com.badlogic.gdx.math.MathUtils; import com.badlogic.gdx.math.Vector2; import io.anuke.mindustry.content.StatusEffects; import io.anuke.mindustry.content.fx.BlockFx; -import io.anuke.mindustry.type.StatusEffect; import io.anuke.mindustry.type.Liquid; +import io.anuke.mindustry.type.StatusEffect; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Tile; import io.anuke.ucore.core.Effects.Effect; @@ -25,6 +25,8 @@ public class Floor extends Block{ protected Predicate blends = block -> block != this; protected boolean blend = true; + /**edge fallback, used mainly for ores*/ + public String edge = "stone"; /**Multiplies unit velocity by this when walked on.*/ public float speedMultiplier = 1f; /**Multiplies unit drag by this when walked on.*/